From c6ab558ed9c34e27d8bde7f890ea1391fa84bf9e Mon Sep 17 00:00:00 2001 From: Sayan kar Date: Fri, 30 Aug 2024 04:35:11 +0530 Subject: [PATCH] Initial commit --- .devcontainer/README.md | 35 + .devcontainer/devcontainer.json | 45 + .devcontainer/setup.sh | 30 + .eslintrc.cjs | 28 + .genignore | 1 + .gitattributes | 2 + .github/workflows/sdk_generation.yaml | 30 + .github/workflows/sdk_publish.yaml | 20 + .gitignore | 16 + .npmignore | 9 + .speakeasy/gen.lock | 852 +++++ .speakeasy/gen.yaml | 47 + .speakeasy/workflow.lock | 51 + .speakeasy/workflow.yaml | 18 + CODEOWNERS | 1 + CONTRIBUTING.md | 26 + FUNCTIONS.md | 106 + LICENSE | 58 + README.md | 778 ++++ RELEASES.md | 1 + RUNTIMES.md | 22 + USAGE.md | 21 + docs/lib/utils/retryconfig.md | 24 + .../components/activedelegatordetails.md | 35 + .../activedelegatordetailsdelegationstatus.md | 15 + .../components/activevalidatordetails.md | 52 + .../activevalidatordetailsvalidationstatus.md | 15 + .../components/addressactivitymetadata.md | 19 + .../components/addresseschangerequest.md | 17 + .../components/aggregatedassetamount.md | 29 + docs/models/components/assetamount.md | 27 + docs/models/components/assetwithpriceinfo.md | 32 + docs/models/components/blockchain.md | 27 + docs/models/components/blockchainid.md | 15 + docs/models/components/blockchainids.md | 15 + docs/models/components/blockchaininfo.md | 17 + docs/models/components/blscredentials.md | 19 + .../models/components/cchainatomicbalances.md | 41 + .../components/cchainexporttransaction.md | 106 + .../components/cchainimporttransaction.md | 99 + .../cchainimporttransactiontxtype.md | 17 + .../components/cchainsharedassetbalance.md | 31 + .../components/chainaddresschainidmap.md | 19 + .../chainaddresschainidmaplistresponse.md | 22 + docs/models/components/chainformat.md | 17 + docs/models/components/chaininfo.md | 46 + docs/models/components/chainstatus.md | 17 + docs/models/components/collectiblebalances.md | 34 + .../components/completeddelegatordetails.md | 35 + .../components/completedvalidatordetails.md | 38 + .../components/contractdeploymentdetails.md | 20 + docs/models/components/contracts.md | 46 + .../createevmtransactionexportrequest.md | 30 + ...eprimarynetworktransactionexportrequest.md | 29 + .../models/components/createwebhookrequest.md | 30 + .../createwebhookrequestmetadata.md | 21 + docs/models/components/currencycode.md | 17 + docs/models/components/delegationstatus.md | 15 + .../models/components/delegationstatustype.md | 15 + docs/models/components/delegators.md | 41 + docs/models/components/delegatorsdetails.md | 19 + ...iveredsourcenotindexedteleportermessage.md | 70 + ...sourcenotindexedteleportermessagestatus.md | 15 + .../components/deliveredteleportermessage.md | 76 + .../deliveredteleportermessagestatus.md | 15 + docs/models/components/enabledfeatures.md | 15 + docs/models/components/erc1155contract.md | 37 + .../components/erc1155contracterctype.md | 15 + docs/models/components/erc1155token.md | 27 + docs/models/components/erc1155tokenbalance.md | 31 + .../components/erc1155tokenbalanceerctype.md | 15 + docs/models/components/erc1155tokenerctype.md | 15 + .../models/components/erc1155tokenmetadata.md | 27 + docs/models/components/erc1155transfer.md | 55 + .../components/erc1155transferdetails.md | 47 + docs/models/components/erc20contract.md | 39 + .../models/components/erc20contracterctype.md | 15 + docs/models/components/erc20token.md | 33 + docs/models/components/erc20tokenbalance.md | 42 + .../components/erc20tokenbalanceerctype.md | 15 + docs/models/components/erc20tokenerctype.md | 15 + docs/models/components/erc20transfer.md | 59 + .../models/components/erc20transferdetails.md | 51 + docs/models/components/erc721contract.md | 36 + .../components/erc721contracterctype.md | 15 + docs/models/components/erc721token.md | 33 + docs/models/components/erc721tokenbalance.md | 35 + .../components/erc721tokenbalanceerctype.md | 15 + docs/models/components/erc721tokenmetadata.md | 26 + docs/models/components/erc721transfer.md | 56 + .../components/erc721transferdetails.md | 48 + docs/models/components/erctype.md | 15 + docs/models/components/eventtype.md | 15 + docs/models/components/evmblock.md | 37 + docs/models/components/evminput.md | 34 + docs/models/components/evmnetworkoptions.md | 19 + docs/models/components/evmoperationtype.md | 15 + docs/models/components/evmoutput.md | 26 + .../fullnativetransactiondetails.md | 69 + docs/models/components/getchainresponse.md | 46 + .../getchainresponseenabledfeatures.md | 15 + docs/models/components/getevmblockresponse.md | 37 + .../components/getnativebalanceresponse.md | 33 + .../components/getnetworkdetailsresponse.md | 34 + .../getprimarynetworkblockresponse.md | 33 + .../components/gettransactionresponse.md | 79 + docs/models/components/glacierapifeature.md | 15 + .../components/glacierlistchainsresponse.md | 34 + docs/models/components/globalparamnetwork.md | 15 + docs/models/components/groupedby.md | 17 + docs/models/components/groupvalue.md | 26 + docs/models/components/historicalreward.md | 48 + docs/models/components/imageasset.md | 16 + docs/models/components/includechains.md | 15 + docs/models/components/internaltransaction.md | 51 + .../components/internaltransactiondetails.md | 43 + .../components/internaltransactionopcall.md | 15 + .../components/listblockchainsresponse.md | 27 + .../listcchainatomicbalancesresponse.md | 47 + .../listcchainatomictransactionsresponse.md | 23 + ...natomictransactionsresponsetransactions.md | 104 + .../listcollectiblebalancesresponse.md | 18 + .../components/listcontractsresponse.md | 18 + .../listdelegatordetailsresponse.md | 31 + .../components/listerc1155balancesresponse.md | 30 + .../listerc1155transactionsresponse.md | 18 + .../components/listerc20balancesresponse.md | 18 + .../listerc20transactionsresponse.md | 18 + .../components/listerc721balancesresponse.md | 32 + .../listerc721transactionsresponse.md | 18 + .../components/listevmblocksresponse.md | 32 + .../listhistoricalrewardsresponse.md | 43 + .../listinternaltransactionsresponse.md | 18 + .../listnativetransactionsresponse.md | 18 + docs/models/components/listnfttokens.md | 18 + .../components/listpchainbalancesresponse.md | 115 + .../listpchaintransactionsresponse.md | 23 + .../components/listpchainutxosresponse.md | 46 + .../components/listpendingrewardsresponse.md | 37 + .../listprimarynetworkblocksresponse.md | 34 + docs/models/components/listsubnetsresponse.md | 37 + .../listteleportermessagesresponse.md | 18 + .../listtransactiondetailsresponse.md | 18 + .../components/listtransfersresponse.md | 18 + docs/models/components/listutxosresponse.md | 53 + .../listvalidatordetailsresponse.md | 18 + .../listwebhookaddressesresponse.md | 20 + .../models/components/listwebhooksresponse.md | 35 + .../components/listxchainbalancesresponse.md | 69 + .../listxchaintransactionsresponse.md | 23 + .../components/listxchainverticesresponse.md | 34 + docs/models/components/logsformat.md | 45 + docs/models/components/logsformatmetadata.md | 21 + docs/models/components/logsresponsedto.md | 39 + docs/models/components/messages.md | 69 + docs/models/components/metadata.md | 18 + docs/models/components/method.md | 21 + docs/models/components/metric.md | 30 + docs/models/components/money.md | 19 + docs/models/components/nativetokenbalance.md | 38 + docs/models/components/nativetransaction.md | 63 + docs/models/components/networktoken.md | 25 + docs/models/components/networktokendetails.md | 33 + docs/models/components/networktype.md | 15 + .../components/nfttokenmetadatastatus.md | 17 + docs/models/components/operationstatus.md | 15 + docs/models/components/operationstatuscode.md | 15 + .../components/operationstatusresponse.md | 28 + docs/models/components/operationtype.md | 15 + docs/models/components/pchainbalance.md | 115 + docs/models/components/pchainid.md | 15 + docs/models/components/pchainsharedasset.md | 33 + docs/models/components/pchaintransaction.md | 129 + .../components/pchaintransactiontype.md | 15 + docs/models/components/pchainutxo.md | 57 + .../components/pendingdelegatordetails.md | 35 + ...pendingdelegatordetailsdelegationstatus.md | 15 + docs/models/components/pendingreward.md | 40 + .../components/pendingteleportermessage.md | 68 + .../components/pendingvalidatordetails.md | 31 + ...pendingvalidatordetailsvalidationstatus.md | 15 + docs/models/components/pricingproviders.md | 15 + docs/models/components/primarynetwork.md | 15 + .../components/primarynetworkassetcap.md | 17 + .../components/primarynetworkassettype.md | 17 + docs/models/components/primarynetworkblock.md | 33 + .../components/primarynetworkchaininfo.md | 19 + .../components/primarynetworkchainname.md | 15 + .../components/primarynetworkoperationtype.md | 15 + .../components/primarynetworkoptions.md | 19 + .../models/components/primarynetworktxtype.md | 15 + docs/models/components/proposerdetails.md | 19 + .../components/removedvalidatordetails.md | 35 + ...removedvalidatordetailsvalidationstatus.md | 15 + docs/models/components/requesttype.md | 17 + docs/models/components/resourcelink.md | 19 + docs/models/components/resourcelinktype.md | 15 + docs/models/components/rewards.md | 21 + docs/models/components/rewardtype.md | 15 + docs/models/components/richaddress.md | 26 + docs/models/components/security.md | 17 + .../components/sharedsecretsresponse.md | 17 + docs/models/components/sortbyoption.md | 15 + docs/models/components/sortorder.md | 15 + docs/models/components/stakingdistribution.md | 21 + docs/models/components/status.md | 15 + docs/models/components/subnet.md | 39 + docs/models/components/subnetownershipinfo.md | 21 + .../teleporterdestinationtransaction.md | 25 + docs/models/components/teleporterreceipt.md | 19 + .../components/teleporterrewarddetails.md | 35 + .../teleporterrewarddetailserctype.md | 15 + .../components/teleportersourcetransaction.md | 21 + .../timeintervalgranularityextended.md | 15 + docs/models/components/tokens.md | 32 + docs/models/components/transactiondetails.md | 59 + .../components/transactionexportmetadata.md | 17 + .../components/transactionmethodtype.md | 17 + docs/models/components/transactions.md | 130 + docs/models/components/transactionstatus.md | 15 + .../components/transactionvertexdetail.md | 21 + docs/models/components/transfers.md | 66 + docs/models/components/txtype.md | 17 + docs/models/components/unknowncontract.md | 34 + .../components/unknowncontracterctype.md | 15 + .../models/components/updatewebhookrequest.md | 20 + .../components/usagemetricsgroupbyenum.md | 15 + .../components/usagemetricsresponsedto.md | 37 + .../models/components/usagemetricsvaluedto.md | 32 + docs/models/components/utilityaddresses.md | 15 + docs/models/components/utxo.md | 58 + docs/models/components/utxocredential.md | 20 + docs/models/components/utxotype.md | 15 + docs/models/components/validationstatus.md | 15 + .../models/components/validationstatustype.md | 15 + .../components/validatorhealthdetails.md | 23 + docs/models/components/validators.md | 46 + docs/models/components/validatorsdetails.md | 31 + docs/models/components/vmname.md | 15 + docs/models/components/webhookresponse.md | 38 + .../components/webhookresponsemetadata.md | 21 + docs/models/components/webhookstatus.md | 15 + docs/models/components/webhookstatustype.md | 15 + docs/models/components/xchainassetdetails.md | 29 + docs/models/components/xchainbalances.md | 65 + docs/models/components/xchainid.md | 15 + .../components/xchainlineartransaction.md | 129 + .../xchainlineartransactionchainformat.md | 17 + .../components/xchainnonlineartransaction.md | 133 + .../components/xchainsharedassetbalance.md | 31 + .../components/xchaintransactiontype.md | 17 + docs/models/components/xchainvertex.md | 31 + docs/models/errors/badgateway.md | 20 + docs/models/errors/badgatewaymessage.md | 26 + docs/models/errors/badrequest.md | 21 + docs/models/errors/details.md | 16 + docs/models/errors/errort.md | 16 + docs/models/errors/forbidden.md | 21 + docs/models/errors/forbiddenmessage.md | 26 + .../errors/glacierhealthcheckresponsebody.md | 20 + docs/models/errors/info.md | 16 + docs/models/errors/internalservererror.md | 22 + .../errors/internalservererrormessage.md | 26 + docs/models/errors/message.md | 26 + docs/models/errors/notfound.md | 21 + docs/models/errors/notfoundmessage.md | 26 + docs/models/errors/serviceunavailable.md | 21 + .../errors/serviceunavailablemessage.md | 26 + docs/models/errors/toomanyrequests.md | 20 + docs/models/errors/toomanyrequestsmessage.md | 26 + docs/models/errors/unauthorized.md | 21 + docs/models/errors/unauthorizedmessage.md | 26 + .../addaddressestowebhookrequest.md | 21 + .../operations/deactivatewebhookrequest.md | 17 + docs/models/operations/details.md | 16 + docs/models/operations/errort.md | 16 + .../getaddressesfromwebhookrequest.md | 20 + .../getaddressesfromwebhookresponse.md | 20 + docs/models/operations/getapilogsrequest.md | 27 + docs/models/operations/getapilogsresponse.md | 39 + .../operations/getapiusagemetricsrequest.md | 29 + .../operations/getassetdetailsglobals.md | 15 + .../operations/getassetdetailsrequest.md | 20 + .../getbalancesbyaddressesglobals.md | 15 + .../getbalancesbyaddressesrequest.md | 22 + .../getbalancesbyaddressesresponsebody.md | 63 + docs/models/operations/getblockbyidglobals.md | 15 + docs/models/operations/getblockbyidrequest.md | 20 + docs/models/operations/getblockglobals.md | 15 + docs/models/operations/getblockrequest.md | 18 + .../getchainidsforaddressesglobals.md | 15 + .../getchainidsforaddressesrequest.md | 18 + docs/models/operations/getchaininfoglobals.md | 15 + docs/models/operations/getchaininforequest.md | 15 + .../operations/getcontractmetadataglobals.md | 15 + .../operations/getcontractmetadatarequest.md | 18 + .../getcontractmetadataresponsebody.md | 47 + .../getdeploymenttransactionglobals.md | 15 + .../getdeploymenttransactionrequest.md | 20 + .../operations/getlatestblocksglobals.md | 15 + .../operations/getlatestblocksrequest.md | 19 + .../operations/getlatestblocksresponse.md | 33 + .../operations/getnativebalanceglobals.md | 15 + .../operations/getnativebalancerequest.md | 22 + .../operations/getnetworkdetailsglobals.md | 15 + .../operations/getnetworkdetailsrequest.md | 15 + .../operations/getoperationresultrequest.md | 17 + .../getsinglevalidatordetailsglobals.md | 15 + .../getsinglevalidatordetailsrequest.md | 25 + .../getsinglevalidatordetailsresponse.md | 19 + .../models/operations/getsubnetbyidglobals.md | 15 + .../models/operations/getsubnetbyidrequest.md | 18 + .../operations/getteleportermessagerequest.md | 17 + .../getteleportermessageresponsebody.md | 77 + .../operations/gettokendetailsglobals.md | 15 + .../operations/gettokendetailsrequest.md | 20 + .../operations/gettokendetailsresponsebody.md | 37 + .../operations/gettransactionglobals.md | 15 + .../operations/gettransactionrequest.md | 18 + .../gettransactionsforblockglobals.md | 15 + .../gettransactionsforblockrequest.md | 18 + docs/models/operations/gettxbyhashglobals.md | 15 + docs/models/operations/gettxbyhashrequest.md | 20 + .../operations/gettxbyhashresponsebody.md | 117 + .../operations/getutxosbyaddressesglobals.md | 15 + .../operations/getutxosbyaddressesrequest.md | 27 + .../operations/getutxosbyaddressesresponse.md | 46 + .../getutxosbyaddressesresponsebody.md | 55 + .../operations/getvertexbyhashglobals.md | 15 + .../operations/getvertexbyhashrequest.md | 20 + .../operations/getvertexbyheightglobals.md | 15 + .../operations/getvertexbyheightrequest.md | 25 + .../operations/getvertexbyheightresponse.md | 34 + docs/models/operations/getwebhookrequest.md | 17 + .../glacierhealthcheckresponsebody.md | 35 + docs/models/operations/info.md | 16 + ...rimarynetworkstakingtransactionsglobals.md | 15 + ...rimarynetworkstakingtransactionsrequest.md | 31 + ...imarynetworkstakingtransactionsresponse.md | 23 + .../listassettransactionsglobals.md | 15 + .../listassettransactionsrequest.md | 29 + .../listassettransactionsresponse.md | 23 + .../operations/listblockchainsglobals.md | 15 + .../operations/listblockchainsrequest.md | 21 + .../operations/listblockchainsresponse.md | 28 + .../listcollectiblebalancesglobals.md | 15 + .../listcollectiblebalancesrequest.md | 23 + .../listcollectiblebalancesresponse.md | 19 + .../listcontractdeploymentsglobals.md | 15 + .../listcontractdeploymentsrequest.md | 21 + .../listcontractdeploymentsresponse.md | 19 + .../operations/listdelegatorsglobals.md | 15 + .../operations/listdelegatorsrequest.md | 28 + .../operations/listdelegatorsresponse.md | 32 + .../operations/listerc1155balancesglobals.md | 15 + .../operations/listerc1155balancesrequest.md | 25 + .../operations/listerc1155balancesresponse.md | 31 + .../listerc1155transactionsglobals.md | 15 + .../listerc1155transactionsrequest.md | 25 + .../listerc1155transactionsresponse.md | 19 + .../operations/listerc20balancesglobals.md | 15 + .../operations/listerc20balancesrequest.md | 29 + .../operations/listerc20balancesresponse.md | 19 + .../listerc20transactionsglobals.md | 15 + .../listerc20transactionsrequest.md | 25 + .../listerc20transactionsresponse.md | 19 + .../operations/listerc721balancesglobals.md | 15 + .../operations/listerc721balancesrequest.md | 23 + .../operations/listerc721balancesresponse.md | 33 + .../listerc721transactionsglobals.md | 15 + .../listerc721transactionsrequest.md | 25 + .../listerc721transactionsresponse.md | 19 + ...thistoricalprimarynetworkrewardsglobals.md | 15 + ...thistoricalprimarynetworkrewardsrequest.md | 27 + ...historicalprimarynetworkrewardsresponse.md | 44 + .../listinternaltransactionsglobals.md | 15 + .../listinternaltransactionsrequest.md | 25 + .../listinternaltransactionsresponse.md | 19 + .../listlatestprimarynetworkblocksglobals.md | 15 + .../listlatestprimarynetworkblocksrequest.md | 21 + .../listlatestprimarynetworkblocksresponse.md | 34 + ...latestprimarynetworktransactionsglobals.md | 15 + ...latestprimarynetworktransactionsrequest.md | 31 + ...atestprimarynetworktransactionsresponse.md | 23 + ...tprimarynetworktransactionsresponsebody.md | 38 + .../listlatesttransactionsglobals.md | 15 + .../listlatesttransactionsrequest.md | 20 + .../listlatesttransactionsresponse.md | 19 + .../listlatestxchainverticesglobals.md | 15 + .../listlatestxchainverticesrequest.md | 21 + .../listlatestxchainverticesresponse.md | 34 + .../listnativetransactionsglobals.md | 15 + .../listnativetransactionsrequest.md | 25 + .../listnativetransactionsresponse.md | 19 + ...listpendingprimarynetworkrewardsglobals.md | 15 + ...listpendingprimarynetworkrewardsrequest.md | 25 + ...istpendingprimarynetworkrewardsresponse.md | 38 + ...listprimarynetworkblocksbynodeidglobals.md | 15 + ...listprimarynetworkblocksbynodeidrequest.md | 23 + ...istprimarynetworkblocksbynodeidresponse.md | 34 + docs/models/operations/listsubnetsglobals.md | 15 + docs/models/operations/listsubnetsrequest.md | 21 + docs/models/operations/listsubnetsresponse.md | 38 + .../listteleportermessagesrequest.md | 29 + .../listteleportermessagesresponse.md | 19 + docs/models/operations/listtokensglobals.md | 15 + docs/models/operations/listtokensrequest.md | 21 + docs/models/operations/listtokensresponse.md | 19 + .../operations/listtransactionsglobals.md | 15 + .../operations/listtransactionsrequest.md | 27 + .../operations/listtransactionsresponse.md | 19 + .../models/operations/listtransfersglobals.md | 15 + .../models/operations/listtransfersrequest.md | 25 + .../operations/listtransfersresponse.md | 19 + .../operations/listvalidatorsglobals.md | 15 + .../operations/listvalidatorsrequest.md | 44 + .../operations/listvalidatorsresponse.md | 19 + docs/models/operations/listwebhooksrequest.md | 20 + .../models/operations/listwebhooksresponse.md | 36 + .../posttransactionexportjobrequestbody.md | 34 + .../operations/queryparamrequesttype.md | 17 + docs/models/operations/reindexnftglobals.md | 15 + docs/models/operations/reindexnftrequest.md | 20 + .../removeaddressesfromwebhookrequest.md | 21 + docs/models/operations/requesttype.md | 17 + .../operations/supportedchainsrequest.md | 19 + .../models/operations/updatewebhookrequest.md | 19 + docs/sdks/avacloudsdk/README.md | 5 + docs/sdks/avacloudsdkbalances/README.md | 512 +++ docs/sdks/avacloudsdkblocks/README.md | 190 + docs/sdks/avacloudsdktransactions/README.md | 1174 ++++++ docs/sdks/balances/README.md | 102 + docs/sdks/blocks/README.md | 292 ++ docs/sdks/chains/README.md | 184 + docs/sdks/contracts/README.md | 96 + docs/sdks/evm/README.md | 2 + docs/sdks/glacier/README.md | 2 + docs/sdks/healthcheck/README.md | 84 + docs/sdks/nfts/README.md | 284 ++ docs/sdks/operations/README.md | 209 ++ docs/sdks/primarynetwork/README.md | 876 +++++ docs/sdks/rewards/README.md | 208 + docs/sdks/teleporter/README.md | 200 + docs/sdks/transactions/README.md | 430 +++ docs/sdks/usagemetrics/README.md | 198 + docs/sdks/utxos/README.md | 106 + docs/sdks/vertices/README.md | 294 ++ docs/sdks/webhooks/README.md | 950 +++++ jsr.json | 28 + package-lock.json | 3333 +++++++++++++++++ package.json | 32 + src/core.ts | 13 + .../glacierEvmBalancesGetNativeBalance.ts | 184 + ...acierEvmBalancesListCollectibleBalances.ts | 228 ++ .../glacierEvmBalancesListErc1155Balances.ts | 231 ++ .../glacierEvmBalancesListErc20Balances.ts | 233 ++ .../glacierEvmBalancesListErc721Balances.ts | 228 ++ src/funcs/glacierEvmBlocksGetBlock.ts | 171 + src/funcs/glacierEvmBlocksGetLatestBlocks.ts | 219 ++ src/funcs/glacierEvmChainsGetChainInfo.ts | 167 + src/funcs/glacierEvmChainsSupportedChains.ts | 166 + .../glacierEvmContractsGetContractMetadata.ts | 170 + ...EvmTransactionsGetDeploymentTransaction.ts | 181 + .../glacierEvmTransactionsGetTransaction.ts | 171 + ...rEvmTransactionsGetTransactionsForBlock.ts | 171 + ...rEvmTransactionsListContractDeployments.ts | 223 ++ ...rEvmTransactionsListErc1155Transactions.ts | 227 ++ ...ierEvmTransactionsListErc20Transactions.ts | 227 ++ ...erEvmTransactionsListErc721Transactions.ts | 227 ++ ...EvmTransactionsListInternalTransactions.ts | 229 ++ ...erEvmTransactionsListLatestTransactions.ts | 220 ++ ...erEvmTransactionsListNativeTransactions.ts | 227 ++ .../glacierEvmTransactionsListTransactions.ts | 228 ++ .../glacierEvmTransactionsListTransfers.ts | 225 ++ .../glacierHealthCheckGlacierHealthCheck.ts | 118 + src/funcs/glacierNftsGetTokenDetails.ts | 176 + src/funcs/glacierNftsListTokens.ts | 223 ++ src/funcs/glacierNftsReindexNft.ts | 177 + .../glacierOperationsGetOperationResult.ts | 167 + ...acierOperationsPostTransactionExportJob.ts | 163 + ...ryNetworkBalancesGetBalancesByAddresses.ts | 183 + ...glacierPrimaryNetworkBlocksGetBlockById.ts | 177 + ...orkBlocksListLatestPrimaryNetworkBlocks.ts | 227 ++ ...kBlocksListPrimaryNetworkBlocksByNodeId.ts | 231 ++ .../glacierPrimaryNetworkGetAssetDetails.ts | 177 + ...erPrimaryNetworkGetChainIdsForAddresses.ts | 175 + .../glacierPrimaryNetworkGetNetworkDetails.ts | 167 + ...PrimaryNetworkGetSingleValidatorDetails.ts | 225 ++ .../glacierPrimaryNetworkGetSubnetById.ts | 171 + .../glacierPrimaryNetworkListBlockchains.ts | 220 ++ .../glacierPrimaryNetworkListDelegators.ts | 223 ++ src/funcs/glacierPrimaryNetworkListSubnets.ts | 220 ++ .../glacierPrimaryNetworkListValidators.ts | 232 ++ ...ardsListHistoricalPrimaryNetworkRewards.ts | 226 ++ ...RewardsListPendingPrimaryNetworkRewards.ts | 224 ++ ...erPrimaryNetworkTransactionsGetTxByHash.ts | 176 + ...ActivePrimaryNetworkStakingTransactions.ts | 235 ++ ...etworkTransactionsListAssetTransactions.ts | 232 ++ ...onsListLatestPrimaryNetworkTransactions.ts | 237 ++ ...rPrimaryNetworkUtxosGetUtxosByAddresses.ts | 229 ++ ...erPrimaryNetworkVerticesGetVertexByHash.ts | 177 + ...PrimaryNetworkVerticesGetVertexByHeight.ts | 227 ++ ...NetworkVerticesListLatestXChainVertices.ts | 225 ++ .../glacierTeleporterGetTeleporterMessage.ts | 166 + ...glacierTeleporterListTeleporterMessages.ts | 215 ++ src/funcs/glacierUsageMetricsGetApiLogs.ts | 217 ++ .../glacierUsageMetricsGetApiUsageMetrics.ts | 174 + .../glacierWebhooksAddAddressesToWebhook.ts | 165 + src/funcs/glacierWebhooksCreateWebhook.ts | 160 + src/funcs/glacierWebhooksDeactivateWebhook.ts | 164 + .../glacierWebhooksGenerateSharedSecret.ts | 142 + .../glacierWebhooksGetAddressesFromWebhook.ts | 216 ++ src/funcs/glacierWebhooksGetSharedSecret.ts | 142 + src/funcs/glacierWebhooksGetWebhook.ts | 164 + src/funcs/glacierWebhooksListWebhooks.ts | 210 ++ ...acierWebhooksRemoveAddressesFromWebhook.ts | 165 + src/funcs/glacierWebhooksUpdateWebhook.ts | 165 + src/hooks/hooks.ts | 103 + src/hooks/index.ts | 6 + src/hooks/registration.ts | 14 + src/hooks/types.ts | 89 + src/index.ts | 6 + src/lib/base64.ts | 37 + src/lib/config.ts | 69 + src/lib/dlv.ts | 53 + src/lib/encodings.ts | 449 +++ src/lib/http.ts | 323 ++ src/lib/is-plain-object.ts | 43 + src/lib/logger.ts | 9 + src/lib/matchers.ts | 308 ++ src/lib/primitives.ts | 40 + src/lib/retries.ts | 187 + src/lib/schemas.ts | 74 + src/lib/sdks.ts | 357 ++ src/lib/security.ts | 203 + src/lib/url.ts | 33 + .../components/activedelegatordetails.ts | 110 + .../components/activevalidatordetails.ts | 159 + .../components/addressactivitymetadata.ts | 55 + .../components/addresseschangerequest.ts | 48 + .../components/aggregatedassetamount.ts | 92 + src/models/components/assetamount.ts | 84 + src/models/components/assetwithpriceinfo.ts | 96 + src/models/components/blockchain.ts | 58 + src/models/components/blockchainid.ts | 42 + src/models/components/blockchainids.ts | 39 + src/models/components/blockchaininfo.ts | 42 + src/models/components/blscredentials.ts | 46 + src/models/components/cchainatomicbalances.ts | 55 + .../components/cchainexporttransaction.ts | 161 + .../components/cchainimporttransaction.ts | 165 + .../components/cchainsharedassetbalance.ts | 96 + .../components/chainaddresschainidmap.ts | 54 + .../chainaddresschainidmaplistresponse.ts | 51 + src/models/components/chaininfo.ts | 149 + src/models/components/chainstatus.ts | 37 + .../components/completeddelegatordetails.ts | 106 + .../components/completedvalidatordetails.ts | 125 + .../components/contractdeploymentdetails.ts | 59 + .../createevmtransactionexportrequest.ts | 82 + ...eprimarynetworktransactionexportrequest.ts | 82 + src/models/components/createwebhookrequest.ts | 118 + src/models/components/currencycode.ts | 49 + src/models/components/delegationstatustype.ts | 32 + src/models/components/delegatorsdetails.ts | 46 + ...iveredsourcenotindexedteleportermessage.ts | 152 + .../components/deliveredteleportermessage.ts | 160 + src/models/components/erc1155contract.ts | 152 + src/models/components/erc1155token.ts | 91 + src/models/components/erc1155tokenbalance.ts | 111 + src/models/components/erc1155tokenmetadata.ts | 93 + src/models/components/erc1155transfer.ts | 98 + .../components/erc1155transferdetails.ts | 73 + src/models/components/erc20contract.ts | 159 + src/models/components/erc20token.ts | 106 + src/models/components/erc20tokenbalance.ts | 133 + src/models/components/erc20transfer.ts | 98 + src/models/components/erc20transferdetails.ts | 73 + src/models/components/erc721contract.ts | 142 + src/models/components/erc721token.ts | 110 + src/models/components/erc721tokenbalance.ts | 125 + src/models/components/erc721tokenmetadata.ts | 89 + src/models/components/erc721transfer.ts | 94 + .../components/erc721transferdetails.ts | 69 + src/models/components/eventtype.ts | 28 + src/models/components/evmblock.ts | 108 + src/models/components/evminput.ts | 67 + src/models/components/evmnetworkoptions.ts | 46 + src/models/components/evmoperationtype.ts | 30 + src/models/components/evmoutput.ts | 54 + .../fullnativetransactiondetails.ts | 160 + src/models/components/getchainresponse.ts | 155 + src/models/components/getevmblockresponse.ts | 115 + .../components/getnativebalanceresponse.ts | 54 + .../components/getnetworkdetailsresponse.ts | 61 + .../getprimarynetworkblockresponse.ts | 87 + .../components/gettransactionresponse.ts | 113 + src/models/components/glacierapifeature.ts | 31 + .../components/glacierlistchainsresponse.ts | 51 + src/models/components/globalparamnetwork.ts | 31 + src/models/components/historicalreward.ts | 92 + src/models/components/imageasset.ts | 45 + src/models/components/index.ts | 191 + src/models/components/internaltransaction.ts | 111 + .../components/internaltransactiondetails.ts | 83 + .../components/internaltransactionopcall.ts | 38 + .../components/listblockchainsresponse.ts | 58 + .../listcchainatomicbalancesresponse.ts | 61 + .../listcchainatomictransactionsresponse.ts | 114 + .../listcollectiblebalancesresponse.ts | 105 + .../components/listcontractsresponse.ts | 191 + .../listdelegatordetailsresponse.ts | 180 + .../components/listerc1155balancesresponse.ts | 61 + .../listerc1155transactionsresponse.ts | 58 + .../components/listerc20balancesresponse.ts | 61 + .../listerc20transactionsresponse.ts | 58 + .../components/listerc721balancesresponse.ts | 61 + .../listerc721transactionsresponse.ts | 58 + .../components/listevmblocksresponse.ts | 58 + .../listhistoricalrewardsresponse.ts | 58 + .../listinternaltransactionsresponse.ts | 58 + .../listnativetransactionsresponse.ts | 58 + src/models/components/listnfttokens.ts | 91 + .../components/listpchainbalancesresponse.ts | 61 + .../listpchaintransactionsresponse.ts | 68 + .../components/listpchainutxosresponse.ts | 68 + .../components/listpendingrewardsresponse.ts | 58 + .../listprimarynetworkblocksresponse.ts | 68 + src/models/components/listsubnetsresponse.ts | 53 + .../listteleportermessagesresponse.ts | 135 + .../listtransactiondetailsresponse.ts | 58 + .../components/listtransfersresponse.ts | 118 + src/models/components/listutxosresponse.ts | 60 + .../listvalidatordetailsresponse.ts | 210 ++ .../listwebhookaddressesresponse.ts | 56 + src/models/components/listwebhooksresponse.ts | 58 + .../components/listxchainbalancesresponse.ts | 61 + .../listxchaintransactionsresponse.ts | 111 + .../components/listxchainverticesresponse.ts | 68 + src/models/components/logsformat.ts | 143 + src/models/components/logsformatmetadata.ts | 62 + src/models/components/logsresponsedto.ts | 65 + src/models/components/method.ts | 59 + src/models/components/metric.ts | 53 + src/models/components/money.ts | 52 + src/models/components/nativetokenbalance.ts | 98 + src/models/components/nativetransaction.ts | 138 + src/models/components/networktoken.ts | 69 + src/models/components/networktokendetails.ts | 66 + src/models/components/networktype.ts | 31 + .../components/nfttokenmetadatastatus.ts | 46 + src/models/components/operationstatus.ts | 33 + src/models/components/operationstatuscode.ts | 32 + .../components/operationstatusresponse.ts | 111 + src/models/components/operationtype.ts | 33 + src/models/components/pchainbalance.ts | 106 + src/models/components/pchainid.ts | 30 + src/models/components/pchainsharedasset.ts | 97 + src/models/components/pchaintransaction.ts | 211 ++ .../components/pchaintransactiontype.ts | 45 + src/models/components/pchainutxo.ts | 151 + .../components/pendingdelegatordetails.ts | 110 + src/models/components/pendingreward.ts | 87 + .../components/pendingteleportermessage.ts | 146 + .../components/pendingvalidatordetails.ts | 115 + src/models/components/pricingproviders.ts | 42 + src/models/components/primarynetwork.ts | 31 + .../components/primarynetworkassetcap.ts | 37 + .../components/primarynetworkassettype.ts | 39 + src/models/components/primarynetworkblock.ts | 87 + .../components/primarynetworkchaininfo.ts | 59 + .../components/primarynetworkchainname.ts | 34 + .../components/primarynetworkoperationtype.ts | 34 + .../components/primarynetworkoptions.ts | 90 + src/models/components/primarynetworktxtype.ts | 47 + src/models/components/proposerdetails.ts | 58 + .../components/removedvalidatordetails.ts | 123 + src/models/components/requesttype.ts | 37 + src/models/components/resourcelink.ts | 50 + src/models/components/resourcelinktype.ts | 47 + src/models/components/rewards.ts | 49 + src/models/components/rewardtype.ts | 32 + src/models/components/richaddress.ts | 72 + src/models/components/security.ts | 38 + .../components/sharedsecretsresponse.ts | 45 + src/models/components/sortbyoption.ts | 34 + src/models/components/sortorder.ts | 29 + src/models/components/stakingdistribution.ts | 53 + src/models/components/subnet.ts | 95 + src/models/components/subnetownershipinfo.ts | 62 + .../teleporterdestinationtransaction.ts | 61 + src/models/components/teleporterreceipt.ts | 46 + .../components/teleporterrewarddetails.ts | 119 + .../components/teleportersourcetransaction.ts | 53 + .../timeintervalgranularityextended.ts | 36 + src/models/components/transactiondetails.ts | 106 + .../components/transactionexportmetadata.ts | 64 + .../components/transactionmethodtype.ts | 38 + src/models/components/transactionstatus.ts | 31 + .../components/transactionvertexdetail.ts | 62 + src/models/components/unknowncontract.ts | 135 + src/models/components/updatewebhookrequest.ts | 70 + .../components/usagemetricsgroupbyenum.ts | 36 + .../components/usagemetricsresponsedto.ts | 63 + src/models/components/usagemetricsvaluedto.ts | 169 + src/models/components/utilityaddresses.ts | 42 + src/models/components/utxo.ts | 154 + src/models/components/utxocredential.ts | 52 + src/models/components/utxotype.ts | 29 + src/models/components/validationstatustype.ts | 33 + .../components/validatorhealthdetails.ts | 69 + src/models/components/validatorsdetails.ts | 64 + src/models/components/vmname.ts | 30 + src/models/components/webhookresponse.ts | 132 + src/models/components/webhookstatus.ts | 31 + src/models/components/webhookstatustype.ts | 31 + src/models/components/xchainassetdetails.ts | 100 + src/models/components/xchainbalances.ts | 72 + src/models/components/xchainid.ts | 32 + .../components/xchainlineartransaction.ts | 187 + .../components/xchainnonlineartransaction.ts | 182 + .../components/xchainsharedassetbalance.ts | 96 + .../components/xchaintransactiontype.ts | 41 + src/models/components/xchainvertex.ts | 69 + src/models/errors/badgateway.ts | 135 + src/models/errors/badrequest.ts | 138 + src/models/errors/forbidden.ts | 137 + src/models/errors/glacierhealthcheck.ts | 255 ++ src/models/errors/httpclienterrors.ts | 62 + src/models/errors/index.ts | 16 + src/models/errors/internalservererror.ts | 150 + src/models/errors/notfound.ts | 137 + src/models/errors/sdkerror.ts | 25 + src/models/errors/sdkvalidationerror.ts | 97 + src/models/errors/serviceunavailable.ts | 148 + src/models/errors/toomanyrequests.ts | 142 + src/models/errors/unauthorized.ts | 144 + .../operations/addaddressestowebhook.ts | 66 + src/models/operations/deactivatewebhook.ts | 48 + .../operations/getaddressesfromwebhook.ts | 116 + src/models/operations/getapilogs.ts | 194 + src/models/operations/getapiusagemetrics.ts | 144 + src/models/operations/getassetdetails.ts | 106 + .../operations/getbalancesbyaddresses.ts | 162 + src/models/operations/getblock.ts | 92 + src/models/operations/getblockbyid.ts | 106 + .../operations/getchainidsforaddresses.ts | 99 + src/models/operations/getchaininfo.ts | 91 + src/models/operations/getcontractmetadata.ts | 168 + .../operations/getdeploymenttransaction.ts | 106 + src/models/operations/getlatestblocks.ts | 159 + src/models/operations/getnativebalance.ts | 113 + src/models/operations/getnetworkdetails.ts | 92 + src/models/operations/getoperationresult.ts | 48 + .../operations/getsinglevalidatordetails.ts | 180 + src/models/operations/getsubnetbyid.ts | 99 + src/models/operations/getteleportermessage.ts | 118 + src/models/operations/gettokendetails.ts | 159 + src/models/operations/gettransaction.ts | 98 + .../operations/gettransactionsforblock.ts | 98 + src/models/operations/gettxbyhash.ts | 163 + src/models/operations/getutxosbyaddresses.ts | 245 ++ src/models/operations/getvertexbyhash.ts | 106 + src/models/operations/getvertexbyheight.ts | 180 + src/models/operations/getwebhook.ts | 45 + src/models/operations/glacierhealthcheck.ts | 209 ++ src/models/operations/index.ts | 66 + ...activeprimarynetworkstakingtransactions.ts | 202 + .../operations/listassettransactions.ts | 194 + src/models/operations/listblockchains.ts | 166 + .../operations/listcollectiblebalances.ts | 173 + .../operations/listcontractdeployments.ts | 166 + src/models/operations/listdelegators.ts | 187 + src/models/operations/listerc1155balances.ts | 180 + .../operations/listerc1155transactions.ts | 180 + src/models/operations/listerc20balances.ts | 194 + .../operations/listerc20transactions.ts | 180 + src/models/operations/listerc721balances.ts | 173 + .../operations/listerc721transactions.ts | 180 + .../listhistoricalprimarynetworkrewards.ts | 187 + .../operations/listinternaltransactions.ts | 180 + .../listlatestprimarynetworkblocks.ts | 166 + .../listlatestprimarynetworktransactions.ts | 264 ++ .../operations/listlatesttransactions.ts | 166 + .../operations/listlatestxchainvertices.ts | 166 + .../operations/listnativetransactions.ts | 180 + .../listpendingprimarynetworkrewards.ts | 180 + .../listprimarynetworkblocksbynodeid.ts | 173 + src/models/operations/listsubnets.ts | 166 + .../operations/listteleportermessages.ts | 151 + src/models/operations/listtokens.ts | 160 + src/models/operations/listtransactions.ts | 187 + src/models/operations/listtransfers.ts | 180 + src/models/operations/listvalidators.ts | 254 ++ src/models/operations/listwebhooks.ts | 116 + .../operations/posttransactionexportjob.ts | 48 + src/models/operations/reindexnft.ts | 99 + .../operations/removeaddressesfromwebhook.ts | 66 + src/models/operations/supportedchains.ts | 56 + src/models/operations/updatewebhook.ts | 66 + src/sdk/avacloudsdkbalances.ts | 97 + src/sdk/avacloudsdkblocks.ts | 39 + src/sdk/avacloudsdktransactions.ts | 197 + src/sdk/balances.ts | 27 + src/sdk/blocks.ts | 57 + src/sdk/chains.ts | 38 + src/sdk/contracts.ts | 23 + src/sdk/evm.ts | 37 + src/sdk/glacier.ts | 55 + src/sdk/healthcheck.ts | 19 + src/sdk/index.ts | 5 + src/sdk/nfts.ts | 52 + src/sdk/operations.ts | 40 + src/sdk/primarynetwork.ts | 175 + src/sdk/rewards.ts | 41 + src/sdk/sdk.ts | 13 + src/sdk/teleporter.ts | 40 + src/sdk/transactions.ts | 84 + src/sdk/usagemetrics.ts | 39 + src/sdk/utxos.ts | 25 + src/sdk/vertices.ts | 57 + src/sdk/webhooks.ts | 147 + src/types/blobs.ts | 31 + src/types/constdatetime.ts | 15 + src/types/enums.ts | 16 + src/types/fp.ts | 50 + src/types/index.ts | 11 + src/types/operations.ts | 99 + src/types/rfcdate.ts | 54 + src/utils/index.ts | 1 + src/utils/isvalidsignature.ts | 11 + tsconfig.json | 40 + utils/index.d.ts | 2 + utils/index.d.ts.map | 1 + utils/index.js | 18 + utils/index.js.map | 1 + utils/isvalidsignature.d.ts | 2 + utils/isvalidsignature.d.ts.map | 1 + utils/isvalidsignature.js | 17 + utils/isvalidsignature.js.map | 1 + 840 files changed, 65715 insertions(+) create mode 100644 .devcontainer/README.md create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/setup.sh create mode 100644 .eslintrc.cjs create mode 100644 .genignore create mode 100644 .gitattributes create mode 100644 .github/workflows/sdk_generation.yaml create mode 100644 .github/workflows/sdk_publish.yaml create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 .speakeasy/gen.lock create mode 100644 .speakeasy/gen.yaml create mode 100644 .speakeasy/workflow.lock create mode 100644 .speakeasy/workflow.yaml create mode 100644 CODEOWNERS create mode 100644 CONTRIBUTING.md create mode 100644 FUNCTIONS.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 RELEASES.md create mode 100644 RUNTIMES.md create mode 100644 USAGE.md create mode 100644 docs/lib/utils/retryconfig.md create mode 100644 docs/models/components/activedelegatordetails.md create mode 100644 docs/models/components/activedelegatordetailsdelegationstatus.md create mode 100644 docs/models/components/activevalidatordetails.md create mode 100644 docs/models/components/activevalidatordetailsvalidationstatus.md create mode 100644 docs/models/components/addressactivitymetadata.md create mode 100644 docs/models/components/addresseschangerequest.md create mode 100644 docs/models/components/aggregatedassetamount.md create mode 100644 docs/models/components/assetamount.md create mode 100644 docs/models/components/assetwithpriceinfo.md create mode 100644 docs/models/components/blockchain.md create mode 100644 docs/models/components/blockchainid.md create mode 100644 docs/models/components/blockchainids.md create mode 100644 docs/models/components/blockchaininfo.md create mode 100644 docs/models/components/blscredentials.md create mode 100644 docs/models/components/cchainatomicbalances.md create mode 100644 docs/models/components/cchainexporttransaction.md create mode 100644 docs/models/components/cchainimporttransaction.md create mode 100644 docs/models/components/cchainimporttransactiontxtype.md create mode 100644 docs/models/components/cchainsharedassetbalance.md create mode 100644 docs/models/components/chainaddresschainidmap.md create mode 100644 docs/models/components/chainaddresschainidmaplistresponse.md create mode 100644 docs/models/components/chainformat.md create mode 100644 docs/models/components/chaininfo.md create mode 100644 docs/models/components/chainstatus.md create mode 100644 docs/models/components/collectiblebalances.md create mode 100644 docs/models/components/completeddelegatordetails.md create mode 100644 docs/models/components/completedvalidatordetails.md create mode 100644 docs/models/components/contractdeploymentdetails.md create mode 100644 docs/models/components/contracts.md create mode 100644 docs/models/components/createevmtransactionexportrequest.md create mode 100644 docs/models/components/createprimarynetworktransactionexportrequest.md create mode 100644 docs/models/components/createwebhookrequest.md create mode 100644 docs/models/components/createwebhookrequestmetadata.md create mode 100644 docs/models/components/currencycode.md create mode 100644 docs/models/components/delegationstatus.md create mode 100644 docs/models/components/delegationstatustype.md create mode 100644 docs/models/components/delegators.md create mode 100644 docs/models/components/delegatorsdetails.md create mode 100644 docs/models/components/deliveredsourcenotindexedteleportermessage.md create mode 100644 docs/models/components/deliveredsourcenotindexedteleportermessagestatus.md create mode 100644 docs/models/components/deliveredteleportermessage.md create mode 100644 docs/models/components/deliveredteleportermessagestatus.md create mode 100644 docs/models/components/enabledfeatures.md create mode 100644 docs/models/components/erc1155contract.md create mode 100644 docs/models/components/erc1155contracterctype.md create mode 100644 docs/models/components/erc1155token.md create mode 100644 docs/models/components/erc1155tokenbalance.md create mode 100644 docs/models/components/erc1155tokenbalanceerctype.md create mode 100644 docs/models/components/erc1155tokenerctype.md create mode 100644 docs/models/components/erc1155tokenmetadata.md create mode 100644 docs/models/components/erc1155transfer.md create mode 100644 docs/models/components/erc1155transferdetails.md create mode 100644 docs/models/components/erc20contract.md create mode 100644 docs/models/components/erc20contracterctype.md create mode 100644 docs/models/components/erc20token.md create mode 100644 docs/models/components/erc20tokenbalance.md create mode 100644 docs/models/components/erc20tokenbalanceerctype.md create mode 100644 docs/models/components/erc20tokenerctype.md create mode 100644 docs/models/components/erc20transfer.md create mode 100644 docs/models/components/erc20transferdetails.md create mode 100644 docs/models/components/erc721contract.md create mode 100644 docs/models/components/erc721contracterctype.md create mode 100644 docs/models/components/erc721token.md create mode 100644 docs/models/components/erc721tokenbalance.md create mode 100644 docs/models/components/erc721tokenbalanceerctype.md create mode 100644 docs/models/components/erc721tokenmetadata.md create mode 100644 docs/models/components/erc721transfer.md create mode 100644 docs/models/components/erc721transferdetails.md create mode 100644 docs/models/components/erctype.md create mode 100644 docs/models/components/eventtype.md create mode 100644 docs/models/components/evmblock.md create mode 100644 docs/models/components/evminput.md create mode 100644 docs/models/components/evmnetworkoptions.md create mode 100644 docs/models/components/evmoperationtype.md create mode 100644 docs/models/components/evmoutput.md create mode 100644 docs/models/components/fullnativetransactiondetails.md create mode 100644 docs/models/components/getchainresponse.md create mode 100644 docs/models/components/getchainresponseenabledfeatures.md create mode 100644 docs/models/components/getevmblockresponse.md create mode 100644 docs/models/components/getnativebalanceresponse.md create mode 100644 docs/models/components/getnetworkdetailsresponse.md create mode 100644 docs/models/components/getprimarynetworkblockresponse.md create mode 100644 docs/models/components/gettransactionresponse.md create mode 100644 docs/models/components/glacierapifeature.md create mode 100644 docs/models/components/glacierlistchainsresponse.md create mode 100644 docs/models/components/globalparamnetwork.md create mode 100644 docs/models/components/groupedby.md create mode 100644 docs/models/components/groupvalue.md create mode 100644 docs/models/components/historicalreward.md create mode 100644 docs/models/components/imageasset.md create mode 100644 docs/models/components/includechains.md create mode 100644 docs/models/components/internaltransaction.md create mode 100644 docs/models/components/internaltransactiondetails.md create mode 100644 docs/models/components/internaltransactionopcall.md create mode 100644 docs/models/components/listblockchainsresponse.md create mode 100644 docs/models/components/listcchainatomicbalancesresponse.md create mode 100644 docs/models/components/listcchainatomictransactionsresponse.md create mode 100644 docs/models/components/listcchainatomictransactionsresponsetransactions.md create mode 100644 docs/models/components/listcollectiblebalancesresponse.md create mode 100644 docs/models/components/listcontractsresponse.md create mode 100644 docs/models/components/listdelegatordetailsresponse.md create mode 100644 docs/models/components/listerc1155balancesresponse.md create mode 100644 docs/models/components/listerc1155transactionsresponse.md create mode 100644 docs/models/components/listerc20balancesresponse.md create mode 100644 docs/models/components/listerc20transactionsresponse.md create mode 100644 docs/models/components/listerc721balancesresponse.md create mode 100644 docs/models/components/listerc721transactionsresponse.md create mode 100644 docs/models/components/listevmblocksresponse.md create mode 100644 docs/models/components/listhistoricalrewardsresponse.md create mode 100644 docs/models/components/listinternaltransactionsresponse.md create mode 100644 docs/models/components/listnativetransactionsresponse.md create mode 100644 docs/models/components/listnfttokens.md create mode 100644 docs/models/components/listpchainbalancesresponse.md create mode 100644 docs/models/components/listpchaintransactionsresponse.md create mode 100644 docs/models/components/listpchainutxosresponse.md create mode 100644 docs/models/components/listpendingrewardsresponse.md create mode 100644 docs/models/components/listprimarynetworkblocksresponse.md create mode 100644 docs/models/components/listsubnetsresponse.md create mode 100644 docs/models/components/listteleportermessagesresponse.md create mode 100644 docs/models/components/listtransactiondetailsresponse.md create mode 100644 docs/models/components/listtransfersresponse.md create mode 100644 docs/models/components/listutxosresponse.md create mode 100644 docs/models/components/listvalidatordetailsresponse.md create mode 100644 docs/models/components/listwebhookaddressesresponse.md create mode 100644 docs/models/components/listwebhooksresponse.md create mode 100644 docs/models/components/listxchainbalancesresponse.md create mode 100644 docs/models/components/listxchaintransactionsresponse.md create mode 100644 docs/models/components/listxchainverticesresponse.md create mode 100644 docs/models/components/logsformat.md create mode 100644 docs/models/components/logsformatmetadata.md create mode 100644 docs/models/components/logsresponsedto.md create mode 100644 docs/models/components/messages.md create mode 100644 docs/models/components/metadata.md create mode 100644 docs/models/components/method.md create mode 100644 docs/models/components/metric.md create mode 100644 docs/models/components/money.md create mode 100644 docs/models/components/nativetokenbalance.md create mode 100644 docs/models/components/nativetransaction.md create mode 100644 docs/models/components/networktoken.md create mode 100644 docs/models/components/networktokendetails.md create mode 100644 docs/models/components/networktype.md create mode 100644 docs/models/components/nfttokenmetadatastatus.md create mode 100644 docs/models/components/operationstatus.md create mode 100644 docs/models/components/operationstatuscode.md create mode 100644 docs/models/components/operationstatusresponse.md create mode 100644 docs/models/components/operationtype.md create mode 100644 docs/models/components/pchainbalance.md create mode 100644 docs/models/components/pchainid.md create mode 100644 docs/models/components/pchainsharedasset.md create mode 100644 docs/models/components/pchaintransaction.md create mode 100644 docs/models/components/pchaintransactiontype.md create mode 100644 docs/models/components/pchainutxo.md create mode 100644 docs/models/components/pendingdelegatordetails.md create mode 100644 docs/models/components/pendingdelegatordetailsdelegationstatus.md create mode 100644 docs/models/components/pendingreward.md create mode 100644 docs/models/components/pendingteleportermessage.md create mode 100644 docs/models/components/pendingvalidatordetails.md create mode 100644 docs/models/components/pendingvalidatordetailsvalidationstatus.md create mode 100644 docs/models/components/pricingproviders.md create mode 100644 docs/models/components/primarynetwork.md create mode 100644 docs/models/components/primarynetworkassetcap.md create mode 100644 docs/models/components/primarynetworkassettype.md create mode 100644 docs/models/components/primarynetworkblock.md create mode 100644 docs/models/components/primarynetworkchaininfo.md create mode 100644 docs/models/components/primarynetworkchainname.md create mode 100644 docs/models/components/primarynetworkoperationtype.md create mode 100644 docs/models/components/primarynetworkoptions.md create mode 100644 docs/models/components/primarynetworktxtype.md create mode 100644 docs/models/components/proposerdetails.md create mode 100644 docs/models/components/removedvalidatordetails.md create mode 100644 docs/models/components/removedvalidatordetailsvalidationstatus.md create mode 100644 docs/models/components/requesttype.md create mode 100644 docs/models/components/resourcelink.md create mode 100644 docs/models/components/resourcelinktype.md create mode 100644 docs/models/components/rewards.md create mode 100644 docs/models/components/rewardtype.md create mode 100644 docs/models/components/richaddress.md create mode 100644 docs/models/components/security.md create mode 100644 docs/models/components/sharedsecretsresponse.md create mode 100644 docs/models/components/sortbyoption.md create mode 100644 docs/models/components/sortorder.md create mode 100644 docs/models/components/stakingdistribution.md create mode 100644 docs/models/components/status.md create mode 100644 docs/models/components/subnet.md create mode 100644 docs/models/components/subnetownershipinfo.md create mode 100644 docs/models/components/teleporterdestinationtransaction.md create mode 100644 docs/models/components/teleporterreceipt.md create mode 100644 docs/models/components/teleporterrewarddetails.md create mode 100644 docs/models/components/teleporterrewarddetailserctype.md create mode 100644 docs/models/components/teleportersourcetransaction.md create mode 100644 docs/models/components/timeintervalgranularityextended.md create mode 100644 docs/models/components/tokens.md create mode 100644 docs/models/components/transactiondetails.md create mode 100644 docs/models/components/transactionexportmetadata.md create mode 100644 docs/models/components/transactionmethodtype.md create mode 100644 docs/models/components/transactions.md create mode 100644 docs/models/components/transactionstatus.md create mode 100644 docs/models/components/transactionvertexdetail.md create mode 100644 docs/models/components/transfers.md create mode 100644 docs/models/components/txtype.md create mode 100644 docs/models/components/unknowncontract.md create mode 100644 docs/models/components/unknowncontracterctype.md create mode 100644 docs/models/components/updatewebhookrequest.md create mode 100644 docs/models/components/usagemetricsgroupbyenum.md create mode 100644 docs/models/components/usagemetricsresponsedto.md create mode 100644 docs/models/components/usagemetricsvaluedto.md create mode 100644 docs/models/components/utilityaddresses.md create mode 100644 docs/models/components/utxo.md create mode 100644 docs/models/components/utxocredential.md create mode 100644 docs/models/components/utxotype.md create mode 100644 docs/models/components/validationstatus.md create mode 100644 docs/models/components/validationstatustype.md create mode 100644 docs/models/components/validatorhealthdetails.md create mode 100644 docs/models/components/validators.md create mode 100644 docs/models/components/validatorsdetails.md create mode 100644 docs/models/components/vmname.md create mode 100644 docs/models/components/webhookresponse.md create mode 100644 docs/models/components/webhookresponsemetadata.md create mode 100644 docs/models/components/webhookstatus.md create mode 100644 docs/models/components/webhookstatustype.md create mode 100644 docs/models/components/xchainassetdetails.md create mode 100644 docs/models/components/xchainbalances.md create mode 100644 docs/models/components/xchainid.md create mode 100644 docs/models/components/xchainlineartransaction.md create mode 100644 docs/models/components/xchainlineartransactionchainformat.md create mode 100644 docs/models/components/xchainnonlineartransaction.md create mode 100644 docs/models/components/xchainsharedassetbalance.md create mode 100644 docs/models/components/xchaintransactiontype.md create mode 100644 docs/models/components/xchainvertex.md create mode 100644 docs/models/errors/badgateway.md create mode 100644 docs/models/errors/badgatewaymessage.md create mode 100644 docs/models/errors/badrequest.md create mode 100644 docs/models/errors/details.md create mode 100644 docs/models/errors/errort.md create mode 100644 docs/models/errors/forbidden.md create mode 100644 docs/models/errors/forbiddenmessage.md create mode 100644 docs/models/errors/glacierhealthcheckresponsebody.md create mode 100644 docs/models/errors/info.md create mode 100644 docs/models/errors/internalservererror.md create mode 100644 docs/models/errors/internalservererrormessage.md create mode 100644 docs/models/errors/message.md create mode 100644 docs/models/errors/notfound.md create mode 100644 docs/models/errors/notfoundmessage.md create mode 100644 docs/models/errors/serviceunavailable.md create mode 100644 docs/models/errors/serviceunavailablemessage.md create mode 100644 docs/models/errors/toomanyrequests.md create mode 100644 docs/models/errors/toomanyrequestsmessage.md create mode 100644 docs/models/errors/unauthorized.md create mode 100644 docs/models/errors/unauthorizedmessage.md create mode 100644 docs/models/operations/addaddressestowebhookrequest.md create mode 100644 docs/models/operations/deactivatewebhookrequest.md create mode 100644 docs/models/operations/details.md create mode 100644 docs/models/operations/errort.md create mode 100644 docs/models/operations/getaddressesfromwebhookrequest.md create mode 100644 docs/models/operations/getaddressesfromwebhookresponse.md create mode 100644 docs/models/operations/getapilogsrequest.md create mode 100644 docs/models/operations/getapilogsresponse.md create mode 100644 docs/models/operations/getapiusagemetricsrequest.md create mode 100644 docs/models/operations/getassetdetailsglobals.md create mode 100644 docs/models/operations/getassetdetailsrequest.md create mode 100644 docs/models/operations/getbalancesbyaddressesglobals.md create mode 100644 docs/models/operations/getbalancesbyaddressesrequest.md create mode 100644 docs/models/operations/getbalancesbyaddressesresponsebody.md create mode 100644 docs/models/operations/getblockbyidglobals.md create mode 100644 docs/models/operations/getblockbyidrequest.md create mode 100644 docs/models/operations/getblockglobals.md create mode 100644 docs/models/operations/getblockrequest.md create mode 100644 docs/models/operations/getchainidsforaddressesglobals.md create mode 100644 docs/models/operations/getchainidsforaddressesrequest.md create mode 100644 docs/models/operations/getchaininfoglobals.md create mode 100644 docs/models/operations/getchaininforequest.md create mode 100644 docs/models/operations/getcontractmetadataglobals.md create mode 100644 docs/models/operations/getcontractmetadatarequest.md create mode 100644 docs/models/operations/getcontractmetadataresponsebody.md create mode 100644 docs/models/operations/getdeploymenttransactionglobals.md create mode 100644 docs/models/operations/getdeploymenttransactionrequest.md create mode 100644 docs/models/operations/getlatestblocksglobals.md create mode 100644 docs/models/operations/getlatestblocksrequest.md create mode 100644 docs/models/operations/getlatestblocksresponse.md create mode 100644 docs/models/operations/getnativebalanceglobals.md create mode 100644 docs/models/operations/getnativebalancerequest.md create mode 100644 docs/models/operations/getnetworkdetailsglobals.md create mode 100644 docs/models/operations/getnetworkdetailsrequest.md create mode 100644 docs/models/operations/getoperationresultrequest.md create mode 100644 docs/models/operations/getsinglevalidatordetailsglobals.md create mode 100644 docs/models/operations/getsinglevalidatordetailsrequest.md create mode 100644 docs/models/operations/getsinglevalidatordetailsresponse.md create mode 100644 docs/models/operations/getsubnetbyidglobals.md create mode 100644 docs/models/operations/getsubnetbyidrequest.md create mode 100644 docs/models/operations/getteleportermessagerequest.md create mode 100644 docs/models/operations/getteleportermessageresponsebody.md create mode 100644 docs/models/operations/gettokendetailsglobals.md create mode 100644 docs/models/operations/gettokendetailsrequest.md create mode 100644 docs/models/operations/gettokendetailsresponsebody.md create mode 100644 docs/models/operations/gettransactionglobals.md create mode 100644 docs/models/operations/gettransactionrequest.md create mode 100644 docs/models/operations/gettransactionsforblockglobals.md create mode 100644 docs/models/operations/gettransactionsforblockrequest.md create mode 100644 docs/models/operations/gettxbyhashglobals.md create mode 100644 docs/models/operations/gettxbyhashrequest.md create mode 100644 docs/models/operations/gettxbyhashresponsebody.md create mode 100644 docs/models/operations/getutxosbyaddressesglobals.md create mode 100644 docs/models/operations/getutxosbyaddressesrequest.md create mode 100644 docs/models/operations/getutxosbyaddressesresponse.md create mode 100644 docs/models/operations/getutxosbyaddressesresponsebody.md create mode 100644 docs/models/operations/getvertexbyhashglobals.md create mode 100644 docs/models/operations/getvertexbyhashrequest.md create mode 100644 docs/models/operations/getvertexbyheightglobals.md create mode 100644 docs/models/operations/getvertexbyheightrequest.md create mode 100644 docs/models/operations/getvertexbyheightresponse.md create mode 100644 docs/models/operations/getwebhookrequest.md create mode 100644 docs/models/operations/glacierhealthcheckresponsebody.md create mode 100644 docs/models/operations/info.md create mode 100644 docs/models/operations/listactiveprimarynetworkstakingtransactionsglobals.md create mode 100644 docs/models/operations/listactiveprimarynetworkstakingtransactionsrequest.md create mode 100644 docs/models/operations/listactiveprimarynetworkstakingtransactionsresponse.md create mode 100644 docs/models/operations/listassettransactionsglobals.md create mode 100644 docs/models/operations/listassettransactionsrequest.md create mode 100644 docs/models/operations/listassettransactionsresponse.md create mode 100644 docs/models/operations/listblockchainsglobals.md create mode 100644 docs/models/operations/listblockchainsrequest.md create mode 100644 docs/models/operations/listblockchainsresponse.md create mode 100644 docs/models/operations/listcollectiblebalancesglobals.md create mode 100644 docs/models/operations/listcollectiblebalancesrequest.md create mode 100644 docs/models/operations/listcollectiblebalancesresponse.md create mode 100644 docs/models/operations/listcontractdeploymentsglobals.md create mode 100644 docs/models/operations/listcontractdeploymentsrequest.md create mode 100644 docs/models/operations/listcontractdeploymentsresponse.md create mode 100644 docs/models/operations/listdelegatorsglobals.md create mode 100644 docs/models/operations/listdelegatorsrequest.md create mode 100644 docs/models/operations/listdelegatorsresponse.md create mode 100644 docs/models/operations/listerc1155balancesglobals.md create mode 100644 docs/models/operations/listerc1155balancesrequest.md create mode 100644 docs/models/operations/listerc1155balancesresponse.md create mode 100644 docs/models/operations/listerc1155transactionsglobals.md create mode 100644 docs/models/operations/listerc1155transactionsrequest.md create mode 100644 docs/models/operations/listerc1155transactionsresponse.md create mode 100644 docs/models/operations/listerc20balancesglobals.md create mode 100644 docs/models/operations/listerc20balancesrequest.md create mode 100644 docs/models/operations/listerc20balancesresponse.md create mode 100644 docs/models/operations/listerc20transactionsglobals.md create mode 100644 docs/models/operations/listerc20transactionsrequest.md create mode 100644 docs/models/operations/listerc20transactionsresponse.md create mode 100644 docs/models/operations/listerc721balancesglobals.md create mode 100644 docs/models/operations/listerc721balancesrequest.md create mode 100644 docs/models/operations/listerc721balancesresponse.md create mode 100644 docs/models/operations/listerc721transactionsglobals.md create mode 100644 docs/models/operations/listerc721transactionsrequest.md create mode 100644 docs/models/operations/listerc721transactionsresponse.md create mode 100644 docs/models/operations/listhistoricalprimarynetworkrewardsglobals.md create mode 100644 docs/models/operations/listhistoricalprimarynetworkrewardsrequest.md create mode 100644 docs/models/operations/listhistoricalprimarynetworkrewardsresponse.md create mode 100644 docs/models/operations/listinternaltransactionsglobals.md create mode 100644 docs/models/operations/listinternaltransactionsrequest.md create mode 100644 docs/models/operations/listinternaltransactionsresponse.md create mode 100644 docs/models/operations/listlatestprimarynetworkblocksglobals.md create mode 100644 docs/models/operations/listlatestprimarynetworkblocksrequest.md create mode 100644 docs/models/operations/listlatestprimarynetworkblocksresponse.md create mode 100644 docs/models/operations/listlatestprimarynetworktransactionsglobals.md create mode 100644 docs/models/operations/listlatestprimarynetworktransactionsrequest.md create mode 100644 docs/models/operations/listlatestprimarynetworktransactionsresponse.md create mode 100644 docs/models/operations/listlatestprimarynetworktransactionsresponsebody.md create mode 100644 docs/models/operations/listlatesttransactionsglobals.md create mode 100644 docs/models/operations/listlatesttransactionsrequest.md create mode 100644 docs/models/operations/listlatesttransactionsresponse.md create mode 100644 docs/models/operations/listlatestxchainverticesglobals.md create mode 100644 docs/models/operations/listlatestxchainverticesrequest.md create mode 100644 docs/models/operations/listlatestxchainverticesresponse.md create mode 100644 docs/models/operations/listnativetransactionsglobals.md create mode 100644 docs/models/operations/listnativetransactionsrequest.md create mode 100644 docs/models/operations/listnativetransactionsresponse.md create mode 100644 docs/models/operations/listpendingprimarynetworkrewardsglobals.md create mode 100644 docs/models/operations/listpendingprimarynetworkrewardsrequest.md create mode 100644 docs/models/operations/listpendingprimarynetworkrewardsresponse.md create mode 100644 docs/models/operations/listprimarynetworkblocksbynodeidglobals.md create mode 100644 docs/models/operations/listprimarynetworkblocksbynodeidrequest.md create mode 100644 docs/models/operations/listprimarynetworkblocksbynodeidresponse.md create mode 100644 docs/models/operations/listsubnetsglobals.md create mode 100644 docs/models/operations/listsubnetsrequest.md create mode 100644 docs/models/operations/listsubnetsresponse.md create mode 100644 docs/models/operations/listteleportermessagesrequest.md create mode 100644 docs/models/operations/listteleportermessagesresponse.md create mode 100644 docs/models/operations/listtokensglobals.md create mode 100644 docs/models/operations/listtokensrequest.md create mode 100644 docs/models/operations/listtokensresponse.md create mode 100644 docs/models/operations/listtransactionsglobals.md create mode 100644 docs/models/operations/listtransactionsrequest.md create mode 100644 docs/models/operations/listtransactionsresponse.md create mode 100644 docs/models/operations/listtransfersglobals.md create mode 100644 docs/models/operations/listtransfersrequest.md create mode 100644 docs/models/operations/listtransfersresponse.md create mode 100644 docs/models/operations/listvalidatorsglobals.md create mode 100644 docs/models/operations/listvalidatorsrequest.md create mode 100644 docs/models/operations/listvalidatorsresponse.md create mode 100644 docs/models/operations/listwebhooksrequest.md create mode 100644 docs/models/operations/listwebhooksresponse.md create mode 100644 docs/models/operations/posttransactionexportjobrequestbody.md create mode 100644 docs/models/operations/queryparamrequesttype.md create mode 100644 docs/models/operations/reindexnftglobals.md create mode 100644 docs/models/operations/reindexnftrequest.md create mode 100644 docs/models/operations/removeaddressesfromwebhookrequest.md create mode 100644 docs/models/operations/requesttype.md create mode 100644 docs/models/operations/supportedchainsrequest.md create mode 100644 docs/models/operations/updatewebhookrequest.md create mode 100644 docs/sdks/avacloudsdk/README.md create mode 100644 docs/sdks/avacloudsdkbalances/README.md create mode 100644 docs/sdks/avacloudsdkblocks/README.md create mode 100644 docs/sdks/avacloudsdktransactions/README.md create mode 100644 docs/sdks/balances/README.md create mode 100644 docs/sdks/blocks/README.md create mode 100644 docs/sdks/chains/README.md create mode 100644 docs/sdks/contracts/README.md create mode 100644 docs/sdks/evm/README.md create mode 100644 docs/sdks/glacier/README.md create mode 100644 docs/sdks/healthcheck/README.md create mode 100644 docs/sdks/nfts/README.md create mode 100644 docs/sdks/operations/README.md create mode 100644 docs/sdks/primarynetwork/README.md create mode 100644 docs/sdks/rewards/README.md create mode 100644 docs/sdks/teleporter/README.md create mode 100644 docs/sdks/transactions/README.md create mode 100644 docs/sdks/usagemetrics/README.md create mode 100644 docs/sdks/utxos/README.md create mode 100644 docs/sdks/vertices/README.md create mode 100644 docs/sdks/webhooks/README.md create mode 100644 jsr.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/core.ts create mode 100644 src/funcs/glacierEvmBalancesGetNativeBalance.ts create mode 100644 src/funcs/glacierEvmBalancesListCollectibleBalances.ts create mode 100644 src/funcs/glacierEvmBalancesListErc1155Balances.ts create mode 100644 src/funcs/glacierEvmBalancesListErc20Balances.ts create mode 100644 src/funcs/glacierEvmBalancesListErc721Balances.ts create mode 100644 src/funcs/glacierEvmBlocksGetBlock.ts create mode 100644 src/funcs/glacierEvmBlocksGetLatestBlocks.ts create mode 100644 src/funcs/glacierEvmChainsGetChainInfo.ts create mode 100644 src/funcs/glacierEvmChainsSupportedChains.ts create mode 100644 src/funcs/glacierEvmContractsGetContractMetadata.ts create mode 100644 src/funcs/glacierEvmTransactionsGetDeploymentTransaction.ts create mode 100644 src/funcs/glacierEvmTransactionsGetTransaction.ts create mode 100644 src/funcs/glacierEvmTransactionsGetTransactionsForBlock.ts create mode 100644 src/funcs/glacierEvmTransactionsListContractDeployments.ts create mode 100644 src/funcs/glacierEvmTransactionsListErc1155Transactions.ts create mode 100644 src/funcs/glacierEvmTransactionsListErc20Transactions.ts create mode 100644 src/funcs/glacierEvmTransactionsListErc721Transactions.ts create mode 100644 src/funcs/glacierEvmTransactionsListInternalTransactions.ts create mode 100644 src/funcs/glacierEvmTransactionsListLatestTransactions.ts create mode 100644 src/funcs/glacierEvmTransactionsListNativeTransactions.ts create mode 100644 src/funcs/glacierEvmTransactionsListTransactions.ts create mode 100644 src/funcs/glacierEvmTransactionsListTransfers.ts create mode 100644 src/funcs/glacierHealthCheckGlacierHealthCheck.ts create mode 100644 src/funcs/glacierNftsGetTokenDetails.ts create mode 100644 src/funcs/glacierNftsListTokens.ts create mode 100644 src/funcs/glacierNftsReindexNft.ts create mode 100644 src/funcs/glacierOperationsGetOperationResult.ts create mode 100644 src/funcs/glacierOperationsPostTransactionExportJob.ts create mode 100644 src/funcs/glacierPrimaryNetworkBalancesGetBalancesByAddresses.ts create mode 100644 src/funcs/glacierPrimaryNetworkBlocksGetBlockById.ts create mode 100644 src/funcs/glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks.ts create mode 100644 src/funcs/glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId.ts create mode 100644 src/funcs/glacierPrimaryNetworkGetAssetDetails.ts create mode 100644 src/funcs/glacierPrimaryNetworkGetChainIdsForAddresses.ts create mode 100644 src/funcs/glacierPrimaryNetworkGetNetworkDetails.ts create mode 100644 src/funcs/glacierPrimaryNetworkGetSingleValidatorDetails.ts create mode 100644 src/funcs/glacierPrimaryNetworkGetSubnetById.ts create mode 100644 src/funcs/glacierPrimaryNetworkListBlockchains.ts create mode 100644 src/funcs/glacierPrimaryNetworkListDelegators.ts create mode 100644 src/funcs/glacierPrimaryNetworkListSubnets.ts create mode 100644 src/funcs/glacierPrimaryNetworkListValidators.ts create mode 100644 src/funcs/glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.ts create mode 100644 src/funcs/glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.ts create mode 100644 src/funcs/glacierPrimaryNetworkTransactionsGetTxByHash.ts create mode 100644 src/funcs/glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions.ts create mode 100644 src/funcs/glacierPrimaryNetworkTransactionsListAssetTransactions.ts create mode 100644 src/funcs/glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions.ts create mode 100644 src/funcs/glacierPrimaryNetworkUtxosGetUtxosByAddresses.ts create mode 100644 src/funcs/glacierPrimaryNetworkVerticesGetVertexByHash.ts create mode 100644 src/funcs/glacierPrimaryNetworkVerticesGetVertexByHeight.ts create mode 100644 src/funcs/glacierPrimaryNetworkVerticesListLatestXChainVertices.ts create mode 100644 src/funcs/glacierTeleporterGetTeleporterMessage.ts create mode 100644 src/funcs/glacierTeleporterListTeleporterMessages.ts create mode 100644 src/funcs/glacierUsageMetricsGetApiLogs.ts create mode 100644 src/funcs/glacierUsageMetricsGetApiUsageMetrics.ts create mode 100644 src/funcs/glacierWebhooksAddAddressesToWebhook.ts create mode 100644 src/funcs/glacierWebhooksCreateWebhook.ts create mode 100644 src/funcs/glacierWebhooksDeactivateWebhook.ts create mode 100644 src/funcs/glacierWebhooksGenerateSharedSecret.ts create mode 100644 src/funcs/glacierWebhooksGetAddressesFromWebhook.ts create mode 100644 src/funcs/glacierWebhooksGetSharedSecret.ts create mode 100644 src/funcs/glacierWebhooksGetWebhook.ts create mode 100644 src/funcs/glacierWebhooksListWebhooks.ts create mode 100644 src/funcs/glacierWebhooksRemoveAddressesFromWebhook.ts create mode 100644 src/funcs/glacierWebhooksUpdateWebhook.ts create mode 100644 src/hooks/hooks.ts create mode 100644 src/hooks/index.ts create mode 100644 src/hooks/registration.ts create mode 100644 src/hooks/types.ts create mode 100644 src/index.ts create mode 100644 src/lib/base64.ts create mode 100644 src/lib/config.ts create mode 100644 src/lib/dlv.ts create mode 100644 src/lib/encodings.ts create mode 100644 src/lib/http.ts create mode 100644 src/lib/is-plain-object.ts create mode 100644 src/lib/logger.ts create mode 100644 src/lib/matchers.ts create mode 100644 src/lib/primitives.ts create mode 100644 src/lib/retries.ts create mode 100644 src/lib/schemas.ts create mode 100644 src/lib/sdks.ts create mode 100644 src/lib/security.ts create mode 100644 src/lib/url.ts create mode 100644 src/models/components/activedelegatordetails.ts create mode 100644 src/models/components/activevalidatordetails.ts create mode 100644 src/models/components/addressactivitymetadata.ts create mode 100644 src/models/components/addresseschangerequest.ts create mode 100644 src/models/components/aggregatedassetamount.ts create mode 100644 src/models/components/assetamount.ts create mode 100644 src/models/components/assetwithpriceinfo.ts create mode 100644 src/models/components/blockchain.ts create mode 100644 src/models/components/blockchainid.ts create mode 100644 src/models/components/blockchainids.ts create mode 100644 src/models/components/blockchaininfo.ts create mode 100644 src/models/components/blscredentials.ts create mode 100644 src/models/components/cchainatomicbalances.ts create mode 100644 src/models/components/cchainexporttransaction.ts create mode 100644 src/models/components/cchainimporttransaction.ts create mode 100644 src/models/components/cchainsharedassetbalance.ts create mode 100644 src/models/components/chainaddresschainidmap.ts create mode 100644 src/models/components/chainaddresschainidmaplistresponse.ts create mode 100644 src/models/components/chaininfo.ts create mode 100644 src/models/components/chainstatus.ts create mode 100644 src/models/components/completeddelegatordetails.ts create mode 100644 src/models/components/completedvalidatordetails.ts create mode 100644 src/models/components/contractdeploymentdetails.ts create mode 100644 src/models/components/createevmtransactionexportrequest.ts create mode 100644 src/models/components/createprimarynetworktransactionexportrequest.ts create mode 100644 src/models/components/createwebhookrequest.ts create mode 100644 src/models/components/currencycode.ts create mode 100644 src/models/components/delegationstatustype.ts create mode 100644 src/models/components/delegatorsdetails.ts create mode 100644 src/models/components/deliveredsourcenotindexedteleportermessage.ts create mode 100644 src/models/components/deliveredteleportermessage.ts create mode 100644 src/models/components/erc1155contract.ts create mode 100644 src/models/components/erc1155token.ts create mode 100644 src/models/components/erc1155tokenbalance.ts create mode 100644 src/models/components/erc1155tokenmetadata.ts create mode 100644 src/models/components/erc1155transfer.ts create mode 100644 src/models/components/erc1155transferdetails.ts create mode 100644 src/models/components/erc20contract.ts create mode 100644 src/models/components/erc20token.ts create mode 100644 src/models/components/erc20tokenbalance.ts create mode 100644 src/models/components/erc20transfer.ts create mode 100644 src/models/components/erc20transferdetails.ts create mode 100644 src/models/components/erc721contract.ts create mode 100644 src/models/components/erc721token.ts create mode 100644 src/models/components/erc721tokenbalance.ts create mode 100644 src/models/components/erc721tokenmetadata.ts create mode 100644 src/models/components/erc721transfer.ts create mode 100644 src/models/components/erc721transferdetails.ts create mode 100644 src/models/components/eventtype.ts create mode 100644 src/models/components/evmblock.ts create mode 100644 src/models/components/evminput.ts create mode 100644 src/models/components/evmnetworkoptions.ts create mode 100644 src/models/components/evmoperationtype.ts create mode 100644 src/models/components/evmoutput.ts create mode 100644 src/models/components/fullnativetransactiondetails.ts create mode 100644 src/models/components/getchainresponse.ts create mode 100644 src/models/components/getevmblockresponse.ts create mode 100644 src/models/components/getnativebalanceresponse.ts create mode 100644 src/models/components/getnetworkdetailsresponse.ts create mode 100644 src/models/components/getprimarynetworkblockresponse.ts create mode 100644 src/models/components/gettransactionresponse.ts create mode 100644 src/models/components/glacierapifeature.ts create mode 100644 src/models/components/glacierlistchainsresponse.ts create mode 100644 src/models/components/globalparamnetwork.ts create mode 100644 src/models/components/historicalreward.ts create mode 100644 src/models/components/imageasset.ts create mode 100644 src/models/components/index.ts create mode 100644 src/models/components/internaltransaction.ts create mode 100644 src/models/components/internaltransactiondetails.ts create mode 100644 src/models/components/internaltransactionopcall.ts create mode 100644 src/models/components/listblockchainsresponse.ts create mode 100644 src/models/components/listcchainatomicbalancesresponse.ts create mode 100644 src/models/components/listcchainatomictransactionsresponse.ts create mode 100644 src/models/components/listcollectiblebalancesresponse.ts create mode 100644 src/models/components/listcontractsresponse.ts create mode 100644 src/models/components/listdelegatordetailsresponse.ts create mode 100644 src/models/components/listerc1155balancesresponse.ts create mode 100644 src/models/components/listerc1155transactionsresponse.ts create mode 100644 src/models/components/listerc20balancesresponse.ts create mode 100644 src/models/components/listerc20transactionsresponse.ts create mode 100644 src/models/components/listerc721balancesresponse.ts create mode 100644 src/models/components/listerc721transactionsresponse.ts create mode 100644 src/models/components/listevmblocksresponse.ts create mode 100644 src/models/components/listhistoricalrewardsresponse.ts create mode 100644 src/models/components/listinternaltransactionsresponse.ts create mode 100644 src/models/components/listnativetransactionsresponse.ts create mode 100644 src/models/components/listnfttokens.ts create mode 100644 src/models/components/listpchainbalancesresponse.ts create mode 100644 src/models/components/listpchaintransactionsresponse.ts create mode 100644 src/models/components/listpchainutxosresponse.ts create mode 100644 src/models/components/listpendingrewardsresponse.ts create mode 100644 src/models/components/listprimarynetworkblocksresponse.ts create mode 100644 src/models/components/listsubnetsresponse.ts create mode 100644 src/models/components/listteleportermessagesresponse.ts create mode 100644 src/models/components/listtransactiondetailsresponse.ts create mode 100644 src/models/components/listtransfersresponse.ts create mode 100644 src/models/components/listutxosresponse.ts create mode 100644 src/models/components/listvalidatordetailsresponse.ts create mode 100644 src/models/components/listwebhookaddressesresponse.ts create mode 100644 src/models/components/listwebhooksresponse.ts create mode 100644 src/models/components/listxchainbalancesresponse.ts create mode 100644 src/models/components/listxchaintransactionsresponse.ts create mode 100644 src/models/components/listxchainverticesresponse.ts create mode 100644 src/models/components/logsformat.ts create mode 100644 src/models/components/logsformatmetadata.ts create mode 100644 src/models/components/logsresponsedto.ts create mode 100644 src/models/components/method.ts create mode 100644 src/models/components/metric.ts create mode 100644 src/models/components/money.ts create mode 100644 src/models/components/nativetokenbalance.ts create mode 100644 src/models/components/nativetransaction.ts create mode 100644 src/models/components/networktoken.ts create mode 100644 src/models/components/networktokendetails.ts create mode 100644 src/models/components/networktype.ts create mode 100644 src/models/components/nfttokenmetadatastatus.ts create mode 100644 src/models/components/operationstatus.ts create mode 100644 src/models/components/operationstatuscode.ts create mode 100644 src/models/components/operationstatusresponse.ts create mode 100644 src/models/components/operationtype.ts create mode 100644 src/models/components/pchainbalance.ts create mode 100644 src/models/components/pchainid.ts create mode 100644 src/models/components/pchainsharedasset.ts create mode 100644 src/models/components/pchaintransaction.ts create mode 100644 src/models/components/pchaintransactiontype.ts create mode 100644 src/models/components/pchainutxo.ts create mode 100644 src/models/components/pendingdelegatordetails.ts create mode 100644 src/models/components/pendingreward.ts create mode 100644 src/models/components/pendingteleportermessage.ts create mode 100644 src/models/components/pendingvalidatordetails.ts create mode 100644 src/models/components/pricingproviders.ts create mode 100644 src/models/components/primarynetwork.ts create mode 100644 src/models/components/primarynetworkassetcap.ts create mode 100644 src/models/components/primarynetworkassettype.ts create mode 100644 src/models/components/primarynetworkblock.ts create mode 100644 src/models/components/primarynetworkchaininfo.ts create mode 100644 src/models/components/primarynetworkchainname.ts create mode 100644 src/models/components/primarynetworkoperationtype.ts create mode 100644 src/models/components/primarynetworkoptions.ts create mode 100644 src/models/components/primarynetworktxtype.ts create mode 100644 src/models/components/proposerdetails.ts create mode 100644 src/models/components/removedvalidatordetails.ts create mode 100644 src/models/components/requesttype.ts create mode 100644 src/models/components/resourcelink.ts create mode 100644 src/models/components/resourcelinktype.ts create mode 100644 src/models/components/rewards.ts create mode 100644 src/models/components/rewardtype.ts create mode 100644 src/models/components/richaddress.ts create mode 100644 src/models/components/security.ts create mode 100644 src/models/components/sharedsecretsresponse.ts create mode 100644 src/models/components/sortbyoption.ts create mode 100644 src/models/components/sortorder.ts create mode 100644 src/models/components/stakingdistribution.ts create mode 100644 src/models/components/subnet.ts create mode 100644 src/models/components/subnetownershipinfo.ts create mode 100644 src/models/components/teleporterdestinationtransaction.ts create mode 100644 src/models/components/teleporterreceipt.ts create mode 100644 src/models/components/teleporterrewarddetails.ts create mode 100644 src/models/components/teleportersourcetransaction.ts create mode 100644 src/models/components/timeintervalgranularityextended.ts create mode 100644 src/models/components/transactiondetails.ts create mode 100644 src/models/components/transactionexportmetadata.ts create mode 100644 src/models/components/transactionmethodtype.ts create mode 100644 src/models/components/transactionstatus.ts create mode 100644 src/models/components/transactionvertexdetail.ts create mode 100644 src/models/components/unknowncontract.ts create mode 100644 src/models/components/updatewebhookrequest.ts create mode 100644 src/models/components/usagemetricsgroupbyenum.ts create mode 100644 src/models/components/usagemetricsresponsedto.ts create mode 100644 src/models/components/usagemetricsvaluedto.ts create mode 100644 src/models/components/utilityaddresses.ts create mode 100644 src/models/components/utxo.ts create mode 100644 src/models/components/utxocredential.ts create mode 100644 src/models/components/utxotype.ts create mode 100644 src/models/components/validationstatustype.ts create mode 100644 src/models/components/validatorhealthdetails.ts create mode 100644 src/models/components/validatorsdetails.ts create mode 100644 src/models/components/vmname.ts create mode 100644 src/models/components/webhookresponse.ts create mode 100644 src/models/components/webhookstatus.ts create mode 100644 src/models/components/webhookstatustype.ts create mode 100644 src/models/components/xchainassetdetails.ts create mode 100644 src/models/components/xchainbalances.ts create mode 100644 src/models/components/xchainid.ts create mode 100644 src/models/components/xchainlineartransaction.ts create mode 100644 src/models/components/xchainnonlineartransaction.ts create mode 100644 src/models/components/xchainsharedassetbalance.ts create mode 100644 src/models/components/xchaintransactiontype.ts create mode 100644 src/models/components/xchainvertex.ts create mode 100644 src/models/errors/badgateway.ts create mode 100644 src/models/errors/badrequest.ts create mode 100644 src/models/errors/forbidden.ts create mode 100644 src/models/errors/glacierhealthcheck.ts create mode 100644 src/models/errors/httpclienterrors.ts create mode 100644 src/models/errors/index.ts create mode 100644 src/models/errors/internalservererror.ts create mode 100644 src/models/errors/notfound.ts create mode 100644 src/models/errors/sdkerror.ts create mode 100644 src/models/errors/sdkvalidationerror.ts create mode 100644 src/models/errors/serviceunavailable.ts create mode 100644 src/models/errors/toomanyrequests.ts create mode 100644 src/models/errors/unauthorized.ts create mode 100644 src/models/operations/addaddressestowebhook.ts create mode 100644 src/models/operations/deactivatewebhook.ts create mode 100644 src/models/operations/getaddressesfromwebhook.ts create mode 100644 src/models/operations/getapilogs.ts create mode 100644 src/models/operations/getapiusagemetrics.ts create mode 100644 src/models/operations/getassetdetails.ts create mode 100644 src/models/operations/getbalancesbyaddresses.ts create mode 100644 src/models/operations/getblock.ts create mode 100644 src/models/operations/getblockbyid.ts create mode 100644 src/models/operations/getchainidsforaddresses.ts create mode 100644 src/models/operations/getchaininfo.ts create mode 100644 src/models/operations/getcontractmetadata.ts create mode 100644 src/models/operations/getdeploymenttransaction.ts create mode 100644 src/models/operations/getlatestblocks.ts create mode 100644 src/models/operations/getnativebalance.ts create mode 100644 src/models/operations/getnetworkdetails.ts create mode 100644 src/models/operations/getoperationresult.ts create mode 100644 src/models/operations/getsinglevalidatordetails.ts create mode 100644 src/models/operations/getsubnetbyid.ts create mode 100644 src/models/operations/getteleportermessage.ts create mode 100644 src/models/operations/gettokendetails.ts create mode 100644 src/models/operations/gettransaction.ts create mode 100644 src/models/operations/gettransactionsforblock.ts create mode 100644 src/models/operations/gettxbyhash.ts create mode 100644 src/models/operations/getutxosbyaddresses.ts create mode 100644 src/models/operations/getvertexbyhash.ts create mode 100644 src/models/operations/getvertexbyheight.ts create mode 100644 src/models/operations/getwebhook.ts create mode 100644 src/models/operations/glacierhealthcheck.ts create mode 100644 src/models/operations/index.ts create mode 100644 src/models/operations/listactiveprimarynetworkstakingtransactions.ts create mode 100644 src/models/operations/listassettransactions.ts create mode 100644 src/models/operations/listblockchains.ts create mode 100644 src/models/operations/listcollectiblebalances.ts create mode 100644 src/models/operations/listcontractdeployments.ts create mode 100644 src/models/operations/listdelegators.ts create mode 100644 src/models/operations/listerc1155balances.ts create mode 100644 src/models/operations/listerc1155transactions.ts create mode 100644 src/models/operations/listerc20balances.ts create mode 100644 src/models/operations/listerc20transactions.ts create mode 100644 src/models/operations/listerc721balances.ts create mode 100644 src/models/operations/listerc721transactions.ts create mode 100644 src/models/operations/listhistoricalprimarynetworkrewards.ts create mode 100644 src/models/operations/listinternaltransactions.ts create mode 100644 src/models/operations/listlatestprimarynetworkblocks.ts create mode 100644 src/models/operations/listlatestprimarynetworktransactions.ts create mode 100644 src/models/operations/listlatesttransactions.ts create mode 100644 src/models/operations/listlatestxchainvertices.ts create mode 100644 src/models/operations/listnativetransactions.ts create mode 100644 src/models/operations/listpendingprimarynetworkrewards.ts create mode 100644 src/models/operations/listprimarynetworkblocksbynodeid.ts create mode 100644 src/models/operations/listsubnets.ts create mode 100644 src/models/operations/listteleportermessages.ts create mode 100644 src/models/operations/listtokens.ts create mode 100644 src/models/operations/listtransactions.ts create mode 100644 src/models/operations/listtransfers.ts create mode 100644 src/models/operations/listvalidators.ts create mode 100644 src/models/operations/listwebhooks.ts create mode 100644 src/models/operations/posttransactionexportjob.ts create mode 100644 src/models/operations/reindexnft.ts create mode 100644 src/models/operations/removeaddressesfromwebhook.ts create mode 100644 src/models/operations/supportedchains.ts create mode 100644 src/models/operations/updatewebhook.ts create mode 100644 src/sdk/avacloudsdkbalances.ts create mode 100644 src/sdk/avacloudsdkblocks.ts create mode 100644 src/sdk/avacloudsdktransactions.ts create mode 100644 src/sdk/balances.ts create mode 100644 src/sdk/blocks.ts create mode 100644 src/sdk/chains.ts create mode 100644 src/sdk/contracts.ts create mode 100644 src/sdk/evm.ts create mode 100644 src/sdk/glacier.ts create mode 100644 src/sdk/healthcheck.ts create mode 100644 src/sdk/index.ts create mode 100644 src/sdk/nfts.ts create mode 100644 src/sdk/operations.ts create mode 100644 src/sdk/primarynetwork.ts create mode 100644 src/sdk/rewards.ts create mode 100644 src/sdk/sdk.ts create mode 100644 src/sdk/teleporter.ts create mode 100644 src/sdk/transactions.ts create mode 100644 src/sdk/usagemetrics.ts create mode 100644 src/sdk/utxos.ts create mode 100644 src/sdk/vertices.ts create mode 100644 src/sdk/webhooks.ts create mode 100644 src/types/blobs.ts create mode 100644 src/types/constdatetime.ts create mode 100644 src/types/enums.ts create mode 100644 src/types/fp.ts create mode 100644 src/types/index.ts create mode 100644 src/types/operations.ts create mode 100644 src/types/rfcdate.ts create mode 100644 src/utils/index.ts create mode 100644 src/utils/isvalidsignature.ts create mode 100644 tsconfig.json create mode 100644 utils/index.d.ts create mode 100644 utils/index.d.ts.map create mode 100644 utils/index.js create mode 100644 utils/index.js.map create mode 100644 utils/isvalidsignature.d.ts create mode 100644 utils/isvalidsignature.d.ts.map create mode 100644 utils/isvalidsignature.js create mode 100644 utils/isvalidsignature.js.map diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000..e7f98e2 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,35 @@ + +
+ +
+
+ +> **Remember to shutdown a GitHub Codespace when it is not in use!** + +# Dev Containers Quick Start + +The default location for usage snippets is the `samples` directory. + +## Running a Usage Sample + +A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below. + +``` +ts-node root.ts +``` + +## Generating Additional Usage Samples + +The speakeasy CLI allows you to generate more usage snippets. Here's how: + +- To generate a sample for a specific operation by providing an operation ID, use: + +``` +speakeasy generate usage -s https://glacier-api.avax.network/api-json -l typescript -i {INPUT_OPERATION_ID} -o ./samples +``` + +- To generate samples for an entire namespace (like a tag or group name), use: + +``` +speakeasy generate usage -s https://glacier-api.avax.network/api-json -l typescript -n {INPUT_TAG_NAME} -o ./samples +``` diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4d560dd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,45 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/images/tree/main/src/typescript-node +{ + "name": "TypeScript", + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.vscode-typescript-tslint-plugin", + "esbenp.prettier-vscode", + "github.vscode-pull-request-github" + ], + "settings": { + "files.eol": "\n", + "editor.formatOnSave": true, + "typescript.tsc.autoDetect": "on", + "typescript.updateImportsOnFileMove.enabled": "always", + "typescript.preferences.importModuleSpecifier": "relative", + "[typescript]": { + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + }, + "[typescriptreact]": { + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + } + } + }, + "codespaces": { + "openFiles": [ + ".devcontainer/README.md" + ] + } + } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 0000000..2b4190c --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Install the speakeasy CLI +curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh + +# Setup samples directory +rmdir samples || true +mkdir samples + +npm install +npm install -g ts-node +npm link +npm link @avalabs/avacloud-sdk +TS_CONFIG_CONTENT=$(cat < samples/tsconfig.json + +# Generate starter usage sample with speakeasy +speakeasy generate usage -s https://glacier-api.avax.network/api-json -l typescript -o samples/root.ts \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..4d160bd --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,28 @@ +/* eslint-env node */ +module.exports = { + root: true, + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/recommended", + "plugin:import/typescript", + ], + parser: "@typescript-eslint/parser", + plugins: ["@typescript-eslint"], + settings: { + "import/resolver": { + typescript: true, + node: true, + }, + }, + rules: { + // Handled by typescript compiler + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-explicit-any": "off", + "import/no-named-as-default-member": "off", + + "import/no-default-export": "error", + }, +}; diff --git a/.genignore b/.genignore new file mode 100644 index 0000000..b2c3b9d --- /dev/null +++ b/.genignore @@ -0,0 +1 @@ +jsr.json \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..113eead --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# This allows generated code to be indexed correctly +*.ts linguist-generated=false \ No newline at end of file diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml new file mode 100644 index 0000000..2ce315a --- /dev/null +++ b/.github/workflows/sdk_generation.yaml @@ -0,0 +1,30 @@ +name: Generate +permissions: + checks: write + contents: write + pull-requests: write + statuses: write +"on": + workflow_dispatch: + inputs: + force: + description: Force generation of SDKs + type: boolean + default: false + set_version: + description: optionally set a specific SDK version + type: string + schedule: + - cron: 0 0 * * * +jobs: + generate: + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 + with: + force: ${{ github.event.inputs.force }} + mode: pr + set_version: ${{ github.event.inputs.set_version }} + speakeasy_version: latest + secrets: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + npm_token: ${{ secrets.NPM_TOKEN }} + speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/.github/workflows/sdk_publish.yaml b/.github/workflows/sdk_publish.yaml new file mode 100644 index 0000000..cfba67c --- /dev/null +++ b/.github/workflows/sdk_publish.yaml @@ -0,0 +1,20 @@ +name: Publish +permissions: + checks: write + contents: write + pull-requests: write + statuses: write +"on": + push: + branches: + - main + paths: + - RELEASES.md + - '*/RELEASES.md' +jobs: + publish: + uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 + secrets: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + npm_token: ${{ secrets.NPM_TOKEN }} + speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..99a6f8f --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +/models +/models/errors +/types +/node_modules +/lib +/sdk +/funcs +/hooks +/index.* +/core.* +/cjs +/esm +/dist +/.tsbuildinfo +/.tshy +/.tshy-* diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..3ef05d1 --- /dev/null +++ b/.npmignore @@ -0,0 +1,9 @@ +**/* +!/**/*.ts +!/**/*.js +!/**/*.map + +/.eslintrc.js +/cjs +/.tshy +/.tshy-* diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock new file mode 100644 index 0000000..29699c2 --- /dev/null +++ b/.speakeasy/gen.lock @@ -0,0 +1,852 @@ +lockVersion: 2.0.0 +id: 2b9c4bf6-4d87-4382-84d9-5fb3c84c7fad +management: + docChecksum: b7c80728933921cf1fd9ad31274d5ad7 + docVersion: Beta + speakeasyVersion: 1.383.2 + generationVersion: 2.407.0 + releaseVersion: 0.2.0 + configChecksum: c0ea7d51e7782a892a23d8b54a7e9bce + repoURL: https://github.com/ava-labs/avacloud-sdk-typescript.git + installationURL: https://github.com/ava-labs/avacloud-sdk-typescript + published: true +features: + typescript: + additionalDependencies: 0.1.0 + additionalProperties: 0.1.1 + constsAndDefaults: 0.1.11 + core: 3.14.1 + defaultEnabledRetries: 0.1.0 + deprecations: 2.81.1 + devContainers: 2.90.0 + envVarSecurityUsage: 0.1.1 + examples: 2.81.4 + globalSecurity: 2.82.11 + globalSecurityCallbacks: 0.1.0 + globalSecurityFlattening: 0.1.0 + globalServerURLs: 2.82.4 + globals: 2.82.1 + groups: 2.81.2 + nameOverrides: 2.81.2 + nullables: 0.1.0 + pagination: 2.82.6 + responseFormat: 0.2.3 + retries: 2.83.0 + sdkHooks: 0.1.0 + unions: 2.85.7 +generatedFiles: + - src/funcs/glacierHealthCheckGlacierHealthCheck.ts + - src/funcs/glacierNftsReindexNft.ts + - src/funcs/glacierNftsListTokens.ts + - src/funcs/glacierNftsGetTokenDetails.ts + - src/funcs/glacierOperationsGetOperationResult.ts + - src/funcs/glacierOperationsPostTransactionExportJob.ts + - src/funcs/glacierPrimaryNetworkGetAssetDetails.ts + - src/funcs/glacierPrimaryNetworkGetChainIdsForAddresses.ts + - src/funcs/glacierPrimaryNetworkGetNetworkDetails.ts + - src/funcs/glacierPrimaryNetworkListBlockchains.ts + - src/funcs/glacierPrimaryNetworkListSubnets.ts + - src/funcs/glacierPrimaryNetworkGetSubnetById.ts + - src/funcs/glacierPrimaryNetworkListValidators.ts + - src/funcs/glacierPrimaryNetworkGetSingleValidatorDetails.ts + - src/funcs/glacierPrimaryNetworkListDelegators.ts + - src/funcs/glacierUsageMetricsGetApiUsageMetrics.ts + - src/funcs/glacierUsageMetricsGetApiLogs.ts + - src/funcs/glacierWebhooksListWebhooks.ts + - src/funcs/glacierWebhooksCreateWebhook.ts + - src/funcs/glacierWebhooksGetWebhook.ts + - src/funcs/glacierWebhooksDeactivateWebhook.ts + - src/funcs/glacierWebhooksUpdateWebhook.ts + - src/funcs/glacierWebhooksGenerateSharedSecret.ts + - src/funcs/glacierWebhooksGetSharedSecret.ts + - src/funcs/glacierWebhooksGetAddressesFromWebhook.ts + - src/funcs/glacierWebhooksRemoveAddressesFromWebhook.ts + - src/funcs/glacierWebhooksAddAddressesToWebhook.ts + - src/funcs/glacierTeleporterGetTeleporterMessage.ts + - src/funcs/glacierTeleporterListTeleporterMessages.ts + - src/funcs/glacierPrimaryNetworkTransactionsGetTxByHash.ts + - src/funcs/glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions.ts + - src/funcs/glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions.ts + - src/funcs/glacierPrimaryNetworkTransactionsListAssetTransactions.ts + - src/funcs/glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.ts + - src/funcs/glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.ts + - src/funcs/glacierPrimaryNetworkUtxosGetUtxosByAddresses.ts + - src/funcs/glacierPrimaryNetworkBalancesGetBalancesByAddresses.ts + - src/funcs/glacierPrimaryNetworkBlocksGetBlockById.ts + - src/funcs/glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId.ts + - src/funcs/glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks.ts + - src/funcs/glacierPrimaryNetworkVerticesListLatestXChainVertices.ts + - src/funcs/glacierPrimaryNetworkVerticesGetVertexByHash.ts + - src/funcs/glacierPrimaryNetworkVerticesGetVertexByHeight.ts + - src/funcs/glacierEvmBalancesGetNativeBalance.ts + - src/funcs/glacierEvmBalancesListErc20Balances.ts + - src/funcs/glacierEvmBalancesListErc721Balances.ts + - src/funcs/glacierEvmBalancesListErc1155Balances.ts + - src/funcs/glacierEvmBalancesListCollectibleBalances.ts + - src/funcs/glacierEvmBlocksGetLatestBlocks.ts + - src/funcs/glacierEvmBlocksGetBlock.ts + - src/funcs/glacierEvmTransactionsGetDeploymentTransaction.ts + - src/funcs/glacierEvmTransactionsListContractDeployments.ts + - src/funcs/glacierEvmTransactionsListTransfers.ts + - src/funcs/glacierEvmTransactionsListTransactions.ts + - src/funcs/glacierEvmTransactionsListNativeTransactions.ts + - src/funcs/glacierEvmTransactionsListErc20Transactions.ts + - src/funcs/glacierEvmTransactionsListErc721Transactions.ts + - src/funcs/glacierEvmTransactionsListErc1155Transactions.ts + - src/funcs/glacierEvmTransactionsListInternalTransactions.ts + - src/funcs/glacierEvmTransactionsGetTransaction.ts + - src/funcs/glacierEvmTransactionsGetTransactionsForBlock.ts + - src/funcs/glacierEvmTransactionsListLatestTransactions.ts + - src/funcs/glacierEvmContractsGetContractMetadata.ts + - src/funcs/glacierEvmChainsSupportedChains.ts + - src/funcs/glacierEvmChainsGetChainInfo.ts + - src/sdk/healthcheck.ts + - src/sdk/nfts.ts + - src/sdk/operations.ts + - src/sdk/transactions.ts + - src/sdk/rewards.ts + - src/sdk/utxos.ts + - src/sdk/balances.ts + - src/sdk/blocks.ts + - src/sdk/vertices.ts + - src/sdk/primarynetwork.ts + - src/sdk/usagemetrics.ts + - src/sdk/webhooks.ts + - src/sdk/teleporter.ts + - src/sdk/avacloudsdkbalances.ts + - src/sdk/avacloudsdkblocks.ts + - src/sdk/avacloudsdktransactions.ts + - src/sdk/contracts.ts + - src/sdk/chains.ts + - src/sdk/evm.ts + - src/sdk/glacier.ts + - src/sdk/sdk.ts + - .eslintrc.cjs + - .npmignore + - FUNCTIONS.md + - RUNTIMES.md + - package.json + - src/core.ts + - src/index.ts + - src/lib/base64.ts + - src/lib/config.ts + - src/lib/dlv.ts + - src/lib/encodings.ts + - src/lib/http.ts + - src/lib/is-plain-object.ts + - src/lib/logger.ts + - src/lib/matchers.ts + - src/lib/primitives.ts + - src/lib/retries.ts + - src/lib/schemas.ts + - src/lib/sdks.ts + - src/lib/security.ts + - src/lib/url.ts + - src/sdk/index.ts + - src/models/errors/httpclienterrors.ts + - src/models/errors/sdkerror.ts + - src/models/errors/sdkvalidationerror.ts + - src/types/blobs.ts + - src/types/constdatetime.ts + - src/types/enums.ts + - src/types/fp.ts + - src/types/index.ts + - src/types/operations.ts + - src/types/rfcdate.ts + - tsconfig.json + - src/models/components/globalparamnetwork.ts + - src/models/components/listnfttokens.ts + - src/models/components/erc721token.ts + - src/models/components/erc721tokenmetadata.ts + - src/models/components/nfttokenmetadatastatus.ts + - src/models/components/erc1155token.ts + - src/models/components/erc1155tokenmetadata.ts + - src/models/components/operationstatusresponse.ts + - src/models/components/transactionexportmetadata.ts + - src/models/components/operationstatuscode.ts + - src/models/components/operationstatus.ts + - src/models/components/operationtype.ts + - src/models/components/createevmtransactionexportrequest.ts + - src/models/components/evmnetworkoptions.ts + - src/models/components/evmoperationtype.ts + - src/models/components/createprimarynetworktransactionexportrequest.ts + - src/models/components/primarynetworkoptions.ts + - src/models/components/primarynetworkoperationtype.ts + - src/models/components/xchainassetdetails.ts + - src/models/components/primarynetworkassetcap.ts + - src/models/components/primarynetworkassettype.ts + - src/models/components/xchainid.ts + - src/models/components/chainaddresschainidmaplistresponse.ts + - src/models/components/chainaddresschainidmap.ts + - src/models/components/blockchainids.ts + - src/models/components/getnetworkdetailsresponse.ts + - src/models/components/delegatorsdetails.ts + - src/models/components/validatorsdetails.ts + - src/models/components/stakingdistribution.ts + - src/models/components/listblockchainsresponse.ts + - src/models/components/blockchain.ts + - src/models/components/sortorder.ts + - src/models/components/listsubnetsresponse.ts + - src/models/components/subnet.ts + - src/models/components/blockchaininfo.ts + - src/models/components/subnetownershipinfo.ts + - src/models/components/listvalidatordetailsresponse.ts + - src/models/components/completedvalidatordetails.ts + - src/models/components/rewards.ts + - src/models/components/blscredentials.ts + - src/models/components/activevalidatordetails.ts + - src/models/components/validatorhealthdetails.ts + - src/models/components/pendingvalidatordetails.ts + - src/models/components/removedvalidatordetails.ts + - src/models/components/validationstatustype.ts + - src/models/components/sortbyoption.ts + - src/models/components/listdelegatordetailsresponse.ts + - src/models/components/completeddelegatordetails.ts + - src/models/components/activedelegatordetails.ts + - src/models/components/pendingdelegatordetails.ts + - src/models/components/delegationstatustype.ts + - src/models/components/pchaintransaction.ts + - src/models/components/assetamount.ts + - src/models/components/pchainutxo.ts + - src/models/components/utxotype.ts + - src/models/components/rewardtype.ts + - src/models/components/pchaintransactiontype.ts + - src/models/components/xchainnonlineartransaction.ts + - src/models/components/transactionvertexdetail.ts + - src/models/components/utxo.ts + - src/models/components/utxocredential.ts + - src/models/components/xchaintransactiontype.ts + - src/models/components/xchainlineartransaction.ts + - src/models/components/cchainexporttransaction.ts + - src/models/components/evminput.ts + - src/models/components/cchainimporttransaction.ts + - src/models/components/evmoutput.ts + - src/models/components/blockchainid.ts + - src/models/components/listpchaintransactionsresponse.ts + - src/models/components/primarynetworkchaininfo.ts + - src/models/components/primarynetwork.ts + - src/models/components/primarynetworkchainname.ts + - src/models/components/listxchaintransactionsresponse.ts + - src/models/components/listcchainatomictransactionsresponse.ts + - src/models/components/primarynetworktxtype.ts + - src/models/components/pchainid.ts + - src/models/components/listpendingrewardsresponse.ts + - src/models/components/pendingreward.ts + - src/models/components/listhistoricalrewardsresponse.ts + - src/models/components/historicalreward.ts + - src/models/components/assetwithpriceinfo.ts + - src/models/components/money.ts + - src/models/components/currencycode.ts + - src/models/components/listpchainutxosresponse.ts + - src/models/components/listutxosresponse.ts + - src/models/components/listpchainbalancesresponse.ts + - src/models/components/pchainbalance.ts + - src/models/components/pchainsharedasset.ts + - src/models/components/aggregatedassetamount.ts + - src/models/components/listxchainbalancesresponse.ts + - src/models/components/xchainbalances.ts + - src/models/components/xchainsharedassetbalance.ts + - src/models/components/listcchainatomicbalancesresponse.ts + - src/models/components/cchainatomicbalances.ts + - src/models/components/cchainsharedassetbalance.ts + - src/models/components/getprimarynetworkblockresponse.ts + - src/models/components/proposerdetails.ts + - src/models/components/listprimarynetworkblocksresponse.ts + - src/models/components/primarynetworkblock.ts + - src/models/components/listxchainverticesresponse.ts + - src/models/components/xchainvertex.ts + - src/models/components/usagemetricsresponsedto.ts + - src/models/components/metric.ts + - src/models/components/usagemetricsvaluedto.ts + - src/models/components/usagemetricsgroupbyenum.ts + - src/models/components/timeintervalgranularityextended.ts + - src/models/components/logsresponsedto.ts + - src/models/components/logsformat.ts + - src/models/components/logsformatmetadata.ts + - src/models/components/requesttype.ts + - src/models/components/listwebhooksresponse.ts + - src/models/components/webhookresponse.ts + - src/models/components/webhookstatustype.ts + - src/models/components/addressactivitymetadata.ts + - src/models/components/eventtype.ts + - src/models/components/webhookstatus.ts + - src/models/components/createwebhookrequest.ts + - src/models/components/updatewebhookrequest.ts + - src/models/components/sharedsecretsresponse.ts + - src/models/components/listwebhookaddressesresponse.ts + - src/models/components/addresseschangerequest.ts + - src/models/components/pendingteleportermessage.ts + - src/models/components/teleportersourcetransaction.ts + - src/models/components/teleporterrewarddetails.ts + - src/models/components/teleporterreceipt.ts + - src/models/components/deliveredteleportermessage.ts + - src/models/components/teleporterdestinationtransaction.ts + - src/models/components/deliveredsourcenotindexedteleportermessage.ts + - src/models/components/listteleportermessagesresponse.ts + - src/models/components/networktype.ts + - src/models/components/getnativebalanceresponse.ts + - src/models/components/nativetokenbalance.ts + - src/models/components/listerc20balancesresponse.ts + - src/models/components/erc20tokenbalance.ts + - src/models/components/listerc721balancesresponse.ts + - src/models/components/erc721tokenbalance.ts + - src/models/components/listerc1155balancesresponse.ts + - src/models/components/erc1155tokenbalance.ts + - src/models/components/listcollectiblebalancesresponse.ts + - src/models/components/listevmblocksresponse.ts + - src/models/components/evmblock.ts + - src/models/components/getevmblockresponse.ts + - src/models/components/gettransactionresponse.ts + - src/models/components/fullnativetransactiondetails.ts + - src/models/components/method.ts + - src/models/components/transactionmethodtype.ts + - src/models/components/richaddress.ts + - src/models/components/networktokendetails.ts + - src/models/components/networktoken.ts + - src/models/components/internaltransactiondetails.ts + - src/models/components/internaltransactionopcall.ts + - src/models/components/erc1155transferdetails.ts + - src/models/components/erc721transferdetails.ts + - src/models/components/erc20transferdetails.ts + - src/models/components/erc20token.ts + - src/models/components/listcontractsresponse.ts + - src/models/components/erc721contract.ts + - src/models/components/contractdeploymentdetails.ts + - src/models/components/resourcelink.ts + - src/models/components/resourcelinktype.ts + - src/models/components/imageasset.ts + - src/models/components/erc1155contract.ts + - src/models/components/pricingproviders.ts + - src/models/components/erc20contract.ts + - src/models/components/unknowncontract.ts + - src/models/components/listtransfersresponse.ts + - src/models/components/erc20transfer.ts + - src/models/components/erc721transfer.ts + - src/models/components/erc1155transfer.ts + - src/models/components/listtransactiondetailsresponse.ts + - src/models/components/transactiondetails.ts + - src/models/components/nativetransaction.ts + - src/models/components/listnativetransactionsresponse.ts + - src/models/components/listerc20transactionsresponse.ts + - src/models/components/listerc721transactionsresponse.ts + - src/models/components/listerc1155transactionsresponse.ts + - src/models/components/listinternaltransactionsresponse.ts + - src/models/components/internaltransaction.ts + - src/models/components/transactionstatus.ts + - src/models/components/glacierlistchainsresponse.ts + - src/models/components/chaininfo.ts + - src/models/components/utilityaddresses.ts + - src/models/components/vmname.ts + - src/models/components/chainstatus.ts + - src/models/components/glacierapifeature.ts + - src/models/components/getchainresponse.ts + - src/models/components/security.ts + - src/models/operations/glacierhealthcheck.ts + - src/models/operations/reindexnft.ts + - src/models/operations/listtokens.ts + - src/models/operations/gettokendetails.ts + - src/models/operations/getoperationresult.ts + - src/models/operations/posttransactionexportjob.ts + - src/models/operations/getassetdetails.ts + - src/models/operations/getchainidsforaddresses.ts + - src/models/operations/getnetworkdetails.ts + - src/models/operations/listblockchains.ts + - src/models/operations/listsubnets.ts + - src/models/operations/getsubnetbyid.ts + - src/models/operations/listvalidators.ts + - src/models/operations/getsinglevalidatordetails.ts + - src/models/operations/listdelegators.ts + - src/models/operations/gettxbyhash.ts + - src/models/operations/listlatestprimarynetworktransactions.ts + - src/models/operations/listactiveprimarynetworkstakingtransactions.ts + - src/models/operations/listassettransactions.ts + - src/models/operations/listpendingprimarynetworkrewards.ts + - src/models/operations/listhistoricalprimarynetworkrewards.ts + - src/models/operations/getutxosbyaddresses.ts + - src/models/operations/getbalancesbyaddresses.ts + - src/models/operations/getblockbyid.ts + - src/models/operations/listprimarynetworkblocksbynodeid.ts + - src/models/operations/listlatestprimarynetworkblocks.ts + - src/models/operations/listlatestxchainvertices.ts + - src/models/operations/getvertexbyhash.ts + - src/models/operations/getvertexbyheight.ts + - src/models/operations/getapiusagemetrics.ts + - src/models/operations/getapilogs.ts + - src/models/operations/listwebhooks.ts + - src/models/operations/getwebhook.ts + - src/models/operations/deactivatewebhook.ts + - src/models/operations/updatewebhook.ts + - src/models/operations/getaddressesfromwebhook.ts + - src/models/operations/removeaddressesfromwebhook.ts + - src/models/operations/addaddressestowebhook.ts + - src/models/operations/getteleportermessage.ts + - src/models/operations/listteleportermessages.ts + - src/models/operations/getnativebalance.ts + - src/models/operations/listerc20balances.ts + - src/models/operations/listerc721balances.ts + - src/models/operations/listerc1155balances.ts + - src/models/operations/listcollectiblebalances.ts + - src/models/operations/getlatestblocks.ts + - src/models/operations/getblock.ts + - src/models/operations/getdeploymenttransaction.ts + - src/models/operations/listcontractdeployments.ts + - src/models/operations/listtransfers.ts + - src/models/operations/listtransactions.ts + - src/models/operations/listnativetransactions.ts + - src/models/operations/listerc20transactions.ts + - src/models/operations/listerc721transactions.ts + - src/models/operations/listerc1155transactions.ts + - src/models/operations/listinternaltransactions.ts + - src/models/operations/gettransaction.ts + - src/models/operations/gettransactionsforblock.ts + - src/models/operations/listlatesttransactions.ts + - src/models/operations/getcontractmetadata.ts + - src/models/operations/supportedchains.ts + - src/models/operations/getchaininfo.ts + - src/models/errors/glacierhealthcheck.ts + - src/models/errors/badrequest.ts + - src/models/errors/unauthorized.ts + - src/models/errors/forbidden.ts + - src/models/errors/notfound.ts + - src/models/errors/toomanyrequests.ts + - src/models/errors/internalservererror.ts + - src/models/errors/badgateway.ts + - src/models/errors/serviceunavailable.ts + - src/models/errors/index.ts + - src/models/components/index.ts + - src/models/operations/index.ts + - docs/models/components/globalparamnetwork.md + - docs/models/components/tokens.md + - docs/models/components/listnfttokens.md + - docs/models/components/erctype.md + - docs/models/components/erc721token.md + - docs/models/components/erc721tokenmetadata.md + - docs/models/components/nfttokenmetadatastatus.md + - docs/models/components/erc1155tokenerctype.md + - docs/models/components/erc1155token.md + - docs/models/components/erc1155tokenmetadata.md + - docs/models/components/metadata.md + - docs/models/components/operationstatusresponse.md + - docs/models/components/transactionexportmetadata.md + - docs/models/components/operationstatuscode.md + - docs/models/components/operationstatus.md + - docs/models/components/operationtype.md + - docs/models/components/createevmtransactionexportrequest.md + - docs/models/components/evmnetworkoptions.md + - docs/models/components/evmoperationtype.md + - docs/models/components/createprimarynetworktransactionexportrequest.md + - docs/models/components/includechains.md + - docs/models/components/primarynetworkoptions.md + - docs/models/components/primarynetworkoperationtype.md + - docs/models/components/xchainassetdetails.md + - docs/models/components/primarynetworkassetcap.md + - docs/models/components/primarynetworkassettype.md + - docs/models/components/xchainid.md + - docs/models/components/chainaddresschainidmaplistresponse.md + - docs/models/components/chainaddresschainidmap.md + - docs/models/components/blockchainids.md + - docs/models/components/getnetworkdetailsresponse.md + - docs/models/components/delegatorsdetails.md + - docs/models/components/validatorsdetails.md + - docs/models/components/stakingdistribution.md + - docs/models/components/listblockchainsresponse.md + - docs/models/components/blockchain.md + - docs/models/components/sortorder.md + - docs/models/components/listsubnetsresponse.md + - docs/models/components/subnet.md + - docs/models/components/blockchaininfo.md + - docs/models/components/subnetownershipinfo.md + - docs/models/components/validators.md + - docs/models/components/listvalidatordetailsresponse.md + - docs/models/components/validationstatus.md + - docs/models/components/completedvalidatordetails.md + - docs/models/components/rewards.md + - docs/models/components/blscredentials.md + - docs/models/components/activevalidatordetailsvalidationstatus.md + - docs/models/components/activevalidatordetails.md + - docs/models/components/validatorhealthdetails.md + - docs/models/components/pendingvalidatordetailsvalidationstatus.md + - docs/models/components/pendingvalidatordetails.md + - docs/models/components/removedvalidatordetailsvalidationstatus.md + - docs/models/components/removedvalidatordetails.md + - docs/models/components/validationstatustype.md + - docs/models/components/sortbyoption.md + - docs/models/components/delegators.md + - docs/models/components/listdelegatordetailsresponse.md + - docs/models/components/delegationstatus.md + - docs/models/components/completeddelegatordetails.md + - docs/models/components/activedelegatordetailsdelegationstatus.md + - docs/models/components/activedelegatordetails.md + - docs/models/components/pendingdelegatordetailsdelegationstatus.md + - docs/models/components/pendingdelegatordetails.md + - docs/models/components/delegationstatustype.md + - docs/models/components/pchaintransaction.md + - docs/models/components/assetamount.md + - docs/models/components/pchainutxo.md + - docs/models/components/utxotype.md + - docs/models/components/rewardtype.md + - docs/models/components/pchaintransactiontype.md + - docs/models/components/chainformat.md + - docs/models/components/xchainnonlineartransaction.md + - docs/models/components/transactionvertexdetail.md + - docs/models/components/utxo.md + - docs/models/components/utxocredential.md + - docs/models/components/xchaintransactiontype.md + - docs/models/components/xchainlineartransactionchainformat.md + - docs/models/components/xchainlineartransaction.md + - docs/models/components/txtype.md + - docs/models/components/cchainexporttransaction.md + - docs/models/components/evminput.md + - docs/models/components/cchainimporttransactiontxtype.md + - docs/models/components/cchainimporttransaction.md + - docs/models/components/evmoutput.md + - docs/models/components/blockchainid.md + - docs/models/components/listpchaintransactionsresponse.md + - docs/models/components/primarynetworkchaininfo.md + - docs/models/components/primarynetwork.md + - docs/models/components/primarynetworkchainname.md + - docs/models/components/transactions.md + - docs/models/components/listxchaintransactionsresponse.md + - docs/models/components/listcchainatomictransactionsresponsetransactions.md + - docs/models/components/listcchainatomictransactionsresponse.md + - docs/models/components/primarynetworktxtype.md + - docs/models/components/pchainid.md + - docs/models/components/listpendingrewardsresponse.md + - docs/models/components/pendingreward.md + - docs/models/components/listhistoricalrewardsresponse.md + - docs/models/components/historicalreward.md + - docs/models/components/assetwithpriceinfo.md + - docs/models/components/money.md + - docs/models/components/currencycode.md + - docs/models/components/listpchainutxosresponse.md + - docs/models/components/listutxosresponse.md + - docs/models/components/listpchainbalancesresponse.md + - docs/models/components/pchainbalance.md + - docs/models/components/pchainsharedasset.md + - docs/models/components/aggregatedassetamount.md + - docs/models/components/listxchainbalancesresponse.md + - docs/models/components/xchainbalances.md + - docs/models/components/xchainsharedassetbalance.md + - docs/models/components/listcchainatomicbalancesresponse.md + - docs/models/components/cchainatomicbalances.md + - docs/models/components/cchainsharedassetbalance.md + - docs/models/components/getprimarynetworkblockresponse.md + - docs/models/components/proposerdetails.md + - docs/models/components/listprimarynetworkblocksresponse.md + - docs/models/components/primarynetworkblock.md + - docs/models/components/listxchainverticesresponse.md + - docs/models/components/xchainvertex.md + - docs/models/components/usagemetricsresponsedto.md + - docs/models/components/metric.md + - docs/models/components/groupedby.md + - docs/models/components/groupvalue.md + - docs/models/components/usagemetricsvaluedto.md + - docs/models/components/usagemetricsgroupbyenum.md + - docs/models/components/timeintervalgranularityextended.md + - docs/models/components/logsresponsedto.md + - docs/models/components/logsformat.md + - docs/models/components/logsformatmetadata.md + - docs/models/components/requesttype.md + - docs/models/components/listwebhooksresponse.md + - docs/models/components/webhookresponsemetadata.md + - docs/models/components/webhookresponse.md + - docs/models/components/webhookstatustype.md + - docs/models/components/addressactivitymetadata.md + - docs/models/components/eventtype.md + - docs/models/components/webhookstatus.md + - docs/models/components/createwebhookrequestmetadata.md + - docs/models/components/createwebhookrequest.md + - docs/models/components/updatewebhookrequest.md + - docs/models/components/sharedsecretsresponse.md + - docs/models/components/listwebhookaddressesresponse.md + - docs/models/components/addresseschangerequest.md + - docs/models/components/status.md + - docs/models/components/pendingteleportermessage.md + - docs/models/components/teleportersourcetransaction.md + - docs/models/components/teleporterrewarddetailserctype.md + - docs/models/components/teleporterrewarddetails.md + - docs/models/components/teleporterreceipt.md + - docs/models/components/deliveredteleportermessagestatus.md + - docs/models/components/deliveredteleportermessage.md + - docs/models/components/teleporterdestinationtransaction.md + - docs/models/components/deliveredsourcenotindexedteleportermessagestatus.md + - docs/models/components/deliveredsourcenotindexedteleportermessage.md + - docs/models/components/messages.md + - docs/models/components/listteleportermessagesresponse.md + - docs/models/components/networktype.md + - docs/models/components/getnativebalanceresponse.md + - docs/models/components/nativetokenbalance.md + - docs/models/components/listerc20balancesresponse.md + - docs/models/components/erc20tokenbalanceerctype.md + - docs/models/components/erc20tokenbalance.md + - docs/models/components/listerc721balancesresponse.md + - docs/models/components/erc721tokenbalanceerctype.md + - docs/models/components/erc721tokenbalance.md + - docs/models/components/listerc1155balancesresponse.md + - docs/models/components/erc1155tokenbalanceerctype.md + - docs/models/components/erc1155tokenbalance.md + - docs/models/components/collectiblebalances.md + - docs/models/components/listcollectiblebalancesresponse.md + - docs/models/components/listevmblocksresponse.md + - docs/models/components/evmblock.md + - docs/models/components/getevmblockresponse.md + - docs/models/components/gettransactionresponse.md + - docs/models/components/fullnativetransactiondetails.md + - docs/models/components/method.md + - docs/models/components/transactionmethodtype.md + - docs/models/components/richaddress.md + - docs/models/components/networktokendetails.md + - docs/models/components/networktoken.md + - docs/models/components/internaltransactiondetails.md + - docs/models/components/internaltransactionopcall.md + - docs/models/components/erc1155transferdetails.md + - docs/models/components/erc721transferdetails.md + - docs/models/components/erc20transferdetails.md + - docs/models/components/erc20tokenerctype.md + - docs/models/components/erc20token.md + - docs/models/components/contracts.md + - docs/models/components/listcontractsresponse.md + - docs/models/components/erc721contracterctype.md + - docs/models/components/erc721contract.md + - docs/models/components/contractdeploymentdetails.md + - docs/models/components/resourcelink.md + - docs/models/components/resourcelinktype.md + - docs/models/components/imageasset.md + - docs/models/components/erc1155contracterctype.md + - docs/models/components/erc1155contract.md + - docs/models/components/pricingproviders.md + - docs/models/components/erc20contracterctype.md + - docs/models/components/erc20contract.md + - docs/models/components/unknowncontracterctype.md + - docs/models/components/unknowncontract.md + - docs/models/components/transfers.md + - docs/models/components/listtransfersresponse.md + - docs/models/components/erc20transfer.md + - docs/models/components/erc721transfer.md + - docs/models/components/erc1155transfer.md + - docs/models/components/listtransactiondetailsresponse.md + - docs/models/components/transactiondetails.md + - docs/models/components/nativetransaction.md + - docs/models/components/listnativetransactionsresponse.md + - docs/models/components/listerc20transactionsresponse.md + - docs/models/components/listerc721transactionsresponse.md + - docs/models/components/listerc1155transactionsresponse.md + - docs/models/components/listinternaltransactionsresponse.md + - docs/models/components/internaltransaction.md + - docs/models/components/transactionstatus.md + - docs/models/components/glacierlistchainsresponse.md + - docs/models/components/enabledfeatures.md + - docs/models/components/chaininfo.md + - docs/models/components/utilityaddresses.md + - docs/models/components/vmname.md + - docs/models/components/chainstatus.md + - docs/models/components/glacierapifeature.md + - docs/models/components/getchainresponseenabledfeatures.md + - docs/models/components/getchainresponse.md + - docs/models/components/security.md + - docs/models/operations/info.md + - docs/models/operations/errort.md + - docs/models/operations/details.md + - docs/models/operations/glacierhealthcheckresponsebody.md + - docs/models/operations/reindexnftglobals.md + - docs/models/operations/reindexnftrequest.md + - docs/models/operations/listtokensglobals.md + - docs/models/operations/listtokensrequest.md + - docs/models/operations/listtokensresponse.md + - docs/models/operations/gettokendetailsglobals.md + - docs/models/operations/gettokendetailsrequest.md + - docs/models/operations/gettokendetailsresponsebody.md + - docs/models/operations/getoperationresultrequest.md + - docs/models/operations/posttransactionexportjobrequestbody.md + - docs/models/operations/getassetdetailsglobals.md + - docs/models/operations/getassetdetailsrequest.md + - docs/models/operations/getchainidsforaddressesglobals.md + - docs/models/operations/getchainidsforaddressesrequest.md + - docs/models/operations/getnetworkdetailsglobals.md + - docs/models/operations/getnetworkdetailsrequest.md + - docs/models/operations/listblockchainsglobals.md + - docs/models/operations/listblockchainsrequest.md + - docs/models/operations/listblockchainsresponse.md + - docs/models/operations/listsubnetsglobals.md + - docs/models/operations/listsubnetsrequest.md + - docs/models/operations/listsubnetsresponse.md + - docs/models/operations/getsubnetbyidglobals.md + - docs/models/operations/getsubnetbyidrequest.md + - docs/models/operations/listvalidatorsglobals.md + - docs/models/operations/listvalidatorsrequest.md + - docs/models/operations/listvalidatorsresponse.md + - docs/models/operations/getsinglevalidatordetailsglobals.md + - docs/models/operations/getsinglevalidatordetailsrequest.md + - docs/models/operations/getsinglevalidatordetailsresponse.md + - docs/models/operations/listdelegatorsglobals.md + - docs/models/operations/listdelegatorsrequest.md + - docs/models/operations/listdelegatorsresponse.md + - docs/models/operations/gettxbyhashglobals.md + - docs/models/operations/gettxbyhashrequest.md + - docs/models/operations/gettxbyhashresponsebody.md + - docs/models/operations/listlatestprimarynetworktransactionsglobals.md + - docs/models/operations/listlatestprimarynetworktransactionsrequest.md + - docs/models/operations/listlatestprimarynetworktransactionsresponsebody.md + - docs/models/operations/listlatestprimarynetworktransactionsresponse.md + - docs/models/operations/listactiveprimarynetworkstakingtransactionsglobals.md + - docs/models/operations/listactiveprimarynetworkstakingtransactionsrequest.md + - docs/models/operations/listactiveprimarynetworkstakingtransactionsresponse.md + - docs/models/operations/listassettransactionsglobals.md + - docs/models/operations/listassettransactionsrequest.md + - docs/models/operations/listassettransactionsresponse.md + - docs/models/operations/listpendingprimarynetworkrewardsglobals.md + - docs/models/operations/listpendingprimarynetworkrewardsrequest.md + - docs/models/operations/listpendingprimarynetworkrewardsresponse.md + - docs/models/operations/listhistoricalprimarynetworkrewardsglobals.md + - docs/models/operations/listhistoricalprimarynetworkrewardsrequest.md + - docs/models/operations/listhistoricalprimarynetworkrewardsresponse.md + - docs/models/operations/getutxosbyaddressesglobals.md + - docs/models/operations/getutxosbyaddressesrequest.md + - docs/models/operations/getutxosbyaddressesresponsebody.md + - docs/models/operations/getutxosbyaddressesresponse.md + - docs/models/operations/getbalancesbyaddressesglobals.md + - docs/models/operations/getbalancesbyaddressesrequest.md + - docs/models/operations/getbalancesbyaddressesresponsebody.md + - docs/models/operations/getblockbyidglobals.md + - docs/models/operations/getblockbyidrequest.md + - docs/models/operations/listprimarynetworkblocksbynodeidglobals.md + - docs/models/operations/listprimarynetworkblocksbynodeidrequest.md + - docs/models/operations/listprimarynetworkblocksbynodeidresponse.md + - docs/models/operations/listlatestprimarynetworkblocksglobals.md + - docs/models/operations/listlatestprimarynetworkblocksrequest.md + - docs/models/operations/listlatestprimarynetworkblocksresponse.md + - docs/models/operations/listlatestxchainverticesglobals.md + - docs/models/operations/listlatestxchainverticesrequest.md + - docs/models/operations/listlatestxchainverticesresponse.md + - docs/models/operations/getvertexbyhashglobals.md + - docs/models/operations/getvertexbyhashrequest.md + - docs/models/operations/getvertexbyheightglobals.md + - docs/models/operations/getvertexbyheightrequest.md + - docs/models/operations/getvertexbyheightresponse.md + - docs/models/operations/requesttype.md + - docs/models/operations/getapiusagemetricsrequest.md + - docs/models/operations/queryparamrequesttype.md + - docs/models/operations/getapilogsrequest.md + - docs/models/operations/getapilogsresponse.md + - docs/models/operations/listwebhooksrequest.md + - docs/models/operations/listwebhooksresponse.md + - docs/models/operations/getwebhookrequest.md + - docs/models/operations/deactivatewebhookrequest.md + - docs/models/operations/updatewebhookrequest.md + - docs/models/operations/getaddressesfromwebhookrequest.md + - docs/models/operations/getaddressesfromwebhookresponse.md + - docs/models/operations/removeaddressesfromwebhookrequest.md + - docs/models/operations/addaddressestowebhookrequest.md + - docs/models/operations/getteleportermessagerequest.md + - docs/models/operations/getteleportermessageresponsebody.md + - docs/models/operations/listteleportermessagesrequest.md + - docs/models/operations/listteleportermessagesresponse.md + - docs/models/operations/getnativebalanceglobals.md + - docs/models/operations/getnativebalancerequest.md + - docs/models/operations/listerc20balancesglobals.md + - docs/models/operations/listerc20balancesrequest.md + - docs/models/operations/listerc20balancesresponse.md + - docs/models/operations/listerc721balancesglobals.md + - docs/models/operations/listerc721balancesrequest.md + - docs/models/operations/listerc721balancesresponse.md + - docs/models/operations/listerc1155balancesglobals.md + - docs/models/operations/listerc1155balancesrequest.md + - docs/models/operations/listerc1155balancesresponse.md + - docs/models/operations/listcollectiblebalancesglobals.md + - docs/models/operations/listcollectiblebalancesrequest.md + - docs/models/operations/listcollectiblebalancesresponse.md + - docs/models/operations/getlatestblocksglobals.md + - docs/models/operations/getlatestblocksrequest.md + - docs/models/operations/getlatestblocksresponse.md + - docs/models/operations/getblockglobals.md + - docs/models/operations/getblockrequest.md + - docs/models/operations/getdeploymenttransactionglobals.md + - docs/models/operations/getdeploymenttransactionrequest.md + - docs/models/operations/listcontractdeploymentsglobals.md + - docs/models/operations/listcontractdeploymentsrequest.md + - docs/models/operations/listcontractdeploymentsresponse.md + - docs/models/operations/listtransfersglobals.md + - docs/models/operations/listtransfersrequest.md + - docs/models/operations/listtransfersresponse.md + - docs/models/operations/listtransactionsglobals.md + - docs/models/operations/listtransactionsrequest.md + - docs/models/operations/listtransactionsresponse.md + - docs/models/operations/listnativetransactionsglobals.md + - docs/models/operations/listnativetransactionsrequest.md + - docs/models/operations/listnativetransactionsresponse.md + - docs/models/operations/listerc20transactionsglobals.md + - docs/models/operations/listerc20transactionsrequest.md + - docs/models/operations/listerc20transactionsresponse.md + - docs/models/operations/listerc721transactionsglobals.md + - docs/models/operations/listerc721transactionsrequest.md + - docs/models/operations/listerc721transactionsresponse.md + - docs/models/operations/listerc1155transactionsglobals.md + - docs/models/operations/listerc1155transactionsrequest.md + - docs/models/operations/listerc1155transactionsresponse.md + - docs/models/operations/listinternaltransactionsglobals.md + - docs/models/operations/listinternaltransactionsrequest.md + - docs/models/operations/listinternaltransactionsresponse.md + - docs/models/operations/gettransactionglobals.md + - docs/models/operations/gettransactionrequest.md + - docs/models/operations/gettransactionsforblockglobals.md + - docs/models/operations/gettransactionsforblockrequest.md + - docs/models/operations/listlatesttransactionsglobals.md + - docs/models/operations/listlatesttransactionsrequest.md + - docs/models/operations/listlatesttransactionsresponse.md + - docs/models/operations/getcontractmetadataglobals.md + - docs/models/operations/getcontractmetadatarequest.md + - docs/models/operations/getcontractmetadataresponsebody.md + - docs/models/operations/supportedchainsrequest.md + - docs/models/operations/getchaininfoglobals.md + - docs/models/operations/getchaininforequest.md + - docs/models/errors/info.md + - docs/models/errors/errort.md + - docs/models/errors/details.md + - docs/models/errors/glacierhealthcheckresponsebody.md + - docs/models/errors/message.md + - docs/models/errors/badrequest.md + - docs/models/errors/unauthorizedmessage.md + - docs/models/errors/unauthorized.md + - docs/models/errors/forbiddenmessage.md + - docs/models/errors/forbidden.md + - docs/models/errors/notfoundmessage.md + - docs/models/errors/notfound.md + - docs/models/errors/toomanyrequestsmessage.md + - docs/models/errors/toomanyrequests.md + - docs/models/errors/internalservererrormessage.md + - docs/models/errors/internalservererror.md + - docs/models/errors/badgatewaymessage.md + - docs/models/errors/badgateway.md + - docs/models/errors/serviceunavailablemessage.md + - docs/models/errors/serviceunavailable.md + - docs/sdks/avacloudsdk/README.md + - docs/sdks/glacier/README.md + - docs/lib/utils/retryconfig.md + - docs/sdks/healthcheck/README.md + - docs/sdks/nfts/README.md + - docs/sdks/operations/README.md + - docs/sdks/primarynetwork/README.md + - docs/sdks/transactions/README.md + - docs/sdks/rewards/README.md + - docs/sdks/utxos/README.md + - docs/sdks/balances/README.md + - docs/sdks/blocks/README.md + - docs/sdks/vertices/README.md + - docs/sdks/usagemetrics/README.md + - docs/sdks/webhooks/README.md + - docs/sdks/teleporter/README.md + - docs/sdks/evm/README.md + - docs/sdks/avacloudsdkbalances/README.md + - docs/sdks/avacloudsdkblocks/README.md + - docs/sdks/avacloudsdktransactions/README.md + - docs/sdks/contracts/README.md + - docs/sdks/chains/README.md + - USAGE.md + - .gitattributes + - .devcontainer/README.md + - .devcontainer/devcontainer.json + - .devcontainer/setup.sh + - src/hooks/hooks.ts + - src/hooks/types.ts + - src/hooks/index.ts + - CONTRIBUTING.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml new file mode 100644 index 0000000..00b6b59 --- /dev/null +++ b/.speakeasy/gen.yaml @@ -0,0 +1,47 @@ +configVersion: 2.0.0 +generation: + devContainers: + enabled: true + schemaPath: https://glacier-api.avax.network/api-json + sdkClassName: AvaCloudSDK + maintainOpenAPIOrder: true + usageSnippets: + optionalPropertyRendering: withExample + useClassNamesForArrayFields: true + fixes: + nameResolutionDec2023: true + parameterOrderingFeb2024: true + requestResponseComponentNamesFeb2024: true + auth: + oAuth2ClientCredentialsEnabled: false +typescript: + version: 0.1.0 + additionalDependencies: + dependencies: + json-canonicalize: ^1.0.6 + devDependencies: + '@types/node': ^22.4.1 + peerDependencies: {} + additionalPackageJSON: + license: SEE LICENSE IN LICENSE.md + clientServerStatusCodesAsErrors: true + enumFormat: union + flattenGlobalSecurity: true + imports: + option: openapi + paths: + callbacks: models/callbacks + errors: models/errors + operations: models/operations + shared: models/components + webhooks: models/webhooks + inputModelSuffix: input + maxMethodParams: 0 + methodArguments: require-security-and-request + moduleFormat: commonjs + outputModelSuffix: output + packageName: '@avalabs/avacloud-sdk' + responseFormat: flat + templateVersion: v2 + useIndexModules: true + envVarPrefix: AVACLOUD diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock new file mode 100644 index 0000000..c241a9b --- /dev/null +++ b/.speakeasy/workflow.lock @@ -0,0 +1,51 @@ +speakeasyVersion: 1.383.2 +sources: + AvaCloudSDK-OAS: + sourceNamespace: avacloud-sdk-oas + sourceRevisionDigest: sha256:303aa83897a990f12523549cb34e55ac639a264aab65f09c0107fe21320ca0b2 + sourceBlobDigest: sha256:7bdbf020c983454ba41e539bdc06708e421d942e068f9a18f85b5f4978ff7c9b + tags: + - latest + - main + AvalancheSDK-OAS: + sourceNamespace: avalanche-sdk-oas + sourceRevisionDigest: sha256:5a1e07e4561e10de09495e4808d129b671b42547b2864d1828b477aadfcb21ae + sourceBlobDigest: sha256:44a68090a51ca1b1edbef83da5907c3497ef7de6605f3e5d00d9f2a89976ec99 + tags: + - latest + - main +targets: + avacloud-sdk: + source: AvaCloudSDK-OAS + sourceNamespace: avacloud-sdk-oas + sourceRevisionDigest: sha256:303aa83897a990f12523549cb34e55ac639a264aab65f09c0107fe21320ca0b2 + sourceBlobDigest: sha256:7bdbf020c983454ba41e539bdc06708e421d942e068f9a18f85b5f4978ff7c9b + codeSamplesNamespace: avacloud-sdk-ts-code-samples + codeSamplesRevisionDigest: sha256:2b497ef2942c118b71bb1b43d19a997370056ee9fe04cc654b294895b01ddb31 + outLocation: /github/workspace/repo + avalanche-sdk: + source: AvalancheSDK-OAS + sourceNamespace: avalanche-sdk-oas + sourceRevisionDigest: sha256:5a1e07e4561e10de09495e4808d129b671b42547b2864d1828b477aadfcb21ae + sourceBlobDigest: sha256:44a68090a51ca1b1edbef83da5907c3497ef7de6605f3e5d00d9f2a89976ec99 + outLocation: /github/workspace/repo +workflow: + workflowVersion: 1.0.0 + speakeasyVersion: latest + sources: + AvaCloudSDK-OAS: + inputs: + - location: https://glacier-api.avax.network/api-json + registry: + location: registry.speakeasyapi.dev/avalabs/avalabs/avacloud-sdk-oas + targets: + avacloud-sdk: + target: typescript + source: AvaCloudSDK-OAS + publish: + npm: + token: $npm_token + codeSamples: + output: "" + registry: + location: registry.speakeasyapi.dev/avalabs/avalabs/avacloud-sdk-ts-code-samples diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml new file mode 100644 index 0000000..63ca13c --- /dev/null +++ b/.speakeasy/workflow.yaml @@ -0,0 +1,18 @@ +workflowVersion: 1.0.0 +speakeasyVersion: latest +sources: + AvaCloudSDK-OAS: + inputs: + - location: https://glacier-api.avax.network/api-json + registry: + location: registry.speakeasyapi.dev/avalabs/avalabs/avacloud-sdk-oas +targets: + avacloud-sdk: + target: typescript + source: AvaCloudSDK-OAS + codeSamples: + registry: + location: registry.speakeasyapi.dev/avalabs/avalabs/avacloud-sdk-ts-code-samples + publish: + npm: + token: $npm_token diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..9c29871 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @ava-labs/data-platform \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d585717 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/FUNCTIONS.md b/FUNCTIONS.md new file mode 100644 index 0000000..dbedc49 --- /dev/null +++ b/FUNCTIONS.md @@ -0,0 +1,106 @@ +# Standalone Functions + +> [!NOTE] +> This section is useful if you are using a bundler and targetting browsers and +> runtimes where the size of an application affects performance and load times. + +Every method in this SDK is also available as a standalone function. This +alternative API is suitable when targetting the browser or serverless runtimes +and using a bundler to build your application since all unused functionality +will be tree-shaken away. This includes code for unused methods, Zod schemas, +encoding helpers and response handlers. The result is dramatically smaller +impact on the application's final bundle size which grows very slowly as you use +more and more functionality from this SDK. + +Calling methods through the main SDK class remains a valid and generally more +more ergonomic option. Standalone functions represent an optimisation for a +specific category of applications. + +## Example + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierHealthCheckGlacierHealthCheck } from "@avalabs/avacloud-sdk/funcs/glacierHealthCheckGlacierHealthCheck.js"; +import { SDKValidationError } from "@avalabs/avacloud-sdk/models/errors/sdkvalidationerror.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierHealthCheckGlacierHealthCheck(avaCloudSDK); + + switch (true) { + case res.ok: + // The success case will be handled outside of the switch block + break; + case res.error instanceof SDKValidationError: + // Pretty-print validation errors. + return console.log(res.error.pretty()); + case res.error instanceof Error: + return console.log(res.error); + default: + // TypeScript's type checking will fail on the following line if the above + // cases were not exhaustive. + res.error satisfies never; + throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error); + } + + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +## Result types + +Standalone functions differ from SDK methods in that they return a +`Result` type to capture _known errors_ and document them using +the type system. By avoiding throwing errors, application code maintains clear +control flow and error-handling become part of the regular flow of application +code. + +> We use the term "known errors" because standalone functions, and JavaScript +> code in general, can still throw unexpected errors such as `TypeError`s, +> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be +> something this SDK addresses in the future. Nevertheless, there is still a lot +> of benefit from capturing most errors and turning them into values. + +The second reason for this style of programming is because these functions will +typically be used in front-end applications where exception throwing is +sometimes discouraged or considered unidiomatic. React and similar ecosystems +and libraries tend to promote this style of programming so that components +render useful content under all states (loading, success, error and so on). + +The general pattern when calling standalone functions looks like this: + +```typescript +import { Core } from ""; +import { fetchSomething } from "/funcs/fetchSomething.js"; + +const client = new Core(); + +async function run() { + const result = await fetchSomething(client, { id: "123" }); + if (!result.ok) { + // You can throw the error or handle it. It's your choice now. + throw result.error; + } + + console.log(result.value); +} + +run(); +``` + +Notably, `result.error` above will have an explicit type compared to a try-catch +variation where the error in the catch block can only be of type `unknown` (or +`any` depending on your TypeScript settings). \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ab4b718 --- /dev/null +++ b/LICENSE @@ -0,0 +1,58 @@ +Copyright (C) 2024, Ava Labs, Inc. All rights reserved. + +Ecosystem License + +Subject to the terms herein, Ava Labs, Inc. (**“Ava Labs”**) hereby grants you a +limited, royalty-free, worldwide, non-sublicensable, non-transferable, +non-exclusive license to use, copy, modify, create derivative works based on, +and redistribute the Software, in source code, binary, or any other form, including any +modifications or derivative works of the Software (collectively,**“Licensed Software”**), +in each case subject to this Ecosystem License (**“License”**). + +This License applies to all copies, modifications, derivative works, and any +other form or usage of the Licensed Software. You will include and display this +License, without modification, with all uses of the Licensed Software, regardless +of form. + +You will use the Licensed Software solely in connection with the Avalanche +Public Blockchain platform and associated blockchains, comprised exclusively of +the Avalanche X-Chain, C-Chain, P-Chain and any subnets linked to the +P-Chain (“Avalanche Authorized Platform”). This License does not permit use of +the Licensed Software in connection with any forks of the Avalanche Authorized +Platform or in any manner not operationally connected to the Avalanche +Authorized Platform. Ava Labs may publicly announce changes or additions to the +Avalanche Authorized Platform, which may expand or modify usage of the Licensed +Software. Upon such announcement, the Avalanche Authorized Platform will be +deemed to be the then-current iteration of such platform. + +You hereby acknowledge and agree to the terms set forth at +www.avalabs.org/important-notice. + +If you use the Licensed Software in violation of this License, this License will +automatically terminate and Ava Labs reserves all rights to seek any remedy for +such violation. + +Except for uses explicitly permitted in this License, Ava Labs retains all +rights in the Licensed Software, including without limitation the ability to +modify it. + +Except as required or explicitly permitted by this License, you will not use any +Ava Labs names, logos, or trademarks without Ava Labs’ prior written consent. + +You may use this License for software other than the “Licensed Software” +specified above, as long as the only change to this License is the definition of +the term “Licensed Software.” + +The Licensed Software may reference third party components. You acknowledge and +agree that these third party components may be governed by a separate license or +terms and that you will comply with them. + +**TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE LICENSED SOFTWARE IS PROVIDED ON +AN “AS IS” BASIS, AND AVA LABS EXPRESSLY DISCLAIMS AND EXCLUDES ALL +REPRESENTATIONS, WARRANTIES AND OTHER TERMS AND CONDITIONS, WHETHER EXPRESS OR +IMPLIED, INCLUDING WITHOUT LIMITATION BY OPERATION OF LAW OR BY CUSTOM, STATUTE +OR OTHERWISE, AND INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTY, TERM, OR +CONDITION OF NON-INFRINGEMENT, MERCHANTABILITY, TITLE, OR FITNESS FOR PARTICULAR +PURPOSE. YOU USE THE LICENSED SOFTWARE AT YOUR OWN RISK. AVA LABS EXPRESSLY +DISCLAIMS ALL LIABILITY (INCLUDING FOR ALL DIRECT, CONSEQUENTIAL OR OTHER +DAMAGES OR LOSSES) RELATED TO ANY USE OF THE LICENSED SOFTWARE.** diff --git a/README.md b/README.md new file mode 100644 index 0000000..b078933 --- /dev/null +++ b/README.md @@ -0,0 +1,778 @@ + +
+

AvaCloud SDK TypeScript

+

+ The AvaCloud SDK is a powerful and flexible toolset designed to simplify the integration with AvaCloud's suite of blockchain services. Currently, this SDK is focused on providing robust support for Glacier APIs.

+
+ + +## SDK Installation + +The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers. + +### NPM + +```bash +npm add @avalabs/avacloud-sdk +``` + +### PNPM + +```bash +pnpm add @avalabs/avacloud-sdk +``` + +### Bun + +```bash +bun add @avalabs/avacloud-sdk +``` + +### Yarn + +```bash +yarn add @avalabs/avacloud-sdk zod + +# Note that Yarn does not install peer dependencies automatically. You will need +# to install zod as shown above. +``` + + + +## Requirements + +For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). + + + +## SDK Example Usage + +### Example + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Available Resources and Operations + +### [glacier.healthCheck](docs/sdks/healthcheck/README.md) + +* [glacierHealthCheck](docs/sdks/healthcheck/README.md#glacierhealthcheck) - Get the health of the service + +### [glacier.nfts](docs/sdks/nfts/README.md) + +* [reindexNft](docs/sdks/nfts/README.md#reindexnft) - Reindex NFT metadata +* [listTokens](docs/sdks/nfts/README.md#listtokens) - List tokens +* [getTokenDetails](docs/sdks/nfts/README.md#gettokendetails) - Get token details + +### [glacier.operations](docs/sdks/operations/README.md) + +* [getOperationResult](docs/sdks/operations/README.md#getoperationresult) - Get operation +* [postTransactionExportJob](docs/sdks/operations/README.md#posttransactionexportjob) - Create transaction export operation + +### [glacier.primaryNetwork](docs/sdks/primarynetwork/README.md) + +* [getAssetDetails](docs/sdks/primarynetwork/README.md#getassetdetails) - Get asset details +* [getChainIdsForAddresses](docs/sdks/primarynetwork/README.md#getchainidsforaddresses) - Get chain interactions for addresses +* [getNetworkDetails](docs/sdks/primarynetwork/README.md#getnetworkdetails) - Get network details +* [listBlockchains](docs/sdks/primarynetwork/README.md#listblockchains) - List blockchains +* [listSubnets](docs/sdks/primarynetwork/README.md#listsubnets) - List subnets +* [getSubnetById](docs/sdks/primarynetwork/README.md#getsubnetbyid) - Get Subnet details by ID +* [listValidators](docs/sdks/primarynetwork/README.md#listvalidators) - List validators +* [getSingleValidatorDetails](docs/sdks/primarynetwork/README.md#getsinglevalidatordetails) - Get single validator details +* [listDelegators](docs/sdks/primarynetwork/README.md#listdelegators) - List delegators + +### [glacier.primaryNetwork.transactions](docs/sdks/transactions/README.md) + +* [getTxByHash](docs/sdks/transactions/README.md#gettxbyhash) - Get transaction +* [listLatestPrimaryNetworkTransactions](docs/sdks/transactions/README.md#listlatestprimarynetworktransactions) - List latest transactions +* [listActivePrimaryNetworkStakingTransactions](docs/sdks/transactions/README.md#listactiveprimarynetworkstakingtransactions) - List staking transactions +* [listAssetTransactions](docs/sdks/transactions/README.md#listassettransactions) - List asset transactions + +### [glacier.primaryNetwork.rewards](docs/sdks/rewards/README.md) + +* [listPendingPrimaryNetworkRewards](docs/sdks/rewards/README.md#listpendingprimarynetworkrewards) - List pending rewards +* [listHistoricalPrimaryNetworkRewards](docs/sdks/rewards/README.md#listhistoricalprimarynetworkrewards) - List historical rewards + +### [glacier.primaryNetwork.utxos](docs/sdks/utxos/README.md) + +* [getUtxosByAddresses](docs/sdks/utxos/README.md#getutxosbyaddresses) - List UTXOs + +### [glacier.primaryNetwork.balances](docs/sdks/balances/README.md) + +* [getBalancesByAddresses](docs/sdks/balances/README.md#getbalancesbyaddresses) - Get balances + +### [glacier.primaryNetwork.blocks](docs/sdks/blocks/README.md) + +* [getBlockById](docs/sdks/blocks/README.md#getblockbyid) - Get block +* [listPrimaryNetworkBlocksByNodeId](docs/sdks/blocks/README.md#listprimarynetworkblocksbynodeid) - List blocks proposed by node +* [listLatestPrimaryNetworkBlocks](docs/sdks/blocks/README.md#listlatestprimarynetworkblocks) - List latest blocks + +### [glacier.primaryNetwork.vertices](docs/sdks/vertices/README.md) + +* [listLatestXChainVertices](docs/sdks/vertices/README.md#listlatestxchainvertices) - List vertices +* [getVertexByHash](docs/sdks/vertices/README.md#getvertexbyhash) - Get vertex +* [getVertexByHeight](docs/sdks/vertices/README.md#getvertexbyheight) - List vertices by height + +### [glacier.usageMetrics](docs/sdks/usagemetrics/README.md) + +* [getApiUsageMetrics](docs/sdks/usagemetrics/README.md#getapiusagemetrics) - Get usage metrics for the Glacier API +* [getApiLogs](docs/sdks/usagemetrics/README.md#getapilogs) - Get logs for requests made by client + +### [glacier.webhooks](docs/sdks/webhooks/README.md) + +* [listWebhooks](docs/sdks/webhooks/README.md#listwebhooks) - List webhooks +* [createWebhook](docs/sdks/webhooks/README.md#createwebhook) - Create a webhook +* [getWebhook](docs/sdks/webhooks/README.md#getwebhook) - Get a webhook by ID +* [deactivateWebhook](docs/sdks/webhooks/README.md#deactivatewebhook) - Deactivate a webhook +* [updateWebhook](docs/sdks/webhooks/README.md#updatewebhook) - Update a webhook +* [generateSharedSecret](docs/sdks/webhooks/README.md#generatesharedsecret) - Generate a shared secret +* [getSharedSecret](docs/sdks/webhooks/README.md#getsharedsecret) - Get a shared secret +* [getAddressesFromWebhook](docs/sdks/webhooks/README.md#getaddressesfromwebhook) - List adresses by webhook +* [removeAddressesFromWebhook](docs/sdks/webhooks/README.md#removeaddressesfromwebhook) - Remove addresses from webhook +* [addAddressesToWebhook](docs/sdks/webhooks/README.md#addaddressestowebhook) - Add addresses to webhook + +### [glacier.teleporter](docs/sdks/teleporter/README.md) + +* [getTeleporterMessage](docs/sdks/teleporter/README.md#getteleportermessage) - Get a teleporter message +* [listTeleporterMessages](docs/sdks/teleporter/README.md#listteleportermessages) - List teleporter messages + + +### [glacier.evm.balances](docs/sdks/avacloudsdkbalances/README.md) + +* [getNativeBalance](docs/sdks/avacloudsdkbalances/README.md#getnativebalance) - Get native token balance +* [listErc20Balances](docs/sdks/avacloudsdkbalances/README.md#listerc20balances) - List ERC-20 balances +* [listErc721Balances](docs/sdks/avacloudsdkbalances/README.md#listerc721balances) - List ERC-721 balances +* [listErc1155Balances](docs/sdks/avacloudsdkbalances/README.md#listerc1155balances) - List ERC-1155 balances +* [listCollectibleBalances](docs/sdks/avacloudsdkbalances/README.md#listcollectiblebalances) - List collectible (ERC-721/ERC-1155) balances + +### [glacier.evm.blocks](docs/sdks/avacloudsdkblocks/README.md) + +* [getLatestBlocks](docs/sdks/avacloudsdkblocks/README.md#getlatestblocks) - List latest blocks +* [getBlock](docs/sdks/avacloudsdkblocks/README.md#getblock) - Get block + +### [glacier.evm.transactions](docs/sdks/avacloudsdktransactions/README.md) + +* [getDeploymentTransaction](docs/sdks/avacloudsdktransactions/README.md#getdeploymenttransaction) - Get deployment transaction +* [listContractDeployments](docs/sdks/avacloudsdktransactions/README.md#listcontractdeployments) - List deployed contracts +* [listTransfers](docs/sdks/avacloudsdktransactions/README.md#listtransfers) - List ERC transfers +* [listTransactions](docs/sdks/avacloudsdktransactions/README.md#listtransactions) - List transactions +* [listNativeTransactions](docs/sdks/avacloudsdktransactions/README.md#listnativetransactions) - List native transactions +* [listErc20Transactions](docs/sdks/avacloudsdktransactions/README.md#listerc20transactions) - List ERC-20 transfers +* [listErc721Transactions](docs/sdks/avacloudsdktransactions/README.md#listerc721transactions) - List ERC-721 transfers +* [listErc1155Transactions](docs/sdks/avacloudsdktransactions/README.md#listerc1155transactions) - List ERC-1155 transfers +* [listInternalTransactions](docs/sdks/avacloudsdktransactions/README.md#listinternaltransactions) - List internal transactions +* [getTransaction](docs/sdks/avacloudsdktransactions/README.md#gettransaction) - Get transaction +* [getTransactionsForBlock](docs/sdks/avacloudsdktransactions/README.md#gettransactionsforblock) - List transactions for a block +* [listLatestTransactions](docs/sdks/avacloudsdktransactions/README.md#listlatesttransactions) - List latest transactions + +### [glacier.evm.contracts](docs/sdks/contracts/README.md) + +* [getContractMetadata](docs/sdks/contracts/README.md#getcontractmetadata) - Get contract metadata + +### [glacier.evm.chains](docs/sdks/chains/README.md) + +* [supportedChains](docs/sdks/chains/README.md#supportedchains) - List chains +* [getChainInfo](docs/sdks/chains/README.md#getchaininfo) - Get chain information + + + +## Standalone functions + +All the methods listed above are available as standalone functions. These +functions are ideal for use in applications running in the browser, serverless +runtimes or other environments where application bundle size is a primary +concern. When using a bundler to build your application, all unused +functionality will be either excluded from the final bundle or tree-shaken away. + +To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). + +
+ +Available standalone functions + +- [glacierEvmBalancesGetNativeBalance](docs/sdks/avacloudsdkbalances/README.md#getnativebalance) +- [glacierEvmBalancesListCollectibleBalances](docs/sdks/avacloudsdkbalances/README.md#listcollectiblebalances) +- [glacierEvmBalancesListErc1155Balances](docs/sdks/avacloudsdkbalances/README.md#listerc1155balances) +- [glacierEvmBalancesListErc20Balances](docs/sdks/avacloudsdkbalances/README.md#listerc20balances) +- [glacierEvmBalancesListErc721Balances](docs/sdks/avacloudsdkbalances/README.md#listerc721balances) +- [glacierEvmBlocksGetBlock](docs/sdks/avacloudsdkblocks/README.md#getblock) +- [glacierEvmBlocksGetLatestBlocks](docs/sdks/avacloudsdkblocks/README.md#getlatestblocks) +- [glacierEvmChainsGetChainInfo](docs/sdks/chains/README.md#getchaininfo) +- [glacierEvmChainsSupportedChains](docs/sdks/chains/README.md#supportedchains) +- [glacierEvmContractsGetContractMetadata](docs/sdks/contracts/README.md#getcontractmetadata) +- [glacierEvmTransactionsGetDeploymentTransaction](docs/sdks/avacloudsdktransactions/README.md#getdeploymenttransaction) +- [glacierEvmTransactionsGetTransaction](docs/sdks/avacloudsdktransactions/README.md#gettransaction) +- [glacierEvmTransactionsGetTransactionsForBlock](docs/sdks/avacloudsdktransactions/README.md#gettransactionsforblock) +- [glacierEvmTransactionsListContractDeployments](docs/sdks/avacloudsdktransactions/README.md#listcontractdeployments) +- [glacierEvmTransactionsListErc1155Transactions](docs/sdks/avacloudsdktransactions/README.md#listerc1155transactions) +- [glacierEvmTransactionsListErc20Transactions](docs/sdks/avacloudsdktransactions/README.md#listerc20transactions) +- [glacierEvmTransactionsListErc721Transactions](docs/sdks/avacloudsdktransactions/README.md#listerc721transactions) +- [glacierEvmTransactionsListInternalTransactions](docs/sdks/avacloudsdktransactions/README.md#listinternaltransactions) +- [glacierEvmTransactionsListLatestTransactions](docs/sdks/avacloudsdktransactions/README.md#listlatesttransactions) +- [glacierEvmTransactionsListNativeTransactions](docs/sdks/avacloudsdktransactions/README.md#listnativetransactions) +- [glacierEvmTransactionsListTransactions](docs/sdks/avacloudsdktransactions/README.md#listtransactions) +- [glacierEvmTransactionsListTransfers](docs/sdks/avacloudsdktransactions/README.md#listtransfers) +- [glacierHealthCheckGlacierHealthCheck](docs/sdks/healthcheck/README.md#glacierhealthcheck) +- [glacierNftsGetTokenDetails](docs/sdks/nfts/README.md#gettokendetails) +- [glacierNftsListTokens](docs/sdks/nfts/README.md#listtokens) +- [glacierNftsReindexNft](docs/sdks/nfts/README.md#reindexnft) +- [glacierOperationsGetOperationResult](docs/sdks/operations/README.md#getoperationresult) +- [glacierOperationsPostTransactionExportJob](docs/sdks/operations/README.md#posttransactionexportjob) +- [glacierPrimaryNetworkBalancesGetBalancesByAddresses](docs/sdks/balances/README.md#getbalancesbyaddresses) +- [glacierPrimaryNetworkBlocksGetBlockById](docs/sdks/blocks/README.md#getblockbyid) +- [glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks](docs/sdks/blocks/README.md#listlatestprimarynetworkblocks) +- [glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId](docs/sdks/blocks/README.md#listprimarynetworkblocksbynodeid) +- [glacierPrimaryNetworkGetAssetDetails](docs/sdks/primarynetwork/README.md#getassetdetails) +- [glacierPrimaryNetworkGetChainIdsForAddresses](docs/sdks/primarynetwork/README.md#getchainidsforaddresses) +- [glacierPrimaryNetworkGetNetworkDetails](docs/sdks/primarynetwork/README.md#getnetworkdetails) +- [glacierPrimaryNetworkGetSingleValidatorDetails](docs/sdks/primarynetwork/README.md#getsinglevalidatordetails) +- [glacierPrimaryNetworkGetSubnetById](docs/sdks/primarynetwork/README.md#getsubnetbyid) +- [glacierPrimaryNetworkListBlockchains](docs/sdks/primarynetwork/README.md#listblockchains) +- [glacierPrimaryNetworkListDelegators](docs/sdks/primarynetwork/README.md#listdelegators) +- [glacierPrimaryNetworkListSubnets](docs/sdks/primarynetwork/README.md#listsubnets) +- [glacierPrimaryNetworkListValidators](docs/sdks/primarynetwork/README.md#listvalidators) +- [glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards](docs/sdks/rewards/README.md#listhistoricalprimarynetworkrewards) +- [glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards](docs/sdks/rewards/README.md#listpendingprimarynetworkrewards) +- [glacierPrimaryNetworkTransactionsGetTxByHash](docs/sdks/transactions/README.md#gettxbyhash) +- [glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions](docs/sdks/transactions/README.md#listactiveprimarynetworkstakingtransactions) +- [glacierPrimaryNetworkTransactionsListAssetTransactions](docs/sdks/transactions/README.md#listassettransactions) +- [glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions](docs/sdks/transactions/README.md#listlatestprimarynetworktransactions) +- [glacierPrimaryNetworkUtxosGetUtxosByAddresses](docs/sdks/utxos/README.md#getutxosbyaddresses) +- [glacierPrimaryNetworkVerticesGetVertexByHash](docs/sdks/vertices/README.md#getvertexbyhash) +- [glacierPrimaryNetworkVerticesGetVertexByHeight](docs/sdks/vertices/README.md#getvertexbyheight) +- [glacierPrimaryNetworkVerticesListLatestXChainVertices](docs/sdks/vertices/README.md#listlatestxchainvertices) +- [glacierTeleporterGetTeleporterMessage](docs/sdks/teleporter/README.md#getteleportermessage) +- [glacierTeleporterListTeleporterMessages](docs/sdks/teleporter/README.md#listteleportermessages) +- [glacierUsageMetricsGetApiLogs](docs/sdks/usagemetrics/README.md#getapilogs) +- [glacierUsageMetricsGetApiUsageMetrics](docs/sdks/usagemetrics/README.md#getapiusagemetrics) +- [glacierWebhooksAddAddressesToWebhook](docs/sdks/webhooks/README.md#addaddressestowebhook) +- [glacierWebhooksCreateWebhook](docs/sdks/webhooks/README.md#createwebhook) +- [glacierWebhooksDeactivateWebhook](docs/sdks/webhooks/README.md#deactivatewebhook) +- [glacierWebhooksGenerateSharedSecret](docs/sdks/webhooks/README.md#generatesharedsecret) +- [glacierWebhooksGetAddressesFromWebhook](docs/sdks/webhooks/README.md#getaddressesfromwebhook) +- [glacierWebhooksGetSharedSecret](docs/sdks/webhooks/README.md#getsharedsecret) +- [glacierWebhooksGetWebhook](docs/sdks/webhooks/README.md#getwebhook) +- [glacierWebhooksListWebhooks](docs/sdks/webhooks/README.md#listwebhooks) +- [glacierWebhooksRemoveAddressesFromWebhook](docs/sdks/webhooks/README.md#removeaddressesfromwebhook) +- [glacierWebhooksUpdateWebhook](docs/sdks/webhooks/README.md#updatewebhook) + + +
+ + + +## Global Parameters + +Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed. + +For example, you can set `chainId` to `"43114"` at SDK initialization and then you do not have to pass the same value on calls to operations like `reindexNft`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. + + +### Available Globals + +The following global parameters are available. + +| Name | Type | Required | Description | +| ---- | ---- |:--------:| ----------- | +| chainId | string | | A supported EVM chain id, chain alias, or blockchain id. | +| network | components.GlobalParamNetwork | | A supported network type mainnet or a testnet. | + + +### Example + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + await avaCloudSDK.glacier.nfts.reindexNft({ + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", + }); +} + +run(); + +``` + + + +## Pagination + +Some of the endpoints in this SDK support pagination. To use pagination, you +make your SDK calls as usual, but the returned response object will also be an +async iterable that can be consumed using the [`for await...of`][for-await-of] +syntax. + +[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of + +Here's an example of one such pagination call: + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.nfts.listTokens({ + pageSize: 10, + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); + +``` + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a retryConfig object to the call: +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck({ + retries: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, + }, + retryConnectionErrors: false, + }, + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization: +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + retryConfig: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, + }, + retryConnectionErrors: false, + }, + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Error Handling + +All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type. + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. + + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; +import { + BadGateway, + BadRequest, + Forbidden, + InternalServerError, + NotFound, + SDKValidationError, + ServiceUnavailable, + TooManyRequests, + Unauthorized, +} from "@avalabs/avacloud-sdk/models/errors"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + try { + await avaCloudSDK.glacier.nfts.reindexNft({ + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", + }); + } catch (err) { + switch (true) { + case err instanceof SDKValidationError: { + // Validation errors can be pretty-printed + console.error(err.pretty()); + // Raw value may also be inspected + console.error(err.rawValue); + return; + } + case err instanceof BadRequest: { + // Handle err.data$: BadRequestData + console.error(err); + return; + } + case err instanceof Unauthorized: { + // Handle err.data$: UnauthorizedData + console.error(err); + return; + } + case err instanceof Forbidden: { + // Handle err.data$: ForbiddenData + console.error(err); + return; + } + case err instanceof NotFound: { + // Handle err.data$: NotFoundData + console.error(err); + return; + } + case err instanceof TooManyRequests: { + // Handle err.data$: TooManyRequestsData + console.error(err); + return; + } + case err instanceof InternalServerError: { + // Handle err.data$: InternalServerErrorData + console.error(err); + return; + } + case err instanceof BadGateway: { + // Handle err.data$: BadGatewayData + console.error(err); + return; + } + case err instanceof ServiceUnavailable: { + // Handle err.data$: ServiceUnavailableData + console.error(err); + return; + } + default: { + throw err; + } + } + } +} + +run(); + +``` + + + +## Server Selection + +### Select Server by Index + +You can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: + +| # | Server | Variables | +| - | ------ | --------- | +| 0 | `https://glacier-api.avax.network` | None | + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + serverIdx: 0, + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + +### Override Server URL Per-Client + +The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example: + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + serverURL: "https://glacier-api.avax.network", + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Custom HTTP Client + +The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native +[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This +client is a thin wrapper around `fetch` and provides the ability to attach hooks +around the request lifecycle that can be used to modify the request or handle +errors and response. + +The `HTTPClient` constructor takes an optional `fetcher` argument that can be +used to integrate a third-party HTTP client or when writing tests to mock out +the HTTP client and feed in fixtures. + +The following example shows how to use the `"beforeRequest"` hook to to add a +custom header and a timeout to requests and how to use the `"requestError"` hook +to log errors: + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; +import { HTTPClient } from "@avalabs/avacloud-sdk/lib/http"; + +const httpClient = new HTTPClient({ + // fetcher takes a function that has the same signature as native `fetch`. + fetcher: (request) => { + return fetch(request); + } +}); + +httpClient.addHook("beforeRequest", (request) => { + const nextRequest = new Request(request, { + signal: request.signal || AbortSignal.timeout(5000) + }); + + nextRequest.headers.set("x-custom-header", "custom value"); + + return nextRequest; +}); + +httpClient.addHook("requestError", (error, request) => { + console.group("Request Error"); + console.log("Reason:", `${error}`); + console.log("Endpoint:", `${request.method} ${request.url}`); + console.groupEnd(); +}); + +const sdk = new AvaCloudSDK({ httpClient }); +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| -------- | -------- | -------- | +| `apiKey` | apiKey | API key | + +To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example: +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Debugging + +You can setup your SDK to emit debug logs for SDK requests and responses. + +You can pass a logger that matches `console`'s interface as an SDK option. + +> [!WARNING] +> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production. + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const sdk = new AvaCloudSDK({ debugLogger: console }); +``` + + + +## Summary + +Glacier API: The Glacier API provides web3 application developers with multi-chain data related to Avalanche's primary network, Avalanche subnets, and Ethereum. With Glacier, you can easily build products that leverage real-time and historical transaction and transfer history, native and token balances, and various types of token metadata. The API is in Beta and may be subject to change.

If you have feedback or feature requests for the API, please submit them here. Bug reports can be submitted here, and any potential security issues can be reported here. + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [Requirements](#requirements) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [Standalone functions](#standalone-functions) +* [Global Parameters](#global-parameters) +* [Pagination](#pagination) +* [Retries](#retries) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Custom HTTP Client](#custom-http-client) +* [Authentication](#authentication) +* [Debugging](#debugging) + + + + +## Verify Webhook Signature + +The isValidSignature function is a utility function in the Avalanche SDK that verifies the authenticity and integrity of incoming webhook requests from AvaCloud. This function ensures that the requests are coming from a trusted source by validating the HMAC SHA-256 signature provided in the request header.Usage + +Import and use the `isValidSignature` function: + +```js +import { isValidSignature } from '@avalabs/avacloud-sdk/utils'; +import express from 'express'; + +const app = express(); +app.use(express.json()); + +const signingSecret = 'your-signing-secret'; // Replace with your signing secret + +app.post('/webhook', (req, res) => { + const signature = req.headers['x-signature']; + const payload = req.body; + + if (isValidSignature(signingSecret, signature, payload)) { + console.log('Valid signature'); + // Process the request + } else { + console.log('Invalid signature'); + } + + res.json({ received: true }); +}); + +app.listen(8000, () => console.log('Server running on port 8000')); +``` + +### Parameters + +* `signingSecret`: The secret key for signing. +* `signature`: The HMAC SHA-256 signature from the request header. +* `payload`: The JSON payload of the request. + +### More Information + +Use this function to securely validate webhooks from AvaCloud. + +For more information, visit the [AvaCloud](https://glacier.docs.avacloud.io/reference/validate-signature) documentation. + +# Development + +## Maturity + +This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage +to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally +looking for the latest version. + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. +We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. + +[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/RELEASES.md @@ -0,0 +1 @@ + diff --git a/RUNTIMES.md b/RUNTIMES.md new file mode 100644 index 0000000..d08a0c0 --- /dev/null +++ b/RUNTIMES.md @@ -0,0 +1,22 @@ +# Supported JavaScript runtimes + +This SDK is intended to be used in JavaScript runtimes that support the following features: + +* [Web Fetch API][web-fetch] +* [Web Streams API][web-streams] and in particular `ReadableStream` +* [Async iterables][async-iter] using `Symbol.asyncIterator` + +[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API +[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API +[async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols + +Runtime environments that are explicitly supported are: + +- Evergreen browsers which include: Chrome, Safari, Edge, Firefox +- Node.js active and maintenance LTS releases + - Currently, this is v18 and v20 +- Bun v1 and above +- Deno v1.39 + - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming]) + +[deno-file-streaming]: https://github.com/denoland/deno/issues/11018 diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..c811d7e --- /dev/null +++ b/USAGE.md @@ -0,0 +1,21 @@ + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck(); + + // Handle the result + console.log(result); +} + +run(); + +``` + \ No newline at end of file diff --git a/docs/lib/utils/retryconfig.md b/docs/lib/utils/retryconfig.md new file mode 100644 index 0000000..08f95f4 --- /dev/null +++ b/docs/lib/utils/retryconfig.md @@ -0,0 +1,24 @@ +# RetryConfig + +Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | +| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | +| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | ------------ | ----------------------------------------- | -------- | +| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | +| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | +| `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/docs/models/components/activedelegatordetails.md b/docs/models/components/activedelegatordetails.md new file mode 100644 index 0000000..a0febc6 --- /dev/null +++ b/docs/models/components/activedelegatordetails.md @@ -0,0 +1,35 @@ +# ActiveDelegatorDetails + +## Example Usage + +```typescript +import { ActiveDelegatorDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: ActiveDelegatorDetails = { + txHash: "", + nodeId: "", + rewardAddresses: [""], + amountDelegated: "", + delegationFee: "", + startTimestamp: 6667.67, + endTimestamp: 6531.4, + estimatedGrossReward: "", + estimatedNetReward: "", + delegationStatus: "active", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `nodeId` | *string* | :heavy_check_mark: | N/A | +| `rewardAddresses` | *string*[] | :heavy_check_mark: | N/A | +| `amountDelegated` | *string* | :heavy_check_mark: | N/A | +| `delegationFee` | *string* | :heavy_check_mark: | N/A | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | +| `estimatedGrossReward` | *string* | :heavy_check_mark: | N/A | +| `estimatedNetReward` | *string* | :heavy_check_mark: | N/A | +| `delegationStatus` | [components.ActiveDelegatorDetailsDelegationStatus](../../models/components/activedelegatordetailsdelegationstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activedelegatordetailsdelegationstatus.md b/docs/models/components/activedelegatordetailsdelegationstatus.md new file mode 100644 index 0000000..a7542fd --- /dev/null +++ b/docs/models/components/activedelegatordetailsdelegationstatus.md @@ -0,0 +1,15 @@ +# ActiveDelegatorDetailsDelegationStatus + +## Example Usage + +```typescript +import { ActiveDelegatorDetailsDelegationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: ActiveDelegatorDetailsDelegationStatus = "active"; +``` + +## Values + +```typescript +"active" +``` \ No newline at end of file diff --git a/docs/models/components/activevalidatordetails.md b/docs/models/components/activevalidatordetails.md new file mode 100644 index 0000000..72453e1 --- /dev/null +++ b/docs/models/components/activevalidatordetails.md @@ -0,0 +1,52 @@ +# ActiveValidatorDetails + +## Example Usage + +```typescript +import { ActiveValidatorDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: ActiveValidatorDetails = { + txHash: "", + nodeId: "", + subnetId: "", + amountStaked: "", + startTimestamp: 1863.32, + endTimestamp: 7742.34, + stakePercentage: 7369.18, + delegatorCount: 4561.5, + uptimePerformance: 2165.5, + potentialRewards: { + validationRewardAmount: "", + delegationRewardAmount: "", + }, + validationStatus: "active", + validatorHealth: { + reachabilityPercent: 5684.34, + benchedPChainRequestsPercent: 1352.18, + benchedXChainRequestsPercent: 187.89, + benchedCChainRequestsPercent: 3241.41, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `nodeId` | *string* | :heavy_check_mark: | N/A | +| `subnetId` | *string* | :heavy_check_mark: | N/A | +| `amountStaked` | *string* | :heavy_check_mark: | N/A | +| `delegationFee` | *string* | :heavy_minus_sign: | N/A | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | +| `blsCredentials` | [components.BlsCredentials](../../models/components/blscredentials.md) | :heavy_minus_sign: | Present for AddPermissionlessValidatorTx | +| `stakePercentage` | *number* | :heavy_check_mark: | N/A | +| `delegatorCount` | *number* | :heavy_check_mark: | N/A | +| `amountDelegated` | *string* | :heavy_minus_sign: | N/A | +| `uptimePerformance` | *number* | :heavy_check_mark: | N/A | +| `avalancheGoVersion` | *string* | :heavy_minus_sign: | N/A | +| `delegationCapacity` | *string* | :heavy_minus_sign: | N/A | +| `potentialRewards` | [components.Rewards](../../models/components/rewards.md) | :heavy_check_mark: | N/A | +| `validationStatus` | [components.ActiveValidatorDetailsValidationStatus](../../models/components/activevalidatordetailsvalidationstatus.md) | :heavy_check_mark: | N/A | +| `validatorHealth` | [components.ValidatorHealthDetails](../../models/components/validatorhealthdetails.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activevalidatordetailsvalidationstatus.md b/docs/models/components/activevalidatordetailsvalidationstatus.md new file mode 100644 index 0000000..94c6945 --- /dev/null +++ b/docs/models/components/activevalidatordetailsvalidationstatus.md @@ -0,0 +1,15 @@ +# ActiveValidatorDetailsValidationStatus + +## Example Usage + +```typescript +import { ActiveValidatorDetailsValidationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: ActiveValidatorDetailsValidationStatus = "active"; +``` + +## Values + +```typescript +"active" +``` \ No newline at end of file diff --git a/docs/models/components/addressactivitymetadata.md b/docs/models/components/addressactivitymetadata.md new file mode 100644 index 0000000..54640e5 --- /dev/null +++ b/docs/models/components/addressactivitymetadata.md @@ -0,0 +1,19 @@ +# AddressActivityMetadata + +## Example Usage + +```typescript +import { AddressActivityMetadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: AddressActivityMetadata = { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + eventSignatures: ["0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `addresses` | *string*[] | :heavy_check_mark: | Ethereum address(es) for the address_activity event type | [
"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
] | +| `eventSignatures` | *string*[] | :heavy_minus_sign: | Array of hexadecimal strings of the event signatures. | [
"0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"
] | \ No newline at end of file diff --git a/docs/models/components/addresseschangerequest.md b/docs/models/components/addresseschangerequest.md new file mode 100644 index 0000000..c376841 --- /dev/null +++ b/docs/models/components/addresseschangerequest.md @@ -0,0 +1,17 @@ +# AddressesChangeRequest + +## Example Usage + +```typescript +import { AddressesChangeRequest } from "@avalabs/avacloud-sdk/models/components"; + +let value: AddressesChangeRequest = { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `addresses` | *string*[] | :heavy_check_mark: | Ethereum address(es) for the address_activity event type | [
"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"
] | \ No newline at end of file diff --git a/docs/models/components/aggregatedassetamount.md b/docs/models/components/aggregatedassetamount.md new file mode 100644 index 0000000..8bfff03 --- /dev/null +++ b/docs/models/components/aggregatedassetamount.md @@ -0,0 +1,29 @@ +# AggregatedAssetAmount + +## Example Usage + +```typescript +import { AggregatedAssetAmount } from "@avalabs/avacloud-sdk/models/components"; + +let value: AggregatedAssetAmount = { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `assetId` | *string* | :heavy_check_mark: | Unique ID for an asset. | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | +| `name` | *string* | :heavy_check_mark: | Name of this asset. | Avalanche | +| `symbol` | *string* | :heavy_check_mark: | Symbol for this asset (max 4 characters). | AVAX | +| `denomination` | *number* | :heavy_check_mark: | Denomination of this asset to represent fungibility. | 9 | +| `type` | [components.PrimaryNetworkAssetType](../../models/components/primarynetworkassettype.md) | :heavy_check_mark: | Type of asset like SECP256K1 or NFT. | | +| `amount` | *string* | :heavy_check_mark: | Amount of the asset. | 5001000 | +| `utxoCount` | *number* | :heavy_check_mark: | N/A | 1 | \ No newline at end of file diff --git a/docs/models/components/assetamount.md b/docs/models/components/assetamount.md new file mode 100644 index 0000000..196d165 --- /dev/null +++ b/docs/models/components/assetamount.md @@ -0,0 +1,27 @@ +# AssetAmount + +## Example Usage + +```typescript +import { AssetAmount } from "@avalabs/avacloud-sdk/models/components"; + +let value: AssetAmount = { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `assetId` | *string* | :heavy_check_mark: | Unique ID for an asset. | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | +| `name` | *string* | :heavy_check_mark: | Name of this asset. | Avalanche | +| `symbol` | *string* | :heavy_check_mark: | Symbol for this asset (max 4 characters). | AVAX | +| `denomination` | *number* | :heavy_check_mark: | Denomination of this asset to represent fungibility. | 9 | +| `type` | [components.PrimaryNetworkAssetType](../../models/components/primarynetworkassettype.md) | :heavy_check_mark: | Type of asset like SECP256K1 or NFT. | | +| `amount` | *string* | :heavy_check_mark: | Amount of the asset. | 5001000 | \ No newline at end of file diff --git a/docs/models/components/assetwithpriceinfo.md b/docs/models/components/assetwithpriceinfo.md new file mode 100644 index 0000000..67c5b02 --- /dev/null +++ b/docs/models/components/assetwithpriceinfo.md @@ -0,0 +1,32 @@ +# AssetWithPriceInfo + +## Example Usage + +```typescript +import { AssetWithPriceInfo } from "@avalabs/avacloud-sdk/models/components"; + +let value: AssetWithPriceInfo = { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + historicalPrice: { + currencyCode: "usd", + value: 42.42, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `assetId` | *string* | :heavy_check_mark: | Unique ID for an asset. | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | +| `name` | *string* | :heavy_check_mark: | Name of this asset. | Avalanche | +| `symbol` | *string* | :heavy_check_mark: | Symbol for this asset (max 4 characters). | AVAX | +| `denomination` | *number* | :heavy_check_mark: | Denomination of this asset to represent fungibility. | 9 | +| `type` | [components.PrimaryNetworkAssetType](../../models/components/primarynetworkassettype.md) | :heavy_check_mark: | Type of asset like SECP256K1 or NFT. | | +| `amount` | *string* | :heavy_check_mark: | Amount of the asset. | 5001000 | +| `historicalPrice` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The historical asset price at the time the reward was granted, if available. Note, this is only provided if the reward occured more than 24 hours ago. | | \ No newline at end of file diff --git a/docs/models/components/blockchain.md b/docs/models/components/blockchain.md new file mode 100644 index 0000000..cc31b58 --- /dev/null +++ b/docs/models/components/blockchain.md @@ -0,0 +1,27 @@ +# Blockchain + +## Example Usage + +```typescript +import { Blockchain } from "@avalabs/avacloud-sdk/models/components"; + +let value: Blockchain = { + createBlockTimestamp: 6788.8, + createBlockNumber: "", + blockchainId: "", + vmId: "", + subnetId: "", + blockchainName: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `createBlockTimestamp` | *number* | :heavy_check_mark: | N/A | +| `createBlockNumber` | *string* | :heavy_check_mark: | N/A | +| `blockchainId` | *string* | :heavy_check_mark: | N/A | +| `vmId` | *string* | :heavy_check_mark: | N/A | +| `subnetId` | *string* | :heavy_check_mark: | N/A | +| `blockchainName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/blockchainid.md b/docs/models/components/blockchainid.md new file mode 100644 index 0000000..6126877 --- /dev/null +++ b/docs/models/components/blockchainid.md @@ -0,0 +1,15 @@ +# BlockchainId + +## Example Usage + +```typescript +import { BlockchainId } from "@avalabs/avacloud-sdk/models/components"; + +let value: BlockchainId = "p-chain"; +``` + +## Values + +```typescript +"11111111111111111111111111111111LpoYY" | "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM" | "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm" | "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5" | "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp" | "p-chain" | "x-chain" | "c-chain" +``` \ No newline at end of file diff --git a/docs/models/components/blockchainids.md b/docs/models/components/blockchainids.md new file mode 100644 index 0000000..f69f52f --- /dev/null +++ b/docs/models/components/blockchainids.md @@ -0,0 +1,15 @@ +# BlockchainIds + +## Example Usage + +```typescript +import { BlockchainIds } from "@avalabs/avacloud-sdk/models/components"; + +let value: BlockchainIds = "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp"; +``` + +## Values + +```typescript +"11111111111111111111111111111111LpoYY" | "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM" | "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm" | "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5" | "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp" +``` \ No newline at end of file diff --git a/docs/models/components/blockchaininfo.md b/docs/models/components/blockchaininfo.md new file mode 100644 index 0000000..2cf7122 --- /dev/null +++ b/docs/models/components/blockchaininfo.md @@ -0,0 +1,17 @@ +# BlockchainInfo + +## Example Usage + +```typescript +import { BlockchainInfo } from "@avalabs/avacloud-sdk/models/components"; + +let value: BlockchainInfo = { + blockchainId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `blockchainId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/blscredentials.md b/docs/models/components/blscredentials.md new file mode 100644 index 0000000..cbe814b --- /dev/null +++ b/docs/models/components/blscredentials.md @@ -0,0 +1,19 @@ +# BlsCredentials + +## Example Usage + +```typescript +import { BlsCredentials } from "@avalabs/avacloud-sdk/models/components"; + +let value: BlsCredentials = { + publicKey: "", + proofOfPossession: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `publicKey` | *string* | :heavy_check_mark: | N/A | +| `proofOfPossession` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/cchainatomicbalances.md b/docs/models/components/cchainatomicbalances.md new file mode 100644 index 0000000..f5e6c6f --- /dev/null +++ b/docs/models/components/cchainatomicbalances.md @@ -0,0 +1,41 @@ +# CChainAtomicBalances + +## Example Usage + +```typescript +import { CChainAtomicBalances } from "@avalabs/avacloud-sdk/models/components"; + +let value: CChainAtomicBalances = { + atomicMemoryUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + atomicMemoryLocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `atomicMemoryUnlocked` | [components.CChainSharedAssetBalance](../../models/components/cchainsharedassetbalance.md)[] | :heavy_check_mark: | N/A | +| `atomicMemoryLocked` | [components.CChainSharedAssetBalance](../../models/components/cchainsharedassetbalance.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/cchainexporttransaction.md b/docs/models/components/cchainexporttransaction.md new file mode 100644 index 0000000..fe2815a --- /dev/null +++ b/docs/models/components/cchainexporttransaction.md @@ -0,0 +1,106 @@ +# CChainExportTransaction + +## Example Usage + +```typescript +import { CChainExportTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: CChainExportTransaction = { + txHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + blockHeight: 1005, + blockHash: "0x57a5cb7704561d1d59bd563b6421021b7563960c05ba3ae0e36fc36917c742ee", + timestamp: 1600762738, + memo: "0x546865204176616c616e6368652050726f6a656374", + amountUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + amountCreated: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + txType: "ExportTx", + evmInputs: [ + { + fromAddress: "0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c", + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + }, + ], + emittedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `txHash` | *string* | :heavy_check_mark: | Unique ID for this transaction. | 3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c | +| `blockHeight` | *number* | :heavy_check_mark: | Height of the block this transaction belongs to. | 1005 | +| `blockHash` | *string* | :heavy_check_mark: | Hash of the block this transaction belongs to. | 0x57a5cb7704561d1d59bd563b6421021b7563960c05ba3ae0e36fc36917c742ee | +| `timestamp` | *number* | :heavy_check_mark: | Latest timestamp in seconds this transaction was accepted. | 1600762738 | +| `memo` | *string* | :heavy_check_mark: | Hex encoded memo bytes for this transaction. | 0x546865204176616c616e6368652050726f6a656374 | +| `amountUnlocked` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets unlocked by inputs of this transaction. | | +| `amountCreated` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets created by outputs of this transaction. | | +| `sourceChain` | *string* | :heavy_check_mark: | Source chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `destinationChain` | *string* | :heavy_check_mark: | Destination chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `txType` | [components.TxType](../../models/components/txtype.md) | :heavy_check_mark: | Type of transaction. | ExportTx | +| `evmInputs` | [components.EVMInput](../../models/components/evminput.md)[] | :heavy_check_mark: | N/A | | +| `emittedUtxos` | [components.Utxo](../../models/components/utxo.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/cchainimporttransaction.md b/docs/models/components/cchainimporttransaction.md new file mode 100644 index 0000000..f9175a6 --- /dev/null +++ b/docs/models/components/cchainimporttransaction.md @@ -0,0 +1,99 @@ +# CChainImportTransaction + +## Example Usage + +```typescript +import { CChainImportTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: CChainImportTransaction = { + txHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + blockHeight: 1005, + blockHash: "0x57a5cb7704561d1d59bd563b6421021b7563960c05ba3ae0e36fc36917c742ee", + timestamp: 1600762738, + memo: "0x546865204176616c616e6368652050726f6a656374", + amountUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + amountCreated: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + txType: "ImportTx", + evmOutputs: [ + { + toAddress: "0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c", + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + }, + ], + consumedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | Unique ID for this transaction. | 3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c | +| `blockHeight` | *number* | :heavy_check_mark: | Height of the block this transaction belongs to. | 1005 | +| `blockHash` | *string* | :heavy_check_mark: | Hash of the block this transaction belongs to. | 0x57a5cb7704561d1d59bd563b6421021b7563960c05ba3ae0e36fc36917c742ee | +| `timestamp` | *number* | :heavy_check_mark: | Latest timestamp in seconds this transaction was accepted. | 1600762738 | +| `memo` | *string* | :heavy_check_mark: | Hex encoded memo bytes for this transaction. | 0x546865204176616c616e6368652050726f6a656374 | +| `amountUnlocked` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets unlocked by inputs of this transaction. | | +| `amountCreated` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets created by outputs of this transaction. | | +| `sourceChain` | *string* | :heavy_check_mark: | Source chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `destinationChain` | *string* | :heavy_check_mark: | Destination chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `txType` | [components.CChainImportTransactionTxType](../../models/components/cchainimporttransactiontxtype.md) | :heavy_check_mark: | Type of transaction. | ImportTx | +| `evmOutputs` | [components.EVMOutput](../../models/components/evmoutput.md)[] | :heavy_check_mark: | N/A | | +| `consumedUtxos` | [components.Utxo](../../models/components/utxo.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/cchainimporttransactiontxtype.md b/docs/models/components/cchainimporttransactiontxtype.md new file mode 100644 index 0000000..ef2621e --- /dev/null +++ b/docs/models/components/cchainimporttransactiontxtype.md @@ -0,0 +1,17 @@ +# CChainImportTransactionTxType + +Type of transaction. + +## Example Usage + +```typescript +import { CChainImportTransactionTxType } from "@avalabs/avacloud-sdk/models/components"; + +let value: CChainImportTransactionTxType = "ImportTx"; +``` + +## Values + +```typescript +"ImportTx" +``` \ No newline at end of file diff --git a/docs/models/components/cchainsharedassetbalance.md b/docs/models/components/cchainsharedassetbalance.md new file mode 100644 index 0000000..5d4e659 --- /dev/null +++ b/docs/models/components/cchainsharedassetbalance.md @@ -0,0 +1,31 @@ +# CChainSharedAssetBalance + +## Example Usage + +```typescript +import { CChainSharedAssetBalance } from "@avalabs/avacloud-sdk/models/components"; + +let value: CChainSharedAssetBalance = { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `assetId` | *string* | :heavy_check_mark: | Unique ID for an asset. | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | +| `name` | *string* | :heavy_check_mark: | Name of this asset. | Avalanche | +| `symbol` | *string* | :heavy_check_mark: | Symbol for this asset (max 4 characters). | AVAX | +| `denomination` | *number* | :heavy_check_mark: | Denomination of this asset to represent fungibility. | 9 | +| `type` | [components.PrimaryNetworkAssetType](../../models/components/primarynetworkassettype.md) | :heavy_check_mark: | Type of asset like SECP256K1 or NFT. | | +| `amount` | *string* | :heavy_check_mark: | Amount of the asset. | 5001000 | +| `utxoCount` | *number* | :heavy_check_mark: | N/A | 1 | +| `sharedWithChainId` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/chainaddresschainidmap.md b/docs/models/components/chainaddresschainidmap.md new file mode 100644 index 0000000..fbd56a8 --- /dev/null +++ b/docs/models/components/chainaddresschainidmap.md @@ -0,0 +1,19 @@ +# ChainAddressChainIdMap + +## Example Usage + +```typescript +import { ChainAddressChainIdMap } from "@avalabs/avacloud-sdk/models/components"; + +let value: ChainAddressChainIdMap = { + address: "0603 Will Shoals", + blockchainIds: ["11111111111111111111111111111111LpoYY"], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | N/A | +| `blockchainIds` | [components.BlockchainIds](../../models/components/blockchainids.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/chainaddresschainidmaplistresponse.md b/docs/models/components/chainaddresschainidmaplistresponse.md new file mode 100644 index 0000000..7765a10 --- /dev/null +++ b/docs/models/components/chainaddresschainidmaplistresponse.md @@ -0,0 +1,22 @@ +# ChainAddressChainIdMapListResponse + +## Example Usage + +```typescript +import { ChainAddressChainIdMapListResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ChainAddressChainIdMapListResponse = { + addresses: [ + { + address: "545 Tianna Stream", + blockchainIds: ["11111111111111111111111111111111LpoYY"], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `addresses` | [components.ChainAddressChainIdMap](../../models/components/chainaddresschainidmap.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/chainformat.md b/docs/models/components/chainformat.md new file mode 100644 index 0000000..690ca2b --- /dev/null +++ b/docs/models/components/chainformat.md @@ -0,0 +1,17 @@ +# ChainFormat + +Represents chain format this transaction is included in. + +## Example Usage + +```typescript +import { ChainFormat } from "@avalabs/avacloud-sdk/models/components"; + +let value: ChainFormat = "non-linear"; +``` + +## Values + +```typescript +"non-linear" | "linear" +``` \ No newline at end of file diff --git a/docs/models/components/chaininfo.md b/docs/models/components/chaininfo.md new file mode 100644 index 0000000..e146c53 --- /dev/null +++ b/docs/models/components/chaininfo.md @@ -0,0 +1,46 @@ +# ChainInfo + +## Example Usage + +```typescript +import { ChainInfo } from "@avalabs/avacloud-sdk/models/components"; + +let value: ChainInfo = { + chainId: "", + status: "OK", + chainName: "", + description: "Balanced 6th generation help-desk", + vmName: "BITCOIN", + rpcUrl: "", + isTestnet: false, + networkToken: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_check_mark: | N/A | +| `status` | [components.ChainStatus](../../models/components/chainstatus.md) | :heavy_check_mark: | Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors. | +| `chainName` | *string* | :heavy_check_mark: | N/A | +| `description` | *string* | :heavy_check_mark: | N/A | +| `platformChainId` | *string* | :heavy_minus_sign: | N/A | +| `subnetId` | *string* | :heavy_minus_sign: | N/A | +| `vmId` | *string* | :heavy_minus_sign: | N/A | +| `vmName` | [components.VmName](../../models/components/vmname.md) | :heavy_check_mark: | N/A | +| `explorerUrl` | *string* | :heavy_minus_sign: | N/A | +| `rpcUrl` | *string* | :heavy_check_mark: | N/A | +| `wsUrl` | *string* | :heavy_minus_sign: | N/A | +| `isTestnet` | *boolean* | :heavy_check_mark: | N/A | +| `utilityAddresses` | [components.UtilityAddresses](../../models/components/utilityaddresses.md) | :heavy_minus_sign: | N/A | +| `networkToken` | [components.NetworkToken](../../models/components/networktoken.md) | :heavy_check_mark: | N/A | +| `chainLogoUri` | *string* | :heavy_minus_sign: | N/A | +| `private` | *boolean* | :heavy_minus_sign: | N/A | +| `enabledFeatures` | [components.EnabledFeatures](../../models/components/enabledfeatures.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/chainstatus.md b/docs/models/components/chainstatus.md new file mode 100644 index 0000000..e2b596e --- /dev/null +++ b/docs/models/components/chainstatus.md @@ -0,0 +1,17 @@ +# ChainStatus + +Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors. + +## Example Usage + +```typescript +import { ChainStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: ChainStatus = "UNAVAILABLE"; +``` + +## Values + +```typescript +"OK" | "UNAVAILABLE" +``` \ No newline at end of file diff --git a/docs/models/components/collectiblebalances.md b/docs/models/components/collectiblebalances.md new file mode 100644 index 0000000..34709d2 --- /dev/null +++ b/docs/models/components/collectiblebalances.md @@ -0,0 +1,34 @@ +# CollectibleBalances + +## Example Usage + +```typescript +import { CollectibleBalances } from "@avalabs/avacloud-sdk/models/components"; + +let value: CollectibleBalances = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INVALID_METADATA", + }, + chainId: "43114", + balance: "2000000000000000000", +}; +``` + +## Supported Types + +### `components.Erc721TokenBalance` + +```typescript +const value: components.Erc721TokenBalance = /* values here */ +``` + +### `components.Erc1155TokenBalance` + +```typescript +const value: components.Erc1155TokenBalance = /* values here */ +``` + diff --git a/docs/models/components/completeddelegatordetails.md b/docs/models/components/completeddelegatordetails.md new file mode 100644 index 0000000..c897aba --- /dev/null +++ b/docs/models/components/completeddelegatordetails.md @@ -0,0 +1,35 @@ +# CompletedDelegatorDetails + +## Example Usage + +```typescript +import { CompletedDelegatorDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: CompletedDelegatorDetails = { + txHash: "", + nodeId: "", + rewardAddresses: [""], + amountDelegated: "", + delegationFee: "", + startTimestamp: 602.25, + endTimestamp: 9698.1, + grossReward: "", + netReward: "", + delegationStatus: "completed", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `nodeId` | *string* | :heavy_check_mark: | N/A | +| `rewardAddresses` | *string*[] | :heavy_check_mark: | N/A | +| `amountDelegated` | *string* | :heavy_check_mark: | N/A | +| `delegationFee` | *string* | :heavy_check_mark: | N/A | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | +| `grossReward` | *string* | :heavy_check_mark: | N/A | +| `netReward` | *string* | :heavy_check_mark: | N/A | +| `delegationStatus` | [components.DelegationStatus](../../models/components/delegationstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/completedvalidatordetails.md b/docs/models/components/completedvalidatordetails.md new file mode 100644 index 0000000..8466f16 --- /dev/null +++ b/docs/models/components/completedvalidatordetails.md @@ -0,0 +1,38 @@ +# CompletedValidatorDetails + +## Example Usage + +```typescript +import { CompletedValidatorDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: CompletedValidatorDetails = { + txHash: "", + nodeId: "", + subnetId: "", + amountStaked: "", + startTimestamp: 4146.62, + endTimestamp: 4736, + delegatorCount: 2645.55, + rewards: { + validationRewardAmount: "", + delegationRewardAmount: "", + }, + validationStatus: "completed", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `nodeId` | *string* | :heavy_check_mark: | N/A | +| `subnetId` | *string* | :heavy_check_mark: | N/A | +| `amountStaked` | *string* | :heavy_check_mark: | N/A | +| `delegationFee` | *string* | :heavy_minus_sign: | N/A | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | +| `blsCredentials` | [components.BlsCredentials](../../models/components/blscredentials.md) | :heavy_minus_sign: | Present for AddPermissionlessValidatorTx | +| `delegatorCount` | *number* | :heavy_check_mark: | N/A | +| `rewards` | [components.Rewards](../../models/components/rewards.md) | :heavy_check_mark: | N/A | +| `validationStatus` | [components.ValidationStatus](../../models/components/validationstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/contractdeploymentdetails.md b/docs/models/components/contractdeploymentdetails.md new file mode 100644 index 0000000..f432ab7 --- /dev/null +++ b/docs/models/components/contractdeploymentdetails.md @@ -0,0 +1,20 @@ +# ContractDeploymentDetails + +## Example Usage + +```typescript +import { ContractDeploymentDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: ContractDeploymentDetails = { + txHash: "", + deployerAddress: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `deployerAddress` | *string* | :heavy_check_mark: | The address that initiated the transaction which deployed this contract. | +| `deployerContractAddress` | *string* | :heavy_minus_sign: | The contract address which deployed this contract via smart contract. This field is only populated when the contract was deployed as part of smart contract execution. | \ No newline at end of file diff --git a/docs/models/components/contracts.md b/docs/models/components/contracts.md new file mode 100644 index 0000000..7d0fae5 --- /dev/null +++ b/docs/models/components/contracts.md @@ -0,0 +1,46 @@ +# Contracts + +## Example Usage + +```typescript +import { Contracts } from "@avalabs/avacloud-sdk/models/components"; + +let value: Contracts = { + name: "Wrapped AVAX", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + deploymentDetails: { + txHash: "", + deployerAddress: "", + }, + ercType: "ERC-20", + symbol: "WAVAX", + decimals: 18, +}; +``` + +## Supported Types + +### `components.Erc721Contract` + +```typescript +const value: components.Erc721Contract = /* values here */ +``` + +### `components.Erc1155Contract` + +```typescript +const value: components.Erc1155Contract = /* values here */ +``` + +### `components.Erc20Contract` + +```typescript +const value: components.Erc20Contract = /* values here */ +``` + +### `components.UnknownContract` + +```typescript +const value: components.UnknownContract = /* values here */ +``` + diff --git a/docs/models/components/createevmtransactionexportrequest.md b/docs/models/components/createevmtransactionexportrequest.md new file mode 100644 index 0000000..914ce8c --- /dev/null +++ b/docs/models/components/createevmtransactionexportrequest.md @@ -0,0 +1,30 @@ +# CreateEvmTransactionExportRequest + +## Example Usage + +```typescript +import { CreateEvmTransactionExportRequest } from "@avalabs/avacloud-sdk/models/components"; + +let value: CreateEvmTransactionExportRequest = { + type: "TRANSACTION_EXPORT_EVM", + firstDate: "2023-05-01", + lastDate: "2023-05-02", + startDate: "2023-05-01", + endDate: "2023-05-02", + options: { + addresses: [""], + includeChains: ["43114"], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.EVMOperationType](../../models/components/evmoperationtype.md) | :heavy_check_mark: | N/A | | +| `firstDate` | *string* | :heavy_check_mark: | N/A | 2023-05-01 | +| `lastDate` | *string* | :heavy_check_mark: | N/A | 2023-05-02 | +| ~~`startDate`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 2023-05-01 | +| ~~`endDate`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 2023-05-02 | +| `options` | [components.EvmNetworkOptions](../../models/components/evmnetworkoptions.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/createprimarynetworktransactionexportrequest.md b/docs/models/components/createprimarynetworktransactionexportrequest.md new file mode 100644 index 0000000..29435aa --- /dev/null +++ b/docs/models/components/createprimarynetworktransactionexportrequest.md @@ -0,0 +1,29 @@ +# CreatePrimaryNetworkTransactionExportRequest + +## Example Usage + +```typescript +import { CreatePrimaryNetworkTransactionExportRequest } from "@avalabs/avacloud-sdk/models/components"; + +let value: CreatePrimaryNetworkTransactionExportRequest = { + type: "TRANSACTION_EXPORT_PRIMARY_NETWORK_SIMPLE", + firstDate: "2023-05-01", + lastDate: "2023-05-02", + startDate: "2023-05-01", + endDate: "2023-05-02", + options: { + includeChains: ["p-chain"], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.PrimaryNetworkOperationType](../../models/components/primarynetworkoperationtype.md) | :heavy_check_mark: | N/A | | +| `firstDate` | *string* | :heavy_check_mark: | N/A | 2023-05-01 | +| `lastDate` | *string* | :heavy_check_mark: | N/A | 2023-05-02 | +| ~~`startDate`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 2023-05-01 | +| ~~`endDate`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 2023-05-02 | +| `options` | [components.PrimaryNetworkOptions](../../models/components/primarynetworkoptions.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/createwebhookrequest.md b/docs/models/components/createwebhookrequest.md new file mode 100644 index 0000000..78cb92f --- /dev/null +++ b/docs/models/components/createwebhookrequest.md @@ -0,0 +1,30 @@ +# CreateWebhookRequest + +## Example Usage + +```typescript +import { CreateWebhookRequest } from "@avalabs/avacloud-sdk/models/components"; + +let value: CreateWebhookRequest = { + url: "https://deafening-feel.name", + chainId: "", + eventType: "address_activity", + metadata: { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + eventSignatures: ["0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `url` | *string* | :heavy_check_mark: | N/A | +| `chainId` | *string* | :heavy_check_mark: | N/A | +| `eventType` | [components.EventType](../../models/components/eventtype.md) | :heavy_check_mark: | N/A | +| `metadata` | *components.CreateWebhookRequestMetadata* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | +| `includeInternalTxs` | *boolean* | :heavy_minus_sign: | Whether to include traces in the webhook payload. | +| `includeLogs` | *boolean* | :heavy_minus_sign: | Whether to include logs in the webhook payload. | \ No newline at end of file diff --git a/docs/models/components/createwebhookrequestmetadata.md b/docs/models/components/createwebhookrequestmetadata.md new file mode 100644 index 0000000..6e2555f --- /dev/null +++ b/docs/models/components/createwebhookrequestmetadata.md @@ -0,0 +1,21 @@ +# CreateWebhookRequestMetadata + +## Example Usage + +```typescript +import { CreateWebhookRequestMetadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: CreateWebhookRequestMetadata = { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + eventSignatures: ["0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"], +}; +``` + +## Supported Types + +### `components.AddressActivityMetadata` + +```typescript +const value: components.AddressActivityMetadata = /* values here */ +``` + diff --git a/docs/models/components/currencycode.md b/docs/models/components/currencycode.md new file mode 100644 index 0000000..f6984b1 --- /dev/null +++ b/docs/models/components/currencycode.md @@ -0,0 +1,17 @@ +# CurrencyCode + +ISO 4217 currency code. + +## Example Usage + +```typescript +import { CurrencyCode } from "@avalabs/avacloud-sdk/models/components"; + +let value: CurrencyCode = "usd"; +``` + +## Values + +```typescript +"usd" | "eur" | "aud" | "cad" | "chf" | "clp" | "cny" | "czk" | "dkk" | "gbp" | "hkd" | "huf" | "jpy" | "nzd" +``` \ No newline at end of file diff --git a/docs/models/components/delegationstatus.md b/docs/models/components/delegationstatus.md new file mode 100644 index 0000000..d639c5c --- /dev/null +++ b/docs/models/components/delegationstatus.md @@ -0,0 +1,15 @@ +# DelegationStatus + +## Example Usage + +```typescript +import { DelegationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: DelegationStatus = "completed"; +``` + +## Values + +```typescript +"completed" +``` \ No newline at end of file diff --git a/docs/models/components/delegationstatustype.md b/docs/models/components/delegationstatustype.md new file mode 100644 index 0000000..13752ad --- /dev/null +++ b/docs/models/components/delegationstatustype.md @@ -0,0 +1,15 @@ +# DelegationStatusType + +## Example Usage + +```typescript +import { DelegationStatusType } from "@avalabs/avacloud-sdk/models/components"; + +let value: DelegationStatusType = "completed"; +``` + +## Values + +```typescript +"completed" | "active" | "pending" +``` \ No newline at end of file diff --git a/docs/models/components/delegators.md b/docs/models/components/delegators.md new file mode 100644 index 0000000..fabd89d --- /dev/null +++ b/docs/models/components/delegators.md @@ -0,0 +1,41 @@ +# Delegators + +## Example Usage + +```typescript +import { Delegators } from "@avalabs/avacloud-sdk/models/components"; + +let value: Delegators = { + txHash: "", + nodeId: "", + rewardAddresses: [""], + amountDelegated: "", + delegationFee: "", + startTimestamp: 6130.64, + endTimestamp: 4370.32, + estimatedGrossReward: "", + estimatedNetReward: "", + delegationStatus: "pending", +}; +``` + +## Supported Types + +### `components.ActiveDelegatorDetails` + +```typescript +const value: components.ActiveDelegatorDetails = /* values here */ +``` + +### `components.PendingDelegatorDetails` + +```typescript +const value: components.PendingDelegatorDetails = /* values here */ +``` + +### `components.CompletedDelegatorDetails` + +```typescript +const value: components.CompletedDelegatorDetails = /* values here */ +``` + diff --git a/docs/models/components/delegatorsdetails.md b/docs/models/components/delegatorsdetails.md new file mode 100644 index 0000000..7a92a8e --- /dev/null +++ b/docs/models/components/delegatorsdetails.md @@ -0,0 +1,19 @@ +# DelegatorsDetails + +## Example Usage + +```typescript +import { DelegatorsDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: DelegatorsDetails = { + delegatorCount: 7991.59, + totalAmountStaked: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `delegatorCount` | *number* | :heavy_check_mark: | N/A | +| `totalAmountStaked` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/deliveredsourcenotindexedteleportermessage.md b/docs/models/components/deliveredsourcenotindexedteleportermessage.md new file mode 100644 index 0000000..9584289 --- /dev/null +++ b/docs/models/components/deliveredsourcenotindexedteleportermessage.md @@ -0,0 +1,70 @@ +# DeliveredSourceNotIndexedTeleporterMessage + +## Example Usage + +```typescript +import { DeliveredSourceNotIndexedTeleporterMessage } from "@avalabs/avacloud-sdk/models/components"; + +let value: DeliveredSourceNotIndexedTeleporterMessage = { + messageId: "", + teleporterContractAddress: "", + sourceBlockchainId: "", + destinationBlockchainId: "", + sourceEvmChainId: "", + destinationEvmChainId: "", + messageNonce: "", + from: "", + to: "", + messageExecuted: false, + receipts: [ + { + receivedMessageNonce: "", + relayerRewardAddress: "", + }, + ], + receiptDelivered: false, + rewardDetails: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + value: "", + }, + destinationTransaction: { + txHash: "", + timestamp: 1709.86, + gasSpent: "", + rewardRedeemer: "", + delivererAddress: "", + }, + status: "delivered_source_not_indexed", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `messageId` | *string* | :heavy_check_mark: | N/A | +| `teleporterContractAddress` | *string* | :heavy_check_mark: | N/A | +| `sourceBlockchainId` | *string* | :heavy_check_mark: | N/A | +| `destinationBlockchainId` | *string* | :heavy_check_mark: | N/A | +| `sourceEvmChainId` | *string* | :heavy_check_mark: | N/A | +| `destinationEvmChainId` | *string* | :heavy_check_mark: | N/A | +| `messageNonce` | *string* | :heavy_check_mark: | N/A | +| `from` | *string* | :heavy_check_mark: | N/A | +| `to` | *string* | :heavy_check_mark: | N/A | +| `data` | *string* | :heavy_minus_sign: | N/A | +| `messageExecuted` | *boolean* | :heavy_check_mark: | N/A | +| `receipts` | [components.TeleporterReceipt](../../models/components/teleporterreceipt.md)[] | :heavy_check_mark: | N/A | +| `receiptDelivered` | *boolean* | :heavy_check_mark: | N/A | +| `rewardDetails` | [components.TeleporterRewardDetails](../../models/components/teleporterrewarddetails.md) | :heavy_check_mark: | N/A | +| `destinationTransaction` | [components.TeleporterDestinationTransaction](../../models/components/teleporterdestinationtransaction.md) | :heavy_check_mark: | N/A | +| `status` | [components.DeliveredSourceNotIndexedTeleporterMessageStatus](../../models/components/deliveredsourcenotindexedteleportermessagestatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/deliveredsourcenotindexedteleportermessagestatus.md b/docs/models/components/deliveredsourcenotindexedteleportermessagestatus.md new file mode 100644 index 0000000..902aa90 --- /dev/null +++ b/docs/models/components/deliveredsourcenotindexedteleportermessagestatus.md @@ -0,0 +1,15 @@ +# DeliveredSourceNotIndexedTeleporterMessageStatus + +## Example Usage + +```typescript +import { DeliveredSourceNotIndexedTeleporterMessageStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: DeliveredSourceNotIndexedTeleporterMessageStatus = "delivered_source_not_indexed"; +``` + +## Values + +```typescript +"delivered_source_not_indexed" +``` \ No newline at end of file diff --git a/docs/models/components/deliveredteleportermessage.md b/docs/models/components/deliveredteleportermessage.md new file mode 100644 index 0000000..8c5b97c --- /dev/null +++ b/docs/models/components/deliveredteleportermessage.md @@ -0,0 +1,76 @@ +# DeliveredTeleporterMessage + +## Example Usage + +```typescript +import { DeliveredTeleporterMessage } from "@avalabs/avacloud-sdk/models/components"; + +let value: DeliveredTeleporterMessage = { + messageId: "", + teleporterContractAddress: "", + sourceBlockchainId: "", + destinationBlockchainId: "", + sourceEvmChainId: "", + destinationEvmChainId: "", + messageNonce: "", + from: "", + to: "", + messageExecuted: false, + receipts: [ + { + receivedMessageNonce: "", + relayerRewardAddress: "", + }, + ], + receiptDelivered: false, + rewardDetails: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + value: "", + }, + sourceTransaction: { + txHash: "", + timestamp: 1999.96, + gasSpent: "", + }, + destinationTransaction: { + txHash: "", + timestamp: 1794.9, + gasSpent: "", + rewardRedeemer: "", + delivererAddress: "", + }, + status: "delivered", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `messageId` | *string* | :heavy_check_mark: | N/A | +| `teleporterContractAddress` | *string* | :heavy_check_mark: | N/A | +| `sourceBlockchainId` | *string* | :heavy_check_mark: | N/A | +| `destinationBlockchainId` | *string* | :heavy_check_mark: | N/A | +| `sourceEvmChainId` | *string* | :heavy_check_mark: | N/A | +| `destinationEvmChainId` | *string* | :heavy_check_mark: | N/A | +| `messageNonce` | *string* | :heavy_check_mark: | N/A | +| `from` | *string* | :heavy_check_mark: | N/A | +| `to` | *string* | :heavy_check_mark: | N/A | +| `data` | *string* | :heavy_minus_sign: | N/A | +| `messageExecuted` | *boolean* | :heavy_check_mark: | N/A | +| `receipts` | [components.TeleporterReceipt](../../models/components/teleporterreceipt.md)[] | :heavy_check_mark: | N/A | +| `receiptDelivered` | *boolean* | :heavy_check_mark: | N/A | +| `rewardDetails` | [components.TeleporterRewardDetails](../../models/components/teleporterrewarddetails.md) | :heavy_check_mark: | N/A | +| `sourceTransaction` | [components.TeleporterSourceTransaction](../../models/components/teleportersourcetransaction.md) | :heavy_check_mark: | N/A | +| `destinationTransaction` | [components.TeleporterDestinationTransaction](../../models/components/teleporterdestinationtransaction.md) | :heavy_check_mark: | N/A | +| `status` | [components.DeliveredTeleporterMessageStatus](../../models/components/deliveredteleportermessagestatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/deliveredteleportermessagestatus.md b/docs/models/components/deliveredteleportermessagestatus.md new file mode 100644 index 0000000..e6e2802 --- /dev/null +++ b/docs/models/components/deliveredteleportermessagestatus.md @@ -0,0 +1,15 @@ +# DeliveredTeleporterMessageStatus + +## Example Usage + +```typescript +import { DeliveredTeleporterMessageStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: DeliveredTeleporterMessageStatus = "delivered"; +``` + +## Values + +```typescript +"delivered" +``` \ No newline at end of file diff --git a/docs/models/components/enabledfeatures.md b/docs/models/components/enabledfeatures.md new file mode 100644 index 0000000..cc6e357 --- /dev/null +++ b/docs/models/components/enabledfeatures.md @@ -0,0 +1,15 @@ +# EnabledFeatures + +## Example Usage + +```typescript +import { EnabledFeatures } from "@avalabs/avacloud-sdk/models/components"; + +let value: EnabledFeatures = "nftIndexing"; +``` + +## Values + +```typescript +"nftIndexing" | "webhooks" +``` \ No newline at end of file diff --git a/docs/models/components/erc1155contract.md b/docs/models/components/erc1155contract.md new file mode 100644 index 0000000..8e69e27 --- /dev/null +++ b/docs/models/components/erc1155contract.md @@ -0,0 +1,37 @@ +# Erc1155Contract + +## Example Usage + +```typescript +import { Erc1155Contract } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155Contract = { + name: "Wrapped AVAX", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + deploymentDetails: { + txHash: "", + deployerAddress: "", + }, + ercType: "ERC-1155", + symbol: "WAVAX", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | The contract name. | Wrapped AVAX | +| `description` | *string* | :heavy_minus_sign: | N/A | | +| `officialSite` | *string* | :heavy_minus_sign: | N/A | | +| `email` | *string* | :heavy_minus_sign: | N/A | | +| `logoAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `bannerAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `color` | *string* | :heavy_minus_sign: | N/A | | +| `resourceLinks` | [components.ResourceLink](../../models/components/resourcelink.md)[] | :heavy_minus_sign: | N/A | | +| `tags` | *string*[] | :heavy_minus_sign: | N/A | | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `deploymentDetails` | [components.ContractDeploymentDetails](../../models/components/contractdeploymentdetails.md) | :heavy_check_mark: | N/A | | +| `ercType` | [components.Erc1155ContractErcType](../../models/components/erc1155contracterctype.md) | :heavy_check_mark: | N/A | | +| `symbol` | *string* | :heavy_minus_sign: | The contract symbol. | WAVAX | +| `pricingProviders` | [components.PricingProviders](../../models/components/pricingproviders.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc1155contracterctype.md b/docs/models/components/erc1155contracterctype.md new file mode 100644 index 0000000..bae13c1 --- /dev/null +++ b/docs/models/components/erc1155contracterctype.md @@ -0,0 +1,15 @@ +# Erc1155ContractErcType + +## Example Usage + +```typescript +import { Erc1155ContractErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155ContractErcType = "ERC-1155"; +``` + +## Values + +```typescript +"ERC-1155" +``` \ No newline at end of file diff --git a/docs/models/components/erc1155token.md b/docs/models/components/erc1155token.md new file mode 100644 index 0000000..f011bf3 --- /dev/null +++ b/docs/models/components/erc1155token.md @@ -0,0 +1,27 @@ +# Erc1155Token + +## Example Usage + +```typescript +import { Erc1155Token } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155Token = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INDEXED", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `ercType` | [components.Erc1155TokenErcType](../../models/components/erc1155tokenerctype.md) | :heavy_check_mark: | N/A | | +| `tokenId` | *string* | :heavy_check_mark: | N/A | | +| `tokenUri` | *string* | :heavy_check_mark: | N/A | | +| `metadata` | [components.Erc1155TokenMetadata](../../models/components/erc1155tokenmetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc1155tokenbalance.md b/docs/models/components/erc1155tokenbalance.md new file mode 100644 index 0000000..bc6e70d --- /dev/null +++ b/docs/models/components/erc1155tokenbalance.md @@ -0,0 +1,31 @@ +# Erc1155TokenBalance + +## Example Usage + +```typescript +import { Erc1155TokenBalance } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155TokenBalance = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "UNINDEXED", + }, + chainId: "43114", + balance: "2000000000000000000", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `ercType` | [components.Erc1155TokenBalanceErcType](../../models/components/erc1155tokenbalanceerctype.md) | :heavy_check_mark: | N/A | | +| `tokenId` | *string* | :heavy_check_mark: | N/A | | +| `tokenUri` | *string* | :heavy_check_mark: | N/A | | +| `metadata` | [components.Erc1155TokenMetadata](../../models/components/erc1155tokenmetadata.md) | :heavy_check_mark: | N/A | | +| `chainId` | *string* | :heavy_check_mark: | The evm chain id. | 43114 | +| `balance` | *string* | :heavy_check_mark: | The address balance for the token, in units specified by the `decimals` value for the contract. | 2000000000000000000 | \ No newline at end of file diff --git a/docs/models/components/erc1155tokenbalanceerctype.md b/docs/models/components/erc1155tokenbalanceerctype.md new file mode 100644 index 0000000..6157aac --- /dev/null +++ b/docs/models/components/erc1155tokenbalanceerctype.md @@ -0,0 +1,15 @@ +# Erc1155TokenBalanceErcType + +## Example Usage + +```typescript +import { Erc1155TokenBalanceErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155TokenBalanceErcType = "ERC-1155"; +``` + +## Values + +```typescript +"ERC-1155" +``` \ No newline at end of file diff --git a/docs/models/components/erc1155tokenerctype.md b/docs/models/components/erc1155tokenerctype.md new file mode 100644 index 0000000..df1bc4a --- /dev/null +++ b/docs/models/components/erc1155tokenerctype.md @@ -0,0 +1,15 @@ +# Erc1155TokenErcType + +## Example Usage + +```typescript +import { Erc1155TokenErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155TokenErcType = "ERC-1155"; +``` + +## Values + +```typescript +"ERC-1155" +``` \ No newline at end of file diff --git a/docs/models/components/erc1155tokenmetadata.md b/docs/models/components/erc1155tokenmetadata.md new file mode 100644 index 0000000..428ed7e --- /dev/null +++ b/docs/models/components/erc1155tokenmetadata.md @@ -0,0 +1,27 @@ +# Erc1155TokenMetadata + +## Example Usage + +```typescript +import { Erc1155TokenMetadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155TokenMetadata = { + indexStatus: "THROTTLED_TOKEN_URI", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `indexStatus` | [components.NftTokenMetadataStatus](../../models/components/nfttokenmetadatastatus.md) | :heavy_check_mark: | The metadata indexing status of the nft. | +| `metadataLastUpdatedTimestamp` | *number* | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_minus_sign: | N/A | +| `symbol` | *string* | :heavy_minus_sign: | N/A | +| `imageUri` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | +| `animationUri` | *string* | :heavy_minus_sign: | N/A | +| `externalUrl` | *string* | :heavy_minus_sign: | N/A | +| `background` | *string* | :heavy_minus_sign: | N/A | +| `decimals` | *number* | :heavy_minus_sign: | N/A | +| `properties` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/erc1155transfer.md b/docs/models/components/erc1155transfer.md new file mode 100644 index 0000000..06f11f8 --- /dev/null +++ b/docs/models/components/erc1155transfer.md @@ -0,0 +1,55 @@ +# Erc1155Transfer + +## Example Usage + +```typescript +import { Erc1155Transfer } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155Transfer = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + logIndex: 2224.43, + value: "10000000000000000000", + erc1155Token: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INVALID_TOKEN_URI", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `txHash` | *string* | :heavy_check_mark: | The transaction hash identifier. | 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4 | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `logIndex` | *number* | :heavy_check_mark: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | +| `erc1155Token` | [components.Erc1155Token](../../models/components/erc1155token.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc1155transferdetails.md b/docs/models/components/erc1155transferdetails.md new file mode 100644 index 0000000..20d53a5 --- /dev/null +++ b/docs/models/components/erc1155transferdetails.md @@ -0,0 +1,47 @@ +# Erc1155TransferDetails + +## Example Usage + +```typescript +import { Erc1155TransferDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc1155TransferDetails = { + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + logIndex: 2378.93, + value: "10000000000000000000", + erc1155Token: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "UNINDEXED", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `logIndex` | *number* | :heavy_check_mark: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | +| `erc1155Token` | [components.Erc1155Token](../../models/components/erc1155token.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc20contract.md b/docs/models/components/erc20contract.md new file mode 100644 index 0000000..24e6066 --- /dev/null +++ b/docs/models/components/erc20contract.md @@ -0,0 +1,39 @@ +# Erc20Contract + +## Example Usage + +```typescript +import { Erc20Contract } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20Contract = { + name: "Wrapped AVAX", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + deploymentDetails: { + txHash: "", + deployerAddress: "", + }, + ercType: "ERC-20", + symbol: "WAVAX", + decimals: 18, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | The contract name. | Wrapped AVAX | +| `description` | *string* | :heavy_minus_sign: | N/A | | +| `officialSite` | *string* | :heavy_minus_sign: | N/A | | +| `email` | *string* | :heavy_minus_sign: | N/A | | +| `logoAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `bannerAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `color` | *string* | :heavy_minus_sign: | N/A | | +| `resourceLinks` | [components.ResourceLink](../../models/components/resourcelink.md)[] | :heavy_minus_sign: | N/A | | +| `tags` | *string*[] | :heavy_minus_sign: | N/A | | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `deploymentDetails` | [components.ContractDeploymentDetails](../../models/components/contractdeploymentdetails.md) | :heavy_check_mark: | N/A | | +| `ercType` | [components.Erc20ContractErcType](../../models/components/erc20contracterctype.md) | :heavy_check_mark: | N/A | | +| `symbol` | *string* | :heavy_minus_sign: | The contract symbol. | WAVAX | +| `decimals` | *number* | :heavy_check_mark: | The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. | 18 | +| `pricingProviders` | [components.PricingProviders](../../models/components/pricingproviders.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc20contracterctype.md b/docs/models/components/erc20contracterctype.md new file mode 100644 index 0000000..7066b3a --- /dev/null +++ b/docs/models/components/erc20contracterctype.md @@ -0,0 +1,15 @@ +# Erc20ContractErcType + +## Example Usage + +```typescript +import { Erc20ContractErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20ContractErcType = "ERC-20"; +``` + +## Values + +```typescript +"ERC-20" +``` \ No newline at end of file diff --git a/docs/models/components/erc20token.md b/docs/models/components/erc20token.md new file mode 100644 index 0000000..51e3845 --- /dev/null +++ b/docs/models/components/erc20token.md @@ -0,0 +1,33 @@ +# Erc20Token + +## Example Usage + +```typescript +import { Erc20Token } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20Token = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `name` | *string* | :heavy_check_mark: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_check_mark: | The contract symbol. | WAVAX | +| `decimals` | *number* | :heavy_check_mark: | The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. | 18 | +| `logoUri` | *string* | :heavy_minus_sign: | The logo uri for the address. | https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg | +| `ercType` | [components.Erc20TokenErcType](../../models/components/erc20tokenerctype.md) | :heavy_check_mark: | N/A | | +| `price` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The token price, if available. | | \ No newline at end of file diff --git a/docs/models/components/erc20tokenbalance.md b/docs/models/components/erc20tokenbalance.md new file mode 100644 index 0000000..33a6000 --- /dev/null +++ b/docs/models/components/erc20tokenbalance.md @@ -0,0 +1,42 @@ +# Erc20TokenBalance + +## Example Usage + +```typescript +import { Erc20TokenBalance } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20TokenBalance = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + chainId: "43114", + balance: "2000000000000000000", + balanceValue: { + currencyCode: "usd", + value: 42.42, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `name` | *string* | :heavy_check_mark: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_check_mark: | The contract symbol. | WAVAX | +| `decimals` | *number* | :heavy_check_mark: | The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. | 18 | +| `logoUri` | *string* | :heavy_minus_sign: | The logo uri for the address. | https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg | +| `ercType` | [components.Erc20TokenBalanceErcType](../../models/components/erc20tokenbalanceerctype.md) | :heavy_check_mark: | N/A | | +| `price` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The token price, if available. | | +| `chainId` | *string* | :heavy_check_mark: | The evm chain id. | 43114 | +| `balance` | *string* | :heavy_check_mark: | The address balance for the token, in units specified by the `decimals` value for the contract. | 2000000000000000000 | +| `balanceValue` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The monetary value of the balance, if a price is available for the token. | | \ No newline at end of file diff --git a/docs/models/components/erc20tokenbalanceerctype.md b/docs/models/components/erc20tokenbalanceerctype.md new file mode 100644 index 0000000..c9ab064 --- /dev/null +++ b/docs/models/components/erc20tokenbalanceerctype.md @@ -0,0 +1,15 @@ +# Erc20TokenBalanceErcType + +## Example Usage + +```typescript +import { Erc20TokenBalanceErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20TokenBalanceErcType = "ERC-20"; +``` + +## Values + +```typescript +"ERC-20" +``` \ No newline at end of file diff --git a/docs/models/components/erc20tokenerctype.md b/docs/models/components/erc20tokenerctype.md new file mode 100644 index 0000000..1a264be --- /dev/null +++ b/docs/models/components/erc20tokenerctype.md @@ -0,0 +1,15 @@ +# Erc20TokenErcType + +## Example Usage + +```typescript +import { Erc20TokenErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20TokenErcType = "ERC-20"; +``` + +## Values + +```typescript +"ERC-20" +``` \ No newline at end of file diff --git a/docs/models/components/erc20transfer.md b/docs/models/components/erc20transfer.md new file mode 100644 index 0000000..d7751bc --- /dev/null +++ b/docs/models/components/erc20transfer.md @@ -0,0 +1,59 @@ +# Erc20Transfer + +## Example Usage + +```typescript +import { Erc20Transfer } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20Transfer = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + logIndex: 3982.21, + value: "10000000000000000000", + erc20Token: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `txHash` | *string* | :heavy_check_mark: | The transaction hash identifier. | 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4 | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `logIndex` | *number* | :heavy_check_mark: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | +| `erc20Token` | [components.Erc20Token](../../models/components/erc20token.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc20transferdetails.md b/docs/models/components/erc20transferdetails.md new file mode 100644 index 0000000..26bac1e --- /dev/null +++ b/docs/models/components/erc20transferdetails.md @@ -0,0 +1,51 @@ +# Erc20TransferDetails + +## Example Usage + +```typescript +import { Erc20TransferDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc20TransferDetails = { + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + logIndex: 6139.66, + value: "10000000000000000000", + erc20Token: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `logIndex` | *number* | :heavy_check_mark: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | +| `erc20Token` | [components.Erc20Token](../../models/components/erc20token.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc721contract.md b/docs/models/components/erc721contract.md new file mode 100644 index 0000000..fad687e --- /dev/null +++ b/docs/models/components/erc721contract.md @@ -0,0 +1,36 @@ +# Erc721Contract + +## Example Usage + +```typescript +import { Erc721Contract } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721Contract = { + name: "Wrapped AVAX", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + deploymentDetails: { + txHash: "", + deployerAddress: "", + }, + ercType: "ERC-721", + symbol: "WAVAX", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | The contract name. | Wrapped AVAX | +| `description` | *string* | :heavy_minus_sign: | N/A | | +| `officialSite` | *string* | :heavy_minus_sign: | N/A | | +| `email` | *string* | :heavy_minus_sign: | N/A | | +| `logoAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `bannerAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `color` | *string* | :heavy_minus_sign: | N/A | | +| `resourceLinks` | [components.ResourceLink](../../models/components/resourcelink.md)[] | :heavy_minus_sign: | N/A | | +| `tags` | *string*[] | :heavy_minus_sign: | N/A | | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `deploymentDetails` | [components.ContractDeploymentDetails](../../models/components/contractdeploymentdetails.md) | :heavy_check_mark: | N/A | | +| `ercType` | [components.Erc721ContractErcType](../../models/components/erc721contracterctype.md) | :heavy_check_mark: | N/A | | +| `symbol` | *string* | :heavy_minus_sign: | The contract symbol. | WAVAX | \ No newline at end of file diff --git a/docs/models/components/erc721contracterctype.md b/docs/models/components/erc721contracterctype.md new file mode 100644 index 0000000..6c2a53b --- /dev/null +++ b/docs/models/components/erc721contracterctype.md @@ -0,0 +1,15 @@ +# Erc721ContractErcType + +## Example Usage + +```typescript +import { Erc721ContractErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721ContractErcType = "ERC-721"; +``` + +## Values + +```typescript +"ERC-721" +``` \ No newline at end of file diff --git a/docs/models/components/erc721token.md b/docs/models/components/erc721token.md new file mode 100644 index 0000000..8391eb6 --- /dev/null +++ b/docs/models/components/erc721token.md @@ -0,0 +1,33 @@ +# Erc721Token + +## Example Usage + +```typescript +import { Erc721Token } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721Token = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + ercType: "ERC-721", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INVALID_METADATA", + }, + ownerAddress: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `name` | *string* | :heavy_check_mark: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_check_mark: | The contract symbol. | WAVAX | +| `ercType` | [components.ErcType](../../models/components/erctype.md) | :heavy_check_mark: | N/A | | +| `tokenId` | *string* | :heavy_check_mark: | N/A | | +| `tokenUri` | *string* | :heavy_check_mark: | N/A | | +| `metadata` | [components.Erc721TokenMetadata](../../models/components/erc721tokenmetadata.md) | :heavy_check_mark: | N/A | | +| `ownerAddress` | *string* | :heavy_minus_sign: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/components/erc721tokenbalance.md b/docs/models/components/erc721tokenbalance.md new file mode 100644 index 0000000..9a750e0 --- /dev/null +++ b/docs/models/components/erc721tokenbalance.md @@ -0,0 +1,35 @@ +# Erc721TokenBalance + +## Example Usage + +```typescript +import { Erc721TokenBalance } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721TokenBalance = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + ercType: "ERC-721", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INVALID_TOKEN_URI_SCHEME", + }, + ownerAddress: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + chainId: "43114", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `name` | *string* | :heavy_check_mark: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_check_mark: | The contract symbol. | WAVAX | +| `ercType` | [components.Erc721TokenBalanceErcType](../../models/components/erc721tokenbalanceerctype.md) | :heavy_check_mark: | N/A | | +| `tokenId` | *string* | :heavy_check_mark: | N/A | | +| `tokenUri` | *string* | :heavy_check_mark: | N/A | | +| `metadata` | [components.Erc721TokenMetadata](../../models/components/erc721tokenmetadata.md) | :heavy_check_mark: | N/A | | +| `ownerAddress` | *string* | :heavy_minus_sign: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `chainId` | *string* | :heavy_check_mark: | The evm chain id. | 43114 | \ No newline at end of file diff --git a/docs/models/components/erc721tokenbalanceerctype.md b/docs/models/components/erc721tokenbalanceerctype.md new file mode 100644 index 0000000..c3ed21a --- /dev/null +++ b/docs/models/components/erc721tokenbalanceerctype.md @@ -0,0 +1,15 @@ +# Erc721TokenBalanceErcType + +## Example Usage + +```typescript +import { Erc721TokenBalanceErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721TokenBalanceErcType = "ERC-721"; +``` + +## Values + +```typescript +"ERC-721" +``` \ No newline at end of file diff --git a/docs/models/components/erc721tokenmetadata.md b/docs/models/components/erc721tokenmetadata.md new file mode 100644 index 0000000..f8bca07 --- /dev/null +++ b/docs/models/components/erc721tokenmetadata.md @@ -0,0 +1,26 @@ +# Erc721TokenMetadata + +## Example Usage + +```typescript +import { Erc721TokenMetadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721TokenMetadata = { + indexStatus: "INDEXED", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `indexStatus` | [components.NftTokenMetadataStatus](../../models/components/nfttokenmetadatastatus.md) | :heavy_check_mark: | The metadata indexing status of the nft. | +| `metadataLastUpdatedTimestamp` | *number* | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_minus_sign: | N/A | +| `symbol` | *string* | :heavy_minus_sign: | N/A | +| `imageUri` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | +| `animationUri` | *string* | :heavy_minus_sign: | N/A | +| `externalUrl` | *string* | :heavy_minus_sign: | N/A | +| `background` | *string* | :heavy_minus_sign: | N/A | +| `attributes` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/erc721transfer.md b/docs/models/components/erc721transfer.md new file mode 100644 index 0000000..35f8e85 --- /dev/null +++ b/docs/models/components/erc721transfer.md @@ -0,0 +1,56 @@ +# Erc721Transfer + +## Example Usage + +```typescript +import { Erc721Transfer } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721Transfer = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + logIndex: 2123.9, + erc721Token: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + ercType: "ERC-721", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INVALID_TOKEN_URI", + }, + ownerAddress: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `txHash` | *string* | :heavy_check_mark: | The transaction hash identifier. | 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4 | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `logIndex` | *number* | :heavy_check_mark: | N/A | | +| `erc721Token` | [components.Erc721Token](../../models/components/erc721token.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/erc721transferdetails.md b/docs/models/components/erc721transferdetails.md new file mode 100644 index 0000000..b451e14 --- /dev/null +++ b/docs/models/components/erc721transferdetails.md @@ -0,0 +1,48 @@ +# Erc721TransferDetails + +## Example Usage + +```typescript +import { Erc721TransferDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: Erc721TransferDetails = { + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + logIndex: 9342.14, + erc721Token: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + ercType: "ERC-721", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INVALID_TOKEN_URI", + }, + ownerAddress: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | +| `logIndex` | *number* | :heavy_check_mark: | N/A | +| `erc721Token` | [components.Erc721Token](../../models/components/erc721token.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/erctype.md b/docs/models/components/erctype.md new file mode 100644 index 0000000..7047267 --- /dev/null +++ b/docs/models/components/erctype.md @@ -0,0 +1,15 @@ +# ErcType + +## Example Usage + +```typescript +import { ErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: ErcType = "ERC-721"; +``` + +## Values + +```typescript +"ERC-721" +``` \ No newline at end of file diff --git a/docs/models/components/eventtype.md b/docs/models/components/eventtype.md new file mode 100644 index 0000000..1891ec8 --- /dev/null +++ b/docs/models/components/eventtype.md @@ -0,0 +1,15 @@ +# EventType + +## Example Usage + +```typescript +import { EventType } from "@avalabs/avacloud-sdk/models/components"; + +let value: EventType = "address_activity"; +``` + +## Values + +```typescript +"address_activity" +``` \ No newline at end of file diff --git a/docs/models/components/evmblock.md b/docs/models/components/evmblock.md new file mode 100644 index 0000000..0793c97 --- /dev/null +++ b/docs/models/components/evmblock.md @@ -0,0 +1,37 @@ +# EvmBlock + +## Example Usage + +```typescript +import { EvmBlock } from "@avalabs/avacloud-sdk/models/components"; + +let value: EvmBlock = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txCount: 318.38, + baseFee: "", + gasUsed: "", + gasLimit: "", + gasCost: "", + parentHash: "", + feesSpent: "", + cumulativeTransactions: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `txCount` | *number* | :heavy_check_mark: | The number of evm transactions in the block. | | +| `baseFee` | *string* | :heavy_check_mark: | The base gas fee for a transaction to be included in the block. | | +| `gasUsed` | *string* | :heavy_check_mark: | The gas used for transactions in the block. | | +| `gasLimit` | *string* | :heavy_check_mark: | The total gas limit set for transactions in the block. | | +| `gasCost` | *string* | :heavy_check_mark: | N/A | | +| `parentHash` | *string* | :heavy_check_mark: | The hash of the parent block. | | +| `feesSpent` | *string* | :heavy_check_mark: | The amount of fees spent/burned for transactions in the block. | | +| `cumulativeTransactions` | *string* | :heavy_check_mark: | The cumulative number of transactions for the chain including this block. | | \ No newline at end of file diff --git a/docs/models/components/evminput.md b/docs/models/components/evminput.md new file mode 100644 index 0000000..0c91a84 --- /dev/null +++ b/docs/models/components/evminput.md @@ -0,0 +1,34 @@ +# EVMInput + +## Example Usage + +```typescript +import { EVMInput } from "@avalabs/avacloud-sdk/models/components"; + +let value: EVMInput = { + fromAddress: "0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c", + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `fromAddress` | *string* | :heavy_check_mark: | EVM address from which the asset is exported in ExportTx. | 0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c | +| `asset` | [components.AssetAmount](../../models/components/assetamount.md) | :heavy_check_mark: | AssetAmount details for the asset being transferred. | | +| `credentials` | [components.UtxoCredential](../../models/components/utxocredential.md)[] | :heavy_check_mark: | Credentials that signed this transaction. | | \ No newline at end of file diff --git a/docs/models/components/evmnetworkoptions.md b/docs/models/components/evmnetworkoptions.md new file mode 100644 index 0000000..d42bd0c --- /dev/null +++ b/docs/models/components/evmnetworkoptions.md @@ -0,0 +1,19 @@ +# EvmNetworkOptions + +## Example Usage + +```typescript +import { EvmNetworkOptions } from "@avalabs/avacloud-sdk/models/components"; + +let value: EvmNetworkOptions = { + addresses: [""], + includeChains: ["43114"], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `addresses` | *string*[] | :heavy_check_mark: | N/A | | +| `includeChains` | *string*[] | :heavy_check_mark: | N/A | [
"43114"
] | \ No newline at end of file diff --git a/docs/models/components/evmoperationtype.md b/docs/models/components/evmoperationtype.md new file mode 100644 index 0000000..3844af7 --- /dev/null +++ b/docs/models/components/evmoperationtype.md @@ -0,0 +1,15 @@ +# EVMOperationType + +## Example Usage + +```typescript +import { EVMOperationType } from "@avalabs/avacloud-sdk/models/components"; + +let value: EVMOperationType = "TRANSACTION_EXPORT_EVM"; +``` + +## Values + +```typescript +"TRANSACTION_EXPORT_EVM" +``` \ No newline at end of file diff --git a/docs/models/components/evmoutput.md b/docs/models/components/evmoutput.md new file mode 100644 index 0000000..b519c8a --- /dev/null +++ b/docs/models/components/evmoutput.md @@ -0,0 +1,26 @@ +# EVMOutput + +## Example Usage + +```typescript +import { EVMOutput } from "@avalabs/avacloud-sdk/models/components"; + +let value: EVMOutput = { + toAddress: "0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c", + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `toAddress` | *string* | :heavy_check_mark: | EVM address to which the asset is imported in ImportTx | 0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c | +| `asset` | [components.AssetAmount](../../models/components/assetamount.md) | :heavy_check_mark: | AssetAmount details for the asset being transferred. | | \ No newline at end of file diff --git a/docs/models/components/fullnativetransactiondetails.md b/docs/models/components/fullnativetransactiondetails.md new file mode 100644 index 0000000..3135f5a --- /dev/null +++ b/docs/models/components/fullnativetransactiondetails.md @@ -0,0 +1,69 @@ +# FullNativeTransactionDetails + +## Example Usage + +```typescript +import { FullNativeTransactionDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: FullNativeTransactionDetails = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + blockIndex: 0, + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + txStatus: "1", + txType: 1, + gasLimit: "51373", + gasUsed: "51373", + gasPrice: "470000000000", + nonce: "1", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + method: { + callType: "CONTRACT_CALL", + methodHash: "0xa9059cbb", + methodName: "transfer(address,uint256)", + }, + value: "10000000000000000000", + input: "", + baseFeePerGas: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `blockIndex` | *number* | :heavy_check_mark: | The index at which the transaction occured in the block (0-indexed). | 0 | +| `txHash` | *string* | :heavy_check_mark: | The transaction hash identifier. | 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4 | +| `txStatus` | *string* | :heavy_check_mark: | The transaction status, which is either 0 (failed) or 1 (successful). | 1 | +| `txType` | *number* | :heavy_check_mark: | The transaction type. | 1 | +| `gasLimit` | *string* | :heavy_check_mark: | The gas limit set for the transaction. | 51373 | +| `gasUsed` | *string* | :heavy_check_mark: | The amount of gas used. | 51373 | +| `gasPrice` | *string* | :heavy_check_mark: | The gas price denominated by the number of decimals of the native token. | 470000000000 | +| `nonce` | *string* | :heavy_check_mark: | The nonce used by the sender of the transaction. | 1 | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `method` | [components.Method](../../models/components/method.md) | :heavy_minus_sign: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | +| `input` | *string* | :heavy_check_mark: | The data sent for the transaction. | | +| `baseFeePerGas` | *string* | :heavy_check_mark: | N/A | | +| `maxFeePerGas` | *string* | :heavy_minus_sign: | N/A | | +| `maxPriorityFeePerGas` | *string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/getchainresponse.md b/docs/models/components/getchainresponse.md new file mode 100644 index 0000000..6980960 --- /dev/null +++ b/docs/models/components/getchainresponse.md @@ -0,0 +1,46 @@ +# GetChainResponse + +## Example Usage + +```typescript +import { GetChainResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: GetChainResponse = { + chainId: "", + status: "UNAVAILABLE", + chainName: "", + description: "Implemented mobile circuit", + vmName: "BITCOIN", + rpcUrl: "", + isTestnet: false, + networkToken: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_check_mark: | N/A | +| `status` | [components.ChainStatus](../../models/components/chainstatus.md) | :heavy_check_mark: | Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors. | +| `chainName` | *string* | :heavy_check_mark: | N/A | +| `description` | *string* | :heavy_check_mark: | N/A | +| `platformChainId` | *string* | :heavy_minus_sign: | N/A | +| `subnetId` | *string* | :heavy_minus_sign: | N/A | +| `vmId` | *string* | :heavy_minus_sign: | N/A | +| `vmName` | [components.VmName](../../models/components/vmname.md) | :heavy_check_mark: | N/A | +| `explorerUrl` | *string* | :heavy_minus_sign: | N/A | +| `rpcUrl` | *string* | :heavy_check_mark: | N/A | +| `wsUrl` | *string* | :heavy_minus_sign: | N/A | +| `isTestnet` | *boolean* | :heavy_check_mark: | N/A | +| `utilityAddresses` | [components.UtilityAddresses](../../models/components/utilityaddresses.md) | :heavy_minus_sign: | N/A | +| `networkToken` | [components.NetworkToken](../../models/components/networktoken.md) | :heavy_check_mark: | N/A | +| `chainLogoUri` | *string* | :heavy_minus_sign: | N/A | +| `private` | *boolean* | :heavy_minus_sign: | N/A | +| `enabledFeatures` | [components.GetChainResponseEnabledFeatures](../../models/components/getchainresponseenabledfeatures.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/getchainresponseenabledfeatures.md b/docs/models/components/getchainresponseenabledfeatures.md new file mode 100644 index 0000000..c70394e --- /dev/null +++ b/docs/models/components/getchainresponseenabledfeatures.md @@ -0,0 +1,15 @@ +# GetChainResponseEnabledFeatures + +## Example Usage + +```typescript +import { GetChainResponseEnabledFeatures } from "@avalabs/avacloud-sdk/models/components"; + +let value: GetChainResponseEnabledFeatures = "webhooks"; +``` + +## Values + +```typescript +"nftIndexing" | "webhooks" +``` \ No newline at end of file diff --git a/docs/models/components/getevmblockresponse.md b/docs/models/components/getevmblockresponse.md new file mode 100644 index 0000000..bf04e13 --- /dev/null +++ b/docs/models/components/getevmblockresponse.md @@ -0,0 +1,37 @@ +# GetEvmBlockResponse + +## Example Usage + +```typescript +import { GetEvmBlockResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: GetEvmBlockResponse = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txCount: 7836.45, + baseFee: "", + gasUsed: "", + gasLimit: "", + gasCost: "", + parentHash: "", + feesSpent: "", + cumulativeTransactions: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `txCount` | *number* | :heavy_check_mark: | The number of evm transactions in the block. | | +| `baseFee` | *string* | :heavy_check_mark: | The base gas fee for a transaction to be included in the block. | | +| `gasUsed` | *string* | :heavy_check_mark: | The gas used for transactions in the block. | | +| `gasLimit` | *string* | :heavy_check_mark: | The total gas limit set for transactions in the block. | | +| `gasCost` | *string* | :heavy_check_mark: | N/A | | +| `parentHash` | *string* | :heavy_check_mark: | The hash of the parent block. | | +| `feesSpent` | *string* | :heavy_check_mark: | The amount of fees spent/burned for transactions in the block. | | +| `cumulativeTransactions` | *string* | :heavy_check_mark: | The cumulative number of transactions for the chain including this block. | | \ No newline at end of file diff --git a/docs/models/components/getnativebalanceresponse.md b/docs/models/components/getnativebalanceresponse.md new file mode 100644 index 0000000..3fc473a --- /dev/null +++ b/docs/models/components/getnativebalanceresponse.md @@ -0,0 +1,33 @@ +# GetNativeBalanceResponse + +## Example Usage + +```typescript +import { GetNativeBalanceResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: GetNativeBalanceResponse = { + nativeTokenBalance: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + chainId: "43114", + price: { + currencyCode: "usd", + value: 42.42, + }, + balance: "2000000000000000000", + balanceValue: { + currencyCode: "usd", + value: 42.42, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `nativeTokenBalance` | [components.NativeTokenBalance](../../models/components/nativetokenbalance.md) | :heavy_check_mark: | The native token balance for the address. | \ No newline at end of file diff --git a/docs/models/components/getnetworkdetailsresponse.md b/docs/models/components/getnetworkdetailsresponse.md new file mode 100644 index 0000000..170efc8 --- /dev/null +++ b/docs/models/components/getnetworkdetailsresponse.md @@ -0,0 +1,34 @@ +# GetNetworkDetailsResponse + +## Example Usage + +```typescript +import { GetNetworkDetailsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: GetNetworkDetailsResponse = { + validatorDetails: { + validatorCount: 8700.88, + totalAmountStaked: "", + estimatedAnnualStakingReward: "", + stakingDistributionByVersion: [ + { + version: "", + amountStaked: "", + validatorCount: 9786.19, + }, + ], + stakingRatio: "", + }, + delegatorDetails: { + delegatorCount: 4736.08, + totalAmountStaked: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `validatorDetails` | [components.ValidatorsDetails](../../models/components/validatorsdetails.md) | :heavy_check_mark: | N/A | +| `delegatorDetails` | [components.DelegatorsDetails](../../models/components/delegatorsdetails.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/getprimarynetworkblockresponse.md b/docs/models/components/getprimarynetworkblockresponse.md new file mode 100644 index 0000000..4e5c809 --- /dev/null +++ b/docs/models/components/getprimarynetworkblockresponse.md @@ -0,0 +1,33 @@ +# GetPrimaryNetworkBlockResponse + +## Example Usage + +```typescript +import { GetPrimaryNetworkBlockResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: GetPrimaryNetworkBlockResponse = { + blockNumber: "", + blockHash: "", + parentHash: "", + blockTimestamp: 5812.73, + blockType: "", + txCount: 3132.18, + transactions: [""], + blockSizeBytes: 8817.36, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_check_mark: | N/A | +| `blockHash` | *string* | :heavy_check_mark: | N/A | +| `parentHash` | *string* | :heavy_check_mark: | N/A | +| `blockTimestamp` | *number* | :heavy_check_mark: | N/A | +| `blockType` | *string* | :heavy_check_mark: | N/A | +| `txCount` | *number* | :heavy_check_mark: | N/A | +| `transactions` | *string*[] | :heavy_check_mark: | N/A | +| `blockSizeBytes` | *number* | :heavy_check_mark: | N/A | +| `currentSupply` | *string* | :heavy_minus_sign: | N/A | +| `proposerDetails` | [components.ProposerDetails](../../models/components/proposerdetails.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/gettransactionresponse.md b/docs/models/components/gettransactionresponse.md new file mode 100644 index 0000000..24effc3 --- /dev/null +++ b/docs/models/components/gettransactionresponse.md @@ -0,0 +1,79 @@ +# GetTransactionResponse + +## Example Usage + +```typescript +import { GetTransactionResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: GetTransactionResponse = { + erc20Transfers: [], + erc721Transfers: [], + erc1155Transfers: [], + internalTransactions: [], + networkTokenDetails: { + networkToken: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + }, + currentPrice: { + currencyCode: "usd", + value: 42.42, + }, + historicalPrice: { + currencyCode: "usd", + value: 42.42, + }, + }, + nativeTransaction: { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + blockIndex: 0, + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + txStatus: "1", + txType: 1, + gasLimit: "51373", + gasUsed: "51373", + gasPrice: "470000000000", + nonce: "1", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + method: { + callType: "NATIVE_TRANSFER", + methodHash: "0xa9059cbb", + methodName: "transfer(address,uint256)", + }, + value: "10000000000000000000", + input: "", + baseFeePerGas: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `erc20Transfers` | [components.Erc20TransferDetails](../../models/components/erc20transferdetails.md)[] | :heavy_minus_sign: | The list of ERC-20 transfers. | +| `erc721Transfers` | [components.Erc721TransferDetails](../../models/components/erc721transferdetails.md)[] | :heavy_minus_sign: | The list of ERC-721 transfers. | +| `erc1155Transfers` | [components.Erc1155TransferDetails](../../models/components/erc1155transferdetails.md)[] | :heavy_minus_sign: | The list of ERC-1155 transfers. | +| `internalTransactions` | [components.InternalTransactionDetails](../../models/components/internaltransactiondetails.md)[] | :heavy_minus_sign: | The list of internal transactions. Note that this list only includes CALL and CALLCODE internal transactions that had a non-zero value and CREATE/CREATE2 calls. Use a client provider to recieve a full debug trace of the transaction. | +| `networkTokenDetails` | [components.NetworkTokenDetails](../../models/components/networktokendetails.md) | :heavy_check_mark: | N/A | +| `nativeTransaction` | [components.FullNativeTransactionDetails](../../models/components/fullnativetransactiondetails.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/glacierapifeature.md b/docs/models/components/glacierapifeature.md new file mode 100644 index 0000000..2f0885a --- /dev/null +++ b/docs/models/components/glacierapifeature.md @@ -0,0 +1,15 @@ +# GlacierApiFeature + +## Example Usage + +```typescript +import { GlacierApiFeature } from "@avalabs/avacloud-sdk/models/components"; + +let value: GlacierApiFeature = "nftIndexing"; +``` + +## Values + +```typescript +"nftIndexing" | "webhooks" +``` \ No newline at end of file diff --git a/docs/models/components/glacierlistchainsresponse.md b/docs/models/components/glacierlistchainsresponse.md new file mode 100644 index 0000000..15d53fa --- /dev/null +++ b/docs/models/components/glacierlistchainsresponse.md @@ -0,0 +1,34 @@ +# GlacierListChainsResponse + +## Example Usage + +```typescript +import { GlacierListChainsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: GlacierListChainsResponse = { + chains: [ + { + chainId: "", + status: "OK", + chainName: "", + description: "Networked well-modulated contingency", + vmName: "ETHEREUM", + rpcUrl: "", + isTestnet: false, + networkToken: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + }, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `chains` | [components.ChainInfo](../../models/components/chaininfo.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/globalparamnetwork.md b/docs/models/components/globalparamnetwork.md new file mode 100644 index 0000000..7c6da05 --- /dev/null +++ b/docs/models/components/globalparamnetwork.md @@ -0,0 +1,15 @@ +# GlobalParamNetwork + +## Example Usage + +```typescript +import { GlobalParamNetwork } from "@avalabs/avacloud-sdk/models/components"; + +let value: GlobalParamNetwork = "mainnet"; +``` + +## Values + +```typescript +"mainnet" | "fuji" +``` \ No newline at end of file diff --git a/docs/models/components/groupedby.md b/docs/models/components/groupedby.md new file mode 100644 index 0000000..56b8f00 --- /dev/null +++ b/docs/models/components/groupedby.md @@ -0,0 +1,17 @@ +# GroupedBy + +Column name used for data aggregation + +## Example Usage + +```typescript +import { GroupedBy } from "@avalabs/avacloud-sdk/models/components"; + +let value: GroupedBy = "None"; +``` + +## Values + +```typescript +"requestPath" | "responseCode" | "chainId" | "apiKeyId" | "requestType" | "None" +``` \ No newline at end of file diff --git a/docs/models/components/groupvalue.md b/docs/models/components/groupvalue.md new file mode 100644 index 0000000..8390e6a --- /dev/null +++ b/docs/models/components/groupvalue.md @@ -0,0 +1,26 @@ +# GroupValue + +The value of the column used for data aggregation + +## Example Usage + +```typescript +import { GroupValue } from "@avalabs/avacloud-sdk/models/components"; + +let value: GroupValue = 3209.97; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `number` + +```typescript +const value: number = /* values here */ +``` + diff --git a/docs/models/components/historicalreward.md b/docs/models/components/historicalreward.md new file mode 100644 index 0000000..ef9ab7e --- /dev/null +++ b/docs/models/components/historicalreward.md @@ -0,0 +1,48 @@ +# HistoricalReward + +## Example Usage + +```typescript +import { HistoricalReward } from "@avalabs/avacloud-sdk/models/components"; + +let value: HistoricalReward = { + addresses: ["avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"], + txHash: "", + amountStaked: "", + nodeId: "", + startTimestamp: 3185.69, + endTimestamp: 93.56, + rewardType: "VALIDATOR_FEE", + utxoId: "", + outputIndex: 8423.42, + reward: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + historicalPrice: { + currencyCode: "usd", + value: 42.42, + }, + }, + rewardTxHash: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `addresses` | *string*[] | :heavy_check_mark: | An array of P-Chain wallet addresses. | [
"avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"
] | +| `txHash` | *string* | :heavy_check_mark: | N/A | | +| `amountStaked` | *string* | :heavy_check_mark: | N/A | | +| `nodeId` | *string* | :heavy_check_mark: | N/A | | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | | +| `rewardType` | [components.RewardType](../../models/components/rewardtype.md) | :heavy_check_mark: | N/A | | +| `utxoId` | *string* | :heavy_check_mark: | N/A | | +| `outputIndex` | *number* | :heavy_check_mark: | N/A | | +| `reward` | [components.AssetWithPriceInfo](../../models/components/assetwithpriceinfo.md) | :heavy_check_mark: | N/A | | +| `rewardTxHash` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/imageasset.md b/docs/models/components/imageasset.md new file mode 100644 index 0000000..cd7372a --- /dev/null +++ b/docs/models/components/imageasset.md @@ -0,0 +1,16 @@ +# ImageAsset + +## Example Usage + +```typescript +import { ImageAsset } from "@avalabs/avacloud-sdk/models/components"; + +let value: ImageAsset = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `assetId` | *string* | :heavy_minus_sign: | N/A | +| `imageUri` | *string* | :heavy_minus_sign: | OUTPUT ONLY | \ No newline at end of file diff --git a/docs/models/components/includechains.md b/docs/models/components/includechains.md new file mode 100644 index 0000000..babc7b1 --- /dev/null +++ b/docs/models/components/includechains.md @@ -0,0 +1,15 @@ +# IncludeChains + +## Example Usage + +```typescript +import { IncludeChains } from "@avalabs/avacloud-sdk/models/components"; + +let value: IncludeChains = "11111111111111111111111111111111LpoYY"; +``` + +## Values + +```typescript +"11111111111111111111111111111111LpoYY" | "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM" | "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm" | "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5" | "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp" | "p-chain" | "x-chain" | "c-chain" +``` \ No newline at end of file diff --git a/docs/models/components/internaltransaction.md b/docs/models/components/internaltransaction.md new file mode 100644 index 0000000..bfe11db --- /dev/null +++ b/docs/models/components/internaltransaction.md @@ -0,0 +1,51 @@ +# InternalTransaction + +## Example Usage + +```typescript +import { InternalTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: InternalTransaction = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + internalTxType: "CREATE2", + value: "10000000000000000000", + isReverted: false, + gasUsed: "", + gasLimit: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `txHash` | *string* | :heavy_check_mark: | The transaction hash identifier. | 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4 | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `internalTxType` | [components.InternalTransactionOpCall](../../models/components/internaltransactionopcall.md) | :heavy_check_mark: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | +| `isReverted` | *boolean* | :heavy_check_mark: | True if the internal transaction was reverted. | | +| `gasUsed` | *string* | :heavy_check_mark: | N/A | | +| `gasLimit` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/internaltransactiondetails.md b/docs/models/components/internaltransactiondetails.md new file mode 100644 index 0000000..4844b0e --- /dev/null +++ b/docs/models/components/internaltransactiondetails.md @@ -0,0 +1,43 @@ +# InternalTransactionDetails + +## Example Usage + +```typescript +import { InternalTransactionDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: InternalTransactionDetails = { + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + internalTxType: "CALLCODE", + value: "10000000000000000000", + isReverted: false, + gasUsed: "", + gasLimit: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `internalTxType` | [components.InternalTransactionOpCall](../../models/components/internaltransactionopcall.md) | :heavy_check_mark: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | +| `isReverted` | *boolean* | :heavy_check_mark: | True if the internal transaction was reverted. | | +| `gasUsed` | *string* | :heavy_check_mark: | N/A | | +| `gasLimit` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/internaltransactionopcall.md b/docs/models/components/internaltransactionopcall.md new file mode 100644 index 0000000..c801168 --- /dev/null +++ b/docs/models/components/internaltransactionopcall.md @@ -0,0 +1,15 @@ +# InternalTransactionOpCall + +## Example Usage + +```typescript +import { InternalTransactionOpCall } from "@avalabs/avacloud-sdk/models/components"; + +let value: InternalTransactionOpCall = "CALLCODE"; +``` + +## Values + +```typescript +"UNKNOWN" | "CALL" | "CREATE" | "CREATE2" | "CALLCODE" | "DELEGATECALL" | "STATICCALL" +``` \ No newline at end of file diff --git a/docs/models/components/listblockchainsresponse.md b/docs/models/components/listblockchainsresponse.md new file mode 100644 index 0000000..ce7b2a0 --- /dev/null +++ b/docs/models/components/listblockchainsresponse.md @@ -0,0 +1,27 @@ +# ListBlockchainsResponse + +## Example Usage + +```typescript +import { ListBlockchainsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListBlockchainsResponse = { + blockchains: [ + { + createBlockTimestamp: 7805.29, + createBlockNumber: "", + blockchainId: "", + vmId: "", + subnetId: "", + blockchainName: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `blockchains` | [components.Blockchain](../../models/components/blockchain.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listcchainatomicbalancesresponse.md b/docs/models/components/listcchainatomicbalancesresponse.md new file mode 100644 index 0000000..31395e5 --- /dev/null +++ b/docs/models/components/listcchainatomicbalancesresponse.md @@ -0,0 +1,47 @@ +# ListCChainAtomicBalancesResponse + +## Example Usage + +```typescript +import { ListCChainAtomicBalancesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListCChainAtomicBalancesResponse = { + balances: { + atomicMemoryUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + atomicMemoryLocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + }, + chainInfo: { + chainName: "x-chain", + network: "mainnet", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `balances` | [components.CChainAtomicBalances](../../models/components/cchainatomicbalances.md) | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listcchainatomictransactionsresponse.md b/docs/models/components/listcchainatomictransactionsresponse.md new file mode 100644 index 0000000..b5da7c8 --- /dev/null +++ b/docs/models/components/listcchainatomictransactionsresponse.md @@ -0,0 +1,23 @@ +# ListCChainAtomicTransactionsResponse + +## Example Usage + +```typescript +import { ListCChainAtomicTransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListCChainAtomicTransactionsResponse = { + transactions: [], + chainInfo: { + chainName: "x-chain", + network: "fuji", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | *components.ListCChainAtomicTransactionsResponseTransactions*[] | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listcchainatomictransactionsresponsetransactions.md b/docs/models/components/listcchainatomictransactionsresponsetransactions.md new file mode 100644 index 0000000..c3762e1 --- /dev/null +++ b/docs/models/components/listcchainatomictransactionsresponsetransactions.md @@ -0,0 +1,104 @@ +# ListCChainAtomicTransactionsResponseTransactions + +## Example Usage + +```typescript +import { ListCChainAtomicTransactionsResponseTransactions } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListCChainAtomicTransactionsResponseTransactions = { + txHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + blockHeight: 1005, + blockHash: "0x57a5cb7704561d1d59bd563b6421021b7563960c05ba3ae0e36fc36917c742ee", + timestamp: 1600762738, + memo: "0x546865204176616c616e6368652050726f6a656374", + amountUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + ], + amountCreated: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + txType: "ExportTx", + evmInputs: [ + { + fromAddress: "0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c", + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + }, + ], + emittedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], +}; +``` + +## Supported Types + +### `components.CChainExportTransaction` + +```typescript +const value: components.CChainExportTransaction = /* values here */ +``` + +### `components.CChainImportTransaction` + +```typescript +const value: components.CChainImportTransaction = /* values here */ +``` + diff --git a/docs/models/components/listcollectiblebalancesresponse.md b/docs/models/components/listcollectiblebalancesresponse.md new file mode 100644 index 0000000..ab46f63 --- /dev/null +++ b/docs/models/components/listcollectiblebalancesresponse.md @@ -0,0 +1,18 @@ +# ListCollectibleBalancesResponse + +## Example Usage + +```typescript +import { ListCollectibleBalancesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListCollectibleBalancesResponse = { + collectibleBalances: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `collectibleBalances` | *components.CollectibleBalances*[] | :heavy_check_mark: | The list of ERC-721 and ERC-1155 token balances for the address. | \ No newline at end of file diff --git a/docs/models/components/listcontractsresponse.md b/docs/models/components/listcontractsresponse.md new file mode 100644 index 0000000..4c4cc7b --- /dev/null +++ b/docs/models/components/listcontractsresponse.md @@ -0,0 +1,18 @@ +# ListContractsResponse + +## Example Usage + +```typescript +import { ListContractsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListContractsResponse = { + contracts: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `contracts` | *components.Contracts*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listdelegatordetailsresponse.md b/docs/models/components/listdelegatordetailsresponse.md new file mode 100644 index 0000000..2a0430e --- /dev/null +++ b/docs/models/components/listdelegatordetailsresponse.md @@ -0,0 +1,31 @@ +# ListDelegatorDetailsResponse + +## Example Usage + +```typescript +import { ListDelegatorDetailsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListDelegatorDetailsResponse = { + delegators: [ + { + txHash: "", + nodeId: "", + rewardAddresses: [""], + amountDelegated: "", + delegationFee: "", + startTimestamp: 6976.31, + endTimestamp: 992.8, + grossReward: "", + netReward: "", + delegationStatus: "completed", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `delegators` | *components.Delegators*[] | :heavy_check_mark: | The list of Delegator Details. | \ No newline at end of file diff --git a/docs/models/components/listerc1155balancesresponse.md b/docs/models/components/listerc1155balancesresponse.md new file mode 100644 index 0000000..ba9b86d --- /dev/null +++ b/docs/models/components/listerc1155balancesresponse.md @@ -0,0 +1,30 @@ +# ListErc1155BalancesResponse + +## Example Usage + +```typescript +import { ListErc1155BalancesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListErc1155BalancesResponse = { + erc1155TokenBalances: [ + { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "UNINDEXED", + }, + chainId: "43114", + balance: "2000000000000000000", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `erc1155TokenBalances` | [components.Erc1155TokenBalance](../../models/components/erc1155tokenbalance.md)[] | :heavy_check_mark: | The list of ERC-1155 token balances for the address. | \ No newline at end of file diff --git a/docs/models/components/listerc1155transactionsresponse.md b/docs/models/components/listerc1155transactionsresponse.md new file mode 100644 index 0000000..895e5e6 --- /dev/null +++ b/docs/models/components/listerc1155transactionsresponse.md @@ -0,0 +1,18 @@ +# ListErc1155TransactionsResponse + +## Example Usage + +```typescript +import { ListErc1155TransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListErc1155TransactionsResponse = { + transactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | [components.Erc1155Transfer](../../models/components/erc1155transfer.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listerc20balancesresponse.md b/docs/models/components/listerc20balancesresponse.md new file mode 100644 index 0000000..6cbdb51 --- /dev/null +++ b/docs/models/components/listerc20balancesresponse.md @@ -0,0 +1,18 @@ +# ListErc20BalancesResponse + +## Example Usage + +```typescript +import { ListErc20BalancesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListErc20BalancesResponse = { + erc20TokenBalances: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `erc20TokenBalances` | [components.Erc20TokenBalance](../../models/components/erc20tokenbalance.md)[] | :heavy_check_mark: | The list of ERC-20 token balances for the address. | \ No newline at end of file diff --git a/docs/models/components/listerc20transactionsresponse.md b/docs/models/components/listerc20transactionsresponse.md new file mode 100644 index 0000000..31650b3 --- /dev/null +++ b/docs/models/components/listerc20transactionsresponse.md @@ -0,0 +1,18 @@ +# ListErc20TransactionsResponse + +## Example Usage + +```typescript +import { ListErc20TransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListErc20TransactionsResponse = { + transactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | [components.Erc20Transfer](../../models/components/erc20transfer.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listerc721balancesresponse.md b/docs/models/components/listerc721balancesresponse.md new file mode 100644 index 0000000..614f49c --- /dev/null +++ b/docs/models/components/listerc721balancesresponse.md @@ -0,0 +1,32 @@ +# ListErc721BalancesResponse + +## Example Usage + +```typescript +import { ListErc721BalancesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListErc721BalancesResponse = { + erc721TokenBalances: [ + { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + ercType: "ERC-721", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INDEXED", + }, + ownerAddress: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + chainId: "43114", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `erc721TokenBalances` | [components.Erc721TokenBalance](../../models/components/erc721tokenbalance.md)[] | :heavy_check_mark: | The list of ERC-721 token balances for the address. | \ No newline at end of file diff --git a/docs/models/components/listerc721transactionsresponse.md b/docs/models/components/listerc721transactionsresponse.md new file mode 100644 index 0000000..8851528 --- /dev/null +++ b/docs/models/components/listerc721transactionsresponse.md @@ -0,0 +1,18 @@ +# ListErc721TransactionsResponse + +## Example Usage + +```typescript +import { ListErc721TransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListErc721TransactionsResponse = { + transactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | [components.Erc721Transfer](../../models/components/erc721transfer.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listevmblocksresponse.md b/docs/models/components/listevmblocksresponse.md new file mode 100644 index 0000000..91330ff --- /dev/null +++ b/docs/models/components/listevmblocksresponse.md @@ -0,0 +1,32 @@ +# ListEvmBlocksResponse + +## Example Usage + +```typescript +import { ListEvmBlocksResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListEvmBlocksResponse = { + blocks: [ + { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txCount: 5966.56, + baseFee: "", + gasUsed: "", + gasLimit: "", + gasCost: "", + parentHash: "", + feesSpent: "", + cumulativeTransactions: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `blocks` | [components.EvmBlock](../../models/components/evmblock.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listhistoricalrewardsresponse.md b/docs/models/components/listhistoricalrewardsresponse.md new file mode 100644 index 0000000..eed065f --- /dev/null +++ b/docs/models/components/listhistoricalrewardsresponse.md @@ -0,0 +1,43 @@ +# ListHistoricalRewardsResponse + +## Example Usage + +```typescript +import { ListHistoricalRewardsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListHistoricalRewardsResponse = { + historicalRewards: [ + { + addresses: ["avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"], + txHash: "", + amountStaked: "", + nodeId: "", + startTimestamp: 9211.58, + endTimestamp: 5759.47, + rewardType: "VALIDATOR", + utxoId: "", + outputIndex: 9292.97, + reward: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + historicalPrice: { + currencyCode: "usd", + value: 42.42, + }, + }, + rewardTxHash: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `historicalRewards` | [components.HistoricalReward](../../models/components/historicalreward.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listinternaltransactionsresponse.md b/docs/models/components/listinternaltransactionsresponse.md new file mode 100644 index 0000000..fa4a596 --- /dev/null +++ b/docs/models/components/listinternaltransactionsresponse.md @@ -0,0 +1,18 @@ +# ListInternalTransactionsResponse + +## Example Usage + +```typescript +import { ListInternalTransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListInternalTransactionsResponse = { + transactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | [components.InternalTransaction](../../models/components/internaltransaction.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listnativetransactionsresponse.md b/docs/models/components/listnativetransactionsresponse.md new file mode 100644 index 0000000..9d4c410 --- /dev/null +++ b/docs/models/components/listnativetransactionsresponse.md @@ -0,0 +1,18 @@ +# ListNativeTransactionsResponse + +## Example Usage + +```typescript +import { ListNativeTransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListNativeTransactionsResponse = { + transactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | [components.NativeTransaction](../../models/components/nativetransaction.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listnfttokens.md b/docs/models/components/listnfttokens.md new file mode 100644 index 0000000..6b7dfcb --- /dev/null +++ b/docs/models/components/listnfttokens.md @@ -0,0 +1,18 @@ +# ListNftTokens + +## Example Usage + +```typescript +import { ListNftTokens } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListNftTokens = { + tokens: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `tokens` | *components.Tokens*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listpchainbalancesresponse.md b/docs/models/components/listpchainbalancesresponse.md new file mode 100644 index 0000000..7d2d163 --- /dev/null +++ b/docs/models/components/listpchainbalancesresponse.md @@ -0,0 +1,115 @@ +# ListPChainBalancesResponse + +## Example Usage + +```typescript +import { ListPChainBalancesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListPChainBalancesResponse = { + balances: { + unlockedUnstaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + unlockedStaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + }, + ], + lockedPlatform: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + }, + ], + lockedStakeable: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + }, + ], + lockedStaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + pendingStaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + atomicMemoryUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + status: "", + }, + ], + atomicMemoryLocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + status: "", + }, + ], + }, + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `balances` | [components.PChainBalance](../../models/components/pchainbalance.md) | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listpchaintransactionsresponse.md b/docs/models/components/listpchaintransactionsresponse.md new file mode 100644 index 0000000..e8d1b44 --- /dev/null +++ b/docs/models/components/listpchaintransactionsresponse.md @@ -0,0 +1,23 @@ +# ListPChainTransactionsResponse + +## Example Usage + +```typescript +import { ListPChainTransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListPChainTransactionsResponse = { + transactions: [], + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | [components.PChainTransaction](../../models/components/pchaintransaction.md)[] | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listpchainutxosresponse.md b/docs/models/components/listpchainutxosresponse.md new file mode 100644 index 0000000..2c508fa --- /dev/null +++ b/docs/models/components/listpchainutxosresponse.md @@ -0,0 +1,46 @@ +# ListPChainUtxosResponse + +## Example Usage + +```typescript +import { ListPChainUtxosResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListPChainUtxosResponse = { + utxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + amount: "841.39", + assetId: "", + blockNumber: "", + blockTimestamp: 2894.06, + outputIndex: 2647.3, + txHash: "", + utxoType: "STAKE", + }, + ], + chainInfo: { + chainName: "x-chain", + network: "fuji", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `utxos` | [components.PChainUtxo](../../models/components/pchainutxo.md)[] | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listpendingrewardsresponse.md b/docs/models/components/listpendingrewardsresponse.md new file mode 100644 index 0000000..b82a52f --- /dev/null +++ b/docs/models/components/listpendingrewardsresponse.md @@ -0,0 +1,37 @@ +# ListPendingRewardsResponse + +## Example Usage + +```typescript +import { ListPendingRewardsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListPendingRewardsResponse = { + pendingRewards: [ + { + addresses: ["avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"], + txHash: "", + amountStaked: "", + nodeId: "", + startTimestamp: 2168.22, + endTimestamp: 6924.72, + rewardType: "DELEGATOR", + progress: 5666.02, + estimatedReward: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `pendingRewards` | [components.PendingReward](../../models/components/pendingreward.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listprimarynetworkblocksresponse.md b/docs/models/components/listprimarynetworkblocksresponse.md new file mode 100644 index 0000000..5f242e9 --- /dev/null +++ b/docs/models/components/listprimarynetworkblocksresponse.md @@ -0,0 +1,34 @@ +# ListPrimaryNetworkBlocksResponse + +## Example Usage + +```typescript +import { ListPrimaryNetworkBlocksResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListPrimaryNetworkBlocksResponse = { + blocks: [ + { + blockNumber: "", + blockHash: "", + parentHash: "", + blockTimestamp: 9654.17, + blockType: "", + txCount: 6925.32, + transactions: [""], + blockSizeBytes: 5884.65, + }, + ], + chainInfo: { + chainName: "c-chain", + network: "fuji", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `blocks` | [components.PrimaryNetworkBlock](../../models/components/primarynetworkblock.md)[] | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listsubnetsresponse.md b/docs/models/components/listsubnetsresponse.md new file mode 100644 index 0000000..f5ee038 --- /dev/null +++ b/docs/models/components/listsubnetsresponse.md @@ -0,0 +1,37 @@ +# ListSubnetsResponse + +## Example Usage + +```typescript +import { ListSubnetsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListSubnetsResponse = { + subnets: [ + { + createBlockTimestamp: 1182.74, + createBlockIndex: "", + subnetId: "", + ownerAddresses: [""], + threshold: 7206.33, + locktime: 6399.21, + subnetOwnershipInfo: { + locktime: 0, + threshold: 1, + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + }, + blockchains: [ + { + blockchainId: "", + }, + ], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `subnets` | [components.Subnet](../../models/components/subnet.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listteleportermessagesresponse.md b/docs/models/components/listteleportermessagesresponse.md new file mode 100644 index 0000000..b128f78 --- /dev/null +++ b/docs/models/components/listteleportermessagesresponse.md @@ -0,0 +1,18 @@ +# ListTeleporterMessagesResponse + +## Example Usage + +```typescript +import { ListTeleporterMessagesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListTeleporterMessagesResponse = { + messages: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `messages` | *components.Messages*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listtransactiondetailsresponse.md b/docs/models/components/listtransactiondetailsresponse.md new file mode 100644 index 0000000..230f904 --- /dev/null +++ b/docs/models/components/listtransactiondetailsresponse.md @@ -0,0 +1,18 @@ +# ListTransactionDetailsResponse + +## Example Usage + +```typescript +import { ListTransactionDetailsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListTransactionDetailsResponse = { + transactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | [components.TransactionDetails](../../models/components/transactiondetails.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listtransfersresponse.md b/docs/models/components/listtransfersresponse.md new file mode 100644 index 0000000..3c6f183 --- /dev/null +++ b/docs/models/components/listtransfersresponse.md @@ -0,0 +1,18 @@ +# ListTransfersResponse + +## Example Usage + +```typescript +import { ListTransfersResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListTransfersResponse = { + transfers: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transfers` | *components.Transfers*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listutxosresponse.md b/docs/models/components/listutxosresponse.md new file mode 100644 index 0000000..ba5df94 --- /dev/null +++ b/docs/models/components/listutxosresponse.md @@ -0,0 +1,53 @@ +# ListUtxosResponse + +## Example Usage + +```typescript +import { ListUtxosResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListUtxosResponse = { + utxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + chainInfo: { + chainName: "p-chain", + network: "mainnet", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `utxos` | [components.Utxo](../../models/components/utxo.md)[] | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listvalidatordetailsresponse.md b/docs/models/components/listvalidatordetailsresponse.md new file mode 100644 index 0000000..4f9f918 --- /dev/null +++ b/docs/models/components/listvalidatordetailsresponse.md @@ -0,0 +1,18 @@ +# ListValidatorDetailsResponse + +## Example Usage + +```typescript +import { ListValidatorDetailsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListValidatorDetailsResponse = { + validators: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `validators` | *components.Validators*[] | :heavy_check_mark: | The list of validator Details. | \ No newline at end of file diff --git a/docs/models/components/listwebhookaddressesresponse.md b/docs/models/components/listwebhookaddressesresponse.md new file mode 100644 index 0000000..c2745c7 --- /dev/null +++ b/docs/models/components/listwebhookaddressesresponse.md @@ -0,0 +1,20 @@ +# ListWebhookAddressesResponse + +## Example Usage + +```typescript +import { ListWebhookAddressesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListWebhookAddressesResponse = { + addresses: [""], + totalAddresses: 4895.49, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `addresses` | *string*[] | :heavy_check_mark: | N/A | +| `totalAddresses` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listwebhooksresponse.md b/docs/models/components/listwebhooksresponse.md new file mode 100644 index 0000000..6bf90b0 --- /dev/null +++ b/docs/models/components/listwebhooksresponse.md @@ -0,0 +1,35 @@ +# ListWebhooksResponse + +## Example Usage + +```typescript +import { ListWebhooksResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListWebhooksResponse = { + webhooks: [ + { + id: "", + eventType: "address_activity", + metadata: { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + eventSignatures: [ + "0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64", + ], + }, + url: "http://worn-programme.info", + chainId: "", + status: "active", + createdAt: 4200.75, + name: "", + description: "Re-contextualized 6th generation strategy", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `webhooks` | [components.WebhookResponse](../../models/components/webhookresponse.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listxchainbalancesresponse.md b/docs/models/components/listxchainbalancesresponse.md new file mode 100644 index 0000000..dc369ca --- /dev/null +++ b/docs/models/components/listxchainbalancesresponse.md @@ -0,0 +1,69 @@ +# ListXChainBalancesResponse + +## Example Usage + +```typescript +import { ListXChainBalancesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListXChainBalancesResponse = { + balances: { + locked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + }, + ], + unlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + atomicMemoryUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + atomicMemoryLocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + }, + chainInfo: { + chainName: "x-chain", + network: "mainnet", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `balances` | [components.XChainBalances](../../models/components/xchainbalances.md) | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listxchaintransactionsresponse.md b/docs/models/components/listxchaintransactionsresponse.md new file mode 100644 index 0000000..03e9c47 --- /dev/null +++ b/docs/models/components/listxchaintransactionsresponse.md @@ -0,0 +1,23 @@ +# ListXChainTransactionsResponse + +## Example Usage + +```typescript +import { ListXChainTransactionsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListXChainTransactionsResponse = { + transactions: [], + chainInfo: { + chainName: "x-chain", + network: "mainnet", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `transactions` | *components.Transactions*[] | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listxchainverticesresponse.md b/docs/models/components/listxchainverticesresponse.md new file mode 100644 index 0000000..07d77b3 --- /dev/null +++ b/docs/models/components/listxchainverticesresponse.md @@ -0,0 +1,34 @@ +# ListXChainVerticesResponse + +## Example Usage + +```typescript +import { ListXChainVerticesResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: ListXChainVerticesResponse = { + vertices: [ + { + vertexHash: "", + parentHashes: [""], + vertexHeight: 2305.33, + vertexIndex: 6439.9, + vertexTimestamp: 3948.69, + txCount: 4238.55, + transactions: [""], + vertexSizeBytes: 6188.09, + }, + ], + chainInfo: { + chainName: "x-chain", + network: "mainnet", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `vertices` | [components.XChainVertex](../../models/components/xchainvertex.md)[] | :heavy_check_mark: | N/A | +| `chainInfo` | [components.PrimaryNetworkChainInfo](../../models/components/primarynetworkchaininfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/logsformat.md b/docs/models/components/logsformat.md new file mode 100644 index 0000000..f4f9c43 --- /dev/null +++ b/docs/models/components/logsformat.md @@ -0,0 +1,45 @@ +# LogsFormat + +## Example Usage + +```typescript +import { LogsFormat } from "@avalabs/avacloud-sdk/models/components"; + +let value: LogsFormat = { + orgId: "", + logId: "", + eventTimestamp: 9988.48, + apiKeyId: "", + apiKeyAlias: "", + hostRegion: "", + requestType: "Glacier RPC Request", + requestPath: "", + apiCreditsConsumed: 1494.48, + requestDurationMsecs: 9046.48, + responseCode: 8681.26, + metadata: { + ipAddress: "9.41.130.157", + host: "daring-camel.net", + userAgent: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `orgId` | *string* | :heavy_check_mark: | The organization id of the request. | +| `logId` | *string* | :heavy_check_mark: | The unique log id of the request. | +| `eventTimestamp` | *number* | :heavy_check_mark: | The timestamp of the request. | +| `apiKeyId` | *string* | :heavy_check_mark: | The apiKey used to make the request. | +| `apiKeyAlias` | *string* | :heavy_check_mark: | The alias of the apiKey used to make the request. | +| `hostRegion` | *string* | :heavy_check_mark: | The region of the host for the request made by the client. | +| `requestType` | [components.RequestType](../../models/components/requesttype.md) | :heavy_check_mark: | The type of request made by the client. | +| `requestPath` | *string* | :heavy_check_mark: | The path of the request made by the client. | +| `apiCreditsConsumed` | *number* | :heavy_check_mark: | The number of API credits consumed by the request. | +| `requestDurationMsecs` | *number* | :heavy_check_mark: | The duration of the request in milliseconds. | +| `responseCode` | *number* | :heavy_check_mark: | The response code of the request. | +| `chainId` | *string* | :heavy_minus_sign: | The chain id of the request. | +| `rpcMethod` | *string* | :heavy_minus_sign: | The rpc method of the request. | +| `metadata` | [components.LogsFormatMetadata](../../models/components/logsformatmetadata.md) | :heavy_check_mark: | The metadata of the request. | \ No newline at end of file diff --git a/docs/models/components/logsformatmetadata.md b/docs/models/components/logsformatmetadata.md new file mode 100644 index 0000000..b770efb --- /dev/null +++ b/docs/models/components/logsformatmetadata.md @@ -0,0 +1,21 @@ +# LogsFormatMetadata + +## Example Usage + +```typescript +import { LogsFormatMetadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: LogsFormatMetadata = { + ipAddress: "217.221.206.105", + host: "nimble-caution.info", + userAgent: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `ipAddress` | *string* | :heavy_check_mark: | The IP address of the client that made the request. | +| `host` | *string* | :heavy_check_mark: | The host for the request made by the client. | +| `userAgent` | *string* | :heavy_check_mark: | The user agent of the client that made the request. | \ No newline at end of file diff --git a/docs/models/components/logsresponsedto.md b/docs/models/components/logsresponsedto.md new file mode 100644 index 0000000..7f5bb93 --- /dev/null +++ b/docs/models/components/logsresponsedto.md @@ -0,0 +1,39 @@ +# LogsResponseDTO + +## Example Usage + +```typescript +import { LogsResponseDTO } from "@avalabs/avacloud-sdk/models/components"; + +let value: LogsResponseDTO = { + orgId: "", + logs: [ + { + orgId: "", + logId: "", + eventTimestamp: 8919.24, + apiKeyId: "", + apiKeyAlias: "", + hostRegion: "", + requestType: "Glacier API Request", + requestPath: "", + apiCreditsConsumed: 8061.94, + requestDurationMsecs: 5370.23, + responseCode: 7038.89, + metadata: { + ipAddress: "114.25.25.235", + host: "grim-quinoa.info", + userAgent: "", + }, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `nextPageToken` | *string* | :heavy_minus_sign: | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. | +| `orgId` | *string* | :heavy_check_mark: | The organization id of the request. | +| `logs` | [components.LogsFormat](../../models/components/logsformat.md)[] | :heavy_check_mark: | An array of logs representing the requests made by clients. | \ No newline at end of file diff --git a/docs/models/components/messages.md b/docs/models/components/messages.md new file mode 100644 index 0000000..0296106 --- /dev/null +++ b/docs/models/components/messages.md @@ -0,0 +1,69 @@ +# Messages + +## Example Usage + +```typescript +import { Messages } from "@avalabs/avacloud-sdk/models/components"; + +let value: Messages = { + messageId: "", + teleporterContractAddress: "", + sourceBlockchainId: "", + destinationBlockchainId: "", + sourceEvmChainId: "", + destinationEvmChainId: "", + messageNonce: "", + from: "", + to: "", + messageExecuted: false, + receipts: [ + { + receivedMessageNonce: "", + relayerRewardAddress: "", + }, + ], + receiptDelivered: false, + rewardDetails: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + value: "", + }, + sourceTransaction: { + txHash: "", + timestamp: 4634.51, + gasSpent: "", + }, + destinationTransaction: { + txHash: "", + timestamp: 2239.24, + gasSpent: "", + rewardRedeemer: "", + delivererAddress: "", + }, + status: "delivered", +}; +``` + +## Supported Types + +### `components.PendingTeleporterMessage` + +```typescript +const value: components.PendingTeleporterMessage = /* values here */ +``` + +### `components.DeliveredTeleporterMessage` + +```typescript +const value: components.DeliveredTeleporterMessage = /* values here */ +``` + diff --git a/docs/models/components/metadata.md b/docs/models/components/metadata.md new file mode 100644 index 0000000..c81b91a --- /dev/null +++ b/docs/models/components/metadata.md @@ -0,0 +1,18 @@ +# Metadata + +## Example Usage + +```typescript +import { Metadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: Metadata = {}; +``` + +## Supported Types + +### `components.TransactionExportMetadata` + +```typescript +const value: components.TransactionExportMetadata = /* values here */ +``` + diff --git a/docs/models/components/method.md b/docs/models/components/method.md new file mode 100644 index 0000000..c6ee940 --- /dev/null +++ b/docs/models/components/method.md @@ -0,0 +1,21 @@ +# Method + +## Example Usage + +```typescript +import { Method } from "@avalabs/avacloud-sdk/models/components"; + +let value: Method = { + callType: "CONTRACT_CALL", + methodHash: "0xa9059cbb", + methodName: "transfer(address,uint256)", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `callType` | [components.TransactionMethodType](../../models/components/transactionmethodtype.md) | :heavy_check_mark: | The contract call type. NATIVE_TRANSFER indicates a transfer of the native token without any smart-contract interaction. CONTRACT_CALL indicates a smart-contract interaction. CONTRACT_CREATION indicates a smart-contract creation. | | +| `methodHash` | *string* | :heavy_check_mark: | The contract method hash identifier. The method hash is only set if the `callType` is `CONTRACT_CALL`. | 0xa9059cbb | +| `methodName` | *string* | :heavy_minus_sign: | The contract method name including parameter types. If the `callType` is `NATIVE_TRANSFER` this is set to 'Native Transfer'. If the `callType` is `CONTRACT_CREATION` this is set to 'Contract Created'. | transfer(address,uint256) | \ No newline at end of file diff --git a/docs/models/components/metric.md b/docs/models/components/metric.md new file mode 100644 index 0000000..21a6a2d --- /dev/null +++ b/docs/models/components/metric.md @@ -0,0 +1,30 @@ +# Metric + +## Example Usage + +```typescript +import { Metric } from "@avalabs/avacloud-sdk/models/components"; + +let value: Metric = { + timestamp: 2982.82, + values: [ + { + groupedBy: "requestPath", + totalRequests: 5699.65, + requestsPerSecond: 3540.47, + successRatePercent: 5908.73, + medianResponseTimeMsecs: 5518.16, + invalidRequests: 5743.25, + apiCreditsUsed: 336.25, + apiCreditsWasted: 6532.01, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `timestamp` | *number* | :heavy_check_mark: | The timestamp of the metrics value | +| `values` | [components.UsageMetricsValueDTO](../../models/components/usagemetricsvaluedto.md)[] | :heavy_check_mark: | The metrics values for the timestamp | \ No newline at end of file diff --git a/docs/models/components/money.md b/docs/models/components/money.md new file mode 100644 index 0000000..5f2293e --- /dev/null +++ b/docs/models/components/money.md @@ -0,0 +1,19 @@ +# Money + +## Example Usage + +```typescript +import { Money } from "@avalabs/avacloud-sdk/models/components"; + +let value: Money = { + currencyCode: "usd", + value: 42.42, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `currencyCode` | [components.CurrencyCode](../../models/components/currencycode.md) | :heavy_check_mark: | ISO 4217 currency code. | usd | +| `value` | *number* | :heavy_check_mark: | Monetary value in base 10 decimals. | 42.42 | \ No newline at end of file diff --git a/docs/models/components/nativetokenbalance.md b/docs/models/components/nativetokenbalance.md new file mode 100644 index 0000000..f0f926d --- /dev/null +++ b/docs/models/components/nativetokenbalance.md @@ -0,0 +1,38 @@ +# NativeTokenBalance + +## Example Usage + +```typescript +import { NativeTokenBalance } from "@avalabs/avacloud-sdk/models/components"; + +let value: NativeTokenBalance = { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + chainId: "43114", + price: { + currencyCode: "usd", + value: 42.42, + }, + balance: "2000000000000000000", + balanceValue: { + currencyCode: "usd", + value: 42.42, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_check_mark: | The contract symbol. | WAVAX | +| `decimals` | *number* | :heavy_check_mark: | The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. | 18 | +| `logoUri` | *string* | :heavy_minus_sign: | The logo uri for the address. | https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg | +| `chainId` | *string* | :heavy_check_mark: | The evm chain id. | 43114 | +| `price` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The token price, if available. | | +| `balance` | *string* | :heavy_check_mark: | The address balance for the token, in units specified by the `decimals` value for the contract. | 2000000000000000000 | +| `balanceValue` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The monetary value of the balance, if a price is available for the token. | | \ No newline at end of file diff --git a/docs/models/components/nativetransaction.md b/docs/models/components/nativetransaction.md new file mode 100644 index 0000000..7209484 --- /dev/null +++ b/docs/models/components/nativetransaction.md @@ -0,0 +1,63 @@ +# NativeTransaction + +## Example Usage + +```typescript +import { NativeTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: NativeTransaction = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + blockIndex: 0, + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + txStatus: "1", + txType: 1, + gasLimit: "51373", + gasUsed: "51373", + gasPrice: "470000000000", + nonce: "1", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + method: { + callType: "CONTRACT_CREATION", + methodHash: "0xa9059cbb", + methodName: "transfer(address,uint256)", + }, + value: "10000000000000000000", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_check_mark: | The block number on the chain. | 339 | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockHash` | *string* | :heavy_check_mark: | The block hash identifier. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | +| `blockIndex` | *number* | :heavy_check_mark: | The index at which the transaction occured in the block (0-indexed). | 0 | +| `txHash` | *string* | :heavy_check_mark: | The transaction hash identifier. | 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4 | +| `txStatus` | *string* | :heavy_check_mark: | The transaction status, which is either 0 (failed) or 1 (successful). | 1 | +| `txType` | *number* | :heavy_check_mark: | The transaction type. | 1 | +| `gasLimit` | *string* | :heavy_check_mark: | The gas limit set for the transaction. | 51373 | +| `gasUsed` | *string* | :heavy_check_mark: | The amount of gas used. | 51373 | +| `gasPrice` | *string* | :heavy_check_mark: | The gas price denominated by the number of decimals of the native token. | 470000000000 | +| `nonce` | *string* | :heavy_check_mark: | The nonce used by the sender of the transaction. | 1 | +| `from` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `to` | [components.RichAddress](../../models/components/richaddress.md) | :heavy_check_mark: | N/A | | +| `method` | [components.Method](../../models/components/method.md) | :heavy_minus_sign: | N/A | | +| `value` | *string* | :heavy_check_mark: | N/A | 10000000000000000000 | \ No newline at end of file diff --git a/docs/models/components/networktoken.md b/docs/models/components/networktoken.md new file mode 100644 index 0000000..fd60dde --- /dev/null +++ b/docs/models/components/networktoken.md @@ -0,0 +1,25 @@ +# NetworkToken + +## Example Usage + +```typescript +import { NetworkToken } from "@avalabs/avacloud-sdk/models/components"; + +let value: NetworkToken = { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_check_mark: | The contract symbol. | WAVAX | +| `decimals` | *number* | :heavy_check_mark: | The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. | 18 | +| `logoUri` | *string* | :heavy_minus_sign: | The logo uri for the address. | https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg | +| `description` | *string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/networktokendetails.md b/docs/models/components/networktokendetails.md new file mode 100644 index 0000000..a07f93b --- /dev/null +++ b/docs/models/components/networktokendetails.md @@ -0,0 +1,33 @@ +# NetworkTokenDetails + +## Example Usage + +```typescript +import { NetworkTokenDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: NetworkTokenDetails = { + networkToken: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + }, + currentPrice: { + currencyCode: "usd", + value: 42.42, + }, + historicalPrice: { + currencyCode: "usd", + value: 42.42, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `networkToken` | [components.NetworkToken](../../models/components/networktoken.md) | :heavy_check_mark: | N/A | +| `currentPrice` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The current token price, if available. | +| `historicalPrice` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The historical token price at the time the transaction occured, if available. Note, this is only provided if the transaction occured more than 24 hours ago. | \ No newline at end of file diff --git a/docs/models/components/networktype.md b/docs/models/components/networktype.md new file mode 100644 index 0000000..56de958 --- /dev/null +++ b/docs/models/components/networktype.md @@ -0,0 +1,15 @@ +# NetworkType + +## Example Usage + +```typescript +import { NetworkType } from "@avalabs/avacloud-sdk/models/components"; + +let value: NetworkType = "mainnet"; +``` + +## Values + +```typescript +"mainnet" | "testnet" +``` \ No newline at end of file diff --git a/docs/models/components/nfttokenmetadatastatus.md b/docs/models/components/nfttokenmetadatastatus.md new file mode 100644 index 0000000..095e3ec --- /dev/null +++ b/docs/models/components/nfttokenmetadatastatus.md @@ -0,0 +1,17 @@ +# NftTokenMetadataStatus + +The metadata indexing status of the nft. + +## Example Usage + +```typescript +import { NftTokenMetadataStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: NftTokenMetadataStatus = "METADATA_CONTENT_TOO_LARGE"; +``` + +## Values + +```typescript +"UNKNOWN" | "MISSING_TOKEN" | "INVALID_TOKEN_URI" | "INVALID_TOKEN_URI_SCHEME" | "UNREACHABLE_TOKEN_URI" | "THROTTLED_TOKEN_URI" | "METADATA_CONTENT_TOO_LARGE" | "INVALID_METADATA" | "INVALID_METADATA_JSON" | "INDEXED" | "UNINDEXED" +``` \ No newline at end of file diff --git a/docs/models/components/operationstatus.md b/docs/models/components/operationstatus.md new file mode 100644 index 0000000..04ebdd9 --- /dev/null +++ b/docs/models/components/operationstatus.md @@ -0,0 +1,15 @@ +# OperationStatus + +## Example Usage + +```typescript +import { OperationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: OperationStatus = "COMPLETED"; +``` + +## Values + +```typescript +"RUNNING" | "COMPLETED" | "COMPLETED_WITH_WARNING" | "FAILED" +``` \ No newline at end of file diff --git a/docs/models/components/operationstatuscode.md b/docs/models/components/operationstatuscode.md new file mode 100644 index 0000000..ea886ed --- /dev/null +++ b/docs/models/components/operationstatuscode.md @@ -0,0 +1,15 @@ +# OperationStatusCode + +## Example Usage + +```typescript +import { OperationStatusCode } from "@avalabs/avacloud-sdk/models/components"; + +let value: OperationStatusCode = "ErrInternal"; +``` + +## Values + +```typescript +"ErrInvalidRequest" | "ErrInternal" | "WarnTruncatedExport" +``` \ No newline at end of file diff --git a/docs/models/components/operationstatusresponse.md b/docs/models/components/operationstatusresponse.md new file mode 100644 index 0000000..d478eb2 --- /dev/null +++ b/docs/models/components/operationstatusresponse.md @@ -0,0 +1,28 @@ +# OperationStatusResponse + +## Example Usage + +```typescript +import { OperationStatusResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: OperationStatusResponse = { + operationId: "", + operationType: "TRANSACTION_EXPORT_EVM", + operationStatus: "COMPLETED", + metadata: {}, + createdAtTimestamp: 6235.64, + updatedAtTimestamp: 6458.94, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `operationId` | *string* | :heavy_check_mark: | N/A | +| `operationType` | [components.OperationType](../../models/components/operationtype.md) | :heavy_check_mark: | N/A | +| `operationStatus` | [components.OperationStatus](../../models/components/operationstatus.md) | :heavy_check_mark: | N/A | +| `message` | *string* | :heavy_minus_sign: | N/A | +| `metadata` | *components.Metadata* | :heavy_check_mark: | N/A | +| `createdAtTimestamp` | *number* | :heavy_check_mark: | N/A | +| `updatedAtTimestamp` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/operationtype.md b/docs/models/components/operationtype.md new file mode 100644 index 0000000..75090e0 --- /dev/null +++ b/docs/models/components/operationtype.md @@ -0,0 +1,15 @@ +# OperationType + +## Example Usage + +```typescript +import { OperationType } from "@avalabs/avacloud-sdk/models/components"; + +let value: OperationType = "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING"; +``` + +## Values + +```typescript +"TRANSACTION_EXPORT_PRIMARY_NETWORK" | "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING" | "TRANSACTION_EXPORT_PRIMARY_NETWORK_SIMPLE" | "TRANSACTION_EXPORT_EVM" +``` \ No newline at end of file diff --git a/docs/models/components/pchainbalance.md b/docs/models/components/pchainbalance.md new file mode 100644 index 0000000..66d59f7 --- /dev/null +++ b/docs/models/components/pchainbalance.md @@ -0,0 +1,115 @@ +# PChainBalance + +## Example Usage + +```typescript +import { PChainBalance } from "@avalabs/avacloud-sdk/models/components"; + +let value: PChainBalance = { + unlockedUnstaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + unlockedStaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + }, + ], + lockedPlatform: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + }, + ], + lockedStakeable: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + lockedStaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + pendingStaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + }, + ], + atomicMemoryUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + status: "", + }, + ], + atomicMemoryLocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + status: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `unlockedUnstaked` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is consumable by any transaction. | +| `unlockedStaked` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax that is consumable by any transaction when the staking period ends. | +| `lockedPlatform` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is locked at the platform level and not consumable by any transaction at the current time. | +| `lockedStakeable` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is locked at the platform level and only consumeable for staking transactions. | +| `lockedStaked` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax that will be locked when the staking period ends. | +| `pendingStaked` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax whose staking period has not yet started. | +| `atomicMemoryUnlocked` | [components.PChainSharedAsset](../../models/components/pchainsharedasset.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount and utxo count of that Asset ID. Denotes the amount of unlocked Avax in the atomic memory between P-Chain and other chain. | +| `atomicMemoryLocked` | [components.PChainSharedAsset](../../models/components/pchainsharedasset.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info, amount and utxo count of that Asset ID. Denotes the amount of locked Avax in the atomic memory between P-Chain and other chain. | \ No newline at end of file diff --git a/docs/models/components/pchainid.md b/docs/models/components/pchainid.md new file mode 100644 index 0000000..6bb4e2e --- /dev/null +++ b/docs/models/components/pchainid.md @@ -0,0 +1,15 @@ +# PChainId + +## Example Usage + +```typescript +import { PChainId } from "@avalabs/avacloud-sdk/models/components"; + +let value: PChainId = "p-chain"; +``` + +## Values + +```typescript +"11111111111111111111111111111111LpoYY" | "p-chain" +``` \ No newline at end of file diff --git a/docs/models/components/pchainsharedasset.md b/docs/models/components/pchainsharedasset.md new file mode 100644 index 0000000..5ba89f3 --- /dev/null +++ b/docs/models/components/pchainsharedasset.md @@ -0,0 +1,33 @@ +# PChainSharedAsset + +## Example Usage + +```typescript +import { PChainSharedAsset } from "@avalabs/avacloud-sdk/models/components"; + +let value: PChainSharedAsset = { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + status: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `assetId` | *string* | :heavy_check_mark: | Unique ID for an asset. | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | +| `name` | *string* | :heavy_check_mark: | Name of this asset. | Avalanche | +| `symbol` | *string* | :heavy_check_mark: | Symbol for this asset (max 4 characters). | AVAX | +| `denomination` | *number* | :heavy_check_mark: | Denomination of this asset to represent fungibility. | 9 | +| `type` | [components.PrimaryNetworkAssetType](../../models/components/primarynetworkassettype.md) | :heavy_check_mark: | Type of asset like SECP256K1 or NFT. | | +| `amount` | *string* | :heavy_check_mark: | Amount of the asset. | 5001000 | +| `utxoCount` | *number* | :heavy_check_mark: | N/A | 1 | +| `sharedWithChainId` | *string* | :heavy_check_mark: | N/A | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `status` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/pchaintransaction.md b/docs/models/components/pchaintransaction.md new file mode 100644 index 0000000..479e15a --- /dev/null +++ b/docs/models/components/pchaintransaction.md @@ -0,0 +1,129 @@ +# PChainTransaction + +## Example Usage + +```typescript +import { PChainTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: PChainTransaction = { + txHash: "3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP", + txType: "CreateChainTx", + blockTimestamp: 1648672486, + blockNumber: "", + blockHash: "", + consumedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + amount: "128.92", + assetId: "", + blockNumber: "", + blockTimestamp: 7506.86, + outputIndex: 3154.28, + txHash: "", + utxoType: "TRANSFER", + }, + ], + emittedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + amount: "325.05", + assetId: "", + blockNumber: "", + blockTimestamp: 5701.97, + outputIndex: 384.25, + txHash: "", + utxoType: "STAKE", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + value: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + amountBurned: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + amountStaked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + subnetOwnershipInfo: { + locktime: 0, + threshold: 1, + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | A P-Chain transaction hash. | 3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP | +| `txType` | [components.PChainTransactionType](../../models/components/pchaintransactiontype.md) | :heavy_check_mark: | N/A | | +| `blockTimestamp` | *number* | :heavy_check_mark: | The block finality timestamp. | 1648672486 | +| `blockNumber` | *string* | :heavy_check_mark: | N/A | | +| `blockHash` | *string* | :heavy_check_mark: | N/A | | +| `consumedUtxos` | [components.PChainUtxo](../../models/components/pchainutxo.md)[] | :heavy_check_mark: | N/A | | +| `emittedUtxos` | [components.PChainUtxo](../../models/components/pchainutxo.md)[] | :heavy_check_mark: | N/A | | +| `sourceChain` | *string* | :heavy_minus_sign: | Source chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `destinationChain` | *string* | :heavy_minus_sign: | Destination chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `value` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info and the amount of that Asset ID. | | +| `amountBurned` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info and the amount of that Asset ID. | | +| `amountStaked` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | A list of objects containing P-chain Asset basic info and the amount of that Asset ID. Present for AddValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx | | +| `startTimestamp` | *number* | :heavy_minus_sign: | Present for AddValidatorTx, AddSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx | | +| `endTimestamp` | *number* | :heavy_minus_sign: | Present for AddValidatorTx, AddSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx | | +| `delegationFeePercent` | *string* | :heavy_minus_sign: | Present for AddValidatorTx, AddPermissionlessValidatorTx | | +| `nodeId` | *string* | :heavy_minus_sign: | Present for AddValidatorTx, AddSubnetValidatorTx, RemoveSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx | | +| `subnetId` | *string* | :heavy_minus_sign: | Present for AddValidatorTx, AddSubnetValidatorTx, RemoveSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx, CreateChainTx, CreateSubnetTx | | +| `estimatedReward` | *string* | :heavy_minus_sign: | Present for AddValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx | | +| `rewardTxHash` | *string* | :heavy_minus_sign: | N/A | | +| `rewardAddresses` | *string*[] | :heavy_minus_sign: | N/A | | +| `memo` | *string* | :heavy_minus_sign: | N/A | | +| `stakingTxHash` | *string* | :heavy_minus_sign: | Present for RewardValidatorTx | | +| `subnetOwnershipInfo` | [components.SubnetOwnershipInfo](../../models/components/subnetownershipinfo.md) | :heavy_minus_sign: | Subnet owner details for the CreateSubnetTx or TransferSubnetOwnershipTx | | +| `blsCredentials` | [components.BlsCredentials](../../models/components/blscredentials.md) | :heavy_minus_sign: | Present for AddPermissionlessValidatorTx | | \ No newline at end of file diff --git a/docs/models/components/pchaintransactiontype.md b/docs/models/components/pchaintransactiontype.md new file mode 100644 index 0000000..6e81d01 --- /dev/null +++ b/docs/models/components/pchaintransactiontype.md @@ -0,0 +1,15 @@ +# PChainTransactionType + +## Example Usage + +```typescript +import { PChainTransactionType } from "@avalabs/avacloud-sdk/models/components"; + +let value: PChainTransactionType = "CreateSubnetTx"; +``` + +## Values + +```typescript +"AddValidatorTx" | "AddSubnetValidatorTx" | "AddDelegatorTx" | "CreateChainTx" | "CreateSubnetTx" | "ImportTx" | "ExportTx" | "AdvanceTimeTx" | "RewardValidatorTx" | "RemoveSubnetValidatorTx" | "TransformSubnetTx" | "AddPermissionlessValidatorTx" | "AddPermissionlessDelegatorTx" | "BaseTx" | "TransferSubnetOwnershipTx" | "UNKNOWN" +``` \ No newline at end of file diff --git a/docs/models/components/pchainutxo.md b/docs/models/components/pchainutxo.md new file mode 100644 index 0000000..42b8e54 --- /dev/null +++ b/docs/models/components/pchainutxo.md @@ -0,0 +1,57 @@ +# PChainUtxo + +## Example Usage + +```typescript +import { PChainUtxo } from "@avalabs/avacloud-sdk/models/components"; + +let value: PChainUtxo = { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + amount: "208.87", + assetId: "", + blockNumber: "", + blockTimestamp: 6350.59, + outputIndex: 1613.09, + txHash: "", + utxoType: "TRANSFER", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `addresses` | *string*[] | :heavy_check_mark: | Addresses that are eligible to sign the consumption of this output. | [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
] | +| `asset` | [components.AssetAmount](../../models/components/assetamount.md) | :heavy_check_mark: | N/A | | +| `consumedOnChainId` | *string* | :heavy_check_mark: | Blockchain ID on which this output is consumed on. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `consumingTxHash` | *string* | :heavy_minus_sign: | Transaction ID that consumed this output. | 3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c | +| `createdOnChainId` | *string* | :heavy_check_mark: | Blockchain ID on which this output is created on. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `utxoId` | *string* | :heavy_check_mark: | UTXO ID for this output. | 68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC | +| ~~`amount`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| ~~`assetId`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `blockNumber` | *string* | :heavy_check_mark: | N/A | | +| `blockTimestamp` | *number* | :heavy_check_mark: | N/A | | +| `consumingBlockNumber` | *string* | :heavy_minus_sign: | N/A | | +| `consumingBlockTimestamp` | *number* | :heavy_minus_sign: | N/A | | +| `platformLocktime` | *number* | :heavy_minus_sign: | N/A | | +| `outputIndex` | *number* | :heavy_check_mark: | N/A | | +| `rewardType` | [components.RewardType](../../models/components/rewardtype.md) | :heavy_minus_sign: | N/A | | +| `stakeableLocktime` | *number* | :heavy_minus_sign: | N/A | | +| `staked` | *boolean* | :heavy_minus_sign: | N/A | | +| `threshold` | *number* | :heavy_minus_sign: | N/A | | +| `txHash` | *string* | :heavy_check_mark: | N/A | | +| `utxoEndTimestamp` | *number* | :heavy_minus_sign: | N/A | | +| `utxoStartTimestamp` | *number* | :heavy_minus_sign: | N/A | | +| `utxoType` | [components.UtxoType](../../models/components/utxotype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/pendingdelegatordetails.md b/docs/models/components/pendingdelegatordetails.md new file mode 100644 index 0000000..6db07c2 --- /dev/null +++ b/docs/models/components/pendingdelegatordetails.md @@ -0,0 +1,35 @@ +# PendingDelegatorDetails + +## Example Usage + +```typescript +import { PendingDelegatorDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: PendingDelegatorDetails = { + txHash: "", + nodeId: "", + rewardAddresses: [""], + amountDelegated: "", + delegationFee: "", + startTimestamp: 6706.38, + endTimestamp: 1709.09, + estimatedGrossReward: "", + estimatedNetReward: "", + delegationStatus: "pending", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `nodeId` | *string* | :heavy_check_mark: | N/A | +| `rewardAddresses` | *string*[] | :heavy_check_mark: | N/A | +| `amountDelegated` | *string* | :heavy_check_mark: | N/A | +| `delegationFee` | *string* | :heavy_check_mark: | N/A | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | +| `estimatedGrossReward` | *string* | :heavy_check_mark: | N/A | +| `estimatedNetReward` | *string* | :heavy_check_mark: | N/A | +| `delegationStatus` | [components.PendingDelegatorDetailsDelegationStatus](../../models/components/pendingdelegatordetailsdelegationstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/pendingdelegatordetailsdelegationstatus.md b/docs/models/components/pendingdelegatordetailsdelegationstatus.md new file mode 100644 index 0000000..b5f7192 --- /dev/null +++ b/docs/models/components/pendingdelegatordetailsdelegationstatus.md @@ -0,0 +1,15 @@ +# PendingDelegatorDetailsDelegationStatus + +## Example Usage + +```typescript +import { PendingDelegatorDetailsDelegationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: PendingDelegatorDetailsDelegationStatus = "pending"; +``` + +## Values + +```typescript +"pending" +``` \ No newline at end of file diff --git a/docs/models/components/pendingreward.md b/docs/models/components/pendingreward.md new file mode 100644 index 0000000..bffeb44 --- /dev/null +++ b/docs/models/components/pendingreward.md @@ -0,0 +1,40 @@ +# PendingReward + +## Example Usage + +```typescript +import { PendingReward } from "@avalabs/avacloud-sdk/models/components"; + +let value: PendingReward = { + addresses: ["avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"], + txHash: "", + amountStaked: "", + nodeId: "", + startTimestamp: 2653.89, + endTimestamp: 5089.69, + rewardType: "DELEGATOR", + progress: 9167.23, + estimatedReward: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `addresses` | *string*[] | :heavy_check_mark: | An array of P-Chain wallet addresses. | [
"avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"
] | +| `txHash` | *string* | :heavy_check_mark: | N/A | | +| `amountStaked` | *string* | :heavy_check_mark: | N/A | | +| `nodeId` | *string* | :heavy_check_mark: | N/A | | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | | +| `rewardType` | [components.RewardType](../../models/components/rewardtype.md) | :heavy_check_mark: | N/A | | +| `progress` | *number* | :heavy_check_mark: | N/A | | +| `estimatedReward` | [components.AssetAmount](../../models/components/assetamount.md) | :heavy_check_mark: | An object containing P-chain Asset basic info and the amount of that Asset ID. | | \ No newline at end of file diff --git a/docs/models/components/pendingteleportermessage.md b/docs/models/components/pendingteleportermessage.md new file mode 100644 index 0000000..3392a98 --- /dev/null +++ b/docs/models/components/pendingteleportermessage.md @@ -0,0 +1,68 @@ +# PendingTeleporterMessage + +## Example Usage + +```typescript +import { PendingTeleporterMessage } from "@avalabs/avacloud-sdk/models/components"; + +let value: PendingTeleporterMessage = { + messageId: "", + teleporterContractAddress: "", + sourceBlockchainId: "", + destinationBlockchainId: "", + sourceEvmChainId: "", + destinationEvmChainId: "", + messageNonce: "", + from: "", + to: "", + messageExecuted: false, + receipts: [ + { + receivedMessageNonce: "", + relayerRewardAddress: "", + }, + ], + receiptDelivered: false, + rewardDetails: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + value: "", + }, + sourceTransaction: { + txHash: "", + timestamp: 543.38, + gasSpent: "", + }, + status: "pending", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `messageId` | *string* | :heavy_check_mark: | N/A | +| `teleporterContractAddress` | *string* | :heavy_check_mark: | N/A | +| `sourceBlockchainId` | *string* | :heavy_check_mark: | N/A | +| `destinationBlockchainId` | *string* | :heavy_check_mark: | N/A | +| `sourceEvmChainId` | *string* | :heavy_check_mark: | N/A | +| `destinationEvmChainId` | *string* | :heavy_check_mark: | N/A | +| `messageNonce` | *string* | :heavy_check_mark: | N/A | +| `from` | *string* | :heavy_check_mark: | N/A | +| `to` | *string* | :heavy_check_mark: | N/A | +| `data` | *string* | :heavy_minus_sign: | N/A | +| `messageExecuted` | *boolean* | :heavy_check_mark: | N/A | +| `receipts` | [components.TeleporterReceipt](../../models/components/teleporterreceipt.md)[] | :heavy_check_mark: | N/A | +| `receiptDelivered` | *boolean* | :heavy_check_mark: | N/A | +| `rewardDetails` | [components.TeleporterRewardDetails](../../models/components/teleporterrewarddetails.md) | :heavy_check_mark: | N/A | +| `sourceTransaction` | [components.TeleporterSourceTransaction](../../models/components/teleportersourcetransaction.md) | :heavy_check_mark: | N/A | +| `status` | [components.Status](../../models/components/status.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/pendingvalidatordetails.md b/docs/models/components/pendingvalidatordetails.md new file mode 100644 index 0000000..06137e9 --- /dev/null +++ b/docs/models/components/pendingvalidatordetails.md @@ -0,0 +1,31 @@ +# PendingValidatorDetails + +## Example Usage + +```typescript +import { PendingValidatorDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: PendingValidatorDetails = { + txHash: "", + nodeId: "", + subnetId: "", + amountStaked: "", + startTimestamp: 6169.34, + endTimestamp: 3864.89, + validationStatus: "pending", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `nodeId` | *string* | :heavy_check_mark: | N/A | +| `subnetId` | *string* | :heavy_check_mark: | N/A | +| `amountStaked` | *string* | :heavy_check_mark: | N/A | +| `delegationFee` | *string* | :heavy_minus_sign: | N/A | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | +| `blsCredentials` | [components.BlsCredentials](../../models/components/blscredentials.md) | :heavy_minus_sign: | Present for AddPermissionlessValidatorTx | +| `validationStatus` | [components.PendingValidatorDetailsValidationStatus](../../models/components/pendingvalidatordetailsvalidationstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/pendingvalidatordetailsvalidationstatus.md b/docs/models/components/pendingvalidatordetailsvalidationstatus.md new file mode 100644 index 0000000..1aeec69 --- /dev/null +++ b/docs/models/components/pendingvalidatordetailsvalidationstatus.md @@ -0,0 +1,15 @@ +# PendingValidatorDetailsValidationStatus + +## Example Usage + +```typescript +import { PendingValidatorDetailsValidationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: PendingValidatorDetailsValidationStatus = "pending"; +``` + +## Values + +```typescript +"pending" +``` \ No newline at end of file diff --git a/docs/models/components/pricingproviders.md b/docs/models/components/pricingproviders.md new file mode 100644 index 0000000..c7fa1e2 --- /dev/null +++ b/docs/models/components/pricingproviders.md @@ -0,0 +1,15 @@ +# PricingProviders + +## Example Usage + +```typescript +import { PricingProviders } from "@avalabs/avacloud-sdk/models/components"; + +let value: PricingProviders = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `coingeckoCoinId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/primarynetwork.md b/docs/models/components/primarynetwork.md new file mode 100644 index 0000000..49efe03 --- /dev/null +++ b/docs/models/components/primarynetwork.md @@ -0,0 +1,15 @@ +# PrimaryNetwork + +## Example Usage + +```typescript +import { PrimaryNetwork } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetwork = "mainnet"; +``` + +## Values + +```typescript +"mainnet" | "fuji" +``` \ No newline at end of file diff --git a/docs/models/components/primarynetworkassetcap.md b/docs/models/components/primarynetworkassetcap.md new file mode 100644 index 0000000..cd6a490 --- /dev/null +++ b/docs/models/components/primarynetworkassetcap.md @@ -0,0 +1,17 @@ +# PrimaryNetworkAssetCap + +Cap represents if an asset is a variable or fixed cap asset. + +## Example Usage + +```typescript +import { PrimaryNetworkAssetCap } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkAssetCap = "fixed"; +``` + +## Values + +```typescript +"fixed" | "variable" +``` \ No newline at end of file diff --git a/docs/models/components/primarynetworkassettype.md b/docs/models/components/primarynetworkassettype.md new file mode 100644 index 0000000..6652383 --- /dev/null +++ b/docs/models/components/primarynetworkassettype.md @@ -0,0 +1,17 @@ +# PrimaryNetworkAssetType + +Type of asset like SECP256K1 or NFT. + +## Example Usage + +```typescript +import { PrimaryNetworkAssetType } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkAssetType = "nft"; +``` + +## Values + +```typescript +"secp256k1" | "nft" +``` \ No newline at end of file diff --git a/docs/models/components/primarynetworkblock.md b/docs/models/components/primarynetworkblock.md new file mode 100644 index 0000000..ebc331c --- /dev/null +++ b/docs/models/components/primarynetworkblock.md @@ -0,0 +1,33 @@ +# PrimaryNetworkBlock + +## Example Usage + +```typescript +import { PrimaryNetworkBlock } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkBlock = { + blockNumber: "", + blockHash: "", + parentHash: "", + blockTimestamp: 5013.24, + blockType: "", + txCount: 5332.06, + transactions: [""], + blockSizeBytes: 9560.84, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_check_mark: | N/A | +| `blockHash` | *string* | :heavy_check_mark: | N/A | +| `parentHash` | *string* | :heavy_check_mark: | N/A | +| `blockTimestamp` | *number* | :heavy_check_mark: | N/A | +| `blockType` | *string* | :heavy_check_mark: | N/A | +| `txCount` | *number* | :heavy_check_mark: | N/A | +| `transactions` | *string*[] | :heavy_check_mark: | N/A | +| `blockSizeBytes` | *number* | :heavy_check_mark: | N/A | +| `currentSupply` | *string* | :heavy_minus_sign: | N/A | +| `proposerDetails` | [components.ProposerDetails](../../models/components/proposerdetails.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/primarynetworkchaininfo.md b/docs/models/components/primarynetworkchaininfo.md new file mode 100644 index 0000000..0c74363 --- /dev/null +++ b/docs/models/components/primarynetworkchaininfo.md @@ -0,0 +1,19 @@ +# PrimaryNetworkChainInfo + +## Example Usage + +```typescript +import { PrimaryNetworkChainInfo } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkChainInfo = { + chainName: "x-chain", + network: "fuji", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `chainName` | [components.PrimaryNetworkChainName](../../models/components/primarynetworkchainname.md) | :heavy_check_mark: | N/A | +| `network` | [components.PrimaryNetwork](../../models/components/primarynetwork.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/primarynetworkchainname.md b/docs/models/components/primarynetworkchainname.md new file mode 100644 index 0000000..df6c3c0 --- /dev/null +++ b/docs/models/components/primarynetworkchainname.md @@ -0,0 +1,15 @@ +# PrimaryNetworkChainName + +## Example Usage + +```typescript +import { PrimaryNetworkChainName } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkChainName = "x-chain"; +``` + +## Values + +```typescript +"p-chain" | "x-chain" | "c-chain" +``` \ No newline at end of file diff --git a/docs/models/components/primarynetworkoperationtype.md b/docs/models/components/primarynetworkoperationtype.md new file mode 100644 index 0000000..9880115 --- /dev/null +++ b/docs/models/components/primarynetworkoperationtype.md @@ -0,0 +1,15 @@ +# PrimaryNetworkOperationType + +## Example Usage + +```typescript +import { PrimaryNetworkOperationType } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkOperationType = "TRANSACTION_EXPORT_PRIMARY_NETWORK_SIMPLE"; +``` + +## Values + +```typescript +"TRANSACTION_EXPORT_PRIMARY_NETWORK" | "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING" | "TRANSACTION_EXPORT_PRIMARY_NETWORK_SIMPLE" +``` \ No newline at end of file diff --git a/docs/models/components/primarynetworkoptions.md b/docs/models/components/primarynetworkoptions.md new file mode 100644 index 0000000..0f9ab5a --- /dev/null +++ b/docs/models/components/primarynetworkoptions.md @@ -0,0 +1,19 @@ +# PrimaryNetworkOptions + +## Example Usage + +```typescript +import { PrimaryNetworkOptions } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkOptions = { + includeChains: ["p-chain"], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `addresses` | *string*[] | :heavy_minus_sign: | N/A | | +| `cChainEvmAddresses` | *string*[] | :heavy_minus_sign: | N/A | | +| `includeChains` | [components.IncludeChains](../../models/components/includechains.md)[] | :heavy_check_mark: | N/A | [
"p-chain"
] | \ No newline at end of file diff --git a/docs/models/components/primarynetworktxtype.md b/docs/models/components/primarynetworktxtype.md new file mode 100644 index 0000000..8f0ebea --- /dev/null +++ b/docs/models/components/primarynetworktxtype.md @@ -0,0 +1,15 @@ +# PrimaryNetworkTxType + +## Example Usage + +```typescript +import { PrimaryNetworkTxType } from "@avalabs/avacloud-sdk/models/components"; + +let value: PrimaryNetworkTxType = "AddSubnetValidatorTx"; +``` + +## Values + +```typescript +"AddValidatorTx" | "AddSubnetValidatorTx" | "AddDelegatorTx" | "CreateChainTx" | "CreateSubnetTx" | "ImportTx" | "ExportTx" | "AdvanceTimeTx" | "RewardValidatorTx" | "RemoveSubnetValidatorTx" | "TransformSubnetTx" | "AddPermissionlessValidatorTx" | "AddPermissionlessDelegatorTx" | "BaseTx" | "TransferSubnetOwnershipTx" | "UNKNOWN" | "CreateAssetTx" | "OperationTx" +``` \ No newline at end of file diff --git a/docs/models/components/proposerdetails.md b/docs/models/components/proposerdetails.md new file mode 100644 index 0000000..2a08901 --- /dev/null +++ b/docs/models/components/proposerdetails.md @@ -0,0 +1,19 @@ +# ProposerDetails + +## Example Usage + +```typescript +import { ProposerDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: ProposerDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `proposerId` | *string* | :heavy_minus_sign: | N/A | +| `proposerParentId` | *string* | :heavy_minus_sign: | N/A | +| `proposerNodeId` | *string* | :heavy_minus_sign: | N/A | +| `proposerPChainHeight` | *number* | :heavy_minus_sign: | N/A | +| `proposerTimestamp` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/removedvalidatordetails.md b/docs/models/components/removedvalidatordetails.md new file mode 100644 index 0000000..8866f8a --- /dev/null +++ b/docs/models/components/removedvalidatordetails.md @@ -0,0 +1,35 @@ +# RemovedValidatorDetails + +## Example Usage + +```typescript +import { RemovedValidatorDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: RemovedValidatorDetails = { + txHash: "", + nodeId: "", + subnetId: "", + amountStaked: "", + startTimestamp: 9437.49, + endTimestamp: 9025.99, + removeTxHash: "", + removeTimestamp: 6818.2, + validationStatus: "removed", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `nodeId` | *string* | :heavy_check_mark: | N/A | +| `subnetId` | *string* | :heavy_check_mark: | N/A | +| `amountStaked` | *string* | :heavy_check_mark: | N/A | +| `delegationFee` | *string* | :heavy_minus_sign: | N/A | +| `startTimestamp` | *number* | :heavy_check_mark: | N/A | +| `endTimestamp` | *number* | :heavy_check_mark: | N/A | +| `blsCredentials` | [components.BlsCredentials](../../models/components/blscredentials.md) | :heavy_minus_sign: | Present for AddPermissionlessValidatorTx | +| `removeTxHash` | *string* | :heavy_check_mark: | N/A | +| `removeTimestamp` | *number* | :heavy_check_mark: | N/A | +| `validationStatus` | [components.RemovedValidatorDetailsValidationStatus](../../models/components/removedvalidatordetailsvalidationstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/removedvalidatordetailsvalidationstatus.md b/docs/models/components/removedvalidatordetailsvalidationstatus.md new file mode 100644 index 0000000..fc44ec2 --- /dev/null +++ b/docs/models/components/removedvalidatordetailsvalidationstatus.md @@ -0,0 +1,15 @@ +# RemovedValidatorDetailsValidationStatus + +## Example Usage + +```typescript +import { RemovedValidatorDetailsValidationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: RemovedValidatorDetailsValidationStatus = "removed"; +``` + +## Values + +```typescript +"removed" +``` \ No newline at end of file diff --git a/docs/models/components/requesttype.md b/docs/models/components/requesttype.md new file mode 100644 index 0000000..2330d63 --- /dev/null +++ b/docs/models/components/requesttype.md @@ -0,0 +1,17 @@ +# RequestType + +The type of request made by the client. + +## Example Usage + +```typescript +import { RequestType } from "@avalabs/avacloud-sdk/models/components"; + +let value: RequestType = "Glacier API Request"; +``` + +## Values + +```typescript +"Glacier API Request" | "Glacier RPC Request" +``` \ No newline at end of file diff --git a/docs/models/components/resourcelink.md b/docs/models/components/resourcelink.md new file mode 100644 index 0000000..9601338 --- /dev/null +++ b/docs/models/components/resourcelink.md @@ -0,0 +1,19 @@ +# ResourceLink + +## Example Usage + +```typescript +import { ResourceLink } from "@avalabs/avacloud-sdk/models/components"; + +let value: ResourceLink = { + type: "Medium", + url: "https://only-rice.net", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `type` | [components.ResourceLinkType](../../models/components/resourcelinktype.md) | :heavy_check_mark: | N/A | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/resourcelinktype.md b/docs/models/components/resourcelinktype.md new file mode 100644 index 0000000..2f46fa8 --- /dev/null +++ b/docs/models/components/resourcelinktype.md @@ -0,0 +1,15 @@ +# ResourceLinkType + +## Example Usage + +```typescript +import { ResourceLinkType } from "@avalabs/avacloud-sdk/models/components"; + +let value: ResourceLinkType = "Youtube"; +``` + +## Values + +```typescript +"Blog" | "CoinGecko" | "CoinMarketCap" | "Discord" | "Documentation" | "Facebook" | "Github" | "Instagram" | "LinkedIn" | "Medium" | "Reddit" | "Support" | "Telegram" | "TikTok" | "Twitter" | "Website" | "Whitepaper" | "Youtube" +``` \ No newline at end of file diff --git a/docs/models/components/rewards.md b/docs/models/components/rewards.md new file mode 100644 index 0000000..0e38d7a --- /dev/null +++ b/docs/models/components/rewards.md @@ -0,0 +1,21 @@ +# Rewards + +## Example Usage + +```typescript +import { Rewards } from "@avalabs/avacloud-sdk/models/components"; + +let value: Rewards = { + validationRewardAmount: "", + delegationRewardAmount: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `validationRewardAmount` | *string* | :heavy_check_mark: | N/A | +| `delegationRewardAmount` | *string* | :heavy_check_mark: | N/A | +| `rewardAddresses` | *string*[] | :heavy_minus_sign: | N/A | +| `rewardTxHash` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/rewardtype.md b/docs/models/components/rewardtype.md new file mode 100644 index 0000000..e422d97 --- /dev/null +++ b/docs/models/components/rewardtype.md @@ -0,0 +1,15 @@ +# RewardType + +## Example Usage + +```typescript +import { RewardType } from "@avalabs/avacloud-sdk/models/components"; + +let value: RewardType = "DELEGATOR"; +``` + +## Values + +```typescript +"VALIDATOR" | "DELEGATOR" | "VALIDATOR_FEE" +``` \ No newline at end of file diff --git a/docs/models/components/richaddress.md b/docs/models/components/richaddress.md new file mode 100644 index 0000000..cab4c46 --- /dev/null +++ b/docs/models/components/richaddress.md @@ -0,0 +1,26 @@ +# RichAddress + +## Example Usage + +```typescript +import { RichAddress } from "@avalabs/avacloud-sdk/models/components"; + +let value: RichAddress = { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_minus_sign: | The contract symbol. | WAVAX | +| `decimals` | *number* | :heavy_minus_sign: | The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. | 18 | +| `logoUri` | *string* | :heavy_minus_sign: | The logo uri for the address. | https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/components/security.md b/docs/models/components/security.md new file mode 100644 index 0000000..474ccd2 --- /dev/null +++ b/docs/models/components/security.md @@ -0,0 +1,17 @@ +# Security + +## Example Usage + +```typescript +import { Security } from "@avalabs/avacloud-sdk/models/components"; + +let value: Security = { + apiKey: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/sharedsecretsresponse.md b/docs/models/components/sharedsecretsresponse.md new file mode 100644 index 0000000..e4daab3 --- /dev/null +++ b/docs/models/components/sharedsecretsresponse.md @@ -0,0 +1,17 @@ +# SharedSecretsResponse + +## Example Usage + +```typescript +import { SharedSecretsResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: SharedSecretsResponse = { + secret: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `secret` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/sortbyoption.md b/docs/models/components/sortbyoption.md new file mode 100644 index 0000000..2f1c57b --- /dev/null +++ b/docs/models/components/sortbyoption.md @@ -0,0 +1,15 @@ +# SortByOption + +## Example Usage + +```typescript +import { SortByOption } from "@avalabs/avacloud-sdk/models/components"; + +let value: SortByOption = "timeRemaining"; +``` + +## Values + +```typescript +"blockIndex" | "delegationCapacity" | "timeRemaining" | "delegationFee" | "uptimePerformance" +``` \ No newline at end of file diff --git a/docs/models/components/sortorder.md b/docs/models/components/sortorder.md new file mode 100644 index 0000000..663f4db --- /dev/null +++ b/docs/models/components/sortorder.md @@ -0,0 +1,15 @@ +# SortOrder + +## Example Usage + +```typescript +import { SortOrder } from "@avalabs/avacloud-sdk/models/components"; + +let value: SortOrder = "asc"; +``` + +## Values + +```typescript +"asc" | "desc" +``` \ No newline at end of file diff --git a/docs/models/components/stakingdistribution.md b/docs/models/components/stakingdistribution.md new file mode 100644 index 0000000..8738cc4 --- /dev/null +++ b/docs/models/components/stakingdistribution.md @@ -0,0 +1,21 @@ +# StakingDistribution + +## Example Usage + +```typescript +import { StakingDistribution } from "@avalabs/avacloud-sdk/models/components"; + +let value: StakingDistribution = { + version: "", + amountStaked: "", + validatorCount: 5204.78, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `version` | *string* | :heavy_check_mark: | N/A | +| `amountStaked` | *string* | :heavy_check_mark: | N/A | +| `validatorCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/status.md b/docs/models/components/status.md new file mode 100644 index 0000000..50b7433 --- /dev/null +++ b/docs/models/components/status.md @@ -0,0 +1,15 @@ +# Status + +## Example Usage + +```typescript +import { Status } from "@avalabs/avacloud-sdk/models/components"; + +let value: Status = "pending"; +``` + +## Values + +```typescript +"pending" +``` \ No newline at end of file diff --git a/docs/models/components/subnet.md b/docs/models/components/subnet.md new file mode 100644 index 0000000..b78153c --- /dev/null +++ b/docs/models/components/subnet.md @@ -0,0 +1,39 @@ +# Subnet + +## Example Usage + +```typescript +import { Subnet } from "@avalabs/avacloud-sdk/models/components"; + +let value: Subnet = { + createBlockTimestamp: 5820.2, + createBlockIndex: "", + subnetId: "", + ownerAddresses: [""], + threshold: 1433.53, + locktime: 5373.73, + subnetOwnershipInfo: { + locktime: 0, + threshold: 1, + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + }, + blockchains: [ + { + blockchainId: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createBlockTimestamp` | *number* | :heavy_check_mark: | N/A | +| `createBlockIndex` | *string* | :heavy_check_mark: | N/A | +| `subnetId` | *string* | :heavy_check_mark: | N/A | +| ~~`ownerAddresses`~~ | *string*[] | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

This field is deprecated. Use subnetOwnershipInfo instead. | +| ~~`threshold`~~ | *number* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

This field is deprecated. Use subnetOwnershipInfo instead. | +| ~~`locktime`~~ | *number* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

This field is deprecated. Use subnetOwnershipInfo instead. | +| `subnetOwnershipInfo` | [components.SubnetOwnershipInfo](../../models/components/subnetownershipinfo.md) | :heavy_check_mark: | Latest subnet owner details for this Subnet. | +| `blockchains` | [components.BlockchainInfo](../../models/components/blockchaininfo.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/subnetownershipinfo.md b/docs/models/components/subnetownershipinfo.md new file mode 100644 index 0000000..ad7952e --- /dev/null +++ b/docs/models/components/subnetownershipinfo.md @@ -0,0 +1,21 @@ +# SubnetOwnershipInfo + +## Example Usage + +```typescript +import { SubnetOwnershipInfo } from "@avalabs/avacloud-sdk/models/components"; + +let value: SubnetOwnershipInfo = { + locktime: 0, + threshold: 1, + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `locktime` | *number* | :heavy_check_mark: | Locktime in seconds after which Subnet owners can control this Subnet. | 0 | +| `threshold` | *number* | :heavy_check_mark: | Minimum number of signatures required to sign the Subnet update transactions. | 1 | +| `addresses` | *string*[] | :heavy_check_mark: | Addresses that are eligible to sign the Subnet update transactions. | [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
] | \ No newline at end of file diff --git a/docs/models/components/teleporterdestinationtransaction.md b/docs/models/components/teleporterdestinationtransaction.md new file mode 100644 index 0000000..828d057 --- /dev/null +++ b/docs/models/components/teleporterdestinationtransaction.md @@ -0,0 +1,25 @@ +# TeleporterDestinationTransaction + +## Example Usage + +```typescript +import { TeleporterDestinationTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: TeleporterDestinationTransaction = { + txHash: "", + timestamp: 185.21, + gasSpent: "", + rewardRedeemer: "", + delivererAddress: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `timestamp` | *number* | :heavy_check_mark: | N/A | +| `gasSpent` | *string* | :heavy_check_mark: | N/A | +| `rewardRedeemer` | *string* | :heavy_check_mark: | N/A | +| `delivererAddress` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/teleporterreceipt.md b/docs/models/components/teleporterreceipt.md new file mode 100644 index 0000000..a7a9130 --- /dev/null +++ b/docs/models/components/teleporterreceipt.md @@ -0,0 +1,19 @@ +# TeleporterReceipt + +## Example Usage + +```typescript +import { TeleporterReceipt } from "@avalabs/avacloud-sdk/models/components"; + +let value: TeleporterReceipt = { + receivedMessageNonce: "", + relayerRewardAddress: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `receivedMessageNonce` | *string* | :heavy_check_mark: | N/A | +| `relayerRewardAddress` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/teleporterrewarddetails.md b/docs/models/components/teleporterrewarddetails.md new file mode 100644 index 0000000..b74acff --- /dev/null +++ b/docs/models/components/teleporterrewarddetails.md @@ -0,0 +1,35 @@ +# TeleporterRewardDetails + +## Example Usage + +```typescript +import { TeleporterRewardDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: TeleporterRewardDetails = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + value: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `name` | *string* | :heavy_check_mark: | The contract name. | Wrapped AVAX | +| `symbol` | *string* | :heavy_check_mark: | The contract symbol. | WAVAX | +| `decimals` | *number* | :heavy_check_mark: | The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. | 18 | +| `logoUri` | *string* | :heavy_minus_sign: | The logo uri for the address. | https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg | +| `ercType` | [components.TeleporterRewardDetailsErcType](../../models/components/teleporterrewarddetailserctype.md) | :heavy_check_mark: | N/A | | +| `price` | [components.Money](../../models/components/money.md) | :heavy_minus_sign: | The token price, if available. | | +| `value` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/teleporterrewarddetailserctype.md b/docs/models/components/teleporterrewarddetailserctype.md new file mode 100644 index 0000000..7efdb35 --- /dev/null +++ b/docs/models/components/teleporterrewarddetailserctype.md @@ -0,0 +1,15 @@ +# TeleporterRewardDetailsErcType + +## Example Usage + +```typescript +import { TeleporterRewardDetailsErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: TeleporterRewardDetailsErcType = "ERC-20"; +``` + +## Values + +```typescript +"ERC-20" +``` \ No newline at end of file diff --git a/docs/models/components/teleportersourcetransaction.md b/docs/models/components/teleportersourcetransaction.md new file mode 100644 index 0000000..6d843ac --- /dev/null +++ b/docs/models/components/teleportersourcetransaction.md @@ -0,0 +1,21 @@ +# TeleporterSourceTransaction + +## Example Usage + +```typescript +import { TeleporterSourceTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: TeleporterSourceTransaction = { + txHash: "", + timestamp: 3389.85, + gasSpent: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `txHash` | *string* | :heavy_check_mark: | N/A | +| `timestamp` | *number* | :heavy_check_mark: | N/A | +| `gasSpent` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/timeintervalgranularityextended.md b/docs/models/components/timeintervalgranularityextended.md new file mode 100644 index 0000000..af763b6 --- /dev/null +++ b/docs/models/components/timeintervalgranularityextended.md @@ -0,0 +1,15 @@ +# TimeIntervalGranularityExtended + +## Example Usage + +```typescript +import { TimeIntervalGranularityExtended } from "@avalabs/avacloud-sdk/models/components"; + +let value: TimeIntervalGranularityExtended = "daily"; +``` + +## Values + +```typescript +"minute" | "hourly" | "daily" | "weekly" | "monthly" +``` \ No newline at end of file diff --git a/docs/models/components/tokens.md b/docs/models/components/tokens.md new file mode 100644 index 0000000..51599f6 --- /dev/null +++ b/docs/models/components/tokens.md @@ -0,0 +1,32 @@ +# Tokens + +## Example Usage + +```typescript +import { Tokens } from "@avalabs/avacloud-sdk/models/components"; + +let value: Tokens = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "METADATA_CONTENT_TOO_LARGE", + }, +}; +``` + +## Supported Types + +### `components.Erc721Token` + +```typescript +const value: components.Erc721Token = /* values here */ +``` + +### `components.Erc1155Token` + +```typescript +const value: components.Erc1155Token = /* values here */ +``` + diff --git a/docs/models/components/transactiondetails.md b/docs/models/components/transactiondetails.md new file mode 100644 index 0000000..3b2cb48 --- /dev/null +++ b/docs/models/components/transactiondetails.md @@ -0,0 +1,59 @@ +# TransactionDetails + +## Example Usage + +```typescript +import { TransactionDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: TransactionDetails = { + nativeTransaction: { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + blockIndex: 0, + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + txStatus: "1", + txType: 1, + gasLimit: "51373", + gasUsed: "51373", + gasPrice: "470000000000", + nonce: "1", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + method: { + callType: "NATIVE_TRANSFER", + methodHash: "0xa9059cbb", + methodName: "transfer(address,uint256)", + }, + value: "10000000000000000000", + }, + erc20Transfers: [], + erc721Transfers: [], + erc1155Transfers: [], + internalTransactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `nativeTransaction` | [components.NativeTransaction](../../models/components/nativetransaction.md) | :heavy_check_mark: | The native (top-level) transaction details. | +| `erc20Transfers` | [components.Erc20TransferDetails](../../models/components/erc20transferdetails.md)[] | :heavy_minus_sign: | The list of ERC-20 transfers. | +| `erc721Transfers` | [components.Erc721TransferDetails](../../models/components/erc721transferdetails.md)[] | :heavy_minus_sign: | The list of ERC-721 transfers. | +| `erc1155Transfers` | [components.Erc1155TransferDetails](../../models/components/erc1155transferdetails.md)[] | :heavy_minus_sign: | The list of ERC-1155 transfers. | +| `internalTransactions` | [components.InternalTransactionDetails](../../models/components/internaltransactiondetails.md)[] | :heavy_minus_sign: | The list of internal transactions. Note that this list only includes CALL and CALLCODE internal transactions that had a non-zero value and CREATE/CREATE2 calls. Use a client provider to recieve a full debug trace of the transaction. | \ No newline at end of file diff --git a/docs/models/components/transactionexportmetadata.md b/docs/models/components/transactionexportmetadata.md new file mode 100644 index 0000000..01a0420 --- /dev/null +++ b/docs/models/components/transactionexportmetadata.md @@ -0,0 +1,17 @@ +# TransactionExportMetadata + +## Example Usage + +```typescript +import { TransactionExportMetadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: TransactionExportMetadata = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `code` | [components.OperationStatusCode](../../models/components/operationstatuscode.md) | :heavy_minus_sign: | N/A | +| `downloadUrl` | *string* | :heavy_minus_sign: | File download URL. Provided only for COMPLETED and COMPLETED_WITH_WARNING operations. | +| `nextDate` | *string* | :heavy_minus_sign: | The next date (YYYY-MM-DD) to use as the firstDate in follow up requests if a request results in a transaction history exceeding the max size and has been reported as `COMPLETED_WITH_WARNING` with the warning 'WarnTruncatedExport'. | \ No newline at end of file diff --git a/docs/models/components/transactionmethodtype.md b/docs/models/components/transactionmethodtype.md new file mode 100644 index 0000000..92233b4 --- /dev/null +++ b/docs/models/components/transactionmethodtype.md @@ -0,0 +1,17 @@ +# TransactionMethodType + +The contract call type. NATIVE_TRANSFER indicates a transfer of the native token without any smart-contract interaction. CONTRACT_CALL indicates a smart-contract interaction. CONTRACT_CREATION indicates a smart-contract creation. + +## Example Usage + +```typescript +import { TransactionMethodType } from "@avalabs/avacloud-sdk/models/components"; + +let value: TransactionMethodType = "NATIVE_TRANSFER"; +``` + +## Values + +```typescript +"NATIVE_TRANSFER" | "CONTRACT_CALL" | "CONTRACT_CREATION" +``` \ No newline at end of file diff --git a/docs/models/components/transactions.md b/docs/models/components/transactions.md new file mode 100644 index 0000000..81a67b9 --- /dev/null +++ b/docs/models/components/transactions.md @@ -0,0 +1,130 @@ +# Transactions + +## Example Usage + +```typescript +import { Transactions } from "@avalabs/avacloud-sdk/models/components"; + +let value: Transactions = { + txHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + chainFormat: "non-linear", + timestamp: 1600762738, + txType: "ExportTx", + memo: "0x546865204176616c616e6368652050726f6a656374", + consumedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + emittedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + amountUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + ], + amountCreated: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + assetCreated: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + createdAtTimestamp: 1675444720, + cap: "fixed", + }, + vertices: [ + { + hash: "82qPRREHmh8Cfta4PGD6GymY9ZLyvgYugqW6hj9FykpMVRz1S", + height: 1961, + timestamp: 1600762738, + }, + ], +}; +``` + +## Supported Types + +### `components.XChainNonLinearTransaction` + +```typescript +const value: components.XChainNonLinearTransaction = /* values here */ +``` + +### `components.XChainLinearTransaction` + +```typescript +const value: components.XChainLinearTransaction = /* values here */ +``` + diff --git a/docs/models/components/transactionstatus.md b/docs/models/components/transactionstatus.md new file mode 100644 index 0000000..985ab98 --- /dev/null +++ b/docs/models/components/transactionstatus.md @@ -0,0 +1,15 @@ +# TransactionStatus + +## Example Usage + +```typescript +import { TransactionStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: TransactionStatus = "success"; +``` + +## Values + +```typescript +"failed" | "success" +``` \ No newline at end of file diff --git a/docs/models/components/transactionvertexdetail.md b/docs/models/components/transactionvertexdetail.md new file mode 100644 index 0000000..7b735e9 --- /dev/null +++ b/docs/models/components/transactionvertexdetail.md @@ -0,0 +1,21 @@ +# TransactionVertexDetail + +## Example Usage + +```typescript +import { TransactionVertexDetail } from "@avalabs/avacloud-sdk/models/components"; + +let value: TransactionVertexDetail = { + hash: "82qPRREHmh8Cfta4PGD6GymY9ZLyvgYugqW6hj9FykpMVRz1S", + height: 1961, + timestamp: 1600762738, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `hash` | *string* | :heavy_check_mark: | Vertex ID of the vertex this transaction belongs to. | 82qPRREHmh8Cfta4PGD6GymY9ZLyvgYugqW6hj9FykpMVRz1S | +| `height` | *number* | :heavy_check_mark: | Vertex height of the vertex this transaction belongs to. | 1961 | +| `timestamp` | *number* | :heavy_check_mark: | Timestamp in seconds this vertex was accepted. | 1600762738 | \ No newline at end of file diff --git a/docs/models/components/transfers.md b/docs/models/components/transfers.md new file mode 100644 index 0000000..2e60306 --- /dev/null +++ b/docs/models/components/transfers.md @@ -0,0 +1,66 @@ +# Transfers + +## Example Usage + +```typescript +import { Transfers } from "@avalabs/avacloud-sdk/models/components"; + +let value: Transfers = { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txHash: "0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4", + from: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + to: { + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }, + logIndex: 5542.42, + value: "10000000000000000000", + erc20Token: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + }, +}; +``` + +## Supported Types + +### `components.Erc20Transfer` + +```typescript +const value: components.Erc20Transfer = /* values here */ +``` + +### `components.Erc721Transfer` + +```typescript +const value: components.Erc721Transfer = /* values here */ +``` + +### `components.Erc1155Transfer` + +```typescript +const value: components.Erc1155Transfer = /* values here */ +``` + diff --git a/docs/models/components/txtype.md b/docs/models/components/txtype.md new file mode 100644 index 0000000..6ddf19b --- /dev/null +++ b/docs/models/components/txtype.md @@ -0,0 +1,17 @@ +# TxType + +Type of transaction. + +## Example Usage + +```typescript +import { TxType } from "@avalabs/avacloud-sdk/models/components"; + +let value: TxType = "ExportTx"; +``` + +## Values + +```typescript +"ExportTx" +``` \ No newline at end of file diff --git a/docs/models/components/unknowncontract.md b/docs/models/components/unknowncontract.md new file mode 100644 index 0000000..c76bccb --- /dev/null +++ b/docs/models/components/unknowncontract.md @@ -0,0 +1,34 @@ +# UnknownContract + +## Example Usage + +```typescript +import { UnknownContract } from "@avalabs/avacloud-sdk/models/components"; + +let value: UnknownContract = { + name: "Wrapped AVAX", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + deploymentDetails: { + txHash: "", + deployerAddress: "", + }, + ercType: "UNKNOWN", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | The contract name. | Wrapped AVAX | +| `description` | *string* | :heavy_minus_sign: | N/A | | +| `officialSite` | *string* | :heavy_minus_sign: | N/A | | +| `email` | *string* | :heavy_minus_sign: | N/A | | +| `logoAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `bannerAsset` | [components.ImageAsset](../../models/components/imageasset.md) | :heavy_minus_sign: | N/A | | +| `color` | *string* | :heavy_minus_sign: | N/A | | +| `resourceLinks` | [components.ResourceLink](../../models/components/resourcelink.md)[] | :heavy_minus_sign: | N/A | | +| `tags` | *string*[] | :heavy_minus_sign: | N/A | | +| `address` | *string* | :heavy_check_mark: | A wallet or contract address in mixed-case checksum encoding. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `deploymentDetails` | [components.ContractDeploymentDetails](../../models/components/contractdeploymentdetails.md) | :heavy_check_mark: | N/A | | +| `ercType` | [components.UnknownContractErcType](../../models/components/unknowncontracterctype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/unknowncontracterctype.md b/docs/models/components/unknowncontracterctype.md new file mode 100644 index 0000000..f526d32 --- /dev/null +++ b/docs/models/components/unknowncontracterctype.md @@ -0,0 +1,15 @@ +# UnknownContractErcType + +## Example Usage + +```typescript +import { UnknownContractErcType } from "@avalabs/avacloud-sdk/models/components"; + +let value: UnknownContractErcType = "UNKNOWN"; +``` + +## Values + +```typescript +"UNKNOWN" +``` \ No newline at end of file diff --git a/docs/models/components/updatewebhookrequest.md b/docs/models/components/updatewebhookrequest.md new file mode 100644 index 0000000..4d55ad4 --- /dev/null +++ b/docs/models/components/updatewebhookrequest.md @@ -0,0 +1,20 @@ +# UpdateWebhookRequest + +## Example Usage + +```typescript +import { UpdateWebhookRequest } from "@avalabs/avacloud-sdk/models/components"; + +let value: UpdateWebhookRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | +| `url` | *string* | :heavy_minus_sign: | N/A | +| `status` | [components.WebhookStatusType](../../models/components/webhookstatustype.md) | :heavy_minus_sign: | N/A | +| `includeInternalTxs` | *boolean* | :heavy_minus_sign: | N/A | +| `includeLogs` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/usagemetricsgroupbyenum.md b/docs/models/components/usagemetricsgroupbyenum.md new file mode 100644 index 0000000..abf2c9b --- /dev/null +++ b/docs/models/components/usagemetricsgroupbyenum.md @@ -0,0 +1,15 @@ +# UsageMetricsGroupByEnum + +## Example Usage + +```typescript +import { UsageMetricsGroupByEnum } from "@avalabs/avacloud-sdk/models/components"; + +let value: UsageMetricsGroupByEnum = "requestPath"; +``` + +## Values + +```typescript +"requestPath" | "responseCode" | "chainId" | "apiKeyId" | "requestType" +``` \ No newline at end of file diff --git a/docs/models/components/usagemetricsresponsedto.md b/docs/models/components/usagemetricsresponsedto.md new file mode 100644 index 0000000..16c5378 --- /dev/null +++ b/docs/models/components/usagemetricsresponsedto.md @@ -0,0 +1,37 @@ +# UsageMetricsResponseDTO + +## Example Usage + +```typescript +import { UsageMetricsResponseDTO } from "@avalabs/avacloud-sdk/models/components"; + +let value: UsageMetricsResponseDTO = { + aggregateDuration: "", + orgId: "", + metrics: [ + { + timestamp: 2879.91, + values: [ + { + groupedBy: "responseCode", + totalRequests: 3834.62, + requestsPerSecond: 6180.16, + successRatePercent: 7491.7, + medianResponseTimeMsecs: 4287.69, + invalidRequests: 8784.53, + apiCreditsUsed: 1354.74, + apiCreditsWasted: 1028.63, + }, + ], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `aggregateDuration` | *string* | :heavy_check_mark: | Duration in which the metrics value is aggregated | +| `orgId` | *string* | :heavy_check_mark: | Org ID for which the metrics are aggregated | +| `metrics` | [components.Metric](../../models/components/metric.md)[] | :heavy_check_mark: | Metrics values | \ No newline at end of file diff --git a/docs/models/components/usagemetricsvaluedto.md b/docs/models/components/usagemetricsvaluedto.md new file mode 100644 index 0000000..d175509 --- /dev/null +++ b/docs/models/components/usagemetricsvaluedto.md @@ -0,0 +1,32 @@ +# UsageMetricsValueDTO + +## Example Usage + +```typescript +import { UsageMetricsValueDTO } from "@avalabs/avacloud-sdk/models/components"; + +let value: UsageMetricsValueDTO = { + groupedBy: "chainId", + totalRequests: 2212.62, + requestsPerSecond: 8965.47, + successRatePercent: 1412.64, + medianResponseTimeMsecs: 3675.62, + invalidRequests: 972.6, + apiCreditsUsed: 4358.65, + apiCreditsWasted: 9840.43, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `groupedBy` | [components.GroupedBy](../../models/components/groupedby.md) | :heavy_check_mark: | Column name used for data aggregation | +| `groupValue` | *components.GroupValue* | :heavy_minus_sign: | The value of the column used for data aggregation | +| `totalRequests` | *number* | :heavy_check_mark: | The total number of requests | +| `requestsPerSecond` | *number* | :heavy_check_mark: | The number of requests per second | +| `successRatePercent` | *number* | :heavy_check_mark: | The success rate percentage | +| `medianResponseTimeMsecs` | *number* | :heavy_check_mark: | The median response time in milliseconds | +| `invalidRequests` | *number* | :heavy_check_mark: | The number of invalid requests | +| `apiCreditsUsed` | *number* | :heavy_check_mark: | The number of API credits used | +| `apiCreditsWasted` | *number* | :heavy_check_mark: | The number of API credits wasted on invalid requests | \ No newline at end of file diff --git a/docs/models/components/utilityaddresses.md b/docs/models/components/utilityaddresses.md new file mode 100644 index 0000000..238e825 --- /dev/null +++ b/docs/models/components/utilityaddresses.md @@ -0,0 +1,15 @@ +# UtilityAddresses + +## Example Usage + +```typescript +import { UtilityAddresses } from "@avalabs/avacloud-sdk/models/components"; + +let value: UtilityAddresses = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `multicall` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/utxo.md b/docs/models/components/utxo.md new file mode 100644 index 0000000..8a0d597 --- /dev/null +++ b/docs/models/components/utxo.md @@ -0,0 +1,58 @@ +# Utxo + +## Example Usage + +```typescript +import { Utxo } from "@avalabs/avacloud-sdk/models/components"; + +let value: Utxo = { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `addresses` | *string*[] | :heavy_check_mark: | Addresses that are eligible to sign the consumption of this output. | [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
] | +| `asset` | [components.AssetAmount](../../models/components/assetamount.md) | :heavy_check_mark: | N/A | | +| `consumedOnChainId` | *string* | :heavy_check_mark: | Blockchain ID on which this output is consumed on. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `consumingTxHash` | *string* | :heavy_minus_sign: | Transaction ID that consumed this output. | 3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c | +| `createdOnChainId` | *string* | :heavy_check_mark: | Blockchain ID on which this output is created on. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `utxoId` | *string* | :heavy_check_mark: | UTXO ID for this output. | 68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC | +| `consumingTxTimestamp` | *number* | :heavy_minus_sign: | Unix timestamp in seconds at which this output was consumed. | 1599696000 | +| `creationTxHash` | *string* | :heavy_check_mark: | Transaction ID that created this output. | FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z | +| `credentials` | [components.UtxoCredential](../../models/components/utxocredential.md)[] | :heavy_minus_sign: | Credentials that signed the transaction to consume this utxo | | +| `groupId` | *number* | :heavy_minus_sign: | Index representing the minting set for the NFT mint output. | | +| `locktime` | *number* | :heavy_check_mark: | Locktime in seconds after which this output can be consumed. | 0 | +| `outputIndex` | *string* | :heavy_check_mark: | Postion of this output in a list of lexiographically sorted outputs of a transaction. | 38 | +| `payload` | *string* | :heavy_minus_sign: | Hex encoded data for NFT assets. | | +| `threshold` | *number* | :heavy_check_mark: | Minimum number of signatures required to consume this output. | 1 | +| `timestamp` | *number* | :heavy_check_mark: | Unix timestamp in seconds at which this outptut was created. | 1599696000 | +| `utxoType` | *string* | :heavy_check_mark: | Type of output. | mint | \ No newline at end of file diff --git a/docs/models/components/utxocredential.md b/docs/models/components/utxocredential.md new file mode 100644 index 0000000..fb9e750 --- /dev/null +++ b/docs/models/components/utxocredential.md @@ -0,0 +1,20 @@ +# UtxoCredential + +## Example Usage + +```typescript +import { UtxoCredential } from "@avalabs/avacloud-sdk/models/components"; + +let value: UtxoCredential = { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `signature` | *string* | :heavy_minus_sign: | Signature provided to consume the output. | bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA | +| `publicKey` | *string* | :heavy_minus_sign: | Public key associated with the signature. | AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI | \ No newline at end of file diff --git a/docs/models/components/utxotype.md b/docs/models/components/utxotype.md new file mode 100644 index 0000000..69ca52f --- /dev/null +++ b/docs/models/components/utxotype.md @@ -0,0 +1,15 @@ +# UtxoType + +## Example Usage + +```typescript +import { UtxoType } from "@avalabs/avacloud-sdk/models/components"; + +let value: UtxoType = "TRANSFER"; +``` + +## Values + +```typescript +"STAKE" | "TRANSFER" +``` \ No newline at end of file diff --git a/docs/models/components/validationstatus.md b/docs/models/components/validationstatus.md new file mode 100644 index 0000000..9585f9c --- /dev/null +++ b/docs/models/components/validationstatus.md @@ -0,0 +1,15 @@ +# ValidationStatus + +## Example Usage + +```typescript +import { ValidationStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: ValidationStatus = "completed"; +``` + +## Values + +```typescript +"completed" +``` \ No newline at end of file diff --git a/docs/models/components/validationstatustype.md b/docs/models/components/validationstatustype.md new file mode 100644 index 0000000..7607cb3 --- /dev/null +++ b/docs/models/components/validationstatustype.md @@ -0,0 +1,15 @@ +# ValidationStatusType + +## Example Usage + +```typescript +import { ValidationStatusType } from "@avalabs/avacloud-sdk/models/components"; + +let value: ValidationStatusType = "completed"; +``` + +## Values + +```typescript +"completed" | "active" | "pending" | "removed" +``` \ No newline at end of file diff --git a/docs/models/components/validatorhealthdetails.md b/docs/models/components/validatorhealthdetails.md new file mode 100644 index 0000000..042af31 --- /dev/null +++ b/docs/models/components/validatorhealthdetails.md @@ -0,0 +1,23 @@ +# ValidatorHealthDetails + +## Example Usage + +```typescript +import { ValidatorHealthDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: ValidatorHealthDetails = { + reachabilityPercent: 6176.36, + benchedPChainRequestsPercent: 1496.75, + benchedXChainRequestsPercent: 6120.96, + benchedCChainRequestsPercent: 2223.21, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `reachabilityPercent` | *number* | :heavy_check_mark: | Percent of requests responded to in last polling. | +| `benchedPChainRequestsPercent` | *number* | :heavy_check_mark: | Percent of requests benched on the P-Chain in last polling. | +| `benchedXChainRequestsPercent` | *number* | :heavy_check_mark: | Percentage of requests benched on the X-Chain in last polling. | +| `benchedCChainRequestsPercent` | *number* | :heavy_check_mark: | Percentage of requests benched on the C-Chain in last polling. | \ No newline at end of file diff --git a/docs/models/components/validators.md b/docs/models/components/validators.md new file mode 100644 index 0000000..58c00c2 --- /dev/null +++ b/docs/models/components/validators.md @@ -0,0 +1,46 @@ +# Validators + +## Example Usage + +```typescript +import { Validators } from "@avalabs/avacloud-sdk/models/components"; + +let value: Validators = { + txHash: "", + nodeId: "", + subnetId: "", + amountStaked: "", + startTimestamp: 7586.16, + endTimestamp: 5218.48, + removeTxHash: "", + removeTimestamp: 1059.07, + validationStatus: "removed", +}; +``` + +## Supported Types + +### `components.ActiveValidatorDetails` + +```typescript +const value: components.ActiveValidatorDetails = /* values here */ +``` + +### `components.PendingValidatorDetails` + +```typescript +const value: components.PendingValidatorDetails = /* values here */ +``` + +### `components.CompletedValidatorDetails` + +```typescript +const value: components.CompletedValidatorDetails = /* values here */ +``` + +### `components.RemovedValidatorDetails` + +```typescript +const value: components.RemovedValidatorDetails = /* values here */ +``` + diff --git a/docs/models/components/validatorsdetails.md b/docs/models/components/validatorsdetails.md new file mode 100644 index 0000000..e321155 --- /dev/null +++ b/docs/models/components/validatorsdetails.md @@ -0,0 +1,31 @@ +# ValidatorsDetails + +## Example Usage + +```typescript +import { ValidatorsDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: ValidatorsDetails = { + validatorCount: 8009.11, + totalAmountStaked: "", + estimatedAnnualStakingReward: "", + stakingDistributionByVersion: [ + { + version: "", + amountStaked: "", + validatorCount: 4614.79, + }, + ], + stakingRatio: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `validatorCount` | *number* | :heavy_check_mark: | N/A | +| `totalAmountStaked` | *string* | :heavy_check_mark: | N/A | +| `estimatedAnnualStakingReward` | *string* | :heavy_check_mark: | N/A | +| `stakingDistributionByVersion` | [components.StakingDistribution](../../models/components/stakingdistribution.md)[] | :heavy_check_mark: | N/A | +| `stakingRatio` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/vmname.md b/docs/models/components/vmname.md new file mode 100644 index 0000000..1e3d8d1 --- /dev/null +++ b/docs/models/components/vmname.md @@ -0,0 +1,15 @@ +# VmName + +## Example Usage + +```typescript +import { VmName } from "@avalabs/avacloud-sdk/models/components"; + +let value: VmName = "EVM"; +``` + +## Values + +```typescript +"EVM" | "BITCOIN" | "ETHEREUM" +``` \ No newline at end of file diff --git a/docs/models/components/webhookresponse.md b/docs/models/components/webhookresponse.md new file mode 100644 index 0000000..13c8c7d --- /dev/null +++ b/docs/models/components/webhookresponse.md @@ -0,0 +1,38 @@ +# WebhookResponse + +## Example Usage + +```typescript +import { WebhookResponse } from "@avalabs/avacloud-sdk/models/components"; + +let value: WebhookResponse = { + id: "", + eventType: "address_activity", + metadata: { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + eventSignatures: ["0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"], + }, + url: "http://wise-airbag.org", + chainId: "", + status: "active", + createdAt: 117.14, + name: "", + description: "Right-sized executive throughput", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `eventType` | [components.EventType](../../models/components/eventtype.md) | :heavy_check_mark: | N/A | +| `metadata` | *components.WebhookResponseMetadata* | :heavy_check_mark: | N/A | +| `includeInternalTxs` | *boolean* | :heavy_minus_sign: | Whether to include traces in the webhook payload. | +| `includeLogs` | *boolean* | :heavy_minus_sign: | Whether to include logs in the webhook payload. | +| `url` | *string* | :heavy_check_mark: | N/A | +| `chainId` | *string* | :heavy_check_mark: | N/A | +| `status` | [components.WebhookStatusType](../../models/components/webhookstatustype.md) | :heavy_check_mark: | N/A | +| `createdAt` | *number* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `description` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/webhookresponsemetadata.md b/docs/models/components/webhookresponsemetadata.md new file mode 100644 index 0000000..40e0994 --- /dev/null +++ b/docs/models/components/webhookresponsemetadata.md @@ -0,0 +1,21 @@ +# WebhookResponseMetadata + +## Example Usage + +```typescript +import { WebhookResponseMetadata } from "@avalabs/avacloud-sdk/models/components"; + +let value: WebhookResponseMetadata = { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + eventSignatures: ["0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"], +}; +``` + +## Supported Types + +### `components.AddressActivityMetadata` + +```typescript +const value: components.AddressActivityMetadata = /* values here */ +``` + diff --git a/docs/models/components/webhookstatus.md b/docs/models/components/webhookstatus.md new file mode 100644 index 0000000..a505b32 --- /dev/null +++ b/docs/models/components/webhookstatus.md @@ -0,0 +1,15 @@ +# WebhookStatus + +## Example Usage + +```typescript +import { WebhookStatus } from "@avalabs/avacloud-sdk/models/components"; + +let value: WebhookStatus = "active"; +``` + +## Values + +```typescript +"active" | "inactive" +``` \ No newline at end of file diff --git a/docs/models/components/webhookstatustype.md b/docs/models/components/webhookstatustype.md new file mode 100644 index 0000000..424ae88 --- /dev/null +++ b/docs/models/components/webhookstatustype.md @@ -0,0 +1,15 @@ +# WebhookStatusType + +## Example Usage + +```typescript +import { WebhookStatusType } from "@avalabs/avacloud-sdk/models/components"; + +let value: WebhookStatusType = "inactive"; +``` + +## Values + +```typescript +"active" | "inactive" +``` \ No newline at end of file diff --git a/docs/models/components/xchainassetdetails.md b/docs/models/components/xchainassetdetails.md new file mode 100644 index 0000000..7688c0e --- /dev/null +++ b/docs/models/components/xchainassetdetails.md @@ -0,0 +1,29 @@ +# XChainAssetDetails + +## Example Usage + +```typescript +import { XChainAssetDetails } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainAssetDetails = { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + createdAtTimestamp: 1675444720, + cap: "fixed", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `assetId` | *string* | :heavy_check_mark: | Unique ID for an asset. | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | +| `name` | *string* | :heavy_check_mark: | Name of this asset. | Avalanche | +| `symbol` | *string* | :heavy_check_mark: | Symbol for this asset (max 4 characters). | AVAX | +| `denomination` | *number* | :heavy_check_mark: | Denomination of this asset to represent fungibility. | 9 | +| `type` | [components.PrimaryNetworkAssetType](../../models/components/primarynetworkassettype.md) | :heavy_check_mark: | Type of asset like SECP256K1 or NFT. | | +| `createdAtTimestamp` | *number* | :heavy_check_mark: | Timestamp in seconds this asset was created on. | 1675444720 | +| `cap` | [components.PrimaryNetworkAssetCap](../../models/components/primarynetworkassetcap.md) | :heavy_check_mark: | Cap represents if an asset is a variable or fixed cap asset. | | \ No newline at end of file diff --git a/docs/models/components/xchainbalances.md b/docs/models/components/xchainbalances.md new file mode 100644 index 0000000..f5f95c0 --- /dev/null +++ b/docs/models/components/xchainbalances.md @@ -0,0 +1,65 @@ +# XChainBalances + +## Example Usage + +```typescript +import { XChainBalances } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainBalances = { + locked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + unlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + }, + ], + atomicMemoryUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + atomicMemoryLocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `locked` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing X-chain Asset balance information. | +| `unlocked` | [components.AggregatedAssetAmount](../../models/components/aggregatedassetamount.md)[] | :heavy_check_mark: | A list of objects containing X-chain Asset balance information. | +| `atomicMemoryUnlocked` | [components.XChainSharedAssetBalance](../../models/components/xchainsharedassetbalance.md)[] | :heavy_check_mark: | N/A | +| `atomicMemoryLocked` | [components.XChainSharedAssetBalance](../../models/components/xchainsharedassetbalance.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/xchainid.md b/docs/models/components/xchainid.md new file mode 100644 index 0000000..8481fdc --- /dev/null +++ b/docs/models/components/xchainid.md @@ -0,0 +1,15 @@ +# XChainId + +## Example Usage + +```typescript +import { XChainId } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainId = "x-chain"; +``` + +## Values + +```typescript +"2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM" | "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm" | "x-chain" +``` \ No newline at end of file diff --git a/docs/models/components/xchainlineartransaction.md b/docs/models/components/xchainlineartransaction.md new file mode 100644 index 0000000..c261881 --- /dev/null +++ b/docs/models/components/xchainlineartransaction.md @@ -0,0 +1,129 @@ +# XChainLinearTransaction + +## Example Usage + +```typescript +import { XChainLinearTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainLinearTransaction = { + txHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + chainFormat: "non-linear", + timestamp: 1600762738, + txType: "ImportTx", + memo: "0x546865204176616c616e6368652050726f6a656374", + consumedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + emittedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + amountUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + amountCreated: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + assetCreated: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + createdAtTimestamp: 1675444720, + cap: "fixed", + }, + blockHeight: 1005, + blockHash: "82qPRREHmh8Cfta4PGD6GymY9ZLyvgYugqW6hj9FykpMVRz1S", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | Unique ID for this transaction. | 3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c | +| `chainFormat` | [components.XChainLinearTransactionChainFormat](../../models/components/xchainlineartransactionchainformat.md) | :heavy_check_mark: | Represents chain format this transaction is included in. | non-linear | +| `timestamp` | *number* | :heavy_check_mark: | Latest timestamp in seconds this transaction was accepted out of the same transaction accepted in other vertices. | 1600762738 | +| `txType` | [components.XChainTransactionType](../../models/components/xchaintransactiontype.md) | :heavy_check_mark: | Type of transaction. | | +| `memo` | *string* | :heavy_check_mark: | Hex encoded memo bytes for this transaction. | 0x546865204176616c616e6368652050726f6a656374 | +| `consumedUtxos` | [components.Utxo](../../models/components/utxo.md)[] | :heavy_check_mark: | N/A | | +| `emittedUtxos` | [components.Utxo](../../models/components/utxo.md)[] | :heavy_check_mark: | N/A | | +| `amountUnlocked` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets unlocked by inputs of this transaction. | | +| `amountCreated` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets created by outputs of this transaction. | | +| `sourceChain` | *string* | :heavy_minus_sign: | Source chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `destinationChain` | *string* | :heavy_minus_sign: | Destination chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `assetCreated` | [components.XChainAssetDetails](../../models/components/xchainassetdetails.md) | :heavy_minus_sign: | AssetAmount details of the asset created in CreateAssetTx | | +| `blockHeight` | *number* | :heavy_check_mark: | Height of the block this transaction belongs to. | 1005 | +| `blockHash` | *string* | :heavy_check_mark: | Hash of the block this transaction belongs to. | 82qPRREHmh8Cfta4PGD6GymY9ZLyvgYugqW6hj9FykpMVRz1S | \ No newline at end of file diff --git a/docs/models/components/xchainlineartransactionchainformat.md b/docs/models/components/xchainlineartransactionchainformat.md new file mode 100644 index 0000000..db02975 --- /dev/null +++ b/docs/models/components/xchainlineartransactionchainformat.md @@ -0,0 +1,17 @@ +# XChainLinearTransactionChainFormat + +Represents chain format this transaction is included in. + +## Example Usage + +```typescript +import { XChainLinearTransactionChainFormat } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainLinearTransactionChainFormat = "non-linear"; +``` + +## Values + +```typescript +"non-linear" | "linear" +``` \ No newline at end of file diff --git a/docs/models/components/xchainnonlineartransaction.md b/docs/models/components/xchainnonlineartransaction.md new file mode 100644 index 0000000..80054a0 --- /dev/null +++ b/docs/models/components/xchainnonlineartransaction.md @@ -0,0 +1,133 @@ +# XChainNonLinearTransaction + +## Example Usage + +```typescript +import { XChainNonLinearTransaction } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainNonLinearTransaction = { + txHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + chainFormat: "non-linear", + timestamp: 1600762738, + txType: "OperationTx", + memo: "0x546865204176616c616e6368652050726f6a656374", + consumedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + emittedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], + amountUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + ], + amountCreated: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + assetCreated: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + createdAtTimestamp: 1675444720, + cap: "fixed", + }, + vertices: [ + { + hash: "82qPRREHmh8Cfta4PGD6GymY9ZLyvgYugqW6hj9FykpMVRz1S", + height: 1961, + timestamp: 1600762738, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `txHash` | *string* | :heavy_check_mark: | Unique ID for this transaction. | 3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c | +| `chainFormat` | [components.ChainFormat](../../models/components/chainformat.md) | :heavy_check_mark: | Represents chain format this transaction is included in. | non-linear | +| `timestamp` | *number* | :heavy_check_mark: | Latest timestamp in seconds this transaction was accepted out of the same transaction accepted in other vertices. | 1600762738 | +| `txType` | [components.XChainTransactionType](../../models/components/xchaintransactiontype.md) | :heavy_check_mark: | Type of transaction. | | +| `memo` | *string* | :heavy_check_mark: | Hex encoded memo bytes for this transaction. | 0x546865204176616c616e6368652050726f6a656374 | +| `consumedUtxos` | [components.Utxo](../../models/components/utxo.md)[] | :heavy_check_mark: | N/A | | +| `emittedUtxos` | [components.Utxo](../../models/components/utxo.md)[] | :heavy_check_mark: | N/A | | +| `amountUnlocked` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets unlocked by inputs of this transaction. | | +| `amountCreated` | [components.AssetAmount](../../models/components/assetamount.md)[] | :heavy_check_mark: | Assets created by outputs of this transaction. | | +| `sourceChain` | *string* | :heavy_minus_sign: | Source chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `destinationChain` | *string* | :heavy_minus_sign: | Destination chain for an atomic transaction. | 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM | +| `assetCreated` | [components.XChainAssetDetails](../../models/components/xchainassetdetails.md) | :heavy_minus_sign: | AssetAmount details of the asset created in CreateAssetTx | | +| `vertices` | [components.TransactionVertexDetail](../../models/components/transactionvertexdetail.md)[] | :heavy_check_mark: | A transaction on X-Chain can be accepted over multiple vertices. | | \ No newline at end of file diff --git a/docs/models/components/xchainsharedassetbalance.md b/docs/models/components/xchainsharedassetbalance.md new file mode 100644 index 0000000..10843b0 --- /dev/null +++ b/docs/models/components/xchainsharedassetbalance.md @@ -0,0 +1,31 @@ +# XChainSharedAssetBalance + +## Example Usage + +```typescript +import { XChainSharedAssetBalance } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainSharedAssetBalance = { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `assetId` | *string* | :heavy_check_mark: | Unique ID for an asset. | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | +| `name` | *string* | :heavy_check_mark: | Name of this asset. | Avalanche | +| `symbol` | *string* | :heavy_check_mark: | Symbol for this asset (max 4 characters). | AVAX | +| `denomination` | *number* | :heavy_check_mark: | Denomination of this asset to represent fungibility. | 9 | +| `type` | [components.PrimaryNetworkAssetType](../../models/components/primarynetworkassettype.md) | :heavy_check_mark: | Type of asset like SECP256K1 or NFT. | | +| `amount` | *string* | :heavy_check_mark: | Amount of the asset. | 5001000 | +| `utxoCount` | *number* | :heavy_check_mark: | N/A | 1 | +| `sharedWithChainId` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/xchaintransactiontype.md b/docs/models/components/xchaintransactiontype.md new file mode 100644 index 0000000..000a816 --- /dev/null +++ b/docs/models/components/xchaintransactiontype.md @@ -0,0 +1,17 @@ +# XChainTransactionType + +Type of transaction. + +## Example Usage + +```typescript +import { XChainTransactionType } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainTransactionType = "ExportTx"; +``` + +## Values + +```typescript +"BaseTx" | "CreateAssetTx" | "OperationTx" | "ImportTx" | "ExportTx" | "UNKNOWN" +``` \ No newline at end of file diff --git a/docs/models/components/xchainvertex.md b/docs/models/components/xchainvertex.md new file mode 100644 index 0000000..d301a46 --- /dev/null +++ b/docs/models/components/xchainvertex.md @@ -0,0 +1,31 @@ +# XChainVertex + +## Example Usage + +```typescript +import { XChainVertex } from "@avalabs/avacloud-sdk/models/components"; + +let value: XChainVertex = { + vertexHash: "", + parentHashes: [""], + vertexHeight: 191.93, + vertexIndex: 4701.32, + vertexTimestamp: 3015.75, + txCount: 7160.75, + transactions: [""], + vertexSizeBytes: 6601.74, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `vertexHash` | *string* | :heavy_check_mark: | N/A | +| `parentHashes` | *string*[] | :heavy_check_mark: | N/A | +| `vertexHeight` | *number* | :heavy_check_mark: | N/A | +| `vertexIndex` | *number* | :heavy_check_mark: | N/A | +| `vertexTimestamp` | *number* | :heavy_check_mark: | N/A | +| `txCount` | *number* | :heavy_check_mark: | N/A | +| `transactions` | *string*[] | :heavy_check_mark: | N/A | +| `vertexSizeBytes` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/badgateway.md b/docs/models/errors/badgateway.md new file mode 100644 index 0000000..19d718b --- /dev/null +++ b/docs/models/errors/badgateway.md @@ -0,0 +1,20 @@ +# BadGateway + +This is an internal error indicating invalid response + received by the client-facing proxy or gateway from the upstream server. + +## Example Usage + +```typescript +import { BadGateway } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.BadGatewayMessage* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 502 | +| `error` | *string* | :heavy_check_mark: | The type of error | Bad Gateway | \ No newline at end of file diff --git a/docs/models/errors/badgatewaymessage.md b/docs/models/errors/badgatewaymessage.md new file mode 100644 index 0000000..37fa9ed --- /dev/null +++ b/docs/models/errors/badgatewaymessage.md @@ -0,0 +1,26 @@ +# BadGatewayMessage + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { BadGatewayMessage } from "@avalabs/avacloud-sdk/models/errors"; + +let value: BadGatewayMessage = [""]; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/errors/badrequest.md b/docs/models/errors/badrequest.md new file mode 100644 index 0000000..92c96a2 --- /dev/null +++ b/docs/models/errors/badrequest.md @@ -0,0 +1,21 @@ +# BadRequest + +Bad requests generally mean the client has passed invalid + or malformed parameters. Error messages in the response could help in + evaluating the error. + +## Example Usage + +```typescript +import { BadRequest } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.Message* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 400 | +| `error` | *string* | :heavy_check_mark: | The type of error | Bad Request | \ No newline at end of file diff --git a/docs/models/errors/details.md b/docs/models/errors/details.md new file mode 100644 index 0000000..1e5cc95 --- /dev/null +++ b/docs/models/errors/details.md @@ -0,0 +1,16 @@ +# Details + +## Example Usage + +```typescript +import { Details } from "@avalabs/avacloud-sdk/models/errors"; + +let value: Details = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `status` | *string* | :heavy_minus_sign: | N/A | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/errors/errort.md b/docs/models/errors/errort.md new file mode 100644 index 0000000..dd74109 --- /dev/null +++ b/docs/models/errors/errort.md @@ -0,0 +1,16 @@ +# ErrorT + +## Example Usage + +```typescript +import { ErrorT } from "@avalabs/avacloud-sdk/models/errors"; + +let value: ErrorT = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `status` | *string* | :heavy_minus_sign: | N/A | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/errors/forbidden.md b/docs/models/errors/forbidden.md new file mode 100644 index 0000000..593c599 --- /dev/null +++ b/docs/models/errors/forbidden.md @@ -0,0 +1,21 @@ +# Forbidden + +When a client attempts to access resources with valid + credentials but doesn't have the privilege to perform that action, + the server responds with 403. + +## Example Usage + +```typescript +import { Forbidden } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.ForbiddenMessage* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 403 | +| `error` | *string* | :heavy_check_mark: | The type of error | Forbidden | \ No newline at end of file diff --git a/docs/models/errors/forbiddenmessage.md b/docs/models/errors/forbiddenmessage.md new file mode 100644 index 0000000..2f8ec57 --- /dev/null +++ b/docs/models/errors/forbiddenmessage.md @@ -0,0 +1,26 @@ +# ForbiddenMessage + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { ForbiddenMessage } from "@avalabs/avacloud-sdk/models/errors"; + +let value: ForbiddenMessage = [""]; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/errors/glacierhealthcheckresponsebody.md b/docs/models/errors/glacierhealthcheckresponsebody.md new file mode 100644 index 0000000..64f7203 --- /dev/null +++ b/docs/models/errors/glacierhealthcheckresponsebody.md @@ -0,0 +1,20 @@ +# GlacierHealthCheckResponseBody + +The Health Check is not successful + +## Example Usage + +```typescript +import { GlacierHealthCheckResponseBody } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `status` | *string* | :heavy_minus_sign: | N/A | error | +| `info` | Record | :heavy_minus_sign: | N/A | {
"database": {
"status": "up"
}
} | +| `error` | Record | :heavy_minus_sign: | N/A | {
"redis": {
"status": "down",
"message": "Could not connect"
}
} | +| `details` | Record | :heavy_minus_sign: | N/A | {
"database": {
"status": "up"
},
"redis": {
"status": "down",
"message": "Could not connect"
}
} | \ No newline at end of file diff --git a/docs/models/errors/info.md b/docs/models/errors/info.md new file mode 100644 index 0000000..338c5e4 --- /dev/null +++ b/docs/models/errors/info.md @@ -0,0 +1,16 @@ +# Info + +## Example Usage + +```typescript +import { Info } from "@avalabs/avacloud-sdk/models/errors"; + +let value: Info = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `status` | *string* | :heavy_minus_sign: | N/A | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/errors/internalservererror.md b/docs/models/errors/internalservererror.md new file mode 100644 index 0000000..e90f0ee --- /dev/null +++ b/docs/models/errors/internalservererror.md @@ -0,0 +1,22 @@ +# InternalServerError + +The error is a generic server side error that is + returned for any uncaught and unexpected issues on the server side. + This should be very rare, and you may reach out to us if the problem + persists for a longer duration. + +## Example Usage + +```typescript +import { InternalServerError } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.InternalServerErrorMessage* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 500 | +| `error` | *string* | :heavy_check_mark: | The type of error | Internal Server Error | \ No newline at end of file diff --git a/docs/models/errors/internalservererrormessage.md b/docs/models/errors/internalservererrormessage.md new file mode 100644 index 0000000..54225f5 --- /dev/null +++ b/docs/models/errors/internalservererrormessage.md @@ -0,0 +1,26 @@ +# InternalServerErrorMessage + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { InternalServerErrorMessage } from "@avalabs/avacloud-sdk/models/errors"; + +let value: InternalServerErrorMessage = ""; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/errors/message.md b/docs/models/errors/message.md new file mode 100644 index 0000000..5c2c5cd --- /dev/null +++ b/docs/models/errors/message.md @@ -0,0 +1,26 @@ +# Message + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { Message } from "@avalabs/avacloud-sdk/models/errors"; + +let value: Message = ""; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/errors/notfound.md b/docs/models/errors/notfound.md new file mode 100644 index 0000000..3cba1be --- /dev/null +++ b/docs/models/errors/notfound.md @@ -0,0 +1,21 @@ +# NotFound + +The error is mostly returned when the client requests + with either mistyped URL, or the passed resource is moved or deleted, + or the resource doesn't exist. + +## Example Usage + +```typescript +import { NotFound } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.NotFoundMessage* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 404 | +| `error` | *string* | :heavy_check_mark: | The type of error | Not Found | \ No newline at end of file diff --git a/docs/models/errors/notfoundmessage.md b/docs/models/errors/notfoundmessage.md new file mode 100644 index 0000000..a795199 --- /dev/null +++ b/docs/models/errors/notfoundmessage.md @@ -0,0 +1,26 @@ +# NotFoundMessage + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { NotFoundMessage } from "@avalabs/avacloud-sdk/models/errors"; + +let value: NotFoundMessage = ""; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/errors/serviceunavailable.md b/docs/models/errors/serviceunavailable.md new file mode 100644 index 0000000..46ea12d --- /dev/null +++ b/docs/models/errors/serviceunavailable.md @@ -0,0 +1,21 @@ +# ServiceUnavailable + +The error is returned for certain routes on a particular + Subnet. This indicates an internal problem with our Subnet node, and may + not necessarily mean the Subnet is down or affected. + +## Example Usage + +```typescript +import { ServiceUnavailable } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.ServiceUnavailableMessage* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 503 | +| `error` | *string* | :heavy_check_mark: | The type of error | Service Unavailable | \ No newline at end of file diff --git a/docs/models/errors/serviceunavailablemessage.md b/docs/models/errors/serviceunavailablemessage.md new file mode 100644 index 0000000..08887a6 --- /dev/null +++ b/docs/models/errors/serviceunavailablemessage.md @@ -0,0 +1,26 @@ +# ServiceUnavailableMessage + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { ServiceUnavailableMessage } from "@avalabs/avacloud-sdk/models/errors"; + +let value: ServiceUnavailableMessage = [""]; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/errors/toomanyrequests.md b/docs/models/errors/toomanyrequests.md new file mode 100644 index 0000000..b9da9a3 --- /dev/null +++ b/docs/models/errors/toomanyrequests.md @@ -0,0 +1,20 @@ +# TooManyRequests + +This error is returned when the client has sent too many, + and has hit the rate limit. + +## Example Usage + +```typescript +import { TooManyRequests } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.TooManyRequestsMessage* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 429 | +| `error` | *string* | :heavy_check_mark: | The type of error | Too Many Requests | \ No newline at end of file diff --git a/docs/models/errors/toomanyrequestsmessage.md b/docs/models/errors/toomanyrequestsmessage.md new file mode 100644 index 0000000..e03d0ab --- /dev/null +++ b/docs/models/errors/toomanyrequestsmessage.md @@ -0,0 +1,26 @@ +# TooManyRequestsMessage + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { TooManyRequestsMessage } from "@avalabs/avacloud-sdk/models/errors"; + +let value: TooManyRequestsMessage = ""; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/errors/unauthorized.md b/docs/models/errors/unauthorized.md new file mode 100644 index 0000000..f57b7fe --- /dev/null +++ b/docs/models/errors/unauthorized.md @@ -0,0 +1,21 @@ +# Unauthorized + +When a client attempts to access resources that require + authorization credentials but the client lacks proper authentication + in the request, the server responds with 401. + +## Example Usage + +```typescript +import { Unauthorized } from "@avalabs/avacloud-sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `message` | *errors.UnauthorizedMessage* | :heavy_check_mark: | The error message describing the reason for the exception | | +| `statusCode` | *number* | :heavy_check_mark: | The HTTP status code of the response | 401 | +| `error` | *string* | :heavy_check_mark: | The type of error | Unauthorized | \ No newline at end of file diff --git a/docs/models/errors/unauthorizedmessage.md b/docs/models/errors/unauthorizedmessage.md new file mode 100644 index 0000000..0f434b6 --- /dev/null +++ b/docs/models/errors/unauthorizedmessage.md @@ -0,0 +1,26 @@ +# UnauthorizedMessage + +The error message describing the reason for the exception + +## Example Usage + +```typescript +import { UnauthorizedMessage } from "@avalabs/avacloud-sdk/models/errors"; + +let value: UnauthorizedMessage = ""; +``` + +## Supported Types + +### `string` + +```typescript +const value: string = /* values here */ +``` + +### `string[]` + +```typescript +const value: string[] = /* values here */ +``` + diff --git a/docs/models/operations/addaddressestowebhookrequest.md b/docs/models/operations/addaddressestowebhookrequest.md new file mode 100644 index 0000000..928264d --- /dev/null +++ b/docs/models/operations/addaddressestowebhookrequest.md @@ -0,0 +1,21 @@ +# AddAddressesToWebhookRequest + +## Example Usage + +```typescript +import { AddAddressesToWebhookRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: AddAddressesToWebhookRequest = { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + addressesChangeRequest: { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The webhook identifier. | f33de69c-d13b-4691-908f-870d6e2e6b04 | +| `addressesChangeRequest` | [components.AddressesChangeRequest](../../models/components/addresseschangerequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/deactivatewebhookrequest.md b/docs/models/operations/deactivatewebhookrequest.md new file mode 100644 index 0000000..27f77d1 --- /dev/null +++ b/docs/models/operations/deactivatewebhookrequest.md @@ -0,0 +1,17 @@ +# DeactivateWebhookRequest + +## Example Usage + +```typescript +import { DeactivateWebhookRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: DeactivateWebhookRequest = { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The webhook identifier. | f33de69c-d13b-4691-908f-870d6e2e6b04 | \ No newline at end of file diff --git a/docs/models/operations/details.md b/docs/models/operations/details.md new file mode 100644 index 0000000..dab7e30 --- /dev/null +++ b/docs/models/operations/details.md @@ -0,0 +1,16 @@ +# Details + +## Example Usage + +```typescript +import { Details } from "@avalabs/avacloud-sdk/models/operations"; + +let value: Details = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `status` | *string* | :heavy_minus_sign: | N/A | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/errort.md b/docs/models/operations/errort.md new file mode 100644 index 0000000..8d122f6 --- /dev/null +++ b/docs/models/operations/errort.md @@ -0,0 +1,16 @@ +# ErrorT + +## Example Usage + +```typescript +import { ErrorT } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ErrorT = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `status` | *string* | :heavy_minus_sign: | N/A | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getaddressesfromwebhookrequest.md b/docs/models/operations/getaddressesfromwebhookrequest.md new file mode 100644 index 0000000..e832750 --- /dev/null +++ b/docs/models/operations/getaddressesfromwebhookrequest.md @@ -0,0 +1,20 @@ +# GetAddressesFromWebhookRequest + +## Example Usage + +```typescript +import { GetAddressesFromWebhookRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetAddressesFromWebhookRequest = { + pageSize: 10, + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `id` | *string* | :heavy_check_mark: | The webhook identifier. | f33de69c-d13b-4691-908f-870d6e2e6b04 | \ No newline at end of file diff --git a/docs/models/operations/getaddressesfromwebhookresponse.md b/docs/models/operations/getaddressesfromwebhookresponse.md new file mode 100644 index 0000000..44e9e43 --- /dev/null +++ b/docs/models/operations/getaddressesfromwebhookresponse.md @@ -0,0 +1,20 @@ +# GetAddressesFromWebhookResponse + +## Example Usage + +```typescript +import { GetAddressesFromWebhookResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetAddressesFromWebhookResponse = { + result: { + addresses: [""], + totalAddresses: 7492.55, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `result` | [components.ListWebhookAddressesResponse](../../models/components/listwebhookaddressesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getapilogsrequest.md b/docs/models/operations/getapilogsrequest.md new file mode 100644 index 0000000..aa8f914 --- /dev/null +++ b/docs/models/operations/getapilogsrequest.md @@ -0,0 +1,27 @@ +# GetApiLogsRequest + +## Example Usage + +```typescript +import { GetApiLogsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetApiLogsRequest = { + startTimestamp: 1689541049, + endTimestamp: 1689800249, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `orgId` | *string* | :heavy_minus_sign: | Organization ID to fetch usage metrics for | | +| `startTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items after a specific timestamp. | 1689541049 | +| `endTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items before a specific timestamp. | 1689800249 | +| `requestPath` | *string* | :heavy_minus_sign: | Filter data by request path. | | +| `requestType` | [operations.QueryParamRequestType](../../models/operations/queryparamrequesttype.md) | :heavy_minus_sign: | Filter data by request type. | | +| `responseStatusCode` | *string* | :heavy_minus_sign: | Filter data by response status code. | | +| `chainId` | *string* | :heavy_minus_sign: | Filter data by chain ID. | | +| `apiKeyId` | *string* | :heavy_minus_sign: | Filter data by API key ID. | | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. | | \ No newline at end of file diff --git a/docs/models/operations/getapilogsresponse.md b/docs/models/operations/getapilogsresponse.md new file mode 100644 index 0000000..bc8acc7 --- /dev/null +++ b/docs/models/operations/getapilogsresponse.md @@ -0,0 +1,39 @@ +# GetApiLogsResponse + +## Example Usage + +```typescript +import { GetApiLogsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetApiLogsResponse = { + result: { + orgId: "", + logs: [ + { + orgId: "", + logId: "", + eventTimestamp: 3960.6, + apiKeyId: "", + apiKeyAlias: "", + hostRegion: "", + requestType: "Glacier API Request", + requestPath: "", + apiCreditsConsumed: 5654.21, + requestDurationMsecs: 8404.29, + responseCode: 1832.8, + metadata: { + ipAddress: "52.37.42.124", + host: "clumsy-flytrap.net", + userAgent: "", + }, + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `result` | [components.LogsResponseDTO](../../models/components/logsresponsedto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getapiusagemetricsrequest.md b/docs/models/operations/getapiusagemetricsrequest.md new file mode 100644 index 0000000..f2bda8f --- /dev/null +++ b/docs/models/operations/getapiusagemetricsrequest.md @@ -0,0 +1,29 @@ +# GetApiUsageMetricsRequest + +## Example Usage + +```typescript +import { GetApiUsageMetricsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetApiUsageMetricsRequest = { + startTimestamp: 1689541049, + endTimestamp: 1689800249, + timeInterval: "daily", + groupBy: "requestPath", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `orgId` | *string* | :heavy_minus_sign: | Organization ID to fetch usage metrics for | | +| `startTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items after a specific timestamp. | 1689541049 | +| `endTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items before a specific timestamp. | 1689800249 | +| `timeInterval` | [components.TimeIntervalGranularityExtended](../../models/components/timeintervalgranularityextended.md) | :heavy_minus_sign: | Time interval granularity for data aggregation | daily | +| `groupBy` | [components.UsageMetricsGroupByEnum](../../models/components/usagemetricsgroupbyenum.md) | :heavy_minus_sign: | Query param for the criterion used for grouping metrics | requestPath | +| `requestPath` | *string* | :heavy_minus_sign: | Filter data by request path. | | +| `requestType` | [operations.RequestType](../../models/operations/requesttype.md) | :heavy_minus_sign: | Filter data by request type. | | +| `responseStatusCode` | *string* | :heavy_minus_sign: | Filter data by response status code. | | +| `chainId` | *string* | :heavy_minus_sign: | Filter data by chain ID. | | +| `apiKeyId` | *string* | :heavy_minus_sign: | Filter data by API key ID. | | \ No newline at end of file diff --git a/docs/models/operations/getassetdetailsglobals.md b/docs/models/operations/getassetdetailsglobals.md new file mode 100644 index 0000000..cd73992 --- /dev/null +++ b/docs/models/operations/getassetdetailsglobals.md @@ -0,0 +1,15 @@ +# GetAssetDetailsGlobals + +## Example Usage + +```typescript +import { GetAssetDetailsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetAssetDetailsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getassetdetailsrequest.md b/docs/models/operations/getassetdetailsrequest.md new file mode 100644 index 0000000..1fe3788 --- /dev/null +++ b/docs/models/operations/getassetdetailsrequest.md @@ -0,0 +1,20 @@ +# GetAssetDetailsRequest + +## Example Usage + +```typescript +import { GetAssetDetailsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetAssetDetailsRequest = { + blockchainId: "x-chain", + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `blockchainId` | [components.XChainId](../../models/components/xchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | x-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `assetId` | *string* | :heavy_check_mark: | Asset ID for any asset on X-Chain | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | \ No newline at end of file diff --git a/docs/models/operations/getbalancesbyaddressesglobals.md b/docs/models/operations/getbalancesbyaddressesglobals.md new file mode 100644 index 0000000..4ffad23 --- /dev/null +++ b/docs/models/operations/getbalancesbyaddressesglobals.md @@ -0,0 +1,15 @@ +# GetBalancesByAddressesGlobals + +## Example Usage + +```typescript +import { GetBalancesByAddressesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetBalancesByAddressesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getbalancesbyaddressesrequest.md b/docs/models/operations/getbalancesbyaddressesrequest.md new file mode 100644 index 0000000..d405e7a --- /dev/null +++ b/docs/models/operations/getbalancesbyaddressesrequest.md @@ -0,0 +1,22 @@ +# GetBalancesByAddressesRequest + +## Example Usage + +```typescript +import { GetBalancesByAddressesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetBalancesByAddressesRequest = { + blockTimestamp: 1599696000, + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + blockchainId: "p-chain", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `blockTimestamp` | *number* | :heavy_minus_sign: | An epoch timestamp in seconds. Balance will be calculated at this timestamp. | 1599696000 | +| `addresses` | *string* | :heavy_minus_sign: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `blockchainId` | [components.BlockchainId](../../models/components/blockchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getbalancesbyaddressesresponsebody.md b/docs/models/operations/getbalancesbyaddressesresponsebody.md new file mode 100644 index 0000000..9ae0916 --- /dev/null +++ b/docs/models/operations/getbalancesbyaddressesresponsebody.md @@ -0,0 +1,63 @@ +# GetBalancesByAddressesResponseBody + +Successful response + +## Example Usage + +```typescript +import { GetBalancesByAddressesResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetBalancesByAddressesResponseBody = { + balances: { + atomicMemoryUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + atomicMemoryLocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + utxoCount: 1, + sharedWithChainId: "", + }, + ], + }, + chainInfo: { + chainName: "p-chain", + network: "fuji", + }, +}; +``` + +## Supported Types + +### `components.ListPChainBalancesResponse` + +```typescript +const value: components.ListPChainBalancesResponse = /* values here */ +``` + +### `components.ListXChainBalancesResponse` + +```typescript +const value: components.ListXChainBalancesResponse = /* values here */ +``` + +### `components.ListCChainAtomicBalancesResponse` + +```typescript +const value: components.ListCChainAtomicBalancesResponse = /* values here */ +``` + diff --git a/docs/models/operations/getblockbyidglobals.md b/docs/models/operations/getblockbyidglobals.md new file mode 100644 index 0000000..68dfaf9 --- /dev/null +++ b/docs/models/operations/getblockbyidglobals.md @@ -0,0 +1,15 @@ +# GetBlockByIdGlobals + +## Example Usage + +```typescript +import { GetBlockByIdGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetBlockByIdGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getblockbyidrequest.md b/docs/models/operations/getblockbyidrequest.md new file mode 100644 index 0000000..518fa1c --- /dev/null +++ b/docs/models/operations/getblockbyidrequest.md @@ -0,0 +1,20 @@ +# GetBlockByIdRequest + +## Example Usage + +```typescript +import { GetBlockByIdRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetBlockByIdRequest = { + blockchainId: "p-chain", + blockId: "5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `blockchainId` | [components.BlockchainId](../../models/components/blockchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `blockId` | *string* | :heavy_check_mark: | A block identifier which is either a block number or the block hash. | 5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S | \ No newline at end of file diff --git a/docs/models/operations/getblockglobals.md b/docs/models/operations/getblockglobals.md new file mode 100644 index 0000000..5e136df --- /dev/null +++ b/docs/models/operations/getblockglobals.md @@ -0,0 +1,15 @@ +# GetBlockGlobals + +## Example Usage + +```typescript +import { GetBlockGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetBlockGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getblockrequest.md b/docs/models/operations/getblockrequest.md new file mode 100644 index 0000000..c36dfea --- /dev/null +++ b/docs/models/operations/getblockrequest.md @@ -0,0 +1,18 @@ +# GetBlockRequest + +## Example Usage + +```typescript +import { GetBlockRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetBlockRequest = { + blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `blockId` | *string* | :heavy_check_mark: | A block identifier which is either a block number or the block hash. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | \ No newline at end of file diff --git a/docs/models/operations/getchainidsforaddressesglobals.md b/docs/models/operations/getchainidsforaddressesglobals.md new file mode 100644 index 0000000..209c244 --- /dev/null +++ b/docs/models/operations/getchainidsforaddressesglobals.md @@ -0,0 +1,15 @@ +# GetChainIdsForAddressesGlobals + +## Example Usage + +```typescript +import { GetChainIdsForAddressesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetChainIdsForAddressesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getchainidsforaddressesrequest.md b/docs/models/operations/getchainidsforaddressesrequest.md new file mode 100644 index 0000000..ffe54a1 --- /dev/null +++ b/docs/models/operations/getchainidsforaddressesrequest.md @@ -0,0 +1,18 @@ +# GetChainIdsForAddressesRequest + +## Example Usage + +```typescript +import { GetChainIdsForAddressesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetChainIdsForAddressesRequest = { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | *string* | :heavy_check_mark: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getchaininfoglobals.md b/docs/models/operations/getchaininfoglobals.md new file mode 100644 index 0000000..426b857 --- /dev/null +++ b/docs/models/operations/getchaininfoglobals.md @@ -0,0 +1,15 @@ +# GetChainInfoGlobals + +## Example Usage + +```typescript +import { GetChainInfoGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetChainInfoGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getchaininforequest.md b/docs/models/operations/getchaininforequest.md new file mode 100644 index 0000000..3d20849 --- /dev/null +++ b/docs/models/operations/getchaininforequest.md @@ -0,0 +1,15 @@ +# GetChainInfoRequest + +## Example Usage + +```typescript +import { GetChainInfoRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetChainInfoRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getcontractmetadataglobals.md b/docs/models/operations/getcontractmetadataglobals.md new file mode 100644 index 0000000..a396359 --- /dev/null +++ b/docs/models/operations/getcontractmetadataglobals.md @@ -0,0 +1,15 @@ +# GetContractMetadataGlobals + +## Example Usage + +```typescript +import { GetContractMetadataGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetContractMetadataGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getcontractmetadatarequest.md b/docs/models/operations/getcontractmetadatarequest.md new file mode 100644 index 0000000..7fc3548 --- /dev/null +++ b/docs/models/operations/getcontractmetadatarequest.md @@ -0,0 +1,18 @@ +# GetContractMetadataRequest + +## Example Usage + +```typescript +import { GetContractMetadataRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetContractMetadataRequest = { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | Contract address on the relevant chain. | 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E | \ No newline at end of file diff --git a/docs/models/operations/getcontractmetadataresponsebody.md b/docs/models/operations/getcontractmetadataresponsebody.md new file mode 100644 index 0000000..c5dd750 --- /dev/null +++ b/docs/models/operations/getcontractmetadataresponsebody.md @@ -0,0 +1,47 @@ +# GetContractMetadataResponseBody + +Successful response + +## Example Usage + +```typescript +import { GetContractMetadataResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetContractMetadataResponseBody = { + name: "Wrapped AVAX", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + deploymentDetails: { + txHash: "", + deployerAddress: "", + }, + ercType: "ERC-1155", + symbol: "WAVAX", +}; +``` + +## Supported Types + +### `components.Erc721Contract` + +```typescript +const value: components.Erc721Contract = /* values here */ +``` + +### `components.Erc1155Contract` + +```typescript +const value: components.Erc1155Contract = /* values here */ +``` + +### `components.Erc20Contract` + +```typescript +const value: components.Erc20Contract = /* values here */ +``` + +### `components.UnknownContract` + +```typescript +const value: components.UnknownContract = /* values here */ +``` + diff --git a/docs/models/operations/getdeploymenttransactionglobals.md b/docs/models/operations/getdeploymenttransactionglobals.md new file mode 100644 index 0000000..604dfad --- /dev/null +++ b/docs/models/operations/getdeploymenttransactionglobals.md @@ -0,0 +1,15 @@ +# GetDeploymentTransactionGlobals + +## Example Usage + +```typescript +import { GetDeploymentTransactionGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetDeploymentTransactionGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getdeploymenttransactionrequest.md b/docs/models/operations/getdeploymenttransactionrequest.md new file mode 100644 index 0000000..4f2cf53 --- /dev/null +++ b/docs/models/operations/getdeploymenttransactionrequest.md @@ -0,0 +1,20 @@ +# GetDeploymentTransactionRequest + +## Example Usage + +```typescript +import { GetDeploymentTransactionRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetDeploymentTransactionRequest = { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + currency: "usd", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | Contract address on the relevant chain. | 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E | +| `currency` | [components.CurrencyCode](../../models/components/currencycode.md) | :heavy_minus_sign: | The currency that return values should use. Defaults to USD. | usd | \ No newline at end of file diff --git a/docs/models/operations/getlatestblocksglobals.md b/docs/models/operations/getlatestblocksglobals.md new file mode 100644 index 0000000..20ddcdc --- /dev/null +++ b/docs/models/operations/getlatestblocksglobals.md @@ -0,0 +1,15 @@ +# GetLatestBlocksGlobals + +## Example Usage + +```typescript +import { GetLatestBlocksGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetLatestBlocksGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getlatestblocksrequest.md b/docs/models/operations/getlatestblocksrequest.md new file mode 100644 index 0000000..aa5384a --- /dev/null +++ b/docs/models/operations/getlatestblocksrequest.md @@ -0,0 +1,19 @@ +# GetLatestBlocksRequest + +## Example Usage + +```typescript +import { GetLatestBlocksRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetLatestBlocksRequest = { + pageSize: 10, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getlatestblocksresponse.md b/docs/models/operations/getlatestblocksresponse.md new file mode 100644 index 0000000..4b6e4d8 --- /dev/null +++ b/docs/models/operations/getlatestblocksresponse.md @@ -0,0 +1,33 @@ +# GetLatestBlocksResponse + +## Example Usage + +```typescript +import { GetLatestBlocksResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetLatestBlocksResponse = { + result: { + blocks: [ + { + blockNumber: "339", + blockTimestamp: 1648672486, + blockHash: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + txCount: 2091.57, + baseFee: "", + gasUsed: "", + gasLimit: "", + gasCost: "", + parentHash: "", + feesSpent: "", + cumulativeTransactions: "", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [components.ListEvmBlocksResponse](../../models/components/listevmblocksresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getnativebalanceglobals.md b/docs/models/operations/getnativebalanceglobals.md new file mode 100644 index 0000000..d3b2ccc --- /dev/null +++ b/docs/models/operations/getnativebalanceglobals.md @@ -0,0 +1,15 @@ +# GetNativeBalanceGlobals + +## Example Usage + +```typescript +import { GetNativeBalanceGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetNativeBalanceGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/getnativebalancerequest.md b/docs/models/operations/getnativebalancerequest.md new file mode 100644 index 0000000..b5ca36c --- /dev/null +++ b/docs/models/operations/getnativebalancerequest.md @@ -0,0 +1,22 @@ +# GetNativeBalanceRequest + +## Example Usage + +```typescript +import { GetNativeBalanceRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetNativeBalanceRequest = { + blockNumber: "6479329", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + currency: "usd", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_minus_sign: | The block number, if not defined the block number will be the latest block. | 6479329 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `currency` | [components.CurrencyCode](../../models/components/currencycode.md) | :heavy_minus_sign: | The currency that return values should use. Defaults to USD. | usd | \ No newline at end of file diff --git a/docs/models/operations/getnetworkdetailsglobals.md b/docs/models/operations/getnetworkdetailsglobals.md new file mode 100644 index 0000000..bb9181e --- /dev/null +++ b/docs/models/operations/getnetworkdetailsglobals.md @@ -0,0 +1,15 @@ +# GetNetworkDetailsGlobals + +## Example Usage + +```typescript +import { GetNetworkDetailsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetNetworkDetailsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getnetworkdetailsrequest.md b/docs/models/operations/getnetworkdetailsrequest.md new file mode 100644 index 0000000..30969d1 --- /dev/null +++ b/docs/models/operations/getnetworkdetailsrequest.md @@ -0,0 +1,15 @@ +# GetNetworkDetailsRequest + +## Example Usage + +```typescript +import { GetNetworkDetailsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetNetworkDetailsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getoperationresultrequest.md b/docs/models/operations/getoperationresultrequest.md new file mode 100644 index 0000000..34c8a2b --- /dev/null +++ b/docs/models/operations/getoperationresultrequest.md @@ -0,0 +1,17 @@ +# GetOperationResultRequest + +## Example Usage + +```typescript +import { GetOperationResultRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetOperationResultRequest = { + operationId: "aa22054a-cb7c-4a4e-9b83-59f2ede74138", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `operationId` | *string* | :heavy_check_mark: | UUID of given operation | aa22054a-cb7c-4a4e-9b83-59f2ede74138 | \ No newline at end of file diff --git a/docs/models/operations/getsinglevalidatordetailsglobals.md b/docs/models/operations/getsinglevalidatordetailsglobals.md new file mode 100644 index 0000000..53ac4fe --- /dev/null +++ b/docs/models/operations/getsinglevalidatordetailsglobals.md @@ -0,0 +1,15 @@ +# GetSingleValidatorDetailsGlobals + +## Example Usage + +```typescript +import { GetSingleValidatorDetailsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetSingleValidatorDetailsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getsinglevalidatordetailsrequest.md b/docs/models/operations/getsinglevalidatordetailsrequest.md new file mode 100644 index 0000000..f35886e --- /dev/null +++ b/docs/models/operations/getsinglevalidatordetailsrequest.md @@ -0,0 +1,25 @@ +# GetSingleValidatorDetailsRequest + +## Example Usage + +```typescript +import { GetSingleValidatorDetailsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetSingleValidatorDetailsRequest = { + pageSize: 10, + nodeId: "NodeID-111111111111111111116DBWJs", + validationStatus: "completed", + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `nodeId` | *string* | :heavy_check_mark: | A primary network (P or X chain) nodeId. | NodeID-111111111111111111116DBWJs | +| `validationStatus` | [components.ValidationStatusType](../../models/components/validationstatustype.md) | :heavy_minus_sign: | Validation status of the node. | completed | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/getsinglevalidatordetailsresponse.md b/docs/models/operations/getsinglevalidatordetailsresponse.md new file mode 100644 index 0000000..4883fdf --- /dev/null +++ b/docs/models/operations/getsinglevalidatordetailsresponse.md @@ -0,0 +1,19 @@ +# GetSingleValidatorDetailsResponse + +## Example Usage + +```typescript +import { GetSingleValidatorDetailsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetSingleValidatorDetailsResponse = { + result: { + validators: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `result` | [components.ListValidatorDetailsResponse](../../models/components/listvalidatordetailsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsubnetbyidglobals.md b/docs/models/operations/getsubnetbyidglobals.md new file mode 100644 index 0000000..67afe30 --- /dev/null +++ b/docs/models/operations/getsubnetbyidglobals.md @@ -0,0 +1,15 @@ +# GetSubnetByIdGlobals + +## Example Usage + +```typescript +import { GetSubnetByIdGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetSubnetByIdGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getsubnetbyidrequest.md b/docs/models/operations/getsubnetbyidrequest.md new file mode 100644 index 0000000..7183e34 --- /dev/null +++ b/docs/models/operations/getsubnetbyidrequest.md @@ -0,0 +1,18 @@ +# GetSubnetByIdRequest + +## Example Usage + +```typescript +import { GetSubnetByIdRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetSubnetByIdRequest = { + subnetId: "11111111111111111111111111111111LpoYY", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `subnetId` | *string* | :heavy_check_mark: | Subnet ID to fetch details for | 11111111111111111111111111111111LpoYY | \ No newline at end of file diff --git a/docs/models/operations/getteleportermessagerequest.md b/docs/models/operations/getteleportermessagerequest.md new file mode 100644 index 0000000..d39b231 --- /dev/null +++ b/docs/models/operations/getteleportermessagerequest.md @@ -0,0 +1,17 @@ +# GetTeleporterMessageRequest + +## Example Usage + +```typescript +import { GetTeleporterMessageRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTeleporterMessageRequest = { + messageId: "acf1c8b06f9aec48e9fcbefbbe576ae8a7ca3b327fcae111396e7cc99956674d", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `messageId` | *string* | :heavy_check_mark: | The message ID of the teleporter message. | acf1c8b06f9aec48e9fcbefbbe576ae8a7ca3b327fcae111396e7cc99956674d | \ No newline at end of file diff --git a/docs/models/operations/getteleportermessageresponsebody.md b/docs/models/operations/getteleportermessageresponsebody.md new file mode 100644 index 0000000..49fa1ff --- /dev/null +++ b/docs/models/operations/getteleportermessageresponsebody.md @@ -0,0 +1,77 @@ +# GetTeleporterMessageResponseBody + +Successful response + +## Example Usage + +```typescript +import { GetTeleporterMessageResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTeleporterMessageResponseBody = { + messageId: "", + teleporterContractAddress: "", + sourceBlockchainId: "", + destinationBlockchainId: "", + sourceEvmChainId: "", + destinationEvmChainId: "", + messageNonce: "", + from: "", + to: "", + messageExecuted: false, + receipts: [ + { + receivedMessageNonce: "", + relayerRewardAddress: "", + }, + ], + receiptDelivered: false, + rewardDetails: { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + decimals: 18, + logoUri: + "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg", + ercType: "ERC-20", + price: { + currencyCode: "usd", + value: 42.42, + }, + value: "", + }, + sourceTransaction: { + txHash: "", + timestamp: 7316.94, + gasSpent: "", + }, + destinationTransaction: { + txHash: "", + timestamp: 5844.76, + gasSpent: "", + rewardRedeemer: "", + delivererAddress: "", + }, + status: "delivered", +}; +``` + +## Supported Types + +### `components.PendingTeleporterMessage` + +```typescript +const value: components.PendingTeleporterMessage = /* values here */ +``` + +### `components.DeliveredTeleporterMessage` + +```typescript +const value: components.DeliveredTeleporterMessage = /* values here */ +``` + +### `components.DeliveredSourceNotIndexedTeleporterMessage` + +```typescript +const value: components.DeliveredSourceNotIndexedTeleporterMessage = /* values here */ +``` + diff --git a/docs/models/operations/gettokendetailsglobals.md b/docs/models/operations/gettokendetailsglobals.md new file mode 100644 index 0000000..b6f9d5a --- /dev/null +++ b/docs/models/operations/gettokendetailsglobals.md @@ -0,0 +1,15 @@ +# GetTokenDetailsGlobals + +## Example Usage + +```typescript +import { GetTokenDetailsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTokenDetailsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailsrequest.md b/docs/models/operations/gettokendetailsrequest.md new file mode 100644 index 0000000..5a12aeb --- /dev/null +++ b/docs/models/operations/gettokendetailsrequest.md @@ -0,0 +1,20 @@ +# GetTokenDetailsRequest + +## Example Usage + +```typescript +import { GetTokenDetailsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTokenDetailsRequest = { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | Contract address on the relevant chain. | 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E | +| `tokenId` | *string* | :heavy_check_mark: | TokenId on the contract | 145 | \ No newline at end of file diff --git a/docs/models/operations/gettokendetailsresponsebody.md b/docs/models/operations/gettokendetailsresponsebody.md new file mode 100644 index 0000000..6a6b6fd --- /dev/null +++ b/docs/models/operations/gettokendetailsresponsebody.md @@ -0,0 +1,37 @@ +# GetTokenDetailsResponseBody + +Successful response + +## Example Usage + +```typescript +import { GetTokenDetailsResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTokenDetailsResponseBody = { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + ercType: "ERC-721", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "INDEXED", + }, + ownerAddress: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Supported Types + +### `components.Erc721Token` + +```typescript +const value: components.Erc721Token = /* values here */ +``` + +### `components.Erc1155Token` + +```typescript +const value: components.Erc1155Token = /* values here */ +``` + diff --git a/docs/models/operations/gettransactionglobals.md b/docs/models/operations/gettransactionglobals.md new file mode 100644 index 0000000..9e4213e --- /dev/null +++ b/docs/models/operations/gettransactionglobals.md @@ -0,0 +1,15 @@ +# GetTransactionGlobals + +## Example Usage + +```typescript +import { GetTransactionGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTransactionGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/gettransactionrequest.md b/docs/models/operations/gettransactionrequest.md new file mode 100644 index 0000000..fe59030 --- /dev/null +++ b/docs/models/operations/gettransactionrequest.md @@ -0,0 +1,18 @@ +# GetTransactionRequest + +## Example Usage + +```typescript +import { GetTransactionRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTransactionRequest = { + txHash: "0x8bf584d7b14b92a32a339872a66b134a70ba3ba7c305823f348db6f860253f45", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `txHash` | *string* | :heavy_check_mark: | A transaction hash. | 0x8bf584d7b14b92a32a339872a66b134a70ba3ba7c305823f348db6f860253f45 | \ No newline at end of file diff --git a/docs/models/operations/gettransactionsforblockglobals.md b/docs/models/operations/gettransactionsforblockglobals.md new file mode 100644 index 0000000..f679023 --- /dev/null +++ b/docs/models/operations/gettransactionsforblockglobals.md @@ -0,0 +1,15 @@ +# GetTransactionsForBlockGlobals + +## Example Usage + +```typescript +import { GetTransactionsForBlockGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTransactionsForBlockGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/gettransactionsforblockrequest.md b/docs/models/operations/gettransactionsforblockrequest.md new file mode 100644 index 0000000..aaf12c0 --- /dev/null +++ b/docs/models/operations/gettransactionsforblockrequest.md @@ -0,0 +1,18 @@ +# GetTransactionsForBlockRequest + +## Example Usage + +```typescript +import { GetTransactionsForBlockRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTransactionsForBlockRequest = { + blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `blockId` | *string* | :heavy_check_mark: | A block identifier which is either a block number or the block hash. | 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c | \ No newline at end of file diff --git a/docs/models/operations/gettxbyhashglobals.md b/docs/models/operations/gettxbyhashglobals.md new file mode 100644 index 0000000..4264135 --- /dev/null +++ b/docs/models/operations/gettxbyhashglobals.md @@ -0,0 +1,15 @@ +# GetTxByHashGlobals + +## Example Usage + +```typescript +import { GetTxByHashGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTxByHashGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/gettxbyhashrequest.md b/docs/models/operations/gettxbyhashrequest.md new file mode 100644 index 0000000..0bb6e33 --- /dev/null +++ b/docs/models/operations/gettxbyhashrequest.md @@ -0,0 +1,20 @@ +# GetTxByHashRequest + +## Example Usage + +```typescript +import { GetTxByHashRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTxByHashRequest = { + blockchainId: "p-chain", + txHash: "3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `blockchainId` | [components.BlockchainId](../../models/components/blockchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `txHash` | *string* | :heavy_check_mark: | A primary network (P or X chain) transaction hash. | 3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP | \ No newline at end of file diff --git a/docs/models/operations/gettxbyhashresponsebody.md b/docs/models/operations/gettxbyhashresponsebody.md new file mode 100644 index 0000000..3b9cf67 --- /dev/null +++ b/docs/models/operations/gettxbyhashresponsebody.md @@ -0,0 +1,117 @@ +# GetTxByHashResponseBody + +Successful response + +## Example Usage + +```typescript +import { GetTxByHashResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetTxByHashResponseBody = { + txHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + blockHeight: 1005, + blockHash: "0x57a5cb7704561d1d59bd563b6421021b7563960c05ba3ae0e36fc36917c742ee", + timestamp: 1600762738, + memo: "0x546865204176616c616e6368652050726f6a656374", + amountUnlocked: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + amountCreated: [ + { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + ], + sourceChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + destinationChain: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + txType: "ImportTx", + evmOutputs: [ + { + toAddress: "0xD0f2898e49d941D6d479B381d3C8F0bd8d983b4c", + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + }, + ], + consumedUtxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + consumingTxTimestamp: 1599696000, + creationTxHash: "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", + credentials: [ + { + signature: + "bWWoZUu0Z3STjuk/+2az7M4vP0oqc9NtiA7kOdqINCIE/2+5va5R1KNCWwEX5jE1xVHLvAxU2LHTN5gK8m84HwA", + publicKey: "AdMQOtubgBFFJu++0faHPIIA6KmdZ2ERErMRGzyy6juI", + }, + ], + locktime: 0, + outputIndex: "38", + threshold: 1, + timestamp: 1599696000, + utxoType: "mint", + }, + ], +}; +``` + +## Supported Types + +### `components.PChainTransaction` + +```typescript +const value: components.PChainTransaction = /* values here */ +``` + +### `components.XChainNonLinearTransaction` + +```typescript +const value: components.XChainNonLinearTransaction = /* values here */ +``` + +### `components.XChainLinearTransaction` + +```typescript +const value: components.XChainLinearTransaction = /* values here */ +``` + +### `components.CChainExportTransaction` + +```typescript +const value: components.CChainExportTransaction = /* values here */ +``` + +### `components.CChainImportTransaction` + +```typescript +const value: components.CChainImportTransaction = /* values here */ +``` + diff --git a/docs/models/operations/getutxosbyaddressesglobals.md b/docs/models/operations/getutxosbyaddressesglobals.md new file mode 100644 index 0000000..29ffb32 --- /dev/null +++ b/docs/models/operations/getutxosbyaddressesglobals.md @@ -0,0 +1,15 @@ +# GetUtxosByAddressesGlobals + +## Example Usage + +```typescript +import { GetUtxosByAddressesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetUtxosByAddressesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getutxosbyaddressesrequest.md b/docs/models/operations/getutxosbyaddressesrequest.md new file mode 100644 index 0000000..1d9849f --- /dev/null +++ b/docs/models/operations/getutxosbyaddressesrequest.md @@ -0,0 +1,27 @@ +# GetUtxosByAddressesRequest + +## Example Usage + +```typescript +import { GetUtxosByAddressesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetUtxosByAddressesRequest = { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | *string* | :heavy_minus_sign: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.BlockchainId](../../models/components/blockchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `assetId` | *string* | :heavy_minus_sign: | Asset ID for any asset (only applicable X-Chain) | | +| `includeSpent` | *boolean* | :heavy_minus_sign: | Boolean filter to include spent UTXOs. | | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/getutxosbyaddressesresponse.md b/docs/models/operations/getutxosbyaddressesresponse.md new file mode 100644 index 0000000..3093fc1 --- /dev/null +++ b/docs/models/operations/getutxosbyaddressesresponse.md @@ -0,0 +1,46 @@ +# GetUtxosByAddressesResponse + +## Example Usage + +```typescript +import { GetUtxosByAddressesResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetUtxosByAddressesResponse = { + result: { + utxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + amount: "483.41", + assetId: "", + blockNumber: "", + blockTimestamp: 2155.07, + outputIndex: 7887.4, + txHash: "", + utxoType: "TRANSFER", + }, + ], + chainInfo: { + chainName: "p-chain", + network: "fuji", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `result` | *operations.GetUtxosByAddressesResponseBody* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getutxosbyaddressesresponsebody.md b/docs/models/operations/getutxosbyaddressesresponsebody.md new file mode 100644 index 0000000..b729c54 --- /dev/null +++ b/docs/models/operations/getutxosbyaddressesresponsebody.md @@ -0,0 +1,55 @@ +# GetUtxosByAddressesResponseBody + +Successful response + +## Example Usage + +```typescript +import { GetUtxosByAddressesResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetUtxosByAddressesResponseBody = { + utxos: [ + { + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + asset: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + consumedOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + consumingTxHash: "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c", + createdOnChainId: "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + utxoId: "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC", + amount: "425.45", + assetId: "", + blockNumber: "", + blockTimestamp: 7980.47, + outputIndex: 8853.38, + txHash: "", + utxoType: "STAKE", + }, + ], + chainInfo: { + chainName: "c-chain", + network: "fuji", + }, +}; +``` + +## Supported Types + +### `components.ListPChainUtxosResponse` + +```typescript +const value: components.ListPChainUtxosResponse = /* values here */ +``` + +### `components.ListUtxosResponse` + +```typescript +const value: components.ListUtxosResponse = /* values here */ +``` + diff --git a/docs/models/operations/getvertexbyhashglobals.md b/docs/models/operations/getvertexbyhashglobals.md new file mode 100644 index 0000000..2747e33 --- /dev/null +++ b/docs/models/operations/getvertexbyhashglobals.md @@ -0,0 +1,15 @@ +# GetVertexByHashGlobals + +## Example Usage + +```typescript +import { GetVertexByHashGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetVertexByHashGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getvertexbyhashrequest.md b/docs/models/operations/getvertexbyhashrequest.md new file mode 100644 index 0000000..8966845 --- /dev/null +++ b/docs/models/operations/getvertexbyhashrequest.md @@ -0,0 +1,20 @@ +# GetVertexByHashRequest + +## Example Usage + +```typescript +import { GetVertexByHashRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetVertexByHashRequest = { + vertexHash: "haP1CW56cspZY7aEuqHNrtpvhqCaMTxQaYe6j5u2Mbn4L2Gqr", + blockchainId: "x-chain", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `vertexHash` | *string* | :heavy_check_mark: | A vertex hash string. | haP1CW56cspZY7aEuqHNrtpvhqCaMTxQaYe6j5u2Mbn4L2Gqr | +| `blockchainId` | [components.XChainId](../../models/components/xchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | x-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getvertexbyheightglobals.md b/docs/models/operations/getvertexbyheightglobals.md new file mode 100644 index 0000000..4b74a62 --- /dev/null +++ b/docs/models/operations/getvertexbyheightglobals.md @@ -0,0 +1,15 @@ +# GetVertexByHeightGlobals + +## Example Usage + +```typescript +import { GetVertexByHeightGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetVertexByHeightGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/getvertexbyheightrequest.md b/docs/models/operations/getvertexbyheightrequest.md new file mode 100644 index 0000000..1adf7ed --- /dev/null +++ b/docs/models/operations/getvertexbyheightrequest.md @@ -0,0 +1,25 @@ +# GetVertexByHeightRequest + +## Example Usage + +```typescript +import { GetVertexByHeightRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetVertexByHeightRequest = { + vertexHeight: 123, + pageSize: 10, + blockchainId: "x-chain", + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `vertexHeight` | *number* | :heavy_check_mark: | The height of a vertex. | 123 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.XChainId](../../models/components/xchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | x-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/getvertexbyheightresponse.md b/docs/models/operations/getvertexbyheightresponse.md new file mode 100644 index 0000000..2bc59e8 --- /dev/null +++ b/docs/models/operations/getvertexbyheightresponse.md @@ -0,0 +1,34 @@ +# GetVertexByHeightResponse + +## Example Usage + +```typescript +import { GetVertexByHeightResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetVertexByHeightResponse = { + result: { + vertices: [ + { + vertexHash: "", + parentHashes: [""], + vertexHeight: 7470.8, + vertexIndex: 1175.31, + vertexTimestamp: 6748.48, + txCount: 5173.79, + transactions: [""], + vertexSizeBytes: 2768.94, + }, + ], + chainInfo: { + chainName: "p-chain", + network: "mainnet", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [components.ListXChainVerticesResponse](../../models/components/listxchainverticesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getwebhookrequest.md b/docs/models/operations/getwebhookrequest.md new file mode 100644 index 0000000..febeae6 --- /dev/null +++ b/docs/models/operations/getwebhookrequest.md @@ -0,0 +1,17 @@ +# GetWebhookRequest + +## Example Usage + +```typescript +import { GetWebhookRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GetWebhookRequest = { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The webhook identifier. | f33de69c-d13b-4691-908f-870d6e2e6b04 | \ No newline at end of file diff --git a/docs/models/operations/glacierhealthcheckresponsebody.md b/docs/models/operations/glacierhealthcheckresponsebody.md new file mode 100644 index 0000000..4bd017e --- /dev/null +++ b/docs/models/operations/glacierhealthcheckresponsebody.md @@ -0,0 +1,35 @@ +# GlacierHealthCheckResponseBody + +The Health Check is successful + +## Example Usage + +```typescript +import { GlacierHealthCheckResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: GlacierHealthCheckResponseBody = { + status: "ok", + info: { + database: { + status: "up", + additionalProperties: {}, + }, + }, + error: {}, + details: { + database: { + status: "up", + additionalProperties: {}, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `status` | *string* | :heavy_minus_sign: | N/A | ok | +| `info` | Record | :heavy_minus_sign: | N/A | {
"database": {
"status": "up"
}
} | +| `error` | Record | :heavy_minus_sign: | N/A | {} | +| `details` | Record | :heavy_minus_sign: | N/A | {
"database": {
"status": "up"
}
} | \ No newline at end of file diff --git a/docs/models/operations/info.md b/docs/models/operations/info.md new file mode 100644 index 0000000..ac217cb --- /dev/null +++ b/docs/models/operations/info.md @@ -0,0 +1,16 @@ +# Info + +## Example Usage + +```typescript +import { Info } from "@avalabs/avacloud-sdk/models/operations"; + +let value: Info = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `status` | *string* | :heavy_minus_sign: | N/A | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listactiveprimarynetworkstakingtransactionsglobals.md b/docs/models/operations/listactiveprimarynetworkstakingtransactionsglobals.md new file mode 100644 index 0000000..05b7faa --- /dev/null +++ b/docs/models/operations/listactiveprimarynetworkstakingtransactionsglobals.md @@ -0,0 +1,15 @@ +# ListActivePrimaryNetworkStakingTransactionsGlobals + +## Example Usage + +```typescript +import { ListActivePrimaryNetworkStakingTransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListActivePrimaryNetworkStakingTransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listactiveprimarynetworkstakingtransactionsrequest.md b/docs/models/operations/listactiveprimarynetworkstakingtransactionsrequest.md new file mode 100644 index 0000000..53fb0b2 --- /dev/null +++ b/docs/models/operations/listactiveprimarynetworkstakingtransactionsrequest.md @@ -0,0 +1,31 @@ +# ListActivePrimaryNetworkStakingTransactionsRequest + +## Example Usage + +```typescript +import { ListActivePrimaryNetworkStakingTransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListActivePrimaryNetworkStakingTransactionsRequest = { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + txTypes: ["AddValidatorTx"], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | *string* | :heavy_minus_sign: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `txTypes` | [components.PrimaryNetworkTxType](../../models/components/primarynetworktxtype.md)[] | :heavy_minus_sign: | Query param for filtering items based on transaction types. | [
"AddValidatorTx"
] | +| `startTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items after a specific timestamp. | 1689541049 | +| `endTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items before a specific timestamp. | 1689800249 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.PChainId](../../models/components/pchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/listactiveprimarynetworkstakingtransactionsresponse.md b/docs/models/operations/listactiveprimarynetworkstakingtransactionsresponse.md new file mode 100644 index 0000000..314895c --- /dev/null +++ b/docs/models/operations/listactiveprimarynetworkstakingtransactionsresponse.md @@ -0,0 +1,23 @@ +# ListActivePrimaryNetworkStakingTransactionsResponse + +## Example Usage + +```typescript +import { ListActivePrimaryNetworkStakingTransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListActivePrimaryNetworkStakingTransactionsResponse = { + result: { + transactions: [], + chainInfo: { + chainName: "p-chain", + network: "fuji", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [components.ListPChainTransactionsResponse](../../models/components/listpchaintransactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listassettransactionsglobals.md b/docs/models/operations/listassettransactionsglobals.md new file mode 100644 index 0000000..40cf505 --- /dev/null +++ b/docs/models/operations/listassettransactionsglobals.md @@ -0,0 +1,15 @@ +# ListAssetTransactionsGlobals + +## Example Usage + +```typescript +import { ListAssetTransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListAssetTransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listassettransactionsrequest.md b/docs/models/operations/listassettransactionsrequest.md new file mode 100644 index 0000000..6fd1195 --- /dev/null +++ b/docs/models/operations/listassettransactionsrequest.md @@ -0,0 +1,29 @@ +# ListAssetTransactionsRequest + +## Example Usage + +```typescript +import { ListAssetTransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListAssetTransactionsRequest = { + txTypes: ["AddValidatorTx"], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "x-chain", + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `txTypes` | [components.PrimaryNetworkTxType](../../models/components/primarynetworktxtype.md)[] | :heavy_minus_sign: | Query param for filtering items based on transaction types. | [
"AddValidatorTx"
] | +| `startTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items after a specific timestamp. | 1689541049 | +| `endTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items before a specific timestamp. | 1689800249 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.XChainId](../../models/components/xchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | x-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `assetId` | *string* | :heavy_check_mark: | Asset ID for any asset on X-Chain | th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof | \ No newline at end of file diff --git a/docs/models/operations/listassettransactionsresponse.md b/docs/models/operations/listassettransactionsresponse.md new file mode 100644 index 0000000..12694fd --- /dev/null +++ b/docs/models/operations/listassettransactionsresponse.md @@ -0,0 +1,23 @@ +# ListAssetTransactionsResponse + +## Example Usage + +```typescript +import { ListAssetTransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListAssetTransactionsResponse = { + result: { + transactions: [], + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [components.ListXChainTransactionsResponse](../../models/components/listxchaintransactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listblockchainsglobals.md b/docs/models/operations/listblockchainsglobals.md new file mode 100644 index 0000000..dc2cb09 --- /dev/null +++ b/docs/models/operations/listblockchainsglobals.md @@ -0,0 +1,15 @@ +# ListBlockchainsGlobals + +## Example Usage + +```typescript +import { ListBlockchainsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListBlockchainsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listblockchainsrequest.md b/docs/models/operations/listblockchainsrequest.md new file mode 100644 index 0000000..5af2e80 --- /dev/null +++ b/docs/models/operations/listblockchainsrequest.md @@ -0,0 +1,21 @@ +# ListBlockchainsRequest + +## Example Usage + +```typescript +import { ListBlockchainsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListBlockchainsRequest = { + pageSize: 10, + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/listblockchainsresponse.md b/docs/models/operations/listblockchainsresponse.md new file mode 100644 index 0000000..b6b461a --- /dev/null +++ b/docs/models/operations/listblockchainsresponse.md @@ -0,0 +1,28 @@ +# ListBlockchainsResponse + +## Example Usage + +```typescript +import { ListBlockchainsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListBlockchainsResponse = { + result: { + blockchains: [ + { + createBlockTimestamp: 7438.35, + createBlockNumber: "", + blockchainId: "", + vmId: "", + subnetId: "", + blockchainName: "", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `result` | [components.ListBlockchainsResponse](../../models/components/listblockchainsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listcollectiblebalancesglobals.md b/docs/models/operations/listcollectiblebalancesglobals.md new file mode 100644 index 0000000..bf66f01 --- /dev/null +++ b/docs/models/operations/listcollectiblebalancesglobals.md @@ -0,0 +1,15 @@ +# ListCollectibleBalancesGlobals + +## Example Usage + +```typescript +import { ListCollectibleBalancesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListCollectibleBalancesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listcollectiblebalancesrequest.md b/docs/models/operations/listcollectiblebalancesrequest.md new file mode 100644 index 0000000..70ee9d0 --- /dev/null +++ b/docs/models/operations/listcollectiblebalancesrequest.md @@ -0,0 +1,23 @@ +# ListCollectibleBalancesRequest + +## Example Usage + +```typescript +import { ListCollectibleBalancesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListCollectibleBalancesRequest = { + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `contractAddress` | *string* | :heavy_minus_sign: | A contract addresses to filter by. | 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7 | \ No newline at end of file diff --git a/docs/models/operations/listcollectiblebalancesresponse.md b/docs/models/operations/listcollectiblebalancesresponse.md new file mode 100644 index 0000000..5803716 --- /dev/null +++ b/docs/models/operations/listcollectiblebalancesresponse.md @@ -0,0 +1,19 @@ +# ListCollectibleBalancesResponse + +## Example Usage + +```typescript +import { ListCollectibleBalancesResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListCollectibleBalancesResponse = { + result: { + collectibleBalances: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `result` | [components.ListCollectibleBalancesResponse](../../models/components/listcollectiblebalancesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listcontractdeploymentsglobals.md b/docs/models/operations/listcontractdeploymentsglobals.md new file mode 100644 index 0000000..40eafbd --- /dev/null +++ b/docs/models/operations/listcontractdeploymentsglobals.md @@ -0,0 +1,15 @@ +# ListContractDeploymentsGlobals + +## Example Usage + +```typescript +import { ListContractDeploymentsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListContractDeploymentsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listcontractdeploymentsrequest.md b/docs/models/operations/listcontractdeploymentsrequest.md new file mode 100644 index 0000000..38f2d2d --- /dev/null +++ b/docs/models/operations/listcontractdeploymentsrequest.md @@ -0,0 +1,21 @@ +# ListContractDeploymentsRequest + +## Example Usage + +```typescript +import { ListContractDeploymentsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListContractDeploymentsRequest = { + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/operations/listcontractdeploymentsresponse.md b/docs/models/operations/listcontractdeploymentsresponse.md new file mode 100644 index 0000000..8104bc0 --- /dev/null +++ b/docs/models/operations/listcontractdeploymentsresponse.md @@ -0,0 +1,19 @@ +# ListContractDeploymentsResponse + +## Example Usage + +```typescript +import { ListContractDeploymentsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListContractDeploymentsResponse = { + result: { + contracts: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [components.ListContractsResponse](../../models/components/listcontractsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listdelegatorsglobals.md b/docs/models/operations/listdelegatorsglobals.md new file mode 100644 index 0000000..b35519d --- /dev/null +++ b/docs/models/operations/listdelegatorsglobals.md @@ -0,0 +1,15 @@ +# ListDelegatorsGlobals + +## Example Usage + +```typescript +import { ListDelegatorsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListDelegatorsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listdelegatorsrequest.md b/docs/models/operations/listdelegatorsrequest.md new file mode 100644 index 0000000..e867c49 --- /dev/null +++ b/docs/models/operations/listdelegatorsrequest.md @@ -0,0 +1,28 @@ +# ListDelegatorsRequest + +## Example Usage + +```typescript +import { ListDelegatorsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListDelegatorsRequest = { + pageSize: 10, + rewardAddresses: + "P-avax1679zrp3z9mf7z4an42ddq47qzj36zv6ga20vwl,P-avax1s7kd0kfndlz6mh3l0etrrcmkg5y366k8e0s6cc", + sortOrder: "asc", + delegationStatus: "completed", + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `rewardAddresses` | *string* | :heavy_minus_sign: | A comma separated list of reward addresses to filter by. | P-avax1679zrp3z9mf7z4an42ddq47qzj36zv6ga20vwl,P-avax1s7kd0kfndlz6mh3l0etrrcmkg5y366k8e0s6cc | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | +| `delegationStatus` | [components.DelegationStatusType](../../models/components/delegationstatustype.md) | :heavy_minus_sign: | Delegation status of the node. | completed | +| `nodeIds` | *string* | :heavy_minus_sign: | A comma separated list of node ids to filter by. | NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs | \ No newline at end of file diff --git a/docs/models/operations/listdelegatorsresponse.md b/docs/models/operations/listdelegatorsresponse.md new file mode 100644 index 0000000..1b9adfb --- /dev/null +++ b/docs/models/operations/listdelegatorsresponse.md @@ -0,0 +1,32 @@ +# ListDelegatorsResponse + +## Example Usage + +```typescript +import { ListDelegatorsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListDelegatorsResponse = { + result: { + delegators: [ + { + txHash: "", + nodeId: "", + rewardAddresses: [""], + amountDelegated: "", + delegationFee: "", + startTimestamp: 5365.79, + endTimestamp: 6070.45, + grossReward: "", + netReward: "", + delegationStatus: "completed", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `result` | [components.ListDelegatorDetailsResponse](../../models/components/listdelegatordetailsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listerc1155balancesglobals.md b/docs/models/operations/listerc1155balancesglobals.md new file mode 100644 index 0000000..1f1f830 --- /dev/null +++ b/docs/models/operations/listerc1155balancesglobals.md @@ -0,0 +1,15 @@ +# ListErc1155BalancesGlobals + +## Example Usage + +```typescript +import { ListErc1155BalancesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc1155BalancesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listerc1155balancesrequest.md b/docs/models/operations/listerc1155balancesrequest.md new file mode 100644 index 0000000..62adc96 --- /dev/null +++ b/docs/models/operations/listerc1155balancesrequest.md @@ -0,0 +1,25 @@ +# ListErc1155BalancesRequest + +## Example Usage + +```typescript +import { ListErc1155BalancesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc1155BalancesRequest = { + blockNumber: "6479329", + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_minus_sign: | The block number, if not defined the block number will be the latest block. | 6479329 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `contractAddress` | *string* | :heavy_minus_sign: | A contract addresses to filter by. | 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7 | \ No newline at end of file diff --git a/docs/models/operations/listerc1155balancesresponse.md b/docs/models/operations/listerc1155balancesresponse.md new file mode 100644 index 0000000..231c6ab --- /dev/null +++ b/docs/models/operations/listerc1155balancesresponse.md @@ -0,0 +1,31 @@ +# ListErc1155BalancesResponse + +## Example Usage + +```typescript +import { ListErc1155BalancesResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc1155BalancesResponse = { + result: { + erc1155TokenBalances: [ + { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + ercType: "ERC-1155", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "UNINDEXED", + }, + chainId: "43114", + balance: "2000000000000000000", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `result` | [components.ListErc1155BalancesResponse](../../models/components/listerc1155balancesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listerc1155transactionsglobals.md b/docs/models/operations/listerc1155transactionsglobals.md new file mode 100644 index 0000000..f0b12ae --- /dev/null +++ b/docs/models/operations/listerc1155transactionsglobals.md @@ -0,0 +1,15 @@ +# ListErc1155TransactionsGlobals + +## Example Usage + +```typescript +import { ListErc1155TransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc1155TransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listerc1155transactionsrequest.md b/docs/models/operations/listerc1155transactionsrequest.md new file mode 100644 index 0000000..0aebb71 --- /dev/null +++ b/docs/models/operations/listerc1155transactionsrequest.md @@ -0,0 +1,25 @@ +# ListErc1155TransactionsRequest + +## Example Usage + +```typescript +import { ListErc1155TransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc1155TransactionsRequest = { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startBlock` | *number* | :heavy_minus_sign: | The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. | 6479329 | +| `endBlock` | *number* | :heavy_minus_sign: | The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. | 6479330 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/operations/listerc1155transactionsresponse.md b/docs/models/operations/listerc1155transactionsresponse.md new file mode 100644 index 0000000..59874a2 --- /dev/null +++ b/docs/models/operations/listerc1155transactionsresponse.md @@ -0,0 +1,19 @@ +# ListErc1155TransactionsResponse + +## Example Usage + +```typescript +import { ListErc1155TransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc1155TransactionsResponse = { + result: { + transactions: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `result` | [components.ListErc1155TransactionsResponse](../../models/components/listerc1155transactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listerc20balancesglobals.md b/docs/models/operations/listerc20balancesglobals.md new file mode 100644 index 0000000..ca9ff63 --- /dev/null +++ b/docs/models/operations/listerc20balancesglobals.md @@ -0,0 +1,15 @@ +# ListErc20BalancesGlobals + +## Example Usage + +```typescript +import { ListErc20BalancesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc20BalancesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listerc20balancesrequest.md b/docs/models/operations/listerc20balancesrequest.md new file mode 100644 index 0000000..966739a --- /dev/null +++ b/docs/models/operations/listerc20balancesrequest.md @@ -0,0 +1,29 @@ +# ListErc20BalancesRequest + +## Example Usage + +```typescript +import { ListErc20BalancesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc20BalancesRequest = { + blockNumber: "6479329", + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddresses: + "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7, 0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + currency: "usd", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `blockNumber` | *string* | :heavy_minus_sign: | The block number, if not defined the block number will be the latest block. | 6479329 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `filterSpamTokens` | *boolean* | :heavy_minus_sign: | whether to filter out spam tokens from the response. Default is true. | | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `contractAddresses` | *string* | :heavy_minus_sign: | A comma separated list of contract addresses to filter by. | 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7, 0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB | +| `currency` | [components.CurrencyCode](../../models/components/currencycode.md) | :heavy_minus_sign: | The currency that return values should use. Defaults to USD. | usd | \ No newline at end of file diff --git a/docs/models/operations/listerc20balancesresponse.md b/docs/models/operations/listerc20balancesresponse.md new file mode 100644 index 0000000..88f776c --- /dev/null +++ b/docs/models/operations/listerc20balancesresponse.md @@ -0,0 +1,19 @@ +# ListErc20BalancesResponse + +## Example Usage + +```typescript +import { ListErc20BalancesResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc20BalancesResponse = { + result: { + erc20TokenBalances: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `result` | [components.ListErc20BalancesResponse](../../models/components/listerc20balancesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listerc20transactionsglobals.md b/docs/models/operations/listerc20transactionsglobals.md new file mode 100644 index 0000000..9425ce6 --- /dev/null +++ b/docs/models/operations/listerc20transactionsglobals.md @@ -0,0 +1,15 @@ +# ListErc20TransactionsGlobals + +## Example Usage + +```typescript +import { ListErc20TransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc20TransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listerc20transactionsrequest.md b/docs/models/operations/listerc20transactionsrequest.md new file mode 100644 index 0000000..b199174 --- /dev/null +++ b/docs/models/operations/listerc20transactionsrequest.md @@ -0,0 +1,25 @@ +# ListErc20TransactionsRequest + +## Example Usage + +```typescript +import { ListErc20TransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc20TransactionsRequest = { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startBlock` | *number* | :heavy_minus_sign: | The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. | 6479329 | +| `endBlock` | *number* | :heavy_minus_sign: | The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. | 6479330 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/operations/listerc20transactionsresponse.md b/docs/models/operations/listerc20transactionsresponse.md new file mode 100644 index 0000000..b03ec0f --- /dev/null +++ b/docs/models/operations/listerc20transactionsresponse.md @@ -0,0 +1,19 @@ +# ListErc20TransactionsResponse + +## Example Usage + +```typescript +import { ListErc20TransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc20TransactionsResponse = { + result: { + transactions: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `result` | [components.ListErc20TransactionsResponse](../../models/components/listerc20transactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listerc721balancesglobals.md b/docs/models/operations/listerc721balancesglobals.md new file mode 100644 index 0000000..2482f47 --- /dev/null +++ b/docs/models/operations/listerc721balancesglobals.md @@ -0,0 +1,15 @@ +# ListErc721BalancesGlobals + +## Example Usage + +```typescript +import { ListErc721BalancesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc721BalancesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listerc721balancesrequest.md b/docs/models/operations/listerc721balancesrequest.md new file mode 100644 index 0000000..0ee4597 --- /dev/null +++ b/docs/models/operations/listerc721balancesrequest.md @@ -0,0 +1,23 @@ +# ListErc721BalancesRequest + +## Example Usage + +```typescript +import { ListErc721BalancesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc721BalancesRequest = { + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `contractAddress` | *string* | :heavy_minus_sign: | A contract addresses to filter by. | 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7 | \ No newline at end of file diff --git a/docs/models/operations/listerc721balancesresponse.md b/docs/models/operations/listerc721balancesresponse.md new file mode 100644 index 0000000..c3f06af --- /dev/null +++ b/docs/models/operations/listerc721balancesresponse.md @@ -0,0 +1,33 @@ +# ListErc721BalancesResponse + +## Example Usage + +```typescript +import { ListErc721BalancesResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc721BalancesResponse = { + result: { + erc721TokenBalances: [ + { + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + name: "Wrapped AVAX", + symbol: "WAVAX", + ercType: "ERC-721", + tokenId: "", + tokenUri: "", + metadata: { + indexStatus: "UNKNOWN", + }, + ownerAddress: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + chainId: "43114", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [components.ListErc721BalancesResponse](../../models/components/listerc721balancesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listerc721transactionsglobals.md b/docs/models/operations/listerc721transactionsglobals.md new file mode 100644 index 0000000..fd108aa --- /dev/null +++ b/docs/models/operations/listerc721transactionsglobals.md @@ -0,0 +1,15 @@ +# ListErc721TransactionsGlobals + +## Example Usage + +```typescript +import { ListErc721TransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc721TransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listerc721transactionsrequest.md b/docs/models/operations/listerc721transactionsrequest.md new file mode 100644 index 0000000..df0c056 --- /dev/null +++ b/docs/models/operations/listerc721transactionsrequest.md @@ -0,0 +1,25 @@ +# ListErc721TransactionsRequest + +## Example Usage + +```typescript +import { ListErc721TransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc721TransactionsRequest = { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startBlock` | *number* | :heavy_minus_sign: | The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. | 6479329 | +| `endBlock` | *number* | :heavy_minus_sign: | The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. | 6479330 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/operations/listerc721transactionsresponse.md b/docs/models/operations/listerc721transactionsresponse.md new file mode 100644 index 0000000..de9f973 --- /dev/null +++ b/docs/models/operations/listerc721transactionsresponse.md @@ -0,0 +1,19 @@ +# ListErc721TransactionsResponse + +## Example Usage + +```typescript +import { ListErc721TransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListErc721TransactionsResponse = { + result: { + transactions: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [components.ListErc721TransactionsResponse](../../models/components/listerc721transactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listhistoricalprimarynetworkrewardsglobals.md b/docs/models/operations/listhistoricalprimarynetworkrewardsglobals.md new file mode 100644 index 0000000..37417c3 --- /dev/null +++ b/docs/models/operations/listhistoricalprimarynetworkrewardsglobals.md @@ -0,0 +1,15 @@ +# ListHistoricalPrimaryNetworkRewardsGlobals + +## Example Usage + +```typescript +import { ListHistoricalPrimaryNetworkRewardsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListHistoricalPrimaryNetworkRewardsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listhistoricalprimarynetworkrewardsrequest.md b/docs/models/operations/listhistoricalprimarynetworkrewardsrequest.md new file mode 100644 index 0000000..0349ab0 --- /dev/null +++ b/docs/models/operations/listhistoricalprimarynetworkrewardsrequest.md @@ -0,0 +1,27 @@ +# ListHistoricalPrimaryNetworkRewardsRequest + +## Example Usage + +```typescript +import { ListHistoricalPrimaryNetworkRewardsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListHistoricalPrimaryNetworkRewardsRequest = { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + currency: "usd", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | *string* | :heavy_minus_sign: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". Optional, but at least one of addresses or nodeIds is required. | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `nodeIds` | *string* | :heavy_minus_sign: | A comma separated list of node ids to filter by. Optional, but at least one of addresses or nodeIds is required. | NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | +| `currency` | [components.CurrencyCode](../../models/components/currencycode.md) | :heavy_minus_sign: | The currency that return values should use. Defaults to USD. | usd | \ No newline at end of file diff --git a/docs/models/operations/listhistoricalprimarynetworkrewardsresponse.md b/docs/models/operations/listhistoricalprimarynetworkrewardsresponse.md new file mode 100644 index 0000000..7c4161f --- /dev/null +++ b/docs/models/operations/listhistoricalprimarynetworkrewardsresponse.md @@ -0,0 +1,44 @@ +# ListHistoricalPrimaryNetworkRewardsResponse + +## Example Usage + +```typescript +import { ListHistoricalPrimaryNetworkRewardsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListHistoricalPrimaryNetworkRewardsResponse = { + result: { + historicalRewards: [ + { + addresses: ["avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"], + txHash: "", + amountStaked: "", + nodeId: "", + startTimestamp: 8310.49, + endTimestamp: 5197.11, + rewardType: "DELEGATOR", + utxoId: "", + outputIndex: 0.55, + reward: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "nft", + amount: "5001000", + historicalPrice: { + currencyCode: "usd", + value: 42.42, + }, + }, + rewardTxHash: "", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `result` | [components.ListHistoricalRewardsResponse](../../models/components/listhistoricalrewardsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listinternaltransactionsglobals.md b/docs/models/operations/listinternaltransactionsglobals.md new file mode 100644 index 0000000..e7dd655 --- /dev/null +++ b/docs/models/operations/listinternaltransactionsglobals.md @@ -0,0 +1,15 @@ +# ListInternalTransactionsGlobals + +## Example Usage + +```typescript +import { ListInternalTransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListInternalTransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listinternaltransactionsrequest.md b/docs/models/operations/listinternaltransactionsrequest.md new file mode 100644 index 0000000..411906d --- /dev/null +++ b/docs/models/operations/listinternaltransactionsrequest.md @@ -0,0 +1,25 @@ +# ListInternalTransactionsRequest + +## Example Usage + +```typescript +import { ListInternalTransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListInternalTransactionsRequest = { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startBlock` | *number* | :heavy_minus_sign: | The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. | 6479329 | +| `endBlock` | *number* | :heavy_minus_sign: | The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. | 6479330 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/operations/listinternaltransactionsresponse.md b/docs/models/operations/listinternaltransactionsresponse.md new file mode 100644 index 0000000..29f9d9a --- /dev/null +++ b/docs/models/operations/listinternaltransactionsresponse.md @@ -0,0 +1,19 @@ +# ListInternalTransactionsResponse + +## Example Usage + +```typescript +import { ListInternalTransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListInternalTransactionsResponse = { + result: { + transactions: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `result` | [components.ListInternalTransactionsResponse](../../models/components/listinternaltransactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listlatestprimarynetworkblocksglobals.md b/docs/models/operations/listlatestprimarynetworkblocksglobals.md new file mode 100644 index 0000000..5e97229 --- /dev/null +++ b/docs/models/operations/listlatestprimarynetworkblocksglobals.md @@ -0,0 +1,15 @@ +# ListLatestPrimaryNetworkBlocksGlobals + +## Example Usage + +```typescript +import { ListLatestPrimaryNetworkBlocksGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestPrimaryNetworkBlocksGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listlatestprimarynetworkblocksrequest.md b/docs/models/operations/listlatestprimarynetworkblocksrequest.md new file mode 100644 index 0000000..46bfe1b --- /dev/null +++ b/docs/models/operations/listlatestprimarynetworkblocksrequest.md @@ -0,0 +1,21 @@ +# ListLatestPrimaryNetworkBlocksRequest + +## Example Usage + +```typescript +import { ListLatestPrimaryNetworkBlocksRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestPrimaryNetworkBlocksRequest = { + pageSize: 10, + blockchainId: "p-chain", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.BlockchainId](../../models/components/blockchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listlatestprimarynetworkblocksresponse.md b/docs/models/operations/listlatestprimarynetworkblocksresponse.md new file mode 100644 index 0000000..a800246 --- /dev/null +++ b/docs/models/operations/listlatestprimarynetworkblocksresponse.md @@ -0,0 +1,34 @@ +# ListLatestPrimaryNetworkBlocksResponse + +## Example Usage + +```typescript +import { ListLatestPrimaryNetworkBlocksResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestPrimaryNetworkBlocksResponse = { + result: { + blocks: [ + { + blockNumber: "", + blockHash: "", + parentHash: "", + blockTimestamp: 1536.94, + blockType: "", + txCount: 4246.85, + transactions: [""], + blockSizeBytes: 7304.42, + }, + ], + chainInfo: { + chainName: "x-chain", + network: "fuji", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `result` | [components.ListPrimaryNetworkBlocksResponse](../../models/components/listprimarynetworkblocksresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listlatestprimarynetworktransactionsglobals.md b/docs/models/operations/listlatestprimarynetworktransactionsglobals.md new file mode 100644 index 0000000..2fcbc7e --- /dev/null +++ b/docs/models/operations/listlatestprimarynetworktransactionsglobals.md @@ -0,0 +1,15 @@ +# ListLatestPrimaryNetworkTransactionsGlobals + +## Example Usage + +```typescript +import { ListLatestPrimaryNetworkTransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestPrimaryNetworkTransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listlatestprimarynetworktransactionsrequest.md b/docs/models/operations/listlatestprimarynetworktransactionsrequest.md new file mode 100644 index 0000000..ad66d2b --- /dev/null +++ b/docs/models/operations/listlatestprimarynetworktransactionsrequest.md @@ -0,0 +1,31 @@ +# ListLatestPrimaryNetworkTransactionsRequest + +## Example Usage + +```typescript +import { ListLatestPrimaryNetworkTransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestPrimaryNetworkTransactionsRequest = { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + txTypes: ["AddValidatorTx"], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | *string* | :heavy_check_mark: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". Also accepts EVM formatted addresses starting with "0x" for C-Chain-related atomic transaction lookups. | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `txTypes` | [components.PrimaryNetworkTxType](../../models/components/primarynetworktxtype.md)[] | :heavy_minus_sign: | Query param for filtering items based on transaction types. | [
"AddValidatorTx"
] | +| `startTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items after a specific timestamp. | 1689541049 | +| `endTimestamp` | *number* | :heavy_minus_sign: | Query param for retrieving items before a specific timestamp. | 1689800249 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.BlockchainId](../../models/components/blockchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/listlatestprimarynetworktransactionsresponse.md b/docs/models/operations/listlatestprimarynetworktransactionsresponse.md new file mode 100644 index 0000000..dc4aea0 --- /dev/null +++ b/docs/models/operations/listlatestprimarynetworktransactionsresponse.md @@ -0,0 +1,23 @@ +# ListLatestPrimaryNetworkTransactionsResponse + +## Example Usage + +```typescript +import { ListLatestPrimaryNetworkTransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestPrimaryNetworkTransactionsResponse = { + result: { + transactions: [], + chainInfo: { + chainName: "p-chain", + network: "mainnet", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `result` | *operations.ListLatestPrimaryNetworkTransactionsResponseBody* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listlatestprimarynetworktransactionsresponsebody.md b/docs/models/operations/listlatestprimarynetworktransactionsresponsebody.md new file mode 100644 index 0000000..68151c0 --- /dev/null +++ b/docs/models/operations/listlatestprimarynetworktransactionsresponsebody.md @@ -0,0 +1,38 @@ +# ListLatestPrimaryNetworkTransactionsResponseBody + +Successful response + +## Example Usage + +```typescript +import { ListLatestPrimaryNetworkTransactionsResponseBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestPrimaryNetworkTransactionsResponseBody = { + transactions: [], + chainInfo: { + chainName: "x-chain", + network: "fuji", + }, +}; +``` + +## Supported Types + +### `components.ListPChainTransactionsResponse` + +```typescript +const value: components.ListPChainTransactionsResponse = /* values here */ +``` + +### `components.ListXChainTransactionsResponse` + +```typescript +const value: components.ListXChainTransactionsResponse = /* values here */ +``` + +### `components.ListCChainAtomicTransactionsResponse` + +```typescript +const value: components.ListCChainAtomicTransactionsResponse = /* values here */ +``` + diff --git a/docs/models/operations/listlatesttransactionsglobals.md b/docs/models/operations/listlatesttransactionsglobals.md new file mode 100644 index 0000000..543f3ca --- /dev/null +++ b/docs/models/operations/listlatesttransactionsglobals.md @@ -0,0 +1,15 @@ +# ListLatestTransactionsGlobals + +## Example Usage + +```typescript +import { ListLatestTransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestTransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listlatesttransactionsrequest.md b/docs/models/operations/listlatesttransactionsrequest.md new file mode 100644 index 0000000..65eb6ab --- /dev/null +++ b/docs/models/operations/listlatesttransactionsrequest.md @@ -0,0 +1,20 @@ +# ListLatestTransactionsRequest + +## Example Usage + +```typescript +import { ListLatestTransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestTransactionsRequest = { + pageSize: 10, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `status` | [components.TransactionStatus](../../models/components/transactionstatus.md) | :heavy_minus_sign: | A status filter for listed transactions. | | \ No newline at end of file diff --git a/docs/models/operations/listlatesttransactionsresponse.md b/docs/models/operations/listlatesttransactionsresponse.md new file mode 100644 index 0000000..e511439 --- /dev/null +++ b/docs/models/operations/listlatesttransactionsresponse.md @@ -0,0 +1,19 @@ +# ListLatestTransactionsResponse + +## Example Usage + +```typescript +import { ListLatestTransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestTransactionsResponse = { + result: { + transactions: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [components.ListNativeTransactionsResponse](../../models/components/listnativetransactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listlatestxchainverticesglobals.md b/docs/models/operations/listlatestxchainverticesglobals.md new file mode 100644 index 0000000..7ccf2f5 --- /dev/null +++ b/docs/models/operations/listlatestxchainverticesglobals.md @@ -0,0 +1,15 @@ +# ListLatestXChainVerticesGlobals + +## Example Usage + +```typescript +import { ListLatestXChainVerticesGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestXChainVerticesGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listlatestxchainverticesrequest.md b/docs/models/operations/listlatestxchainverticesrequest.md new file mode 100644 index 0000000..a8f270a --- /dev/null +++ b/docs/models/operations/listlatestxchainverticesrequest.md @@ -0,0 +1,21 @@ +# ListLatestXChainVerticesRequest + +## Example Usage + +```typescript +import { ListLatestXChainVerticesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestXChainVerticesRequest = { + pageSize: 10, + blockchainId: "x-chain", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.XChainId](../../models/components/xchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | x-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listlatestxchainverticesresponse.md b/docs/models/operations/listlatestxchainverticesresponse.md new file mode 100644 index 0000000..d19ee85 --- /dev/null +++ b/docs/models/operations/listlatestxchainverticesresponse.md @@ -0,0 +1,34 @@ +# ListLatestXChainVerticesResponse + +## Example Usage + +```typescript +import { ListLatestXChainVerticesResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListLatestXChainVerticesResponse = { + result: { + vertices: [ + { + vertexHash: "", + parentHashes: [""], + vertexHeight: 4635.75, + vertexIndex: 2148.8, + vertexTimestamp: 2776.28, + txCount: 1864.58, + transactions: [""], + vertexSizeBytes: 5867.84, + }, + ], + chainInfo: { + chainName: "c-chain", + network: "fuji", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [components.ListXChainVerticesResponse](../../models/components/listxchainverticesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listnativetransactionsglobals.md b/docs/models/operations/listnativetransactionsglobals.md new file mode 100644 index 0000000..dfe28fe --- /dev/null +++ b/docs/models/operations/listnativetransactionsglobals.md @@ -0,0 +1,15 @@ +# ListNativeTransactionsGlobals + +## Example Usage + +```typescript +import { ListNativeTransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListNativeTransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listnativetransactionsrequest.md b/docs/models/operations/listnativetransactionsrequest.md new file mode 100644 index 0000000..e636cc1 --- /dev/null +++ b/docs/models/operations/listnativetransactionsrequest.md @@ -0,0 +1,25 @@ +# ListNativeTransactionsRequest + +## Example Usage + +```typescript +import { ListNativeTransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListNativeTransactionsRequest = { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startBlock` | *number* | :heavy_minus_sign: | The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. | 6479329 | +| `endBlock` | *number* | :heavy_minus_sign: | The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. | 6479330 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/operations/listnativetransactionsresponse.md b/docs/models/operations/listnativetransactionsresponse.md new file mode 100644 index 0000000..74ed7bb --- /dev/null +++ b/docs/models/operations/listnativetransactionsresponse.md @@ -0,0 +1,19 @@ +# ListNativeTransactionsResponse + +## Example Usage + +```typescript +import { ListNativeTransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListNativeTransactionsResponse = { + result: { + transactions: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [components.ListNativeTransactionsResponse](../../models/components/listnativetransactionsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listpendingprimarynetworkrewardsglobals.md b/docs/models/operations/listpendingprimarynetworkrewardsglobals.md new file mode 100644 index 0000000..98eb9c1 --- /dev/null +++ b/docs/models/operations/listpendingprimarynetworkrewardsglobals.md @@ -0,0 +1,15 @@ +# ListPendingPrimaryNetworkRewardsGlobals + +## Example Usage + +```typescript +import { ListPendingPrimaryNetworkRewardsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListPendingPrimaryNetworkRewardsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listpendingprimarynetworkrewardsrequest.md b/docs/models/operations/listpendingprimarynetworkrewardsrequest.md new file mode 100644 index 0000000..d304fd2 --- /dev/null +++ b/docs/models/operations/listpendingprimarynetworkrewardsrequest.md @@ -0,0 +1,25 @@ +# ListPendingPrimaryNetworkRewardsRequest + +## Example Usage + +```typescript +import { ListPendingPrimaryNetworkRewardsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListPendingPrimaryNetworkRewardsRequest = { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | *string* | :heavy_minus_sign: | A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". One of addresses or nodeIds is required. | avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `nodeIds` | *string* | :heavy_minus_sign: | A comma separated list of node ids to filter by. One of addresses or nodeIds is required. | NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/listpendingprimarynetworkrewardsresponse.md b/docs/models/operations/listpendingprimarynetworkrewardsresponse.md new file mode 100644 index 0000000..4eafed7 --- /dev/null +++ b/docs/models/operations/listpendingprimarynetworkrewardsresponse.md @@ -0,0 +1,38 @@ +# ListPendingPrimaryNetworkRewardsResponse + +## Example Usage + +```typescript +import { ListPendingPrimaryNetworkRewardsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListPendingPrimaryNetworkRewardsResponse = { + result: { + pendingRewards: [ + { + addresses: ["avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"], + txHash: "", + amountStaked: "", + nodeId: "", + startTimestamp: 9044.25, + endTimestamp: 3834.64, + rewardType: "DELEGATOR", + progress: 5883.17, + estimatedReward: { + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + name: "Avalanche", + symbol: "AVAX", + denomination: 9, + type: "secp256k1", + amount: "5001000", + }, + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [components.ListPendingRewardsResponse](../../models/components/listpendingrewardsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listprimarynetworkblocksbynodeidglobals.md b/docs/models/operations/listprimarynetworkblocksbynodeidglobals.md new file mode 100644 index 0000000..aa9f23f --- /dev/null +++ b/docs/models/operations/listprimarynetworkblocksbynodeidglobals.md @@ -0,0 +1,15 @@ +# ListPrimaryNetworkBlocksByNodeIdGlobals + +## Example Usage + +```typescript +import { ListPrimaryNetworkBlocksByNodeIdGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListPrimaryNetworkBlocksByNodeIdGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listprimarynetworkblocksbynodeidrequest.md b/docs/models/operations/listprimarynetworkblocksbynodeidrequest.md new file mode 100644 index 0000000..40a098a --- /dev/null +++ b/docs/models/operations/listprimarynetworkblocksbynodeidrequest.md @@ -0,0 +1,23 @@ +# ListPrimaryNetworkBlocksByNodeIdRequest + +## Example Usage + +```typescript +import { ListPrimaryNetworkBlocksByNodeIdRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListPrimaryNetworkBlocksByNodeIdRequest = { + pageSize: 10, + blockchainId: "p-chain", + nodeId: "NodeID-111111111111111111116DBWJs", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `blockchainId` | [components.BlockchainId](../../models/components/blockchainid.md) | :heavy_check_mark: | A primary network blockchain id or alias. | p-chain | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `nodeId` | *string* | :heavy_check_mark: | A primary network (P or X chain) nodeId. | NodeID-111111111111111111116DBWJs | \ No newline at end of file diff --git a/docs/models/operations/listprimarynetworkblocksbynodeidresponse.md b/docs/models/operations/listprimarynetworkblocksbynodeidresponse.md new file mode 100644 index 0000000..ca65229 --- /dev/null +++ b/docs/models/operations/listprimarynetworkblocksbynodeidresponse.md @@ -0,0 +1,34 @@ +# ListPrimaryNetworkBlocksByNodeIdResponse + +## Example Usage + +```typescript +import { ListPrimaryNetworkBlocksByNodeIdResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListPrimaryNetworkBlocksByNodeIdResponse = { + result: { + blocks: [ + { + blockNumber: "", + blockHash: "", + parentHash: "", + blockTimestamp: 5182.01, + blockType: "", + txCount: 4717.52, + transactions: [""], + blockSizeBytes: 256.62, + }, + ], + chainInfo: { + chainName: "c-chain", + network: "mainnet", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `result` | [components.ListPrimaryNetworkBlocksResponse](../../models/components/listprimarynetworkblocksresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listsubnetsglobals.md b/docs/models/operations/listsubnetsglobals.md new file mode 100644 index 0000000..280c881 --- /dev/null +++ b/docs/models/operations/listsubnetsglobals.md @@ -0,0 +1,15 @@ +# ListSubnetsGlobals + +## Example Usage + +```typescript +import { ListSubnetsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListSubnetsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listsubnetsrequest.md b/docs/models/operations/listsubnetsrequest.md new file mode 100644 index 0000000..1d25da5 --- /dev/null +++ b/docs/models/operations/listsubnetsrequest.md @@ -0,0 +1,21 @@ +# ListSubnetsRequest + +## Example Usage + +```typescript +import { ListSubnetsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListSubnetsRequest = { + pageSize: 10, + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/listsubnetsresponse.md b/docs/models/operations/listsubnetsresponse.md new file mode 100644 index 0000000..4f213c7 --- /dev/null +++ b/docs/models/operations/listsubnetsresponse.md @@ -0,0 +1,38 @@ +# ListSubnetsResponse + +## Example Usage + +```typescript +import { ListSubnetsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListSubnetsResponse = { + result: { + subnets: [ + { + createBlockTimestamp: 6793.93, + createBlockIndex: "", + subnetId: "", + ownerAddresses: [""], + threshold: 4785.96, + locktime: 4536.97, + subnetOwnershipInfo: { + locktime: 0, + threshold: 1, + addresses: ["avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"], + }, + blockchains: [ + { + blockchainId: "", + }, + ], + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `result` | [components.ListSubnetsResponse](../../models/components/listsubnetsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listteleportermessagesrequest.md b/docs/models/operations/listteleportermessagesrequest.md new file mode 100644 index 0000000..dcb086e --- /dev/null +++ b/docs/models/operations/listteleportermessagesrequest.md @@ -0,0 +1,29 @@ +# ListTeleporterMessagesRequest + +## Example Usage + +```typescript +import { ListTeleporterMessagesRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTeleporterMessagesRequest = { + pageSize: 10, + sourceBlockchainId: "2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY", + destinationBlockchainId: "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp", + to: "0x664A4Be5Af2cFc824F9C0914CbAc4703396Da2DC", + from: "0x321eDA69247566D662178feE695C7026c604Cd94", + network: "mainnet", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `sourceBlockchainId` | *string* | :heavy_minus_sign: | The base58 encoded blockchain ID or evm chain ID of the source chain that the teleporter message was sent from. | 2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY | +| `destinationBlockchainId` | *string* | :heavy_minus_sign: | The base58 encoded blockchain ID or evm chain ID of the destination chain that the teleporter message was sent to. | yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp | +| `blockchainId` | *string* | :heavy_minus_sign: | The base58 encoded blockchain ID of either source or destination chain that one teleporter message interacts with. | | +| `to` | *string* | :heavy_minus_sign: | The address of the recipient of the teleporter message. | 0x664A4Be5Af2cFc824F9C0914CbAc4703396Da2DC | +| `from` | *string* | :heavy_minus_sign: | The address of the sender of the teleporter message. | 0x321eDA69247566D662178feE695C7026c604Cd94 | +| `network` | [components.NetworkType](../../models/components/networktype.md) | :heavy_minus_sign: | mainnet or testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listteleportermessagesresponse.md b/docs/models/operations/listteleportermessagesresponse.md new file mode 100644 index 0000000..2d00a0e --- /dev/null +++ b/docs/models/operations/listteleportermessagesresponse.md @@ -0,0 +1,19 @@ +# ListTeleporterMessagesResponse + +## Example Usage + +```typescript +import { ListTeleporterMessagesResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTeleporterMessagesResponse = { + result: { + messages: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [components.ListTeleporterMessagesResponse](../../models/components/listteleportermessagesresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listtokensglobals.md b/docs/models/operations/listtokensglobals.md new file mode 100644 index 0000000..dcd1e56 --- /dev/null +++ b/docs/models/operations/listtokensglobals.md @@ -0,0 +1,15 @@ +# ListTokensGlobals + +## Example Usage + +```typescript +import { ListTokensGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTokensGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listtokensrequest.md b/docs/models/operations/listtokensrequest.md new file mode 100644 index 0000000..6f689cf --- /dev/null +++ b/docs/models/operations/listtokensrequest.md @@ -0,0 +1,21 @@ +# ListTokensRequest + +## Example Usage + +```typescript +import { ListTokensRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTokensRequest = { + pageSize: 10, + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | Contract address on the relevant chain. | 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E | \ No newline at end of file diff --git a/docs/models/operations/listtokensresponse.md b/docs/models/operations/listtokensresponse.md new file mode 100644 index 0000000..610f30c --- /dev/null +++ b/docs/models/operations/listtokensresponse.md @@ -0,0 +1,19 @@ +# ListTokensResponse + +## Example Usage + +```typescript +import { ListTokensResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTokensResponse = { + result: { + tokens: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `result` | [components.ListNftTokens](../../models/components/listnfttokens.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listtransactionsglobals.md b/docs/models/operations/listtransactionsglobals.md new file mode 100644 index 0000000..acdb16f --- /dev/null +++ b/docs/models/operations/listtransactionsglobals.md @@ -0,0 +1,15 @@ +# ListTransactionsGlobals + +## Example Usage + +```typescript +import { ListTransactionsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTransactionsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listtransactionsrequest.md b/docs/models/operations/listtransactionsrequest.md new file mode 100644 index 0000000..d9712da --- /dev/null +++ b/docs/models/operations/listtransactionsrequest.md @@ -0,0 +1,27 @@ +# ListTransactionsRequest + +## Example Usage + +```typescript +import { ListTransactionsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTransactionsRequest = { + pageSize: 10, + startBlock: 6479329, + endBlock: 6479330, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + sortOrder: "asc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `startBlock` | *number* | :heavy_minus_sign: | The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. | 6479329 | +| `endBlock` | *number* | :heavy_minus_sign: | The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. | 6479330 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | \ No newline at end of file diff --git a/docs/models/operations/listtransactionsresponse.md b/docs/models/operations/listtransactionsresponse.md new file mode 100644 index 0000000..d3d8500 --- /dev/null +++ b/docs/models/operations/listtransactionsresponse.md @@ -0,0 +1,19 @@ +# ListTransactionsResponse + +## Example Usage + +```typescript +import { ListTransactionsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTransactionsResponse = { + result: { + transactions: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [components.ListTransactionDetailsResponse](../../models/components/listtransactiondetailsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listtransfersglobals.md b/docs/models/operations/listtransfersglobals.md new file mode 100644 index 0000000..0281b27 --- /dev/null +++ b/docs/models/operations/listtransfersglobals.md @@ -0,0 +1,15 @@ +# ListTransfersGlobals + +## Example Usage + +```typescript +import { ListTransfersGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTransfersGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/listtransfersrequest.md b/docs/models/operations/listtransfersrequest.md new file mode 100644 index 0000000..4700f7b --- /dev/null +++ b/docs/models/operations/listtransfersrequest.md @@ -0,0 +1,25 @@ +# ListTransfersRequest + +## Example Usage + +```typescript +import { ListTransfersRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTransfersRequest = { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startBlock` | *number* | :heavy_minus_sign: | The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. | 6479329 | +| `endBlock` | *number* | :heavy_minus_sign: | The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. | 6479330 | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | A wallet address. | 0x71C7656EC7ab88b098defB751B7401B5f6d8976F | \ No newline at end of file diff --git a/docs/models/operations/listtransfersresponse.md b/docs/models/operations/listtransfersresponse.md new file mode 100644 index 0000000..bfe76a6 --- /dev/null +++ b/docs/models/operations/listtransfersresponse.md @@ -0,0 +1,19 @@ +# ListTransfersResponse + +## Example Usage + +```typescript +import { ListTransfersResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListTransfersResponse = { + result: { + transfers: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [components.ListTransfersResponse](../../models/components/listtransfersresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listvalidatorsglobals.md b/docs/models/operations/listvalidatorsglobals.md new file mode 100644 index 0000000..7062153 --- /dev/null +++ b/docs/models/operations/listvalidatorsglobals.md @@ -0,0 +1,15 @@ +# ListValidatorsGlobals + +## Example Usage + +```typescript +import { ListValidatorsGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListValidatorsGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | A supported network type mainnet or a testnet. | mainnet | \ No newline at end of file diff --git a/docs/models/operations/listvalidatorsrequest.md b/docs/models/operations/listvalidatorsrequest.md new file mode 100644 index 0000000..013bcec --- /dev/null +++ b/docs/models/operations/listvalidatorsrequest.md @@ -0,0 +1,44 @@ +# ListValidatorsRequest + +## Example Usage + +```typescript +import { ListValidatorsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListValidatorsRequest = { + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + validationStatus: "completed", + minDelegationCapacity: "0", + maxDelegationCapacity: "720000000000000000", + minTimeRemaining: 0, + maxTimeRemaining: 2147483647, + minFeePercentage: 2, + maxFeePercentage: 100, + minUptimePerformance: 90, + maxUptimePerformance: 100, + subnetId: "11111111111111111111111111111111LpoYY", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `network` | [components.GlobalParamNetwork](../../models/components/globalparamnetwork.md) | :heavy_minus_sign: | Either mainnet or a testnet. | mainnet | +| `nodeIds` | *string* | :heavy_minus_sign: | A comma separated list of node ids to filter by. | NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs | +| `sortBy` | [components.SortByOption](../../models/components/sortbyoption.md) | :heavy_minus_sign: | Which property to sort by, in conjunction with sortOrder.

Note: Delegation fee is only available for mainnet validators. Set `subnetId` to `11111111111111111111111111111111LpoYY` to use this option. | | +| `sortOrder` | [components.SortOrder](../../models/components/sortorder.md) | :heavy_minus_sign: | The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. | asc | +| `validationStatus` | [components.ValidationStatusType](../../models/components/validationstatustype.md) | :heavy_minus_sign: | Validation status of the node. | completed | +| `minDelegationCapacity` | *string* | :heavy_minus_sign: | The minimum delegation capacity, in nAVAX, used to filter the set of nodes being returned. Accepts values between 0 and 720,000,000,000,000,000 | 0 | +| `maxDelegationCapacity` | *string* | :heavy_minus_sign: | The maximum delegation capacity, in nAVAX, used to filter the set of nodes being returned. Accepts values between 0 and 720,000,000,000,000,000. | 720000000000000000 | +| `minTimeRemaining` | *number* | :heavy_minus_sign: | The minimum validation time remaining, in seconds, used to filter the set of nodes being returned. | 0 | +| `maxTimeRemaining` | *number* | :heavy_minus_sign: | The maximum validation time remaining, in seconds, used to filter the set of nodes being returned. | 2147483647 | +| `minFeePercentage` | *number* | :heavy_minus_sign: | The minimum fee percentage, used to filter the set of nodes being returned. If this field is populated no subnet validations will be returned, as their fee percentage is null, since subnet delegations are not supported. Default is 2.0, as per the Avalanche spec. | 2 | +| `maxFeePercentage` | *number* | :heavy_minus_sign: | The maximum fee percentage, used to filter the set of nodes being returned. If this field is populated no subnet validations will be returned, as their fee percentage is null, since subnet delegations are not supported. Default is 100.0. | 100 | +| `minUptimePerformance` | *number* | :heavy_minus_sign: | The minimum node uptime performance percentage, which represents node health, used to filter the set of nodes being returned Default is 90. | 90 | +| `maxUptimePerformance` | *number* | :heavy_minus_sign: | The maximum node uptime performance percentage, which represents node health, used to filter the set of nodes being returned. Default is 100. | 100 | +| `subnetId` | *any* | :heavy_minus_sign: | The subnet ID to filter by. If not provided, then all subnets will be returned. | 11111111111111111111111111111111LpoYY | \ No newline at end of file diff --git a/docs/models/operations/listvalidatorsresponse.md b/docs/models/operations/listvalidatorsresponse.md new file mode 100644 index 0000000..94d1cd0 --- /dev/null +++ b/docs/models/operations/listvalidatorsresponse.md @@ -0,0 +1,19 @@ +# ListValidatorsResponse + +## Example Usage + +```typescript +import { ListValidatorsResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListValidatorsResponse = { + result: { + validators: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `result` | [components.ListValidatorDetailsResponse](../../models/components/listvalidatordetailsresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listwebhooksrequest.md b/docs/models/operations/listwebhooksrequest.md new file mode 100644 index 0000000..4121c09 --- /dev/null +++ b/docs/models/operations/listwebhooksrequest.md @@ -0,0 +1,20 @@ +# ListWebhooksRequest + +## Example Usage + +```typescript +import { ListWebhooksRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListWebhooksRequest = { + pageSize: 10, + status: "active", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pageToken` | *string* | :heavy_minus_sign: | A page token, received from a previous list call. Provide this to retrieve the subsequent page. | | +| `pageSize` | *number* | :heavy_minus_sign: | The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. | 10 | +| `status` | [components.WebhookStatus](../../models/components/webhookstatus.md) | :heavy_minus_sign: | Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned. | active | \ No newline at end of file diff --git a/docs/models/operations/listwebhooksresponse.md b/docs/models/operations/listwebhooksresponse.md new file mode 100644 index 0000000..6d920c4 --- /dev/null +++ b/docs/models/operations/listwebhooksresponse.md @@ -0,0 +1,36 @@ +# ListWebhooksResponse + +## Example Usage + +```typescript +import { ListWebhooksResponse } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ListWebhooksResponse = { + result: { + webhooks: [ + { + id: "", + eventType: "address_activity", + metadata: { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + eventSignatures: [ + "0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64", + ], + }, + url: "https://ample-sake.net", + chainId: "", + status: "inactive", + createdAt: 925.96, + name: "", + description: "Triple-buffered composite architecture", + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `result` | [components.ListWebhooksResponse](../../models/components/listwebhooksresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/posttransactionexportjobrequestbody.md b/docs/models/operations/posttransactionexportjobrequestbody.md new file mode 100644 index 0000000..cdcf8a9 --- /dev/null +++ b/docs/models/operations/posttransactionexportjobrequestbody.md @@ -0,0 +1,34 @@ +# PostTransactionExportJobRequestBody + +## Example Usage + +```typescript +import { PostTransactionExportJobRequestBody } from "@avalabs/avacloud-sdk/models/operations"; + +let value: PostTransactionExportJobRequestBody = { + type: "TRANSACTION_EXPORT_EVM", + firstDate: "2023-05-01", + lastDate: "2023-05-02", + startDate: "2023-05-01", + endDate: "2023-05-02", + options: { + addresses: [""], + includeChains: ["43114"], + }, +}; +``` + +## Supported Types + +### `components.CreateEvmTransactionExportRequest` + +```typescript +const value: components.CreateEvmTransactionExportRequest = /* values here */ +``` + +### `components.CreatePrimaryNetworkTransactionExportRequest` + +```typescript +const value: components.CreatePrimaryNetworkTransactionExportRequest = /* values here */ +``` + diff --git a/docs/models/operations/queryparamrequesttype.md b/docs/models/operations/queryparamrequesttype.md new file mode 100644 index 0000000..ede0985 --- /dev/null +++ b/docs/models/operations/queryparamrequesttype.md @@ -0,0 +1,17 @@ +# QueryParamRequestType + +Filter data by request type. + +## Example Usage + +```typescript +import { QueryParamRequestType } from "@avalabs/avacloud-sdk/models/operations"; + +let value: QueryParamRequestType = "Glacier RPC Request"; +``` + +## Values + +```typescript +"Glacier API Request" | "Glacier RPC Request" +``` \ No newline at end of file diff --git a/docs/models/operations/reindexnftglobals.md b/docs/models/operations/reindexnftglobals.md new file mode 100644 index 0000000..49c778c --- /dev/null +++ b/docs/models/operations/reindexnftglobals.md @@ -0,0 +1,15 @@ +# ReindexNftGlobals + +## Example Usage + +```typescript +import { ReindexNftGlobals } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ReindexNftGlobals = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `chainId` | *string* | :heavy_minus_sign: | A supported EVM chain id, chain alias, or blockchain id. | 43114 | \ No newline at end of file diff --git a/docs/models/operations/reindexnftrequest.md b/docs/models/operations/reindexnftrequest.md new file mode 100644 index 0000000..da05669 --- /dev/null +++ b/docs/models/operations/reindexnftrequest.md @@ -0,0 +1,20 @@ +# ReindexNftRequest + +## Example Usage + +```typescript +import { ReindexNftRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: ReindexNftRequest = { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `chainId` | *string* | :heavy_minus_sign: | A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. | 43114 | +| `address` | *string* | :heavy_check_mark: | Contract address on the relevant chain. | 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E | +| `tokenId` | *string* | :heavy_check_mark: | TokenId on the contract | 145 | \ No newline at end of file diff --git a/docs/models/operations/removeaddressesfromwebhookrequest.md b/docs/models/operations/removeaddressesfromwebhookrequest.md new file mode 100644 index 0000000..039248f --- /dev/null +++ b/docs/models/operations/removeaddressesfromwebhookrequest.md @@ -0,0 +1,21 @@ +# RemoveAddressesFromWebhookRequest + +## Example Usage + +```typescript +import { RemoveAddressesFromWebhookRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: RemoveAddressesFromWebhookRequest = { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + addressesChangeRequest: { + addresses: ["0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The webhook identifier. | f33de69c-d13b-4691-908f-870d6e2e6b04 | +| `addressesChangeRequest` | [components.AddressesChangeRequest](../../models/components/addresseschangerequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/requesttype.md b/docs/models/operations/requesttype.md new file mode 100644 index 0000000..e1139d1 --- /dev/null +++ b/docs/models/operations/requesttype.md @@ -0,0 +1,17 @@ +# RequestType + +Filter data by request type. + +## Example Usage + +```typescript +import { RequestType } from "@avalabs/avacloud-sdk/models/operations"; + +let value: RequestType = "Glacier RPC Request"; +``` + +## Values + +```typescript +"Glacier API Request" | "Glacier RPC Request" +``` \ No newline at end of file diff --git a/docs/models/operations/supportedchainsrequest.md b/docs/models/operations/supportedchainsrequest.md new file mode 100644 index 0000000..f4ed01d --- /dev/null +++ b/docs/models/operations/supportedchainsrequest.md @@ -0,0 +1,19 @@ +# SupportedChainsRequest + +## Example Usage + +```typescript +import { SupportedChainsRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: SupportedChainsRequest = { + network: "mainnet", + feature: "nftIndexing", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `network` | [components.NetworkType](../../models/components/networktype.md) | :heavy_minus_sign: | mainnet or testnet. | mainnet | +| `feature` | [components.GlacierApiFeature](../../models/components/glacierapifeature.md) | :heavy_minus_sign: | Filter by feature. | nftIndexing | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookrequest.md b/docs/models/operations/updatewebhookrequest.md new file mode 100644 index 0000000..21d4656 --- /dev/null +++ b/docs/models/operations/updatewebhookrequest.md @@ -0,0 +1,19 @@ +# UpdateWebhookRequest + +## Example Usage + +```typescript +import { UpdateWebhookRequest } from "@avalabs/avacloud-sdk/models/operations"; + +let value: UpdateWebhookRequest = { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + updateWebhookRequest: {}, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The webhook identifier. | f33de69c-d13b-4691-908f-870d6e2e6b04 | +| `updateWebhookRequest` | [components.UpdateWebhookRequest](../../models/components/updatewebhookrequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdks/avacloudsdk/README.md b/docs/sdks/avacloudsdk/README.md new file mode 100644 index 0000000..c56327a --- /dev/null +++ b/docs/sdks/avacloudsdk/README.md @@ -0,0 +1,5 @@ +# AvaCloudSDK + +## Overview + +Glacier API: The Glacier API provides web3 application developers with multi-chain data related to Avalanche's primary network, Avalanche subnets, and Ethereum. With Glacier, you can easily build products that leverage real-time and historical transaction and transfer history, native and token balances, and various types of token metadata. The API is in Beta and may be subject to change.

If you have feedback or feature requests for the API, please submit them here. Bug reports can be submitted here, and any potential security issues can be reported here. \ No newline at end of file diff --git a/docs/sdks/avacloudsdkbalances/README.md b/docs/sdks/avacloudsdkbalances/README.md new file mode 100644 index 0000000..47e62ca --- /dev/null +++ b/docs/sdks/avacloudsdkbalances/README.md @@ -0,0 +1,512 @@ +# AvaCloudSDKBalances +(*glacier.evm.balances*) + +## Overview + +### Available Operations + +* [getNativeBalance](#getnativebalance) - Get native token balance +* [listErc20Balances](#listerc20balances) - List ERC-20 balances +* [listErc721Balances](#listerc721balances) - List ERC-721 balances +* [listErc1155Balances](#listerc1155balances) - List ERC-1155 balances +* [listCollectibleBalances](#listcollectiblebalances) - List collectible (ERC-721/ERC-1155) balances + +## getNativeBalance + +Gets native token balance of a wallet address. + +Balance at a given block can be retrieved with the `blockNumber` parameter. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.balances.getNativeBalance({ + blockNumber: "6479329", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + currency: "usd", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmBalancesGetNativeBalance } from "@avalabs/avacloud-sdk/funcs/glacierEvmBalancesGetNativeBalance.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmBalancesGetNativeBalance(avaCloudSDK, { + blockNumber: "6479329", + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + currency: "usd", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetNativeBalanceRequest](../../models/operations/getnativebalancerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetNativeBalanceResponse](../../models/components/getnativebalanceresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listErc20Balances + +Lists ERC-20 token balances of a wallet address. + +Balance at a given block can be retrieved with the `blockNumber` parameter. + +Balance for specific contracts can be retrieved with the `contractAddresses` parameter. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.balances.listErc20Balances({ + blockNumber: "6479329", + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddresses: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7, 0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + currency: "usd", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmBalancesListErc20Balances } from "@avalabs/avacloud-sdk/funcs/glacierEvmBalancesListErc20Balances.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmBalancesListErc20Balances(avaCloudSDK, { + blockNumber: "6479329", + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddresses: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7, 0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + currency: "usd", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListErc20BalancesRequest](../../models/operations/listerc20balancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListErc20BalancesResponse](../../models/operations/listerc20balancesresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listErc721Balances + +Lists ERC-721 token balances of a wallet address. + +Balance for a specific contract can be retrieved with the `contractAddress` parameter. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.balances.listErc721Balances({ + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmBalancesListErc721Balances } from "@avalabs/avacloud-sdk/funcs/glacierEvmBalancesListErc721Balances.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmBalancesListErc721Balances(avaCloudSDK, { + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListErc721BalancesRequest](../../models/operations/listerc721balancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListErc721BalancesResponse](../../models/operations/listerc721balancesresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listErc1155Balances + +Lists ERC-1155 token balances of a wallet address. + +Balance at a given block can be retrieved with the `blockNumber` parameter. + +Balance for a specific contract can be retrieved with the `contractAddress` parameter. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.balances.listErc1155Balances({ + blockNumber: "6479329", + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmBalancesListErc1155Balances } from "@avalabs/avacloud-sdk/funcs/glacierEvmBalancesListErc1155Balances.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmBalancesListErc1155Balances(avaCloudSDK, { + blockNumber: "6479329", + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListErc1155BalancesRequest](../../models/operations/listerc1155balancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListErc1155BalancesResponse](../../models/operations/listerc1155balancesresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listCollectibleBalances + +Lists ERC-721 and ERC-1155 token balances of a wallet address. + +Balance for a specific contract can be retrieved with the `contractAddress` parameter. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.balances.listCollectibleBalances({ + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmBalancesListCollectibleBalances } from "@avalabs/avacloud-sdk/funcs/glacierEvmBalancesListCollectibleBalances.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmBalancesListCollectibleBalances(avaCloudSDK, { + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCollectibleBalancesRequest](../../models/operations/listcollectiblebalancesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListCollectibleBalancesResponse](../../models/operations/listcollectiblebalancesresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/avacloudsdkblocks/README.md b/docs/sdks/avacloudsdkblocks/README.md new file mode 100644 index 0000000..7d598ad --- /dev/null +++ b/docs/sdks/avacloudsdkblocks/README.md @@ -0,0 +1,190 @@ +# AvaCloudSDKBlocks +(*glacier.evm.blocks*) + +## Overview + +### Available Operations + +* [getLatestBlocks](#getlatestblocks) - List latest blocks +* [getBlock](#getblock) - Get block + +## getLatestBlocks + +Lists the latest indexed blocks on the EVM-compatible chain sorted in descending order by block timestamp. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.blocks.getLatestBlocks({ + pageSize: 10, + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmBlocksGetLatestBlocks } from "@avalabs/avacloud-sdk/funcs/glacierEvmBlocksGetLatestBlocks.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmBlocksGetLatestBlocks(avaCloudSDK, { + pageSize: 10, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetLatestBlocksRequest](../../models/operations/getlatestblocksrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetLatestBlocksResponse](../../models/operations/getlatestblocksresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getBlock + +Gets the details of an individual block on the EVM-compatible chain. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.blocks.getBlock({ + blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmBlocksGetBlock } from "@avalabs/avacloud-sdk/funcs/glacierEvmBlocksGetBlock.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmBlocksGetBlock(avaCloudSDK, { + blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetBlockRequest](../../models/operations/getblockrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetEvmBlockResponse](../../models/components/getevmblockresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/avacloudsdktransactions/README.md b/docs/sdks/avacloudsdktransactions/README.md new file mode 100644 index 0000000..8ae8549 --- /dev/null +++ b/docs/sdks/avacloudsdktransactions/README.md @@ -0,0 +1,1174 @@ +# AvaCloudSDKTransactions +(*glacier.evm.transactions*) + +## Overview + +### Available Operations + +* [getDeploymentTransaction](#getdeploymenttransaction) - Get deployment transaction +* [listContractDeployments](#listcontractdeployments) - List deployed contracts +* [listTransfers](#listtransfers) - List ERC transfers +* [listTransactions](#listtransactions) - List transactions +* [listNativeTransactions](#listnativetransactions) - List native transactions +* [listErc20Transactions](#listerc20transactions) - List ERC-20 transfers +* [listErc721Transactions](#listerc721transactions) - List ERC-721 transfers +* [listErc1155Transactions](#listerc1155transactions) - List ERC-1155 transfers +* [listInternalTransactions](#listinternaltransactions) - List internal transactions +* [getTransaction](#gettransaction) - Get transaction +* [getTransactionsForBlock](#gettransactionsforblock) - List transactions for a block +* [listLatestTransactions](#listlatesttransactions) - List latest transactions + +## getDeploymentTransaction + +If the address is a smart contract, returns the transaction in which it was deployed. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.getDeploymentTransaction({ + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + currency: "usd", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsGetDeploymentTransaction } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsGetDeploymentTransaction.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsGetDeploymentTransaction(avaCloudSDK, { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + currency: "usd", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetDeploymentTransactionRequest](../../models/operations/getdeploymenttransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetTransactionResponse](../../models/components/gettransactionresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listContractDeployments + +Lists all contracts deployed by the given address. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listContractDeployments({ + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListContractDeployments } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListContractDeployments.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListContractDeployments(avaCloudSDK, { + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListContractDeploymentsRequest](../../models/operations/listcontractdeploymentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListContractDeploymentsResponse](../../models/operations/listcontractdeploymentsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listTransfers + +Lists ERC transfers for an ERC-20, ERC-721, or ERC-1155 contract address. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listTransfers({ + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListTransfers } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListTransfers.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListTransfers(avaCloudSDK, { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListTransfersRequest](../../models/operations/listtransfersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListTransfersResponse](../../models/operations/listtransfersresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listTransactions + +Returns a list of transactions where the given wallet address had an on-chain interaction for the given chain. The ERC-20 transfers, ERC-721 transfers, ERC-1155, and internal transactions returned are only those where the input address had an interaction. Specifically, those lists only inlcude entries where the input address was the sender (`from` field) or the receiver (`to` field) for the sub-transaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the `/chains/:chainId/transactions/:txHash` endpoint. + +Filterable by block ranges. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listTransactions({ + pageSize: 10, + startBlock: 6479329, + endBlock: 6479330, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListTransactions } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListTransactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListTransactions(avaCloudSDK, { + pageSize: 10, + startBlock: 6479329, + endBlock: 6479330, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListTransactionsRequest](../../models/operations/listtransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListTransactionsResponse](../../models/operations/listtransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listNativeTransactions + +Lists native transactions for an address. Filterable by block range. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listNativeTransactions({ + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListNativeTransactions } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListNativeTransactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListNativeTransactions(avaCloudSDK, { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListNativeTransactionsRequest](../../models/operations/listnativetransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListNativeTransactionsResponse](../../models/operations/listnativetransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listErc20Transactions + +Lists ERC-20 transfers for an address. Filterable by block range. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listErc20Transactions({ + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListErc20Transactions } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListErc20Transactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListErc20Transactions(avaCloudSDK, { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListErc20TransactionsRequest](../../models/operations/listerc20transactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListErc20TransactionsResponse](../../models/operations/listerc20transactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listErc721Transactions + +Lists ERC-721 transfers for an address. Filterable by block range. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listErc721Transactions({ + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListErc721Transactions } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListErc721Transactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListErc721Transactions(avaCloudSDK, { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListErc721TransactionsRequest](../../models/operations/listerc721transactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListErc721TransactionsResponse](../../models/operations/listerc721transactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listErc1155Transactions + +Lists ERC-1155 transfers for an address. Filterable by block range. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listErc1155Transactions({ + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListErc1155Transactions } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListErc1155Transactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListErc1155Transactions(avaCloudSDK, { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListErc1155TransactionsRequest](../../models/operations/listerc1155transactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListErc1155TransactionsResponse](../../models/operations/listerc1155transactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listInternalTransactions + +Returns a list of internal transactions for an address and chain. Filterable by block range. + +Note that the internal transactions list only contains `CALL` or `CALLCODE` transactions with a non-zero value and `CREATE`/`CREATE2` transactions. To get a complete list of internal transactions use the `debug_` prefixed RPC methods on an archive node. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listInternalTransactions({ + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListInternalTransactions } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListInternalTransactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListInternalTransactions(avaCloudSDK, { + startBlock: 6479329, + endBlock: 6479330, + pageSize: 10, + address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListInternalTransactionsRequest](../../models/operations/listinternaltransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListInternalTransactionsResponse](../../models/operations/listinternaltransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getTransaction + +Gets the details of a single transaction. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.getTransaction({ + txHash: "0x8bf584d7b14b92a32a339872a66b134a70ba3ba7c305823f348db6f860253f45", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsGetTransaction } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsGetTransaction.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsGetTransaction(avaCloudSDK, { + txHash: "0x8bf584d7b14b92a32a339872a66b134a70ba3ba7c305823f348db6f860253f45", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTransactionRequest](../../models/operations/gettransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetTransactionResponse](../../models/components/gettransactionresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getTransactionsForBlock + +Lists the transactions that occured in a given block. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.getTransactionsForBlock({ + blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsGetTransactionsForBlock } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsGetTransactionsForBlock.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsGetTransactionsForBlock(avaCloudSDK, { + blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTransactionsForBlockRequest](../../models/operations/gettransactionsforblockrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.ListNativeTransactionsResponse](../../models/components/listnativetransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listLatestTransactions + +Lists the latest transactions. Filterable by status. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.transactions.listLatestTransactions({ + pageSize: 10, + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmTransactionsListLatestTransactions } from "@avalabs/avacloud-sdk/funcs/glacierEvmTransactionsListLatestTransactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmTransactionsListLatestTransactions(avaCloudSDK, { + pageSize: 10, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListLatestTransactionsRequest](../../models/operations/listlatesttransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListLatestTransactionsResponse](../../models/operations/listlatesttransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/balances/README.md b/docs/sdks/balances/README.md new file mode 100644 index 0000000..d3f797c --- /dev/null +++ b/docs/sdks/balances/README.md @@ -0,0 +1,102 @@ +# Balances +(*glacier.primaryNetwork.balances*) + +## Overview + +### Available Operations + +* [getBalancesByAddresses](#getbalancesbyaddresses) - Get balances + +## getBalancesByAddresses + +Gets primary network balances for one of the Primary Network chains for the supplied addresses. + +C-Chain balances returned are only the shared atomic memory balance. For EVM balance, use the `/v1/chains/:chainId/addresses/:addressId/balances:getNative` endpoint. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.balances.getBalancesByAddresses({ + blockTimestamp: 1599696000, + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + blockchainId: "p-chain", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkBalancesGetBalancesByAddresses } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkBalancesGetBalancesByAddresses.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkBalancesGetBalancesByAddresses(avaCloudSDK, { + blockTimestamp: 1599696000, + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + blockchainId: "p-chain", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetBalancesByAddressesRequest](../../models/operations/getbalancesbyaddressesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetBalancesByAddressesResponseBody](../../models/operations/getbalancesbyaddressesresponsebody.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/blocks/README.md b/docs/sdks/blocks/README.md new file mode 100644 index 0000000..64e4761 --- /dev/null +++ b/docs/sdks/blocks/README.md @@ -0,0 +1,292 @@ +# Blocks +(*glacier.primaryNetwork.blocks*) + +## Overview + +### Available Operations + +* [getBlockById](#getblockbyid) - Get block +* [listPrimaryNetworkBlocksByNodeId](#listprimarynetworkblocksbynodeid) - List blocks proposed by node +* [listLatestPrimaryNetworkBlocks](#listlatestprimarynetworkblocks) - List latest blocks + +## getBlockById + +Gets a block by block height or block hash on one of the Primary Network chains. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.blocks.getBlockById({ + blockchainId: "p-chain", + blockId: "5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkBlocksGetBlockById } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkBlocksGetBlockById.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkBlocksGetBlockById(avaCloudSDK, { + blockchainId: "p-chain", + blockId: "5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetBlockByIdRequest](../../models/operations/getblockbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetPrimaryNetworkBlockResponse](../../models/components/getprimarynetworkblockresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listPrimaryNetworkBlocksByNodeId + +Lists the latest blocks proposed by a given NodeID on one of the Primary Network chains. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.blocks.listPrimaryNetworkBlocksByNodeId({ + pageSize: 10, + blockchainId: "p-chain", + nodeId: "NodeID-111111111111111111116DBWJs", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId(avaCloudSDK, { + pageSize: 10, + blockchainId: "p-chain", + nodeId: "NodeID-111111111111111111116DBWJs", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListPrimaryNetworkBlocksByNodeIdRequest](../../models/operations/listprimarynetworkblocksbynodeidrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListPrimaryNetworkBlocksByNodeIdResponse](../../models/operations/listprimarynetworkblocksbynodeidresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listLatestPrimaryNetworkBlocks + +Lists latest blocks on one of the Primary Network chains. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.blocks.listLatestPrimaryNetworkBlocks({ + pageSize: 10, + blockchainId: "p-chain", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks(avaCloudSDK, { + pageSize: 10, + blockchainId: "p-chain", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListLatestPrimaryNetworkBlocksRequest](../../models/operations/listlatestprimarynetworkblocksrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListLatestPrimaryNetworkBlocksResponse](../../models/operations/listlatestprimarynetworkblocksresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/chains/README.md b/docs/sdks/chains/README.md new file mode 100644 index 0000000..ff31d6c --- /dev/null +++ b/docs/sdks/chains/README.md @@ -0,0 +1,184 @@ +# Chains +(*glacier.evm.chains*) + +## Overview + +### Available Operations + +* [supportedChains](#supportedchains) - List chains +* [getChainInfo](#getchaininfo) - Get chain information + +## supportedChains + +Lists the supported EVM-compatible chains. Filterable by network. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.chains.supportedChains({ + network: "mainnet", + feature: "nftIndexing", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmChainsSupportedChains } from "@avalabs/avacloud-sdk/funcs/glacierEvmChainsSupportedChains.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmChainsSupportedChains(avaCloudSDK, { + network: "mainnet", + feature: "nftIndexing", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.SupportedChainsRequest](../../models/operations/supportedchainsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GlacierListChainsResponse](../../models/components/glacierlistchainsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getChainInfo + +Gets chain information for the EVM-compatible chain if supported by the api. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.chains.getChainInfo({}); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmChainsGetChainInfo } from "@avalabs/avacloud-sdk/funcs/glacierEvmChainsGetChainInfo.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmChainsGetChainInfo(avaCloudSDK, {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetChainInfoRequest](../../models/operations/getchaininforequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetChainResponse](../../models/components/getchainresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/contracts/README.md b/docs/sdks/contracts/README.md new file mode 100644 index 0000000..e4f7a64 --- /dev/null +++ b/docs/sdks/contracts/README.md @@ -0,0 +1,96 @@ +# Contracts +(*glacier.evm.contracts*) + +## Overview + +### Available Operations + +* [getContractMetadata](#getcontractmetadata) - Get contract metadata + +## getContractMetadata + +Gets metadata about the contract at the given address. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.evm.contracts.getContractMetadata({ + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierEvmContractsGetContractMetadata } from "@avalabs/avacloud-sdk/funcs/glacierEvmContractsGetContractMetadata.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierEvmContractsGetContractMetadata(avaCloudSDK, { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetContractMetadataRequest](../../models/operations/getcontractmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetContractMetadataResponseBody](../../models/operations/getcontractmetadataresponsebody.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/evm/README.md b/docs/sdks/evm/README.md new file mode 100644 index 0000000..2ec3344 --- /dev/null +++ b/docs/sdks/evm/README.md @@ -0,0 +1,2 @@ +# Evm +(*glacier.evm*) \ No newline at end of file diff --git a/docs/sdks/glacier/README.md b/docs/sdks/glacier/README.md new file mode 100644 index 0000000..273bbfc --- /dev/null +++ b/docs/sdks/glacier/README.md @@ -0,0 +1,2 @@ +# Glacier +(*glacier*) \ No newline at end of file diff --git a/docs/sdks/healthcheck/README.md b/docs/sdks/healthcheck/README.md new file mode 100644 index 0000000..8a92e9a --- /dev/null +++ b/docs/sdks/healthcheck/README.md @@ -0,0 +1,84 @@ +# HealthCheck +(*glacier.healthCheck*) + +## Overview + +### Available Operations + +* [glacierHealthCheck](#glacierhealthcheck) - Get the health of the service + +## glacierHealthCheck + +Get the health of the service + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.healthCheck.glacierHealthCheck(); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierHealthCheckGlacierHealthCheck } from "@avalabs/avacloud-sdk/funcs/glacierHealthCheckGlacierHealthCheck.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierHealthCheckGlacierHealthCheck(avaCloudSDK); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GlacierHealthCheckResponseBody](../../models/operations/glacierhealthcheckresponsebody.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| errors.GlacierHealthCheckResponseBody | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/nfts/README.md b/docs/sdks/nfts/README.md new file mode 100644 index 0000000..3f017c3 --- /dev/null +++ b/docs/sdks/nfts/README.md @@ -0,0 +1,284 @@ +# Nfts +(*glacier.nfts*) + +## Overview + +### Available Operations + +* [reindexNft](#reindexnft) - Reindex NFT metadata +* [listTokens](#listtokens) - List tokens +* [getTokenDetails](#gettokendetails) - Get token details + +## reindexNft + +Triggers reindexing of token metadata for an NFT token. Reindexing can only be called once per hour for each NFT token. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + await avaCloudSDK.glacier.nfts.reindexNft({ + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierNftsReindexNft } from "@avalabs/avacloud-sdk/funcs/glacierNftsReindexNft.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierNftsReindexNft(avaCloudSDK, { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ReindexNftRequest](../../models/operations/reindexnftrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listTokens + +Lists tokens for an NFT contract. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.nfts.listTokens({ + pageSize: 10, + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierNftsListTokens } from "@avalabs/avacloud-sdk/funcs/glacierNftsListTokens.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierNftsListTokens(avaCloudSDK, { + pageSize: 10, + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListTokensRequest](../../models/operations/listtokensrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListTokensResponse](../../models/operations/listtokensresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getTokenDetails + +Gets token details for a specific token of an NFT contract. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.nfts.getTokenDetails({ + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierNftsGetTokenDetails } from "@avalabs/avacloud-sdk/funcs/glacierNftsGetTokenDetails.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierNftsGetTokenDetails(avaCloudSDK, { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + tokenId: "145", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTokenDetailsRequest](../../models/operations/gettokendetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetTokenDetailsResponseBody](../../models/operations/gettokendetailsresponsebody.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/operations/README.md b/docs/sdks/operations/README.md new file mode 100644 index 0000000..6225626 --- /dev/null +++ b/docs/sdks/operations/README.md @@ -0,0 +1,209 @@ +# Operations +(*glacier.operations*) + +## Overview + +### Available Operations + +* [getOperationResult](#getoperationresult) - Get operation +* [postTransactionExportJob](#posttransactionexportjob) - Create transaction export operation + +## getOperationResult + +Gets operation details for the given operation id. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.operations.getOperationResult({ + operationId: "aa22054a-cb7c-4a4e-9b83-59f2ede74138", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierOperationsGetOperationResult } from "@avalabs/avacloud-sdk/funcs/glacierOperationsGetOperationResult.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierOperationsGetOperationResult(avaCloudSDK, { + operationId: "aa22054a-cb7c-4a4e-9b83-59f2ede74138", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetOperationResultRequest](../../models/operations/getoperationresultrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.OperationStatusResponse](../../models/components/operationstatusresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## postTransactionExportJob + +Trigger a transaction export operation with given parameters. + +The transaction export operation runs asynchronously in the background. The status of the job can be retrieved from the `/v1/operations/:operationId` endpoint using the `operationId` returned from this endpoint. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.operations.postTransactionExportJob({ + type: "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING", + firstDate: "2023-05-01", + lastDate: "2023-05-02", + startDate: "2023-05-01", + endDate: "2023-05-02", + options: { + includeChains: [ + "p-chain", + ], + }, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierOperationsPostTransactionExportJob } from "@avalabs/avacloud-sdk/funcs/glacierOperationsPostTransactionExportJob.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierOperationsPostTransactionExportJob(avaCloudSDK, { + type: "TRANSACTION_EXPORT_EVM", + firstDate: "2023-05-01", + lastDate: "2023-05-02", + startDate: "2023-05-01", + endDate: "2023-05-02", + options: { + addresses: [ + "", + ], + includeChains: [ + "43114", + ], + }, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.PostTransactionExportJobRequestBody](../../models/operations/posttransactionexportjobrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.OperationStatusResponse](../../models/components/operationstatusresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/primarynetwork/README.md b/docs/sdks/primarynetwork/README.md new file mode 100644 index 0000000..0bf98d1 --- /dev/null +++ b/docs/sdks/primarynetwork/README.md @@ -0,0 +1,876 @@ +# PrimaryNetwork +(*glacier.primaryNetwork*) + +## Overview + +### Available Operations + +* [getAssetDetails](#getassetdetails) - Get asset details +* [getChainIdsForAddresses](#getchainidsforaddresses) - Get chain interactions for addresses +* [getNetworkDetails](#getnetworkdetails) - Get network details +* [listBlockchains](#listblockchains) - List blockchains +* [listSubnets](#listsubnets) - List subnets +* [getSubnetById](#getsubnetbyid) - Get Subnet details by ID +* [listValidators](#listvalidators) - List validators +* [getSingleValidatorDetails](#getsinglevalidatordetails) - Get single validator details +* [listDelegators](#listdelegators) - List delegators + +## getAssetDetails + +Gets asset details corresponding to the given asset id on the X-Chain. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.getAssetDetails({ + blockchainId: "x-chain", + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkGetAssetDetails } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkGetAssetDetails.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkGetAssetDetails(avaCloudSDK, { + blockchainId: "x-chain", + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetAssetDetailsRequest](../../models/operations/getassetdetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.XChainAssetDetails](../../models/components/xchainassetdetails.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getChainIdsForAddresses + +Returns Primary Network chains that each address has touched in the form of an address mapped array. If an address has had any on-chain interaction for a chain, that chain's chain id will be returned. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.getChainIdsForAddresses({ + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkGetChainIdsForAddresses } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkGetChainIdsForAddresses.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkGetChainIdsForAddresses(avaCloudSDK, { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetChainIdsForAddressesRequest](../../models/operations/getchainidsforaddressesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.ChainAddressChainIdMapListResponse](../../models/components/chainaddresschainidmaplistresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getNetworkDetails + +Gets network details such as validator and delegator stats. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.getNetworkDetails({}); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkGetNetworkDetails } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkGetNetworkDetails.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkGetNetworkDetails(avaCloudSDK, {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetNetworkDetailsRequest](../../models/operations/getnetworkdetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.GetNetworkDetailsResponse](../../models/components/getnetworkdetailsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listBlockchains + +Lists all blockchains registered on the network. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.listBlockchains({ + pageSize: 10, + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkListBlockchains } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkListBlockchains.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkListBlockchains(avaCloudSDK, { + pageSize: 10, + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListBlockchainsRequest](../../models/operations/listblockchainsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListBlockchainsResponse](../../models/operations/listblockchainsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listSubnets + +Lists all subnets registered on the network. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.listSubnets({ + pageSize: 10, + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkListSubnets } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkListSubnets.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkListSubnets(avaCloudSDK, { + pageSize: 10, + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListSubnetsRequest](../../models/operations/listsubnetsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListSubnetsResponse](../../models/operations/listsubnetsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getSubnetById + +Get details of the Subnet registered on the network. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.getSubnetById({ + subnetId: "11111111111111111111111111111111LpoYY", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkGetSubnetById } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkGetSubnetById.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkGetSubnetById(avaCloudSDK, { + subnetId: "11111111111111111111111111111111LpoYY", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetSubnetByIdRequest](../../models/operations/getsubnetbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.Subnet](../../models/components/subnet.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listValidators + +Lists details for validators. By default, returns details for all validators. Filterable by validator node ids and minimum delegation capacity. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.listValidators({ + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + validationStatus: "completed", + minDelegationCapacity: "0", + maxDelegationCapacity: "720000000000000000", + minTimeRemaining: 0, + maxTimeRemaining: 2147483647, + minFeePercentage: 2, + maxFeePercentage: 100, + minUptimePerformance: 90, + maxUptimePerformance: 100, + subnetId: "11111111111111111111111111111111LpoYY", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkListValidators } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkListValidators.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkListValidators(avaCloudSDK, { + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + validationStatus: "completed", + minDelegationCapacity: "0", + maxDelegationCapacity: "720000000000000000", + minTimeRemaining: 0, + maxTimeRemaining: 2147483647, + minFeePercentage: 2, + maxFeePercentage: 100, + minUptimePerformance: 90, + maxUptimePerformance: 100, + subnetId: "11111111111111111111111111111111LpoYY", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListValidatorsRequest](../../models/operations/listvalidatorsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListValidatorsResponse](../../models/operations/listvalidatorsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getSingleValidatorDetails + +List validator details for a single validator. Filterable by validation status. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.getSingleValidatorDetails({ + pageSize: 10, + nodeId: "NodeID-111111111111111111116DBWJs", + validationStatus: "completed", + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkGetSingleValidatorDetails } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkGetSingleValidatorDetails.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkGetSingleValidatorDetails(avaCloudSDK, { + pageSize: 10, + nodeId: "NodeID-111111111111111111116DBWJs", + validationStatus: "completed", + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetSingleValidatorDetailsRequest](../../models/operations/getsinglevalidatordetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetSingleValidatorDetailsResponse](../../models/operations/getsinglevalidatordetailsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listDelegators + +Lists details for delegators. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.listDelegators({ + pageSize: 10, + rewardAddresses: "P-avax1679zrp3z9mf7z4an42ddq47qzj36zv6ga20vwl,P-avax1s7kd0kfndlz6mh3l0etrrcmkg5y366k8e0s6cc", + sortOrder: "asc", + delegationStatus: "completed", + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkListDelegators } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkListDelegators.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkListDelegators(avaCloudSDK, { + pageSize: 10, + rewardAddresses: "P-avax1679zrp3z9mf7z4an42ddq47qzj36zv6ga20vwl,P-avax1s7kd0kfndlz6mh3l0etrrcmkg5y366k8e0s6cc", + sortOrder: "asc", + delegationStatus: "completed", + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListDelegatorsRequest](../../models/operations/listdelegatorsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListDelegatorsResponse](../../models/operations/listdelegatorsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/rewards/README.md b/docs/sdks/rewards/README.md new file mode 100644 index 0000000..ed81e27 --- /dev/null +++ b/docs/sdks/rewards/README.md @@ -0,0 +1,208 @@ +# Rewards +(*glacier.primaryNetwork.rewards*) + +## Overview + +### Available Operations + +* [listPendingPrimaryNetworkRewards](#listpendingprimarynetworkrewards) - List pending rewards +* [listHistoricalPrimaryNetworkRewards](#listhistoricalprimarynetworkrewards) - List historical rewards + +## listPendingPrimaryNetworkRewards + +Lists pending rewards on the Primary Network for the supplied addresses. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.rewards.listPendingPrimaryNetworkRewards({ + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards(avaCloudSDK, { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListPendingPrimaryNetworkRewardsRequest](../../models/operations/listpendingprimarynetworkrewardsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListPendingPrimaryNetworkRewardsResponse](../../models/operations/listpendingprimarynetworkrewardsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listHistoricalPrimaryNetworkRewards + +Lists historical rewards on the Primary Network for the supplied addresses. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.rewards.listHistoricalPrimaryNetworkRewards({ + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + currency: "usd", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards(avaCloudSDK, { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs", + sortOrder: "asc", + currency: "usd", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListHistoricalPrimaryNetworkRewardsRequest](../../models/operations/listhistoricalprimarynetworkrewardsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListHistoricalPrimaryNetworkRewardsResponse](../../models/operations/listhistoricalprimarynetworkrewardsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/teleporter/README.md b/docs/sdks/teleporter/README.md new file mode 100644 index 0000000..8ae339e --- /dev/null +++ b/docs/sdks/teleporter/README.md @@ -0,0 +1,200 @@ +# Teleporter +(*glacier.teleporter*) + +## Overview + +### Available Operations + +* [getTeleporterMessage](#getteleportermessage) - Get a teleporter message +* [listTeleporterMessages](#listteleportermessages) - List teleporter messages + +## getTeleporterMessage + +Gets a teleporter message by message ID. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.teleporter.getTeleporterMessage({ + messageId: "acf1c8b06f9aec48e9fcbefbbe576ae8a7ca3b327fcae111396e7cc99956674d", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierTeleporterGetTeleporterMessage } from "@avalabs/avacloud-sdk/funcs/glacierTeleporterGetTeleporterMessage.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierTeleporterGetTeleporterMessage(avaCloudSDK, { + messageId: "acf1c8b06f9aec48e9fcbefbbe576ae8a7ca3b327fcae111396e7cc99956674d", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTeleporterMessageRequest](../../models/operations/getteleportermessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetTeleporterMessageResponseBody](../../models/operations/getteleportermessageresponsebody.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listTeleporterMessages + +Lists teleporter messages. Ordered by timestamp in descending order. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.teleporter.listTeleporterMessages({ + pageSize: 10, + sourceBlockchainId: "2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY", + destinationBlockchainId: "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp", + to: "0x664A4Be5Af2cFc824F9C0914CbAc4703396Da2DC", + from: "0x321eDA69247566D662178feE695C7026c604Cd94", + network: "mainnet", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierTeleporterListTeleporterMessages } from "@avalabs/avacloud-sdk/funcs/glacierTeleporterListTeleporterMessages.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierTeleporterListTeleporterMessages(avaCloudSDK, { + pageSize: 10, + sourceBlockchainId: "2D8RG4UpSXbPbvPCAWppNJyqTG2i2CAXSkTgmTBBvs7GKNZjsY", + destinationBlockchainId: "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp", + to: "0x664A4Be5Af2cFc824F9C0914CbAc4703396Da2DC", + from: "0x321eDA69247566D662178feE695C7026c604Cd94", + network: "mainnet", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListTeleporterMessagesRequest](../../models/operations/listteleportermessagesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListTeleporterMessagesResponse](../../models/operations/listteleportermessagesresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/transactions/README.md b/docs/sdks/transactions/README.md new file mode 100644 index 0000000..b5827cd --- /dev/null +++ b/docs/sdks/transactions/README.md @@ -0,0 +1,430 @@ +# Transactions +(*glacier.primaryNetwork.transactions*) + +## Overview + +### Available Operations + +* [getTxByHash](#gettxbyhash) - Get transaction +* [listLatestPrimaryNetworkTransactions](#listlatestprimarynetworktransactions) - List latest transactions +* [listActivePrimaryNetworkStakingTransactions](#listactiveprimarynetworkstakingtransactions) - List staking transactions +* [listAssetTransactions](#listassettransactions) - List asset transactions + +## getTxByHash + +Gets the details of a single transaction on one of the Primary Network chains. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.transactions.getTxByHash({ + blockchainId: "p-chain", + txHash: "3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkTransactionsGetTxByHash } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkTransactionsGetTxByHash.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkTransactionsGetTxByHash(avaCloudSDK, { + blockchainId: "p-chain", + txHash: "3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTxByHashRequest](../../models/operations/gettxbyhashrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetTxByHashResponseBody](../../models/operations/gettxbyhashresponsebody.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listLatestPrimaryNetworkTransactions + +Lists the latest transactions on one of the Primary Network chains. + +Transactions are filterable by addresses, txTypes, and timestamps. When querying for latest transactions without an address parameter, filtering by txTypes and timestamps is not supported. An address filter must be provided to utilize txTypes and timestamp filters. + +Given that each transaction may return a large number of UTXO objects, bounded only by the maximum transaction size, the query may return less transactions than the provided page size. The result will contain less results than the page size if the number of utxos contained in the resulting transactions reach a performance threshold. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.transactions.listLatestPrimaryNetworkTransactions({ + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + txTypes: [ + "AddValidatorTx", + ], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions(avaCloudSDK, { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + txTypes: [ + "AddValidatorTx", + ], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListLatestPrimaryNetworkTransactionsRequest](../../models/operations/listlatestprimarynetworktransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListLatestPrimaryNetworkTransactionsResponse](../../models/operations/listlatestprimarynetworktransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listActivePrimaryNetworkStakingTransactions + +Lists active staking transactions on the P-Chain for the supplied addresses. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.transactions.listActivePrimaryNetworkStakingTransactions({ + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + txTypes: [ + "AddValidatorTx", + ], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions(avaCloudSDK, { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + txTypes: [ + "AddValidatorTx", + ], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListActivePrimaryNetworkStakingTransactionsRequest](../../models/operations/listactiveprimarynetworkstakingtransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListActivePrimaryNetworkStakingTransactionsResponse](../../models/operations/listactiveprimarynetworkstakingtransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## listAssetTransactions + +Lists asset transactions corresponding to the given asset id on the X-Chain. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.transactions.listAssetTransactions({ + txTypes: [ + "AddValidatorTx", + ], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "x-chain", + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkTransactionsListAssetTransactions } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkTransactionsListAssetTransactions.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkTransactionsListAssetTransactions(avaCloudSDK, { + txTypes: [ + "AddValidatorTx", + ], + startTimestamp: 1689541049, + endTimestamp: 1689800249, + pageSize: 10, + blockchainId: "x-chain", + assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListAssetTransactionsRequest](../../models/operations/listassettransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListAssetTransactionsResponse](../../models/operations/listassettransactionsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/usagemetrics/README.md b/docs/sdks/usagemetrics/README.md new file mode 100644 index 0000000..d241be7 --- /dev/null +++ b/docs/sdks/usagemetrics/README.md @@ -0,0 +1,198 @@ +# UsageMetrics +(*glacier.usageMetrics*) + +## Overview + +### Available Operations + +* [getApiUsageMetrics](#getapiusagemetrics) - Get usage metrics for the Glacier API +* [getApiLogs](#getapilogs) - Get logs for requests made by client + +## getApiUsageMetrics + +Gets metrics for Glacier API usage over a specified time interval aggregated at the specified time-duration granularity. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.usageMetrics.getApiUsageMetrics({ + startTimestamp: 1689541049, + endTimestamp: 1689800249, + timeInterval: "daily", + groupBy: "requestPath", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierUsageMetricsGetApiUsageMetrics } from "@avalabs/avacloud-sdk/funcs/glacierUsageMetricsGetApiUsageMetrics.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierUsageMetricsGetApiUsageMetrics(avaCloudSDK, { + startTimestamp: 1689541049, + endTimestamp: 1689800249, + timeInterval: "daily", + groupBy: "requestPath", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetApiUsageMetricsRequest](../../models/operations/getapiusagemetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.UsageMetricsResponseDTO](../../models/components/usagemetricsresponsedto.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getApiLogs + +Gets logs for requests made by client over a specified time interval for a specific organization. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.usageMetrics.getApiLogs({ + startTimestamp: 1689541049, + endTimestamp: 1689800249, + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierUsageMetricsGetApiLogs } from "@avalabs/avacloud-sdk/funcs/glacierUsageMetricsGetApiLogs.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierUsageMetricsGetApiLogs(avaCloudSDK, { + startTimestamp: 1689541049, + endTimestamp: 1689800249, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetApiLogsRequest](../../models/operations/getapilogsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetApiLogsResponse](../../models/operations/getapilogsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/utxos/README.md b/docs/sdks/utxos/README.md new file mode 100644 index 0000000..872dc26 --- /dev/null +++ b/docs/sdks/utxos/README.md @@ -0,0 +1,106 @@ +# Utxos +(*glacier.primaryNetwork.utxos*) + +## Overview + +### Available Operations + +* [getUtxosByAddresses](#getutxosbyaddresses) - List UTXOs + +## getUtxosByAddresses + +Lists UTXOs on one of the Primary Network chains for the supplied addresses. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.utxos.getUtxosByAddresses({ + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkUtxosGetUtxosByAddresses } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkUtxosGetUtxosByAddresses.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkUtxosGetUtxosByAddresses(avaCloudSDK, { + addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg", + pageSize: 10, + blockchainId: "p-chain", + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetUtxosByAddressesRequest](../../models/operations/getutxosbyaddressesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetUtxosByAddressesResponse](../../models/operations/getutxosbyaddressesresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/vertices/README.md b/docs/sdks/vertices/README.md new file mode 100644 index 0000000..3939ed2 --- /dev/null +++ b/docs/sdks/vertices/README.md @@ -0,0 +1,294 @@ +# Vertices +(*glacier.primaryNetwork.vertices*) + +## Overview + +### Available Operations + +* [listLatestXChainVertices](#listlatestxchainvertices) - List vertices +* [getVertexByHash](#getvertexbyhash) - Get vertex +* [getVertexByHeight](#getvertexbyheight) - List vertices by height + +## listLatestXChainVertices + +Lists latest vertices on the X-Chain. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.vertices.listLatestXChainVertices({ + pageSize: 10, + blockchainId: "x-chain", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkVerticesListLatestXChainVertices } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkVerticesListLatestXChainVertices.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkVerticesListLatestXChainVertices(avaCloudSDK, { + pageSize: 10, + blockchainId: "x-chain", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListLatestXChainVerticesRequest](../../models/operations/listlatestxchainverticesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListLatestXChainVerticesResponse](../../models/operations/listlatestxchainverticesresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getVertexByHash + +Gets a single vertex on the X-Chain. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.vertices.getVertexByHash({ + vertexHash: "haP1CW56cspZY7aEuqHNrtpvhqCaMTxQaYe6j5u2Mbn4L2Gqr", + blockchainId: "x-chain", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkVerticesGetVertexByHash } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkVerticesGetVertexByHash.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkVerticesGetVertexByHash(avaCloudSDK, { + vertexHash: "haP1CW56cspZY7aEuqHNrtpvhqCaMTxQaYe6j5u2Mbn4L2Gqr", + blockchainId: "x-chain", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetVertexByHashRequest](../../models/operations/getvertexbyhashrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.XChainVertex](../../models/components/xchainvertex.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getVertexByHeight + +Lists vertices at the given vertex height on the X-Chain. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.primaryNetwork.vertices.getVertexByHeight({ + vertexHeight: 123, + pageSize: 10, + blockchainId: "x-chain", + sortOrder: "asc", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierPrimaryNetworkVerticesGetVertexByHeight } from "@avalabs/avacloud-sdk/funcs/glacierPrimaryNetworkVerticesGetVertexByHeight.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierPrimaryNetworkVerticesGetVertexByHeight(avaCloudSDK, { + vertexHeight: 123, + pageSize: 10, + blockchainId: "x-chain", + sortOrder: "asc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetVertexByHeightRequest](../../models/operations/getvertexbyheightrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetVertexByHeightResponse](../../models/operations/getvertexbyheightresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md new file mode 100644 index 0000000..2d35982 --- /dev/null +++ b/docs/sdks/webhooks/README.md @@ -0,0 +1,950 @@ +# Webhooks +(*glacier.webhooks*) + +## Overview + +### Available Operations + +* [listWebhooks](#listwebhooks) - List webhooks +* [createWebhook](#createwebhook) - Create a webhook +* [getWebhook](#getwebhook) - Get a webhook by ID +* [deactivateWebhook](#deactivatewebhook) - Deactivate a webhook +* [updateWebhook](#updatewebhook) - Update a webhook +* [generateSharedSecret](#generatesharedsecret) - Generate a shared secret +* [getSharedSecret](#getsharedsecret) - Get a shared secret +* [getAddressesFromWebhook](#getaddressesfromwebhook) - List adresses by webhook +* [removeAddressesFromWebhook](#removeaddressesfromwebhook) - Remove addresses from webhook +* [addAddressesToWebhook](#addaddressestowebhook) - Add addresses to webhook + +## listWebhooks + +Lists webhooks for the user. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.listWebhooks({ + pageSize: 10, + status: "active", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksListWebhooks } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksListWebhooks.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksListWebhooks(avaCloudSDK, { + pageSize: 10, + status: "active", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListWebhooksRequest](../../models/operations/listwebhooksrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListWebhooksResponse](../../models/operations/listwebhooksresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## createWebhook + +Create a new webhook. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.createWebhook({ + url: "https://unrealistic-well-being.name", + chainId: "", + eventType: "address_activity", + metadata: { + addresses: [ + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + ], + eventSignatures: [ + "0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64", + ], + }, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksCreateWebhook } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksCreateWebhook.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksCreateWebhook(avaCloudSDK, { + url: "http://revolving-inverse.net", + chainId: "", + eventType: "address_activity", + metadata: { + addresses: [ + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + ], + eventSignatures: [ + "0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64", + ], + }, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.CreateWebhookRequest](../../models/components/createwebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.WebhookResponse](../../models/components/webhookresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getWebhook + +Retrieves a webhook by ID. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.getWebhook({ + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksGetWebhook } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksGetWebhook.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksGetWebhook(avaCloudSDK, { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWebhookRequest](../../models/operations/getwebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.WebhookResponse](../../models/components/webhookresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## deactivateWebhook + +Deactivates a webhook by ID. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.deactivateWebhook({ + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksDeactivateWebhook } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksDeactivateWebhook.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksDeactivateWebhook(avaCloudSDK, { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeactivateWebhookRequest](../../models/operations/deactivatewebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.WebhookResponse](../../models/components/webhookresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## updateWebhook + +Updates an existing webhook. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.updateWebhook({ + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + updateWebhookRequest: {}, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksUpdateWebhook } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksUpdateWebhook.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksUpdateWebhook(avaCloudSDK, { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + updateWebhookRequest: {}, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateWebhookRequest](../../models/operations/updatewebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.WebhookResponse](../../models/components/webhookresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## generateSharedSecret + +Generates a new shared secret. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.generateSharedSecret(); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksGenerateSharedSecret } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksGenerateSharedSecret.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksGenerateSharedSecret(avaCloudSDK); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.SharedSecretsResponse](../../models/components/sharedsecretsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getSharedSecret + +Get a previously generated shared secret. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.getSharedSecret(); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksGetSharedSecret } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksGetSharedSecret.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksGetSharedSecret(avaCloudSDK); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.SharedSecretsResponse](../../models/components/sharedsecretsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## getAddressesFromWebhook + +List adresses by webhook. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.getAddressesFromWebhook({ + pageSize: 10, + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + }); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksGetAddressesFromWebhook } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksGetAddressesFromWebhook.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksGetAddressesFromWebhook(avaCloudSDK, { + pageSize: 10, + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetAddressesFromWebhookRequest](../../models/operations/getaddressesfromwebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetAddressesFromWebhookResponse](../../models/operations/getaddressesfromwebhookresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## removeAddressesFromWebhook + +Remove addresses from webhook. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.removeAddressesFromWebhook({ + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + addressesChangeRequest: { + addresses: [ + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + ], + }, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksRemoveAddressesFromWebhook } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksRemoveAddressesFromWebhook.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksRemoveAddressesFromWebhook(avaCloudSDK, { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + addressesChangeRequest: { + addresses: [ + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + ], + }, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RemoveAddressesFromWebhookRequest](../../models/operations/removeaddressesfromwebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.WebhookResponse](../../models/components/webhookresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | + + +## addAddressesToWebhook + +Add addresses to webhook. + +### Example Usage + +```typescript +import { AvaCloudSDK } from "@avalabs/avacloud-sdk"; + +const avaCloudSDK = new AvaCloudSDK({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const result = await avaCloudSDK.glacier.webhooks.addAddressesToWebhook({ + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + addressesChangeRequest: { + addresses: [ + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + ], + }, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js"; +import { glacierWebhooksAddAddressesToWebhook } from "@avalabs/avacloud-sdk/funcs/glacierWebhooksAddAddressesToWebhook.js"; + +// Use `AvaCloudSDKCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const avaCloudSDK = new AvaCloudSDKCore({ + apiKey: "", + chainId: "43114", + network: "mainnet", +}); + +async function run() { + const res = await glacierWebhooksAddAddressesToWebhook(avaCloudSDK, { + id: "f33de69c-d13b-4691-908f-870d6e2e6b04", + addressesChangeRequest: { + addresses: [ + "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + ], + }, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AddAddressesToWebhookRequest](../../models/operations/addaddressestowebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.WebhookResponse](../../models/components/webhookresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.TooManyRequests | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.BadGateway | 502 | application/json | +| errors.ServiceUnavailable | 503 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/jsr.json b/jsr.json new file mode 100644 index 0000000..de26183 --- /dev/null +++ b/jsr.json @@ -0,0 +1,28 @@ + + +{ + "name": "@avalabs/avacloud-sdk", + "version": "0.0.1-alpha.1", + "exports": { + ".": "./src/index.ts", + "./models/errors": "./src/models/errors/index.ts", + "./models/components": "./src/models/components/index.ts", + "./models/operations": "./src/models/operations/index.ts", + "./lib/config": "./src/lib/config.ts", + "./lib/http": "./src/lib/http.ts", + "./lib/retries": "./src/lib/retries.ts", + "./lib/sdks": "./src/lib/sdks.ts", + "./types": "./src/types/index.ts", + "./utils": "./src/utils/index.ts" + }, + "publish": { + "include": [ + "LICENSE", + "README.md", + "RUNTIMES.md", + "USAGE.md", + "jsr.json", + "src/**/*.ts" + ] + } +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6b6e33b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3333 @@ +{ + "name": "@avalabs/avacloud-sdk", + "version": "0.2.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@avalabs/avacloud-sdk", + "version": "0.2.0", + "dependencies": { + "json-canonicalize": "^1.0.6" + }, + "devDependencies": { + "@types/node": "^22.4.1", + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/parser": "^7.7.1", + "eslint": "^8.57.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.1", + "typescript": "^5.4.5", + "zod": "^3.23.4" + }, + "peerDependencies": { + "zod": ">= 3" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.4.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.4.1.tgz", + "integrity": "sha512-1tbpb9325+gPnKK0dMm+/LMriX0vKxf6RnB0SZUqfyVkQ4fMgUSySqhxE/y8Jvs4NyF1yHzTfG9KlnkIODxPKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", + "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/type-utils": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", + "dev": true, + "license": "ISC", + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "license": "ISC" + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.6.tgz", + "integrity": "sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-canonicalize": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/json-canonicalize/-/json-canonicalize-1.0.6.tgz", + "integrity": "sha512-kP2iYpOS5SZHYhIaR1t9oG80d4uTY3jPoaBj+nimy3njtJk8+sRsVatN8pyJRDRtk9Su3+6XqA2U8k0dByJBUQ==", + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..746c1e1 --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "@avalabs/avacloud-sdk", + "version": "0.2.0", + "author": "Speakeasy", + "main": "./index.js", + "sideEffects": false, + "repository": { + "type": "git", + "url": "https://github.com/ava-labs/avacloud-sdk-typescript.git" + }, + "scripts": { + "lint": "eslint --max-warnings=0 src", + "build": "tsc", + "prepare": "npm run build" + }, + "peerDependencies": { + "zod": ">= 3" + }, + "devDependencies": { + "@types/node": "^22.4.1", + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/parser": "^7.7.1", + "eslint": "^8.57.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.1", + "typescript": "^5.4.5", + "zod": "^3.23.4" + }, + "dependencies": { + "json-canonicalize": "^1.0.6" + } +} diff --git a/src/core.ts b/src/core.ts new file mode 100644 index 0000000..5cd07d8 --- /dev/null +++ b/src/core.ts @@ -0,0 +1,13 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "./lib/sdks.js"; + +/** + * A minimal client to use when calling standalone SDK functions. Typically, an + * instance of this class would be instantiated once at the start of an + * application and passed around through some dependency injection mechanism to + * parts of an application that need to make SDK calls. + */ +export class AvaCloudSDKCore extends ClientSDK {} diff --git a/src/funcs/glacierEvmBalancesGetNativeBalance.ts b/src/funcs/glacierEvmBalancesGetNativeBalance.ts new file mode 100644 index 0000000..2ed41b4 --- /dev/null +++ b/src/funcs/glacierEvmBalancesGetNativeBalance.ts @@ -0,0 +1,184 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get native token balance + * + * @remarks + * Gets native token balance of a wallet address. + * + * Balance at a given block can be retrieved with the `blockNumber` parameter. + */ +export async function glacierEvmBalancesGetNativeBalance( + client$: AvaCloudSDKCore, + request: operations.GetNativeBalanceRequest, + options?: RequestOptions +): Promise< + Result< + components.GetNativeBalanceResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetNativeBalanceRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/balances:getNative")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + blockNumber: payload$.blockNumber, + currency: payload$.currency, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getNativeBalance", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GetNativeBalanceResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetNativeBalanceResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmBalancesListCollectibleBalances.ts b/src/funcs/glacierEvmBalancesListCollectibleBalances.ts new file mode 100644 index 0000000..91ee9f5 --- /dev/null +++ b/src/funcs/glacierEvmBalancesListCollectibleBalances.ts @@ -0,0 +1,228 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List collectible (ERC-721/ERC-1155) balances + * + * @remarks + * Lists ERC-721 and ERC-1155 token balances of a wallet address. + * + * Balance for a specific contract can be retrieved with the `contractAddress` parameter. + */ +export async function glacierEvmBalancesListCollectibleBalances( + client$: AvaCloudSDKCore, + request: operations.ListCollectibleBalancesRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListCollectibleBalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListCollectibleBalancesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/balances:listCollectibles")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + contractAddress: payload$.contractAddress, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listCollectibleBalances", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListCollectibleBalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListCollectibleBalancesResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListCollectibleBalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmBalancesListCollectibleBalances( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmBalancesListErc1155Balances.ts b/src/funcs/glacierEvmBalancesListErc1155Balances.ts new file mode 100644 index 0000000..da2c9e6 --- /dev/null +++ b/src/funcs/glacierEvmBalancesListErc1155Balances.ts @@ -0,0 +1,231 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List ERC-1155 balances + * + * @remarks + * Lists ERC-1155 token balances of a wallet address. + * + * Balance at a given block can be retrieved with the `blockNumber` parameter. + * + * Balance for a specific contract can be retrieved with the `contractAddress` parameter. + */ +export async function glacierEvmBalancesListErc1155Balances( + client$: AvaCloudSDKCore, + request: operations.ListErc1155BalancesRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListErc1155BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListErc1155BalancesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/balances:listErc1155")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + blockNumber: payload$.blockNumber, + contractAddress: payload$.contractAddress, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listErc1155Balances", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListErc1155BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListErc1155BalancesResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListErc1155BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmBalancesListErc1155Balances( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmBalancesListErc20Balances.ts b/src/funcs/glacierEvmBalancesListErc20Balances.ts new file mode 100644 index 0000000..ac96bd1 --- /dev/null +++ b/src/funcs/glacierEvmBalancesListErc20Balances.ts @@ -0,0 +1,233 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List ERC-20 balances + * + * @remarks + * Lists ERC-20 token balances of a wallet address. + * + * Balance at a given block can be retrieved with the `blockNumber` parameter. + * + * Balance for specific contracts can be retrieved with the `contractAddresses` parameter. + */ +export async function glacierEvmBalancesListErc20Balances( + client$: AvaCloudSDKCore, + request: operations.ListErc20BalancesRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListErc20BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListErc20BalancesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/balances:listErc20")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + blockNumber: payload$.blockNumber, + contractAddresses: payload$.contractAddresses, + currency: payload$.currency, + filterSpamTokens: payload$.filterSpamTokens, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listErc20Balances", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListErc20BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListErc20BalancesResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListErc20BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmBalancesListErc20Balances( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmBalancesListErc721Balances.ts b/src/funcs/glacierEvmBalancesListErc721Balances.ts new file mode 100644 index 0000000..e5d303f --- /dev/null +++ b/src/funcs/glacierEvmBalancesListErc721Balances.ts @@ -0,0 +1,228 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List ERC-721 balances + * + * @remarks + * Lists ERC-721 token balances of a wallet address. + * + * Balance for a specific contract can be retrieved with the `contractAddress` parameter. + */ +export async function glacierEvmBalancesListErc721Balances( + client$: AvaCloudSDKCore, + request: operations.ListErc721BalancesRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListErc721BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListErc721BalancesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/balances:listErc721")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + contractAddress: payload$.contractAddress, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listErc721Balances", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListErc721BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListErc721BalancesResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListErc721BalancesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmBalancesListErc721Balances( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmBlocksGetBlock.ts b/src/funcs/glacierEvmBlocksGetBlock.ts new file mode 100644 index 0000000..192da3d --- /dev/null +++ b/src/funcs/glacierEvmBlocksGetBlock.ts @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get block + * + * @remarks + * Gets the details of an individual block on the EVM-compatible chain. + */ +export async function glacierEvmBlocksGetBlock( + client$: AvaCloudSDKCore, + request: operations.GetBlockRequest, + options?: RequestOptions +): Promise< + Result< + components.GetEvmBlockResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetBlockRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockId: encodeSimple$("blockId", payload$.blockId, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/blocks/{blockId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getBlock", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GetEvmBlockResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetEvmBlockResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmBlocksGetLatestBlocks.ts b/src/funcs/glacierEvmBlocksGetLatestBlocks.ts new file mode 100644 index 0000000..effb9c9 --- /dev/null +++ b/src/funcs/glacierEvmBlocksGetLatestBlocks.ts @@ -0,0 +1,219 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List latest blocks + * + * @remarks + * Lists the latest indexed blocks on the EVM-compatible chain sorted in descending order by block timestamp. + */ +export async function glacierEvmBlocksGetLatestBlocks( + client$: AvaCloudSDKCore, + request: operations.GetLatestBlocksRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.GetLatestBlocksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetLatestBlocksRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/blocks")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getLatestBlocks", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.GetLatestBlocksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetLatestBlocksResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.GetLatestBlocksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmBlocksGetLatestBlocks( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmChainsGetChainInfo.ts b/src/funcs/glacierEvmChainsGetChainInfo.ts new file mode 100644 index 0000000..5581078 --- /dev/null +++ b/src/funcs/glacierEvmChainsGetChainInfo.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get chain information + * + * @remarks + * Gets chain information for the EVM-compatible chain if supported by the api. + */ +export async function glacierEvmChainsGetChainInfo( + client$: AvaCloudSDKCore, + request: operations.GetChainInfoRequest, + options?: RequestOptions +): Promise< + Result< + components.GetChainResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetChainInfoRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getChainInfo", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GetChainResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetChainResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmChainsSupportedChains.ts b/src/funcs/glacierEvmChainsSupportedChains.ts new file mode 100644 index 0000000..1286879 --- /dev/null +++ b/src/funcs/glacierEvmChainsSupportedChains.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * List chains + * + * @remarks + * Lists the supported EVM-compatible chains. Filterable by network. + */ +export async function glacierEvmChainsSupportedChains( + client$: AvaCloudSDKCore, + request: operations.SupportedChainsRequest, + options?: RequestOptions +): Promise< + Result< + components.GlacierListChainsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SupportedChainsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/chains")(); + + const query$ = encodeFormQuery$({ + feature: payload$.feature, + network: payload$.network, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "supportedChains", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GlacierListChainsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GlacierListChainsResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmContractsGetContractMetadata.ts b/src/funcs/glacierEvmContractsGetContractMetadata.ts new file mode 100644 index 0000000..8db3659 --- /dev/null +++ b/src/funcs/glacierEvmContractsGetContractMetadata.ts @@ -0,0 +1,170 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get contract metadata + * + * @remarks + * Gets metadata about the contract at the given address. + */ +export async function glacierEvmContractsGetContractMetadata( + client$: AvaCloudSDKCore, + request: operations.GetContractMetadataRequest, + options?: RequestOptions +): Promise< + Result< + operations.GetContractMetadataResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetContractMetadataRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getContractMetadata", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + operations.GetContractMetadataResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetContractMetadataResponseBody$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmTransactionsGetDeploymentTransaction.ts b/src/funcs/glacierEvmTransactionsGetDeploymentTransaction.ts new file mode 100644 index 0000000..08940e1 --- /dev/null +++ b/src/funcs/glacierEvmTransactionsGetDeploymentTransaction.ts @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get deployment transaction + * + * @remarks + * If the address is a smart contract, returns the transaction in which it was deployed. + */ +export async function glacierEvmTransactionsGetDeploymentTransaction( + client$: AvaCloudSDKCore, + request: operations.GetDeploymentTransactionRequest, + options?: RequestOptions +): Promise< + Result< + components.GetTransactionResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetDeploymentTransactionRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/contracts/{address}/transactions:getDeployment")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + currency: payload$.currency, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getDeploymentTransaction", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GetTransactionResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetTransactionResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmTransactionsGetTransaction.ts b/src/funcs/glacierEvmTransactionsGetTransaction.ts new file mode 100644 index 0000000..2322142 --- /dev/null +++ b/src/funcs/glacierEvmTransactionsGetTransaction.ts @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get transaction + * + * @remarks + * Gets the details of a single transaction. + */ +export async function glacierEvmTransactionsGetTransaction( + client$: AvaCloudSDKCore, + request: operations.GetTransactionRequest, + options?: RequestOptions +): Promise< + Result< + components.GetTransactionResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTransactionRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + txHash: encodeSimple$("txHash", payload$.txHash, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/transactions/{txHash}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getTransaction", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GetTransactionResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetTransactionResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmTransactionsGetTransactionsForBlock.ts b/src/funcs/glacierEvmTransactionsGetTransactionsForBlock.ts new file mode 100644 index 0000000..f7725fb --- /dev/null +++ b/src/funcs/glacierEvmTransactionsGetTransactionsForBlock.ts @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * List transactions for a block + * + * @remarks + * Lists the transactions that occured in a given block. + */ +export async function glacierEvmTransactionsGetTransactionsForBlock( + client$: AvaCloudSDKCore, + request: operations.GetTransactionsForBlockRequest, + options?: RequestOptions +): Promise< + Result< + components.ListNativeTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTransactionsForBlockRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockId: encodeSimple$("blockId", payload$.blockId, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/blocks/{blockId}/transactions")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getTransactionsForBlock", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.ListNativeTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.ListNativeTransactionsResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierEvmTransactionsListContractDeployments.ts b/src/funcs/glacierEvmTransactionsListContractDeployments.ts new file mode 100644 index 0000000..00a5f6d --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListContractDeployments.ts @@ -0,0 +1,223 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List deployed contracts + * + * @remarks + * Lists all contracts deployed by the given address. + */ +export async function glacierEvmTransactionsListContractDeployments( + client$: AvaCloudSDKCore, + request: operations.ListContractDeploymentsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListContractDeploymentsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListContractDeploymentsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/contracts/{address}/deployments")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listContractDeployments", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListContractDeploymentsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListContractDeploymentsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListContractDeploymentsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListContractDeployments( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListErc1155Transactions.ts b/src/funcs/glacierEvmTransactionsListErc1155Transactions.ts new file mode 100644 index 0000000..cd7f2ac --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListErc1155Transactions.ts @@ -0,0 +1,227 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List ERC-1155 transfers + * + * @remarks + * Lists ERC-1155 transfers for an address. Filterable by block range. + */ +export async function glacierEvmTransactionsListErc1155Transactions( + client$: AvaCloudSDKCore, + request: operations.ListErc1155TransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListErc1155TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListErc1155TransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/transactions:listErc1155")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + endBlock: payload$.endBlock, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + startBlock: payload$.startBlock, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listErc1155Transactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListErc1155TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListErc1155TransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListErc1155TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListErc1155Transactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListErc20Transactions.ts b/src/funcs/glacierEvmTransactionsListErc20Transactions.ts new file mode 100644 index 0000000..0cda84c --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListErc20Transactions.ts @@ -0,0 +1,227 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List ERC-20 transfers + * + * @remarks + * Lists ERC-20 transfers for an address. Filterable by block range. + */ +export async function glacierEvmTransactionsListErc20Transactions( + client$: AvaCloudSDKCore, + request: operations.ListErc20TransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListErc20TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListErc20TransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/transactions:listErc20")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + endBlock: payload$.endBlock, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + startBlock: payload$.startBlock, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listErc20Transactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListErc20TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListErc20TransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListErc20TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListErc20Transactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListErc721Transactions.ts b/src/funcs/glacierEvmTransactionsListErc721Transactions.ts new file mode 100644 index 0000000..f5a4e88 --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListErc721Transactions.ts @@ -0,0 +1,227 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List ERC-721 transfers + * + * @remarks + * Lists ERC-721 transfers for an address. Filterable by block range. + */ +export async function glacierEvmTransactionsListErc721Transactions( + client$: AvaCloudSDKCore, + request: operations.ListErc721TransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListErc721TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListErc721TransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/transactions:listErc721")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + endBlock: payload$.endBlock, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + startBlock: payload$.startBlock, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listErc721Transactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListErc721TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListErc721TransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListErc721TransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListErc721Transactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListInternalTransactions.ts b/src/funcs/glacierEvmTransactionsListInternalTransactions.ts new file mode 100644 index 0000000..9729206 --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListInternalTransactions.ts @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List internal transactions + * + * @remarks + * Returns a list of internal transactions for an address and chain. Filterable by block range. + * + * Note that the internal transactions list only contains `CALL` or `CALLCODE` transactions with a non-zero value and `CREATE`/`CREATE2` transactions. To get a complete list of internal transactions use the `debug_` prefixed RPC methods on an archive node. + */ +export async function glacierEvmTransactionsListInternalTransactions( + client$: AvaCloudSDKCore, + request: operations.ListInternalTransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListInternalTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListInternalTransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/transactions:listInternals")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + endBlock: payload$.endBlock, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + startBlock: payload$.startBlock, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listInternalTransactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListInternalTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListInternalTransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListInternalTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListInternalTransactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListLatestTransactions.ts b/src/funcs/glacierEvmTransactionsListLatestTransactions.ts new file mode 100644 index 0000000..6b7d94f --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListLatestTransactions.ts @@ -0,0 +1,220 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List latest transactions + * + * @remarks + * Lists the latest transactions. Filterable by status. + */ +export async function glacierEvmTransactionsListLatestTransactions( + client$: AvaCloudSDKCore, + request: operations.ListLatestTransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListLatestTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListLatestTransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/transactions")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + status: payload$.status, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listLatestTransactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListLatestTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListLatestTransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListLatestTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListLatestTransactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListNativeTransactions.ts b/src/funcs/glacierEvmTransactionsListNativeTransactions.ts new file mode 100644 index 0000000..9ab86cf --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListNativeTransactions.ts @@ -0,0 +1,227 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List native transactions + * + * @remarks + * Lists native transactions for an address. Filterable by block range. + */ +export async function glacierEvmTransactionsListNativeTransactions( + client$: AvaCloudSDKCore, + request: operations.ListNativeTransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListNativeTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListNativeTransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/transactions:listNative")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + endBlock: payload$.endBlock, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + startBlock: payload$.startBlock, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listNativeTransactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListNativeTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListNativeTransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListNativeTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListNativeTransactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListTransactions.ts b/src/funcs/glacierEvmTransactionsListTransactions.ts new file mode 100644 index 0000000..89b8ff8 --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListTransactions.ts @@ -0,0 +1,228 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List transactions + * + * @remarks + * Returns a list of transactions where the given wallet address had an on-chain interaction for the given chain. The ERC-20 transfers, ERC-721 transfers, ERC-1155, and internal transactions returned are only those where the input address had an interaction. Specifically, those lists only inlcude entries where the input address was the sender (`from` field) or the receiver (`to` field) for the sub-transaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the `/chains/:chainId/transactions/:txHash` endpoint. + * + * Filterable by block ranges. + */ +export async function glacierEvmTransactionsListTransactions( + client$: AvaCloudSDKCore, + request: operations.ListTransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListTransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/addresses/{address}/transactions")(pathParams$); + + const query$ = encodeFormQuery$({ + endBlock: payload$.endBlock, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + startBlock: payload$.startBlock, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listTransactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListTransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListTransactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierEvmTransactionsListTransfers.ts b/src/funcs/glacierEvmTransactionsListTransfers.ts new file mode 100644 index 0000000..090f2f0 --- /dev/null +++ b/src/funcs/glacierEvmTransactionsListTransfers.ts @@ -0,0 +1,225 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List ERC transfers + * + * @remarks + * Lists ERC transfers for an ERC-20, ERC-721, or ERC-1155 contract address. + */ +export async function glacierEvmTransactionsListTransfers( + client$: AvaCloudSDKCore, + request: operations.ListTransfersRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListTransfersResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListTransfersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/tokens/{address}/transfers")(pathParams$); + + const query$ = encodeFormQuery$({ + endBlock: payload$.endBlock, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + startBlock: payload$.startBlock, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listTransfers", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListTransfersResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListTransfersResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListTransfersResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierEvmTransactionsListTransfers( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierHealthCheckGlacierHealthCheck.ts b/src/funcs/glacierHealthCheckGlacierHealthCheck.ts new file mode 100644 index 0000000..bb08d6e --- /dev/null +++ b/src/funcs/glacierHealthCheckGlacierHealthCheck.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get the health of the service + */ +export async function glacierHealthCheckGlacierHealthCheck( + client$: AvaCloudSDKCore, + options?: RequestOptions +): Promise< + Result< + operations.GlacierHealthCheckResponseBody, + | errors.GlacierHealthCheckResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/health-check")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "glacier-health-check", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + operations.GlacierHealthCheckResponseBody, + | errors.GlacierHealthCheckResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GlacierHealthCheckResponseBody$inboundSchema), + m$.jsonErr(503, errors.GlacierHealthCheckResponseBody$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierNftsGetTokenDetails.ts b/src/funcs/glacierNftsGetTokenDetails.ts new file mode 100644 index 0000000..79cd7d0 --- /dev/null +++ b/src/funcs/glacierNftsGetTokenDetails.ts @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get token details + * + * @remarks + * Gets token details for a specific token of an NFT contract. + */ +export async function glacierNftsGetTokenDetails( + client$: AvaCloudSDKCore, + request: operations.GetTokenDetailsRequest, + options?: RequestOptions +): Promise< + Result< + operations.GetTokenDetailsResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTokenDetailsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + tokenId: encodeSimple$("tokenId", payload$.tokenId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}")( + pathParams$ + ); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getTokenDetails", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + operations.GetTokenDetailsResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetTokenDetailsResponseBody$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierNftsListTokens.ts b/src/funcs/glacierNftsListTokens.ts new file mode 100644 index 0000000..1283179 --- /dev/null +++ b/src/funcs/glacierNftsListTokens.ts @@ -0,0 +1,223 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List tokens + * + * @remarks + * Lists tokens for an NFT contract. + */ +export async function glacierNftsListTokens( + client$: AvaCloudSDKCore, + request: operations.ListTokensRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListTokensResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListTokensRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/chains/{chainId}/nfts/collections/{address}/tokens")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listTokens", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListTokensResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListTokensResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListTokensResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierNftsListTokens( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierNftsReindexNft.ts b/src/funcs/glacierNftsReindexNft.ts new file mode 100644 index 0000000..0c7244e --- /dev/null +++ b/src/funcs/glacierNftsReindexNft.ts @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Reindex NFT metadata + * + * @remarks + * Triggers reindexing of token metadata for an NFT token. Reindexing can only be called once per hour for each NFT token. + */ +export async function glacierNftsReindexNft( + client$: AvaCloudSDKCore, + request: operations.ReindexNftRequest, + options?: RequestOptions +): Promise< + Result< + void, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ReindexNftRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + address: encodeSimple$("address", payload$.address, { + explode: false, + charEncoding: "percent", + }), + chainId: encodeSimple$("chainId", payload$.chainId ?? client$.options$.chainId, { + explode: false, + charEncoding: "percent", + }), + tokenId: encodeSimple$("tokenId", payload$.tokenId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}:reindex" + )(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "reindexNft", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + void, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(200, z.void()), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierOperationsGetOperationResult.ts b/src/funcs/glacierOperationsGetOperationResult.ts new file mode 100644 index 0000000..38f806e --- /dev/null +++ b/src/funcs/glacierOperationsGetOperationResult.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get operation + * + * @remarks + * Gets operation details for the given operation id. + */ +export async function glacierOperationsGetOperationResult( + client$: AvaCloudSDKCore, + request: operations.GetOperationResultRequest, + options?: RequestOptions +): Promise< + Result< + components.OperationStatusResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetOperationResultRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + operationId: encodeSimple$("operationId", payload$.operationId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/operations/{operationId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getOperationResult", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.OperationStatusResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.OperationStatusResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierOperationsPostTransactionExportJob.ts b/src/funcs/glacierOperationsPostTransactionExportJob.ts new file mode 100644 index 0000000..a3535f5 --- /dev/null +++ b/src/funcs/glacierOperationsPostTransactionExportJob.ts @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Create transaction export operation + * + * @remarks + * Trigger a transaction export operation with given parameters. + * + * The transaction export operation runs asynchronously in the background. The status of the job can be retrieved from the `/v1/operations/:operationId` endpoint using the `operationId` returned from this endpoint. + */ +export async function glacierOperationsPostTransactionExportJob( + client$: AvaCloudSDKCore, + request: operations.PostTransactionExportJobRequestBody, + options?: RequestOptions +): Promise< + Result< + components.OperationStatusResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.PostTransactionExportJobRequestBody$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/operations/transactions:export")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "postTransactionExportJob", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.OperationStatusResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.OperationStatusResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkBalancesGetBalancesByAddresses.ts b/src/funcs/glacierPrimaryNetworkBalancesGetBalancesByAddresses.ts new file mode 100644 index 0000000..915d43e --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkBalancesGetBalancesByAddresses.ts @@ -0,0 +1,183 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get balances + * + * @remarks + * Gets primary network balances for one of the Primary Network chains for the supplied addresses. + * + * C-Chain balances returned are only the shared atomic memory balance. For EVM balance, use the `/v1/chains/:chainId/addresses/:addressId/balances:getNative` endpoint. + */ +export async function glacierPrimaryNetworkBalancesGetBalancesByAddresses( + client$: AvaCloudSDKCore, + request: operations.GetBalancesByAddressesRequest, + options?: RequestOptions +): Promise< + Result< + operations.GetBalancesByAddressesResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetBalancesByAddressesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains/{blockchainId}/balances")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + addresses: payload$.addresses, + blockTimestamp: payload$.blockTimestamp, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getBalancesByAddresses", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + operations.GetBalancesByAddressesResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetBalancesByAddressesResponseBody$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkBlocksGetBlockById.ts b/src/funcs/glacierPrimaryNetworkBlocksGetBlockById.ts new file mode 100644 index 0000000..e066183 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkBlocksGetBlockById.ts @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get block + * + * @remarks + * Gets a block by block height or block hash on one of the Primary Network chains. + */ +export async function glacierPrimaryNetworkBlocksGetBlockById( + client$: AvaCloudSDKCore, + request: operations.GetBlockByIdRequest, + options?: RequestOptions +): Promise< + Result< + components.GetPrimaryNetworkBlockResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetBlockByIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockId: encodeSimple$("blockId", payload$.blockId, { + explode: false, + charEncoding: "percent", + }), + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains/{blockchainId}/blocks/{blockId}")( + pathParams$ + ); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getBlockById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GetPrimaryNetworkBlockResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetPrimaryNetworkBlockResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks.ts b/src/funcs/glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks.ts new file mode 100644 index 0000000..26e20fc --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks.ts @@ -0,0 +1,227 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List latest blocks + * + * @remarks + * Lists latest blocks on one of the Primary Network chains. + */ +export async function glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks( + client$: AvaCloudSDKCore, + request: operations.ListLatestPrimaryNetworkBlocksRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListLatestPrimaryNetworkBlocksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListLatestPrimaryNetworkBlocksRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains/{blockchainId}/blocks")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listLatestPrimaryNetworkBlocks", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListLatestPrimaryNetworkBlocksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListLatestPrimaryNetworkBlocksResponse$inboundSchema, { + key: "Result", + }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListLatestPrimaryNetworkBlocksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId.ts b/src/funcs/glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId.ts new file mode 100644 index 0000000..086b740 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId.ts @@ -0,0 +1,231 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List blocks proposed by node + * + * @remarks + * Lists the latest blocks proposed by a given NodeID on one of the Primary Network chains. + */ +export async function glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId( + client$: AvaCloudSDKCore, + request: operations.ListPrimaryNetworkBlocksByNodeIdRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListPrimaryNetworkBlocksByNodeIdResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListPrimaryNetworkBlocksByNodeIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + nodeId: encodeSimple$("nodeId", payload$.nodeId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/networks/{network}/blockchains/{blockchainId}/nodes/{nodeId}/blocks" + )(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listPrimaryNetworkBlocksByNodeId", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListPrimaryNetworkBlocksByNodeIdResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListPrimaryNetworkBlocksByNodeIdResponse$inboundSchema, { + key: "Result", + }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListPrimaryNetworkBlocksByNodeIdResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkGetAssetDetails.ts b/src/funcs/glacierPrimaryNetworkGetAssetDetails.ts new file mode 100644 index 0000000..4430433 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkGetAssetDetails.ts @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get asset details + * + * @remarks + * Gets asset details corresponding to the given asset id on the X-Chain. + */ +export async function glacierPrimaryNetworkGetAssetDetails( + client$: AvaCloudSDKCore, + request: operations.GetAssetDetailsRequest, + options?: RequestOptions +): Promise< + Result< + components.XChainAssetDetails, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetAssetDetailsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + assetId: encodeSimple$("assetId", payload$.assetId, { + explode: false, + charEncoding: "percent", + }), + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}")( + pathParams$ + ); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getAssetDetails", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.XChainAssetDetails, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.XChainAssetDetails$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkGetChainIdsForAddresses.ts b/src/funcs/glacierPrimaryNetworkGetChainIdsForAddresses.ts new file mode 100644 index 0000000..9325229 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkGetChainIdsForAddresses.ts @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get chain interactions for addresses + * + * @remarks + * Returns Primary Network chains that each address has touched in the form of an address mapped array. If an address has had any on-chain interaction for a chain, that chain's chain id will be returned. + */ +export async function glacierPrimaryNetworkGetChainIdsForAddresses( + client$: AvaCloudSDKCore, + request: operations.GetChainIdsForAddressesRequest, + options?: RequestOptions +): Promise< + Result< + components.ChainAddressChainIdMapListResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetChainIdsForAddressesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/addresses:listChainIds")(pathParams$); + + const query$ = encodeFormQuery$({ + addresses: payload$.addresses, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getChainIdsForAddresses", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.ChainAddressChainIdMapListResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.ChainAddressChainIdMapListResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkGetNetworkDetails.ts b/src/funcs/glacierPrimaryNetworkGetNetworkDetails.ts new file mode 100644 index 0000000..b597b03 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkGetNetworkDetails.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get network details + * + * @remarks + * Gets network details such as validator and delegator stats. + */ +export async function glacierPrimaryNetworkGetNetworkDetails( + client$: AvaCloudSDKCore, + request: operations.GetNetworkDetailsRequest, + options?: RequestOptions +): Promise< + Result< + components.GetNetworkDetailsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetNetworkDetailsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getNetworkDetails", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.GetNetworkDetailsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetNetworkDetailsResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkGetSingleValidatorDetails.ts b/src/funcs/glacierPrimaryNetworkGetSingleValidatorDetails.ts new file mode 100644 index 0000000..6b71e36 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkGetSingleValidatorDetails.ts @@ -0,0 +1,225 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * Get single validator details + * + * @remarks + * List validator details for a single validator. Filterable by validation status. + */ +export async function glacierPrimaryNetworkGetSingleValidatorDetails( + client$: AvaCloudSDKCore, + request: operations.GetSingleValidatorDetailsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.GetSingleValidatorDetailsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetSingleValidatorDetailsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + nodeId: encodeSimple$("nodeId", payload$.nodeId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/validators/{nodeId}")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + validationStatus: payload$.validationStatus, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getSingleValidatorDetails", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.GetSingleValidatorDetailsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetSingleValidatorDetailsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.GetSingleValidatorDetailsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkGetSingleValidatorDetails( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkGetSubnetById.ts b/src/funcs/glacierPrimaryNetworkGetSubnetById.ts new file mode 100644 index 0000000..a816dd6 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkGetSubnetById.ts @@ -0,0 +1,171 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get Subnet details by ID + * + * @remarks + * Get details of the Subnet registered on the network. + */ +export async function glacierPrimaryNetworkGetSubnetById( + client$: AvaCloudSDKCore, + request: operations.GetSubnetByIdRequest, + options?: RequestOptions +): Promise< + Result< + components.Subnet, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetSubnetByIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + subnetId: encodeSimple$("subnetId", payload$.subnetId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/subnets/{subnetId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getSubnetById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.Subnet, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.Subnet$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkListBlockchains.ts b/src/funcs/glacierPrimaryNetworkListBlockchains.ts new file mode 100644 index 0000000..9ee000e --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkListBlockchains.ts @@ -0,0 +1,220 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List blockchains + * + * @remarks + * Lists all blockchains registered on the network. + */ +export async function glacierPrimaryNetworkListBlockchains( + client$: AvaCloudSDKCore, + request: operations.ListBlockchainsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListBlockchainsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListBlockchainsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listBlockchains", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListBlockchainsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListBlockchainsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListBlockchainsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkListBlockchains( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkListDelegators.ts b/src/funcs/glacierPrimaryNetworkListDelegators.ts new file mode 100644 index 0000000..d978aaa --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkListDelegators.ts @@ -0,0 +1,223 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List delegators + * + * @remarks + * Lists details for delegators. + */ +export async function glacierPrimaryNetworkListDelegators( + client$: AvaCloudSDKCore, + request: operations.ListDelegatorsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListDelegatorsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListDelegatorsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/delegators")(pathParams$); + + const query$ = encodeFormQuery$({ + delegationStatus: payload$.delegationStatus, + nodeIds: payload$.nodeIds, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + rewardAddresses: payload$.rewardAddresses, + sortOrder: payload$.sortOrder, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listDelegators", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListDelegatorsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListDelegatorsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListDelegatorsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkListDelegators( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkListSubnets.ts b/src/funcs/glacierPrimaryNetworkListSubnets.ts new file mode 100644 index 0000000..3ce8373 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkListSubnets.ts @@ -0,0 +1,220 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List subnets + * + * @remarks + * Lists all subnets registered on the network. + */ +export async function glacierPrimaryNetworkListSubnets( + client$: AvaCloudSDKCore, + request: operations.ListSubnetsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListSubnetsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListSubnetsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/subnets")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listSubnets", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListSubnetsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListSubnetsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListSubnetsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkListSubnets( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkListValidators.ts b/src/funcs/glacierPrimaryNetworkListValidators.ts new file mode 100644 index 0000000..5d3341a --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkListValidators.ts @@ -0,0 +1,232 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List validators + * + * @remarks + * Lists details for validators. By default, returns details for all validators. Filterable by validator node ids and minimum delegation capacity. + */ +export async function glacierPrimaryNetworkListValidators( + client$: AvaCloudSDKCore, + request: operations.ListValidatorsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListValidatorsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListValidatorsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/validators")(pathParams$); + + const query$ = encodeFormQuery$({ + maxDelegationCapacity: payload$.maxDelegationCapacity, + maxFeePercentage: payload$.maxFeePercentage, + maxTimeRemaining: payload$.maxTimeRemaining, + maxUptimePerformance: payload$.maxUptimePerformance, + minDelegationCapacity: payload$.minDelegationCapacity, + minFeePercentage: payload$.minFeePercentage, + minTimeRemaining: payload$.minTimeRemaining, + minUptimePerformance: payload$.minUptimePerformance, + nodeIds: payload$.nodeIds, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortBy: payload$.sortBy, + sortOrder: payload$.sortOrder, + subnetId: payload$.subnetId, + validationStatus: payload$.validationStatus, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listValidators", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListValidatorsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListValidatorsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListValidatorsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkListValidators( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.ts b/src/funcs/glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.ts new file mode 100644 index 0000000..5f26f8c --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.ts @@ -0,0 +1,226 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List historical rewards + * + * @remarks + * Lists historical rewards on the Primary Network for the supplied addresses. + */ +export async function glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards( + client$: AvaCloudSDKCore, + request: operations.ListHistoricalPrimaryNetworkRewardsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListHistoricalPrimaryNetworkRewardsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.ListHistoricalPrimaryNetworkRewardsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/rewards")(pathParams$); + + const query$ = encodeFormQuery$({ + addresses: payload$.addresses, + currency: payload$.currency, + nodeIds: payload$.nodeIds, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listHistoricalPrimaryNetworkRewards", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListHistoricalPrimaryNetworkRewardsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListHistoricalPrimaryNetworkRewardsResponse$inboundSchema, { + key: "Result", + }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListHistoricalPrimaryNetworkRewardsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.ts b/src/funcs/glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.ts new file mode 100644 index 0000000..a610cd6 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.ts @@ -0,0 +1,224 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List pending rewards + * + * @remarks + * Lists pending rewards on the Primary Network for the supplied addresses. + */ +export async function glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards( + client$: AvaCloudSDKCore, + request: operations.ListPendingPrimaryNetworkRewardsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListPendingPrimaryNetworkRewardsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListPendingPrimaryNetworkRewardsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/rewards:listPending")(pathParams$); + + const query$ = encodeFormQuery$({ + addresses: payload$.addresses, + nodeIds: payload$.nodeIds, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listPendingPrimaryNetworkRewards", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListPendingPrimaryNetworkRewardsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListPendingPrimaryNetworkRewardsResponse$inboundSchema, { + key: "Result", + }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListPendingPrimaryNetworkRewardsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkTransactionsGetTxByHash.ts b/src/funcs/glacierPrimaryNetworkTransactionsGetTxByHash.ts new file mode 100644 index 0000000..d729e41 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkTransactionsGetTxByHash.ts @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get transaction + * + * @remarks + * Gets the details of a single transaction on one of the Primary Network chains. + */ +export async function glacierPrimaryNetworkTransactionsGetTxByHash( + client$: AvaCloudSDKCore, + request: operations.GetTxByHashRequest, + options?: RequestOptions +): Promise< + Result< + operations.GetTxByHashResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTxByHashRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + txHash: encodeSimple$("txHash", payload$.txHash, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/networks/{network}/blockchains/{blockchainId}/transactions/{txHash}" + )(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getTxByHash", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + operations.GetTxByHashResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetTxByHashResponseBody$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions.ts b/src/funcs/glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions.ts new file mode 100644 index 0000000..7dc87f2 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions.ts @@ -0,0 +1,235 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List staking transactions + * + * @remarks + * Lists active staking transactions on the P-Chain for the supplied addresses. + */ +export async function glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions( + client$: AvaCloudSDKCore, + request: operations.ListActivePrimaryNetworkStakingTransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListActivePrimaryNetworkStakingTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.ListActivePrimaryNetworkStakingTransactionsRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/networks/{network}/blockchains/{blockchainId}/transactions:listStaking" + )(pathParams$); + + const query$ = encodeFormQuery$({ + addresses: payload$.addresses, + endTimestamp: payload$.endTimestamp, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + startTimestamp: payload$.startTimestamp, + txTypes: payload$.txTypes, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listActivePrimaryNetworkStakingTransactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListActivePrimaryNetworkStakingTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListActivePrimaryNetworkStakingTransactionsResponse$inboundSchema, { + key: "Result", + }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListActivePrimaryNetworkStakingTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkTransactionsListAssetTransactions.ts b/src/funcs/glacierPrimaryNetworkTransactionsListAssetTransactions.ts new file mode 100644 index 0000000..98f4a08 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkTransactionsListAssetTransactions.ts @@ -0,0 +1,232 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List asset transactions + * + * @remarks + * Lists asset transactions corresponding to the given asset id on the X-Chain. + */ +export async function glacierPrimaryNetworkTransactionsListAssetTransactions( + client$: AvaCloudSDKCore, + request: operations.ListAssetTransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListAssetTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListAssetTransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + assetId: encodeSimple$("assetId", payload$.assetId, { + explode: false, + charEncoding: "percent", + }), + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions" + )(pathParams$); + + const query$ = encodeFormQuery$({ + endTimestamp: payload$.endTimestamp, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + startTimestamp: payload$.startTimestamp, + txTypes: payload$.txTypes, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listAssetTransactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListAssetTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListAssetTransactionsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListAssetTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkTransactionsListAssetTransactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions.ts b/src/funcs/glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions.ts new file mode 100644 index 0000000..f1d7f6d --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions.ts @@ -0,0 +1,237 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List latest transactions + * + * @remarks + * Lists the latest transactions on one of the Primary Network chains. + * + * Transactions are filterable by addresses, txTypes, and timestamps. When querying for latest transactions without an address parameter, filtering by txTypes and timestamps is not supported. An address filter must be provided to utilize txTypes and timestamp filters. + * + * Given that each transaction may return a large number of UTXO objects, bounded only by the maximum transaction size, the query may return less transactions than the provided page size. The result will contain less results than the page size if the number of utxos contained in the resulting transactions reach a performance threshold. + */ +export async function glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions( + client$: AvaCloudSDKCore, + request: operations.ListLatestPrimaryNetworkTransactionsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListLatestPrimaryNetworkTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.ListLatestPrimaryNetworkTransactionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains/{blockchainId}/transactions")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + addresses: payload$.addresses, + endTimestamp: payload$.endTimestamp, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + startTimestamp: payload$.startTimestamp, + txTypes: payload$.txTypes, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listLatestPrimaryNetworkTransactions", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListLatestPrimaryNetworkTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListLatestPrimaryNetworkTransactionsResponse$inboundSchema, { + key: "Result", + }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListLatestPrimaryNetworkTransactionsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkUtxosGetUtxosByAddresses.ts b/src/funcs/glacierPrimaryNetworkUtxosGetUtxosByAddresses.ts new file mode 100644 index 0000000..f19746b --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkUtxosGetUtxosByAddresses.ts @@ -0,0 +1,229 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List UTXOs + * + * @remarks + * Lists UTXOs on one of the Primary Network chains for the supplied addresses. + */ +export async function glacierPrimaryNetworkUtxosGetUtxosByAddresses( + client$: AvaCloudSDKCore, + request: operations.GetUtxosByAddressesRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.GetUtxosByAddressesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetUtxosByAddressesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains/{blockchainId}/utxos")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + addresses: payload$.addresses, + assetId: payload$.assetId, + includeSpent: payload$.includeSpent, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getUtxosByAddresses", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.GetUtxosByAddressesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetUtxosByAddressesResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.GetUtxosByAddressesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkUtxosGetUtxosByAddresses( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkVerticesGetVertexByHash.ts b/src/funcs/glacierPrimaryNetworkVerticesGetVertexByHash.ts new file mode 100644 index 0000000..2b5da6f --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkVerticesGetVertexByHash.ts @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get vertex + * + * @remarks + * Gets a single vertex on the X-Chain. + */ +export async function glacierPrimaryNetworkVerticesGetVertexByHash( + client$: AvaCloudSDKCore, + request: operations.GetVertexByHashRequest, + options?: RequestOptions +): Promise< + Result< + components.XChainVertex, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetVertexByHashRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + vertexHash: encodeSimple$("vertexHash", payload$.vertexHash, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/networks/{network}/blockchains/{blockchainId}/vertices/{vertexHash}" + )(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getVertexByHash", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.XChainVertex, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.XChainVertex$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierPrimaryNetworkVerticesGetVertexByHeight.ts b/src/funcs/glacierPrimaryNetworkVerticesGetVertexByHeight.ts new file mode 100644 index 0000000..0cec620 --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkVerticesGetVertexByHeight.ts @@ -0,0 +1,227 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List vertices by height + * + * @remarks + * Lists vertices at the given vertex height on the X-Chain. + */ +export async function glacierPrimaryNetworkVerticesGetVertexByHeight( + client$: AvaCloudSDKCore, + request: operations.GetVertexByHeightRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.GetVertexByHeightResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetVertexByHeightRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/networks/{network}/blockchains/{blockchainId}/vertices:listByHeight" + )(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sortOrder: payload$.sortOrder, + vertexHeight: payload$.vertexHeight, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getVertexByHeight", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.GetVertexByHeightResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetVertexByHeightResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.GetVertexByHeightResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkVerticesGetVertexByHeight( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierPrimaryNetworkVerticesListLatestXChainVertices.ts b/src/funcs/glacierPrimaryNetworkVerticesListLatestXChainVertices.ts new file mode 100644 index 0000000..4e9fe4f --- /dev/null +++ b/src/funcs/glacierPrimaryNetworkVerticesListLatestXChainVertices.ts @@ -0,0 +1,225 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List vertices + * + * @remarks + * Lists latest vertices on the X-Chain. + */ +export async function glacierPrimaryNetworkVerticesListLatestXChainVertices( + client$: AvaCloudSDKCore, + request: operations.ListLatestXChainVerticesRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListLatestXChainVerticesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListLatestXChainVerticesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + blockchainId: encodeSimple$("blockchainId", payload$.blockchainId, { + explode: false, + charEncoding: "percent", + }), + network: encodeSimple$("network", payload$.network ?? client$.options$.network, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/networks/{network}/blockchains/{blockchainId}/vertices")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listLatestXChainVertices", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListLatestXChainVerticesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListLatestXChainVerticesResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListLatestXChainVerticesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierPrimaryNetworkVerticesListLatestXChainVertices( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierTeleporterGetTeleporterMessage.ts b/src/funcs/glacierTeleporterGetTeleporterMessage.ts new file mode 100644 index 0000000..003b059 --- /dev/null +++ b/src/funcs/glacierTeleporterGetTeleporterMessage.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get a teleporter message + * + * @remarks + * Gets a teleporter message by message ID. + */ +export async function glacierTeleporterGetTeleporterMessage( + client$: AvaCloudSDKCore, + request: operations.GetTeleporterMessageRequest, + options?: RequestOptions +): Promise< + Result< + operations.GetTeleporterMessageResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTeleporterMessageRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + messageId: encodeSimple$("messageId", payload$.messageId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/teleporter/messages/{messageId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getTeleporterMessage", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + operations.GetTeleporterMessageResponseBody, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetTeleporterMessageResponseBody$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierTeleporterListTeleporterMessages.ts b/src/funcs/glacierTeleporterListTeleporterMessages.ts new file mode 100644 index 0000000..3a74fa6 --- /dev/null +++ b/src/funcs/glacierTeleporterListTeleporterMessages.ts @@ -0,0 +1,215 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List teleporter messages + * + * @remarks + * Lists teleporter messages. Ordered by timestamp in descending order. + */ +export async function glacierTeleporterListTeleporterMessages( + client$: AvaCloudSDKCore, + request: operations.ListTeleporterMessagesRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListTeleporterMessagesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListTeleporterMessagesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/teleporter/messages")(); + + const query$ = encodeFormQuery$({ + blockchainId: payload$.blockchainId, + destinationBlockchainId: payload$.destinationBlockchainId, + from: payload$.from, + network: payload$.network, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + sourceBlockchainId: payload$.sourceBlockchainId, + to: payload$.to, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listTeleporterMessages", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListTeleporterMessagesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListTeleporterMessagesResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListTeleporterMessagesResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierTeleporterListTeleporterMessages( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierUsageMetricsGetApiLogs.ts b/src/funcs/glacierUsageMetricsGetApiLogs.ts new file mode 100644 index 0000000..5fb4b02 --- /dev/null +++ b/src/funcs/glacierUsageMetricsGetApiLogs.ts @@ -0,0 +1,217 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * Get logs for requests made by client + * + * @remarks + * Gets logs for requests made by client over a specified time interval for a specific organization. + */ +export async function glacierUsageMetricsGetApiLogs( + client$: AvaCloudSDKCore, + request: operations.GetApiLogsRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.GetApiLogsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetApiLogsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/apiLogs")(); + + const query$ = encodeFormQuery$({ + apiKeyId: payload$.apiKeyId, + chainId: payload$.chainId, + endTimestamp: payload$.endTimestamp, + orgId: payload$.orgId, + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + requestPath: payload$.requestPath, + requestType: payload$.requestType, + responseStatusCode: payload$.responseStatusCode, + startTimestamp: payload$.startTimestamp, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getApiLogs", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.GetApiLogsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetApiLogsResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.GetApiLogsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierUsageMetricsGetApiLogs( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierUsageMetricsGetApiUsageMetrics.ts b/src/funcs/glacierUsageMetricsGetApiUsageMetrics.ts new file mode 100644 index 0000000..9b22de5 --- /dev/null +++ b/src/funcs/glacierUsageMetricsGetApiUsageMetrics.ts @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get usage metrics for the Glacier API + * + * @remarks + * Gets metrics for Glacier API usage over a specified time interval aggregated at the specified time-duration granularity. + */ +export async function glacierUsageMetricsGetApiUsageMetrics( + client$: AvaCloudSDKCore, + request: operations.GetApiUsageMetricsRequest, + options?: RequestOptions +): Promise< + Result< + components.UsageMetricsResponseDTO, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetApiUsageMetricsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/apiUsageMetrics")(); + + const query$ = encodeFormQuery$({ + apiKeyId: payload$.apiKeyId, + chainId: payload$.chainId, + endTimestamp: payload$.endTimestamp, + groupBy: payload$.groupBy, + orgId: payload$.orgId, + requestPath: payload$.requestPath, + requestType: payload$.requestType, + responseStatusCode: payload$.responseStatusCode, + startTimestamp: payload$.startTimestamp, + timeInterval: payload$.timeInterval, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getApiUsageMetrics", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.UsageMetricsResponseDTO, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.UsageMetricsResponseDTO$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksAddAddressesToWebhook.ts b/src/funcs/glacierWebhooksAddAddressesToWebhook.ts new file mode 100644 index 0000000..956cdb2 --- /dev/null +++ b/src/funcs/glacierWebhooksAddAddressesToWebhook.ts @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Add addresses to webhook + * + * @remarks + * Add addresses to webhook. + */ +export async function glacierWebhooksAddAddressesToWebhook( + client$: AvaCloudSDKCore, + request: operations.AddAddressesToWebhookRequest, + options?: RequestOptions +): Promise< + Result< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AddAddressesToWebhookRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.AddressesChangeRequest, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/webhooks/{id}/addresses")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "addAddressesToWebhook", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WebhookResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksCreateWebhook.ts b/src/funcs/glacierWebhooksCreateWebhook.ts new file mode 100644 index 0000000..881e840 --- /dev/null +++ b/src/funcs/glacierWebhooksCreateWebhook.ts @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create a webhook + * + * @remarks + * Create a new webhook. + */ +export async function glacierWebhooksCreateWebhook( + client$: AvaCloudSDKCore, + request: components.CreateWebhookRequest, + options?: RequestOptions +): Promise< + Result< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateWebhookRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/webhooks")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "createWebhook", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WebhookResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksDeactivateWebhook.ts b/src/funcs/glacierWebhooksDeactivateWebhook.ts new file mode 100644 index 0000000..dc6a03a --- /dev/null +++ b/src/funcs/glacierWebhooksDeactivateWebhook.ts @@ -0,0 +1,164 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Deactivate a webhook + * + * @remarks + * Deactivates a webhook by ID. + */ +export async function glacierWebhooksDeactivateWebhook( + client$: AvaCloudSDKCore, + request: operations.DeactivateWebhookRequest, + options?: RequestOptions +): Promise< + Result< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeactivateWebhookRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/webhooks/{id}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "deactivateWebhook", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WebhookResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksGenerateSharedSecret.ts b/src/funcs/glacierWebhooksGenerateSharedSecret.ts new file mode 100644 index 0000000..f9a6db8 --- /dev/null +++ b/src/funcs/glacierWebhooksGenerateSharedSecret.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Generate a shared secret + * + * @remarks + * Generates a new shared secret. + */ +export async function glacierWebhooksGenerateSharedSecret( + client$: AvaCloudSDKCore, + options?: RequestOptions +): Promise< + Result< + components.SharedSecretsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/webhooks:generateOrRotateSharedSecret")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "generateSharedSecret", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.SharedSecretsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.SharedSecretsResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksGetAddressesFromWebhook.ts b/src/funcs/glacierWebhooksGetAddressesFromWebhook.ts new file mode 100644 index 0000000..8a69443 --- /dev/null +++ b/src/funcs/glacierWebhooksGetAddressesFromWebhook.ts @@ -0,0 +1,216 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List adresses by webhook + * + * @remarks + * List adresses by webhook. + */ +export async function glacierWebhooksGetAddressesFromWebhook( + client$: AvaCloudSDKCore, + request: operations.GetAddressesFromWebhookRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.GetAddressesFromWebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetAddressesFromWebhookRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/webhooks/{id}/addresses")(pathParams$); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getAddressesFromWebhook", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.GetAddressesFromWebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.GetAddressesFromWebhookResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.GetAddressesFromWebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierWebhooksGetAddressesFromWebhook( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierWebhooksGetSharedSecret.ts b/src/funcs/glacierWebhooksGetSharedSecret.ts new file mode 100644 index 0000000..50186af --- /dev/null +++ b/src/funcs/glacierWebhooksGetSharedSecret.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Get a shared secret + * + * @remarks + * Get a previously generated shared secret. + */ +export async function glacierWebhooksGetSharedSecret( + client$: AvaCloudSDKCore, + options?: RequestOptions +): Promise< + Result< + components.SharedSecretsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/webhooks:getSharedSecret")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getSharedSecret", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.SharedSecretsResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.SharedSecretsResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksGetWebhook.ts b/src/funcs/glacierWebhooksGetWebhook.ts new file mode 100644 index 0000000..8b8475c --- /dev/null +++ b/src/funcs/glacierWebhooksGetWebhook.ts @@ -0,0 +1,164 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get a webhook by ID + * + * @remarks + * Retrieves a webhook by ID. + */ +export async function glacierWebhooksGetWebhook( + client$: AvaCloudSDKCore, + request: operations.GetWebhookRequest, + options?: RequestOptions +): Promise< + Result< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetWebhookRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/webhooks/{id}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "getWebhook", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WebhookResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksListWebhooks.ts b/src/funcs/glacierWebhooksListWebhooks.ts new file mode 100644 index 0000000..9d27dc7 --- /dev/null +++ b/src/funcs/glacierWebhooksListWebhooks.ts @@ -0,0 +1,210 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * List webhooks + * + * @remarks + * Lists webhooks for the user. + */ +export async function glacierWebhooksListWebhooks( + client$: AvaCloudSDKCore, + request: operations.ListWebhooksRequest, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.ListWebhooksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListWebhooksRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/webhooks")(); + + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + pageToken: payload$.pageToken, + status: payload$.status, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "listWebhooks", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.ListWebhooksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.ListWebhooksResponse$inboundSchema, { key: "Result" }), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.ListWebhooksResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const nextCursor = dlv(responseData, "nextPageToken"); + + if (nextCursor == null) { + return () => null; + } + + return () => + glacierWebhooksListWebhooks( + client$, + { + ...input$, + pageToken: nextCursor, + }, + options + ); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/glacierWebhooksRemoveAddressesFromWebhook.ts b/src/funcs/glacierWebhooksRemoveAddressesFromWebhook.ts new file mode 100644 index 0000000..9f83623 --- /dev/null +++ b/src/funcs/glacierWebhooksRemoveAddressesFromWebhook.ts @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Remove addresses from webhook + * + * @remarks + * Remove addresses from webhook. + */ +export async function glacierWebhooksRemoveAddressesFromWebhook( + client$: AvaCloudSDKCore, + request: operations.RemoveAddressesFromWebhookRequest, + options?: RequestOptions +): Promise< + Result< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.RemoveAddressesFromWebhookRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.AddressesChangeRequest, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/webhooks/{id}/addresses")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "removeAddressesFromWebhook", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WebhookResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/glacierWebhooksUpdateWebhook.ts b/src/funcs/glacierWebhooksUpdateWebhook.ts new file mode 100644 index 0000000..f1331a8 --- /dev/null +++ b/src/funcs/glacierWebhooksUpdateWebhook.ts @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { AvaCloudSDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update a webhook + * + * @remarks + * Updates an existing webhook. + */ +export async function glacierWebhooksUpdateWebhook( + client$: AvaCloudSDKCore, + request: operations.UpdateWebhookRequest, + options?: RequestOptions +): Promise< + Result< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateWebhookRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateWebhookRequest, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/webhooks/{id}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "updateWebhook", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "502", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 120000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$] = await m$.match< + components.WebhookResponse, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.TooManyRequests + | errors.InternalServerError + | errors.BadGateway + | errors.ServiceUnavailable + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WebhookResponse$inboundSchema), + m$.jsonErr(400, errors.BadRequest$inboundSchema), + m$.jsonErr(401, errors.Unauthorized$inboundSchema), + m$.jsonErr(403, errors.Forbidden$inboundSchema), + m$.jsonErr(404, errors.NotFound$inboundSchema), + m$.jsonErr(429, errors.TooManyRequests$inboundSchema), + m$.jsonErr(500, errors.InternalServerError$inboundSchema), + m$.jsonErr(502, errors.BadGateway$inboundSchema), + m$.jsonErr(503, errors.ServiceUnavailable$inboundSchema), + m$.fail(["4XX", "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts new file mode 100644 index 0000000..a6b6e17 --- /dev/null +++ b/src/hooks/hooks.ts @@ -0,0 +1,103 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { RequestInput } from "../lib/http.js"; +import { + AfterErrorContext, + AfterErrorHook, + AfterSuccessContext, + AfterSuccessHook, + BeforeRequestContext, + BeforeRequestHook, + BeforeCreateRequestHook, + BeforeCreateRequestContext, + Hooks, + SDKInitHook, + SDKInitOptions, +} from "./types.js"; + +import { initHooks } from "./registration.js"; + +export class SDKHooks implements Hooks { + sdkInitHooks: SDKInitHook[] = []; + beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; + beforeRequestHooks: BeforeRequestHook[] = []; + afterSuccessHooks: AfterSuccessHook[] = []; + afterErrorHooks: AfterErrorHook[] = []; + + constructor() { + initHooks(this); + } + + registerSDKInitHook(hook: SDKInitHook) { + this.sdkInitHooks.push(hook); + } + + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { + this.beforeCreateRequestHooks.push(hook); + } + + registerBeforeRequestHook(hook: BeforeRequestHook) { + this.beforeRequestHooks.push(hook); + } + + registerAfterSuccessHook(hook: AfterSuccessHook) { + this.afterSuccessHooks.push(hook); + } + + registerAfterErrorHook(hook: AfterErrorHook) { + this.afterErrorHooks.push(hook); + } + + sdkInit(opts: SDKInitOptions): SDKInitOptions { + return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); + } + + beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput { + let inp = input; + + for (const hook of this.beforeCreateRequestHooks) { + inp = hook.beforeCreateRequest(hookCtx, inp); + } + + return inp; + } + + async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise { + let req = request; + + for (const hook of this.beforeRequestHooks) { + req = await hook.beforeRequest(hookCtx, req); + } + + return req; + } + + async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise { + let res = response; + + for (const hook of this.afterSuccessHooks) { + res = await hook.afterSuccess(hookCtx, res); + } + + return res; + } + + async afterError( + hookCtx: AfterErrorContext, + response: Response | null, + error: unknown + ): Promise<{ response: Response | null; error: unknown }> { + let res = response; + let err = error; + + for (const hook of this.afterErrorHooks) { + const result = await hook.afterError(hookCtx, res, err); + res = result.response; + err = result.error; + } + + return { response: res, error: err }; + } +} diff --git a/src/hooks/index.ts b/src/hooks/index.ts new file mode 100644 index 0000000..8f0e4db --- /dev/null +++ b/src/hooks/index.ts @@ -0,0 +1,6 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export * from "./types.js"; +export * from "./hooks.js"; diff --git a/src/hooks/registration.ts b/src/hooks/registration.ts new file mode 100644 index 0000000..598a6df --- /dev/null +++ b/src/hooks/registration.ts @@ -0,0 +1,14 @@ +import { Hooks } from "./types.js"; + +/* + * This file is only ever generated once on the first generation and then is free to be modified. + * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them + * in this file or in separate files in the hooks folder. + */ + +// @ts-expect-error remove this line when you add your first hook and hooks is used +export function initHooks(hooks: Hooks) { + // Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook + // with an instance of a hook that implements that specific Hook interface + // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance +} diff --git a/src/hooks/types.ts b/src/hooks/types.ts new file mode 100644 index 0000000..3a31914 --- /dev/null +++ b/src/hooks/types.ts @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { HTTPClient, RequestInput } from "../lib/http.js"; + +export type HookContext = { + operationID: string; + oAuth2Scopes?: string[]; + securitySource?: any | (() => Promise); +}; + +export type Awaitable = T | Promise; + +export type SDKInitOptions = { + baseURL: URL | null; + client: HTTPClient; +}; + +export type BeforeCreateRequestContext = HookContext & {}; +export type BeforeRequestContext = HookContext & {}; +export type AfterSuccessContext = HookContext & {}; +export type AfterErrorContext = HookContext & {}; + +/** + * SDKInitHook is called when the SDK is initializing. The + * hook can return a new baseURL and HTTP client to be used by the SDK. + */ +export interface SDKInitHook { + sdkInit: (opts: SDKInitOptions) => SDKInitOptions; +} + +export interface BeforeCreateRequestHook { + /** + * A hook that is called before the SDK creates a `Request` object. The hook + * can modify how a request is constructed since certain modifications, like + * changing the request URL, cannot be done on a request object directly. + */ + beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput; +} + +export interface BeforeRequestHook { + /** + * A hook that is called before the SDK sends a request. The hook can + * introduce instrumentation code such as logging, tracing and metrics or + * replace the request before it is sent or throw an error to stop the + * request from being sent. + */ + beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable; +} + +export interface AfterSuccessHook { + /** + * A hook that is called after the SDK receives a response. The hook can + * introduce instrumentation code such as logging, tracing and metrics or + * modify the response before it is handled or throw an error to stop the + * response from being handled. + */ + afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable; +} + +export interface AfterErrorHook { + /** + * A hook that is called after the SDK encounters an error, or a + * non-successful response. The hook can introduce instrumentation code such + * as logging, tracing and metrics or modify the response or error values. + */ + afterError: ( + hookCtx: AfterErrorContext, + response: Response | null, + error: unknown + ) => Awaitable<{ + response: Response | null; + error: unknown; + }>; +} + +export interface Hooks { + /** Registers a hook to be used by the SDK for initialization event. */ + registerSDKInitHook(hook: SDKInitHook): void; + /** Registers a hook to be used by the SDK for to modify `Request` construction. */ + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; + /** Registers a hook to be used by the SDK for the before request event. */ + registerBeforeRequestHook(hook: BeforeRequestHook): void; + /** Registers a hook to be used by the SDK for the after success event. */ + registerAfterSuccessHook(hook: AfterSuccessHook): void; + /** Registers a hook to be used by the SDK for the after error event. */ + registerAfterErrorHook(hook: AfterErrorHook): void; +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..ceb6380 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,6 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export * from "./sdk/sdk.js"; +export * from "./lib/config.js"; diff --git a/src/lib/base64.ts b/src/lib/base64.ts new file mode 100644 index 0000000..c2d5b38 --- /dev/null +++ b/src/lib/base64.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export function bytesToBase64(u8arr: Uint8Array): string { + return btoa(String.fromCodePoint(...u8arr)); +} + +export function bytesFromBase64(encoded: string): Uint8Array { + return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); +} + +export function stringToBytes(str: string): Uint8Array { + return new TextEncoder().encode(str); +} + +export function stringFromBytes(u8arr: Uint8Array): string { + return new TextDecoder().decode(u8arr); +} + +export function stringToBase64(str: string): string { + return bytesToBase64(stringToBytes(str)); +} + +export function stringFromBase64(b64str: string): string { + return stringFromBytes(bytesFromBase64(b64str)); +} + +export const zodOutbound = z + .instanceof(Uint8Array) + .or(z.string().transform(stringToBytes)); + +export const zodInbound = z + .instanceof(Uint8Array) + .or(z.string().transform(bytesFromBase64)); diff --git a/src/lib/config.ts b/src/lib/config.ts new file mode 100644 index 0000000..817f52a --- /dev/null +++ b/src/lib/config.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../models/components/index.js"; +import { HTTPClient } from "./http.js"; +import { Logger } from "./logger.js"; +import { RetryConfig } from "./retries.js"; +import { Params, pathToFunc } from "./url.js"; + +/** + * Contains the list of servers available to the SDK + */ +export const ServerList = ["https://glacier-api.avax.network"] as const; + +export type SDKOptions = { + apiKey?: string | (() => Promise); + + /** + * Allows setting the chainId parameter for all supported operations + */ + chainId?: string | undefined; + + /** + * Allows setting the network parameter for all supported operations + */ + network?: components.GlobalParamNetwork | undefined; + + httpClient?: HTTPClient; + /** + * Allows overriding the default server used by the SDK + */ + serverIdx?: number; + /** + * Allows overriding the default server URL used by the SDK + */ + serverURL?: string; + /** + * Allows overriding the default retry config used by the SDK + */ + retryConfig?: RetryConfig; + timeoutMs?: number; + debugLogger?: Logger; +}; + +export function serverURLFromOptions(options: SDKOptions): URL | null { + let serverURL = options.serverURL; + + const params: Params = {}; + + if (!serverURL) { + const serverIdx = options.serverIdx ?? 0; + if (serverIdx < 0 || serverIdx >= ServerList.length) { + throw new Error(`Invalid server index ${serverIdx}`); + } + serverURL = ServerList[serverIdx] || ""; + } + + const u = pathToFunc(serverURL)(params); + return new URL(u); +} + +export const SDK_METADATA = { + language: "typescript", + openapiDocVersion: "Beta", + sdkVersion: "0.2.0", + genVersion: "2.407.0", + userAgent: "speakeasy-sdk/typescript 0.2.0 2.407.0 Beta @avalabs/avacloud-sdk", +} as const; diff --git a/src/lib/dlv.ts b/src/lib/dlv.ts new file mode 100644 index 0000000..e81091f --- /dev/null +++ b/src/lib/dlv.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/* +MIT License + +Copyright (c) 2024 Jason Miller (http://jasonformat.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @param obj The object to walk + * @param key The key path to walk the object with + * @param def A default value to return if the result is undefined + * + * @example + * dlv(obj, "a.b.c.d") + * @example + * dlv(object, ["a", "b", "c", "d"]) + * @example + * dlv(object, "foo.bar.baz", "Hello, default value!") + */ +export function dlv( + obj: any, + key: string | string[], + def?: T, + p?: number, + undef?: never, +): T | undefined { + key = Array.isArray(key) ? key : key.split("."); + for (p = 0; p < key.length; p++) { + const k = key[p]; + obj = k != null && obj ? obj[k] : undef; + } + return obj === undef ? def : obj; +} diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts new file mode 100644 index 0000000..44fa728 --- /dev/null +++ b/src/lib/encodings.ts @@ -0,0 +1,449 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { bytesToBase64 } from "./base64.js"; +import { isPlainObject } from "./is-plain-object.js"; + +export class EncodingError extends Error { + constructor(message: string) { + super(message); + this.name = "EncodingError"; + } +} + +export function encodeMatrix( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `,${encodeString(k)},${encodeValue(v)}`; + }).join(""); + encValue = encValue.slice(1); + } else { + encValue = `${encodeValue(pv)}`; + } + + const keyPrefix = encodeString(pk); + tmp = `${keyPrefix}=${encValue}`; + // trim trailing '=' if value was empty + if (tmp === `${keyPrefix}=`) { + tmp = tmp.slice(0, -1); + } + + // If we end up with the nothing then skip forward + if (!tmp) { + return; + } + + out += `;${tmp}`; + }); + + return out; +} + +export function encodeLabel( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join("."); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `.${encodeString(k)}.${encodeValue(v)}`; + }).join(""); + encValue = encValue.slice(1); + } else { + const k = + options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : ""; + encValue = `${k}${encodeValue(pv)}`; + } + + out += `.${encValue}`; + }); + + return out; +} + +type FormEncoder = ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +) => string; + +function formEncoder(sep: string): FormEncoder { + return ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, + ) => { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + const encodedSep = encodeString(sep); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(encodedSep); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; + }).join(encodedSep); + } else { + encValue = `${encodeValue(pv)}`; + } + + tmp = `${encodeString(pk)}=${encValue}`; + + // If we end up with the nothing then skip forward + if (!tmp || tmp === "=") { + return; + } + + out += `&${tmp}`; + }); + + return out.slice(1); + }; +} + +export const encodeForm = formEncoder(","); +export const encodeSpaceDelimited = formEncoder(" "); +export const encodePipeDelimited = formEncoder("|"); + +export function encodeBodyForm( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = JSON.stringify(pv, jsonReplacer); + } else if (isPlainObject(pv)) { + encValue = JSON.stringify(pv, jsonReplacer); + } else { + encValue = `${encodeValue(pv)}`; + } + + tmp = `${encodeString(pk)}=${encValue}`; + + // If we end up with the nothing then skip forward + if (!tmp || tmp === "=") { + return; + } + + out += `&${tmp}`; + }); + + return out.slice(1); +} + +export function encodeDeepObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +): string { + if (value == null) { + return ""; + } + + if (!isPlainObject(value)) { + throw new EncodingError( + `Value of parameter '${key}' which uses deepObject encoding must be an object`, + ); + } + + return encodeDeepObjectObject(key, value, options); +} + +export function encodeDeepObjectObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +): string { + if (value == null) { + return ""; + } + + let out = ""; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + if (!isPlainObject(value)) { + throw new EncodingError(`Expected parameter '${key}' to be an object.`); + } + + Object.entries(value).forEach(([ck, cv]) => { + if (cv === undefined) { + return; + } + + const pk = `${key}[${ck}]`; + + if (isPlainObject(cv)) { + const objOut = encodeDeepObjectObject(pk, cv, options); + + out += `&${objOut}`; + + return; + } + + const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; + let encoded = ""; + + encoded = mapDefined(pairs, (v) => { + return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; + }).join("&"); + + out += `&${encoded}`; + }); + + return out.slice(1); +} + +export function encodeJSON( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + if (typeof value === "undefined") { + return ""; + } + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encVal = encodeString(JSON.stringify(value, jsonReplacer)); + + return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; +} + +export const encodeSimple = ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string => { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + tmp = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + } else if (isPlainObject(pv)) { + tmp = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `,${encodeString(k)},${encodeValue(v)}`; + }).join(""); + tmp = tmp.slice(1); + } else { + const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; + tmp = `${k}${encodeValue(pv)}`; + } + + // If we end up with the nothing then skip forward + if (!tmp) { + return; + } + + out += `,${tmp}`; + }); + + return out.slice(1); +}; + +function explode(key: string, value: unknown): [string, unknown][] { + if (Array.isArray(value)) { + return value.map((v) => [key, v]); + } else if (isPlainObject(value)) { + const o = value ?? {}; + return Object.entries(o).map(([k, v]) => [k, v]); + } else { + return [[key, value]]; + } +} + +function serializeValue(value: unknown): string { + if (value === null) { + return "null"; + } else if (typeof value === "undefined") { + return ""; + } else if (value instanceof Date) { + return value.toISOString(); + } else if (value instanceof Uint8Array) { + return bytesToBase64(value); + } else if (typeof value === "object") { + return JSON.stringify(value, jsonReplacer); + } + + return `${value}`; +} + +function jsonReplacer(_: string, value: unknown): unknown { + if (value instanceof Uint8Array) { + return bytesToBase64(value); + } else { + return value; + } +} + +function mapDefined(inp: T[], mapper: (v: T) => R): R[] { + return inp.reduce((acc, v) => { + if (v === undefined) { + return acc; + } + + const m = mapper(v); + if (m === undefined) { + return acc; + } + + acc.push(m); + + return acc; + }, []); +} + +function mapDefinedEntries( + inp: Iterable<[K, V]>, + mapper: (v: [K, V]) => R, +): R[] { + const acc: R[] = []; + for (const [k, v] of inp) { + if (v === undefined) { + continue; + } + + const m = mapper([k, v]); + if (m === undefined) { + continue; + } + + acc.push(m); + } + + return acc; +} + +export function queryJoin(...args: string[]): string { + return args.filter(Boolean).join("&"); +} + +type QueryEncoderOptions = { + explode?: boolean; + charEncoding?: "percent" | "none"; +}; + +type QueryEncoder = ( + key: string, + value: unknown, + options?: QueryEncoderOptions, +) => string; + +type BulkQueryEncoder = ( + values: Record, + options?: QueryEncoderOptions, +) => string; + +export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { + const bulkEncode = function ( + values: Record, + options?: QueryEncoderOptions, + ): string { + const opts: QueryEncoderOptions = { + ...options, + explode: options?.explode ?? true, + charEncoding: options?.charEncoding ?? "percent", + }; + + const encoded = Object.entries(values).map(([key, value]) => { + return f(key, value, opts); + }); + return queryJoin(...encoded); + }; + + return bulkEncode; +} + +export const encodeJSONQuery = queryEncoder(encodeJSON); +export const encodeFormQuery = queryEncoder(encodeForm); +export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); +export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); +export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); diff --git a/src/lib/http.ts b/src/lib/http.ts new file mode 100644 index 0000000..13cf1fd --- /dev/null +++ b/src/lib/http.ts @@ -0,0 +1,323 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export type Fetcher = ( + input: RequestInfo | URL, + init?: RequestInit, +) => Promise; + +export type Awaitable = T | Promise; + +const DEFAULT_FETCHER: Fetcher = (input, init) => { + // If input is a Request and init is undefined, Bun will discard the method, + // headers, body and other options that were set on the request object. + // Node.js and browers would ignore an undefined init value. This check is + // therefore needed for interop with Bun. + if (init == null) { + return fetch(input); + } else { + return fetch(input, init); + } +}; + +export type RequestInput = { + /** + * The URL the request will use. + */ + url: URL; + /** + * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). + */ + options?: RequestInit | undefined; +}; + +export interface HTTPClientOptions { + fetcher?: Fetcher; +} + +export type BeforeRequestHook = (req: Request) => Awaitable; +export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; +export type ResponseHook = (res: Response, req: Request) => Awaitable; + +export class HTTPClient { + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const nextRequest = await hook(req); + if (nextRequest) { + req = nextRequest; + } + } + + try { + const res = await this.fetcher(req); + + for (const hook of this.responseHooks) { + await hook(res, req); + } + + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } + + throw err; + } + } + + /** + * Registers a hook that is called before a request is made. The hook function + * can mutate the request or return a new request. This may be useful to add + * additional information to request such as request IDs and tracing headers. + */ + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** + * Registers a hook that is called when a request cannot be made due to a + * network error. + */ + addHook(hook: "requestError", fn: RequestErrorHook): this; + /** + * Registers a hook that is called when a response has been received from the + * server. + */ + addHook(hook: "response", fn: ResponseHook): this; + addHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ) { + if (args[0] === "beforeRequest") { + this.requestHooks.push(args[1]); + } else if (args[0] === "requestError") { + this.requestErrorHooks.push(args[1]); + } else if (args[0] === "response") { + this.responseHooks.push(args[1]); + } else { + throw new Error(`Invalid hook type: ${args[0]}`); + } + return this; + } + + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "requestError", fn: RequestErrorHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "response", fn: ResponseHook): this; + removeHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ): this { + let target: unknown[]; + if (args[0] === "beforeRequest") { + target = this.requestHooks; + } else if (args[0] === "requestError") { + target = this.requestErrorHooks; + } else if (args[0] === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${args[0]}`); + } + + const index = target.findIndex((v) => v === args[1]); + if (index >= 0) { + target.splice(index, 1); + } + + return this; + } + + clone(): HTTPClient { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + + return child; + } +} + +export type StatusCodePredicate = number | string | (number | string)[]; + +// A semicolon surrounded by optional whitespace characters is used to separate +// segments in a media type string. +const mediaParamSeparator = /\s*;\s*/g; + +export function matchContentType(response: Response, pattern: string): boolean { + // `*` is a special case which means anything is acceptable. + if (pattern === "*") { + return true; + } + + let contentType = + response.headers.get("content-type")?.trim() || "application/octet-stream"; + contentType = contentType.toLowerCase(); + + const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); + const [wantType = "", ...wantParams] = wantParts; + + if (wantType.split("/").length !== 2) { + return false; + } + + const gotParts = contentType.split(mediaParamSeparator); + const [gotType = "", ...gotParams] = gotParts; + + const [type = "", subtype = ""] = gotType.split("/"); + if (!type || !subtype) { + return false; + } + + if ( + wantType !== "*/*" && + gotType !== wantType && + `${type}/*` !== wantType && + `*/${subtype}` !== wantType + ) { + return false; + } + + if (gotParams.length < wantParams.length) { + return false; + } + + const params = new Set(gotParams); + for (const wantParam of wantParams) { + if (!params.has(wantParam)) { + return false; + } + } + + return true; +} + +const codeRangeRE = new RegExp("^[0-9]xx$", "i"); + +export function matchStatusCode( + response: Response, + codes: StatusCodePredicate, +): boolean { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } + + return expectedCodes.some((ec) => { + const code = `${ec}`; + + if (code === "default") { + return true; + } + + if (!codeRangeRE.test(`${code}`)) { + return code === actual; + } + + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + + return actualFamily === expectFamily; + }); +} + +export function matchResponse( + response: Response, + code: StatusCodePredicate, + contentTypePattern: string, +): boolean { + return ( + matchStatusCode(response, code) && + matchContentType(response, contentTypePattern) + ); +} + +/** + * Uses various heurisitics to determine if an error is a connection error. + */ +export function isConnectionError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Covers fetch in Deno as well + const isBrowserErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("failed to fetch"); + + const isNodeErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("fetch failed"); + + const isBunErr = "name" in err && err.name === "ConnectionError"; + + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnreset"; + + return isBrowserErr || isNodeErr || isGenericErr || isBunErr; +} + +/** + * Uses various heurisitics to determine if an error is a timeout error. + */ +export function isTimeoutError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Fetch in browser, Node.js, Bun, Deno + const isNative = "name" in err && err.name === "TimeoutError"; + const isLegacyNative = "code" in err && err.code === 23; + + // Node.js HTTP client and Axios + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnaborted"; + + return isNative || isLegacyNative || isGenericErr; +} + +/** + * Uses various heurisitics to determine if an error is a abort error. + */ +export function isAbortError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Fetch in browser, Node.js, Bun, Deno + const isNative = "name" in err && err.name === "AbortError"; + const isLegacyNative = "code" in err && err.code === 20; + + // Node.js HTTP client and Axios + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnaborted"; + + return isNative || isLegacyNative || isGenericErr; +} diff --git a/src/lib/is-plain-object.ts b/src/lib/is-plain-object.ts new file mode 100644 index 0000000..61070d3 --- /dev/null +++ b/src/lib/is-plain-object.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/* +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js + +export function isPlainObject(value: unknown): value is object { + if (typeof value !== "object" || value === null) { + return false; + } + + const prototype = Object.getPrototypeOf(value); + return ( + (prototype === null || + prototype === Object.prototype || + Object.getPrototypeOf(prototype) === null) && + !(Symbol.toStringTag in value) && + !(Symbol.iterator in value) + ); +} diff --git a/src/lib/logger.ts b/src/lib/logger.ts new file mode 100644 index 0000000..d181f29 --- /dev/null +++ b/src/lib/logger.ts @@ -0,0 +1,9 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export interface Logger { + group(label?: string): void; + groupEnd(): void; + log(message: any, ...args: any[]): void; +} diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts new file mode 100644 index 0000000..dcb468b --- /dev/null +++ b/src/lib/matchers.ts @@ -0,0 +1,308 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { safeParse } from "./schemas.js"; +import { StatusCodePredicate, matchResponse, matchStatusCode } from "./http.js"; +import { isPlainObject } from "./is-plain-object.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +export type Encoding = "json" | "text" | "bytes" | "stream" | "sse" | "nil" | "fail"; + +const DEFAULT_CONTENT_TYPES: Record = { + json: "application/json", + text: "text/plain", + bytes: "application/octet-stream", + stream: "application/octet-stream", + sse: "text/event-stream", + nil: "*", + fail: "*", +}; + +type Schema = { parse(raw: unknown): T }; + +type MatchOptions = { ctype?: string; hdrs?: boolean; key?: string; sseSentinel?: string }; + +export type ValueMatcher = MatchOptions & { + enc: Encoding; + codes: StatusCodePredicate; + schema: Schema; +}; + +export type ErrorMatcher = MatchOptions & { + enc: Encoding; + codes: StatusCodePredicate; + schema: Schema; + err: true; +}; + +export type FailMatcher = { + enc: "fail"; + codes: StatusCodePredicate; +}; + +export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; + +export function jsonErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "json", codes, schema }; +} +export function json( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "json", codes, schema }; +} + +export function textErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "text", codes, schema }; +} +export function text( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "text", codes, schema }; +} + +export function bytesErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "bytes", codes, schema }; +} +export function bytes( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "bytes", codes, schema }; +} + +export function streamErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "stream", codes, schema }; +} +export function stream( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "stream", codes, schema }; +} + +export function sseErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "sse", codes, schema }; +} +export function sse( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "sse", codes, schema }; +} + +export function nilErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "nil", codes, schema }; +} +export function nil( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "nil", codes, schema }; +} + +export function fail(codes: StatusCodePredicate): FailMatcher { + return { enc: "fail", codes }; +} + +export type MatchedValue = Matchers extends Matcher[] ? T : never; +export type MatchedError = Matchers extends Matcher[] ? E : never; +export type MatchFunc = ( + response: Response, + options?: { resultKey?: string; extraFields?: Record } +) => Promise<[result: Result, raw: unknown]>; + +export function match( + ...matchers: Array> +): MatchFunc { + return async function matchFunc( + response: Response, + options?: { resultKey?: string; extraFields?: Record } + ): Promise<[result: Result, raw: unknown]> { + let raw: unknown; + let matcher: Matcher | undefined; + for (const match of matchers) { + const { codes } = match; + const ctpattern = "ctype" in match ? match.ctype : DEFAULT_CONTENT_TYPES[match.enc]; + if (ctpattern && matchResponse(response, codes, ctpattern)) { + matcher = match; + break; + } else if (!ctpattern && matchStatusCode(response, codes)) { + matcher = match; + break; + } + } + + if (!matcher) { + const responseBody = await response.text(); + return [ + { + ok: false, + error: new SDKError( + "Unexpected API response status or content-type", + response, + responseBody + ), + }, + responseBody, + ]; + } + + const encoding = matcher.enc; + switch (encoding) { + case "json": + raw = await response.json(); + break; + case "bytes": + raw = await response.arrayBuffer(); + break; + case "stream": + raw = response.body; + break; + case "text": + raw = await response.text(); + break; + case "sse": + raw = response.body; + break; + case "nil": + raw = await discardResponseBody(response); + break; + case "fail": + raw = await response.text(); + break; + default: + encoding satisfies never; + throw new Error(`Unsupported response type: ${encoding}`); + } + + if (matcher.enc === "fail") { + return [ + { + ok: false, + error: new SDKError( + "API error occurred", + response, + typeof raw === "string" ? raw : "" + ), + }, + raw, + ]; + } + + const resultKey = matcher.key || options?.resultKey; + let data: unknown; + + if ("err" in matcher) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + ...(isPlainObject(raw) ? raw : null), + }; + } else if (resultKey) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + [resultKey]: raw, + }; + } else if (matcher.hdrs) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + ...(isPlainObject(raw) ? raw : null), + }; + } else { + data = raw; + } + + if ("err" in matcher) { + const result = safeParse( + data, + (v: unknown) => matcher.schema.parse(v), + "Response validation failed" + ); + return [result.ok ? { ok: false, error: result.value } : result, raw]; + } else { + return [ + safeParse( + data, + (v: unknown) => matcher.schema.parse(v), + "Response validation failed" + ), + raw, + ]; + } + }; +} + +const headerValRE = /, */; +/** + * Iterates over a Headers object and returns an object with all the header + * entries. Values are represented as an array to account for repeated headers. + */ +export function unpackHeaders(headers: Headers): Record { + const out: Record = {}; + + for (const [k, v] of headers.entries()) { + out[k] = v.split(headerValRE); + } + + return out; +} + +/** + * Discards the response body to free up resources. + * + * To learn why this is need, see the undici docs: + * https://undici.nodejs.org/#/?id=garbage-collection + */ +export async function discardResponseBody(res: Response) { + const reader = res.body?.getReader(); + if (reader == null) { + return; + } + + try { + let done = false; + while (!done) { + const res = await reader.read(); + done = res.done; + } + } finally { + reader.releaseLock(); + } +} diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts new file mode 100644 index 0000000..23794a2 --- /dev/null +++ b/src/lib/primitives.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export type Remap = { + [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ + ? Mapping[k] + : Mapping[k] extends null /* if the mapping is to `null` then drop the key */ + ? never + : k /* otherwise keep the key as-is */]: Inp[k]; +}; + +/** + * Converts or omits an object's keys according to a mapping. + * + * @param inp An object whose keys will be remapped + * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object. + * @returns A new object with keys remapped or omitted according to the mappings + */ +export function remap< + Inp extends Record, + const Mapping extends { [k in keyof Inp]?: string | null }, +>(inp: Inp, mappings: Mapping): Remap { + let out: any = {}; + + if (!Object.keys(mappings).length) { + out = inp; + return out; + } + + for (const [k, v] of Object.entries(inp)) { + const j = mappings[k]; + if (j === null) { + continue; + } + out[j ?? k] = v; + } + + return out; +} diff --git a/src/lib/retries.ts b/src/lib/retries.ts new file mode 100644 index 0000000..df3e0bc --- /dev/null +++ b/src/lib/retries.ts @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { isConnectionError, isTimeoutError } from "./http.js"; + +export type BackoffStrategy = { + initialInterval: number; + maxInterval: number; + exponent: number; + maxElapsedTime: number; +}; + +const defaultBackoff: BackoffStrategy = { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, +}; + +export type RetryConfig = + | { strategy: "none" } + | { + strategy: "backoff"; + backoff?: BackoffStrategy; + retryConnectionErrors?: boolean; + }; + +class PermanentError extends Error { + inner: unknown; + + constructor(inner: unknown) { + super("Permanent error"); + this.inner = inner; + + Object.setPrototypeOf(this, PermanentError.prototype); + } +} + +class TemporaryError extends Error { + res: Response; + + constructor(res: Response) { + super("Temporary error"); + this.res = res; + + Object.setPrototypeOf(this, TemporaryError.prototype); + } +} + +export async function retry( + fetchFn: () => Promise, + options: { + config: RetryConfig; + statusCodes: string[]; + }, +): Promise { + switch (options.config.strategy) { + case "backoff": + return retryBackoff( + wrapFetcher(fetchFn, { + statusCodes: options.statusCodes, + retryConnectionErrors: !!options.config.retryConnectionErrors, + }), + options.config.backoff ?? defaultBackoff, + ); + default: + return await fetchFn(); + } +} + +function wrapFetcher( + fn: () => Promise, + options: { + statusCodes: string[]; + retryConnectionErrors: boolean; + }, +): () => Promise { + return async () => { + try { + const res = await fn(); + if (isRetryableResponse(res, options.statusCodes)) { + throw new TemporaryError(res); + } + + return res; + } catch (err) { + if (err instanceof TemporaryError) { + throw err; + } + + if ( + options.retryConnectionErrors && + (isTimeoutError(err) || isConnectionError(err)) + ) { + throw err; + } + + throw new PermanentError(err); + } + }; +} + +const codeRangeRE = new RegExp("^[0-9]xx$", "i"); + +function isRetryableResponse(res: Response, statusCodes: string[]): boolean { + const actual = `${res.status}`; + + return statusCodes.some((code) => { + if (!codeRangeRE.test(code)) { + return code === actual; + } + + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + + return actualFamily === expectFamily; + }); +} + +async function retryBackoff( + fn: () => Promise, + strategy: BackoffStrategy, +): Promise { + const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; + + const start = Date.now(); + let x = 0; + + // eslint-disable-next-line no-constant-condition + while (true) { + try { + const res = await fn(); + return res; + } catch (err) { + if (err instanceof PermanentError) { + throw err.inner; + } + const elapsed = Date.now() - start; + if (elapsed > maxElapsedTime) { + if (err instanceof TemporaryError) { + return err.res; + } + + throw err; + } + + let retryInterval = 0; + if (err instanceof TemporaryError && err.res && err.res.headers) { + const retryVal = err.res.headers.get("retry-after") || ""; + if (retryVal != "") { + const parsedNumber = Number(retryVal); + if (!isNaN(parsedNumber) && Number.isInteger(parsedNumber)) { + retryInterval = parsedNumber * 1000; + } else { + const parsedDate = Date.parse(retryVal); + if (!isNaN(parsedDate)) { + const deltaMS = parsedDate - Date.now(); + retryInterval = deltaMS > 0 ? Math.ceil(deltaMS) : 0; + } + } + } + } + + if (retryInterval == 0) { + retryInterval = + initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + + const d = Math.min(retryInterval, maxInterval); + + await delay(d); + x++; + } + } +} + +async function delay(delay: number): Promise { + return new Promise((resolve) => setTimeout(resolve, delay)); +} diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts new file mode 100644 index 0000000..37b0b13 --- /dev/null +++ b/src/lib/schemas.ts @@ -0,0 +1,74 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { output, ZodEffects, ZodError, ZodObject, ZodRawShape, ZodTypeAny } from "zod"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { ERR, OK, Result } from "../types/fp.js"; + +/** + * Utility function that executes some code which may throw a ZodError. It + * intercepts this error and converts it to an SDKValidationError so as to not + * leak Zod implementation details to user code. + */ +export function parse(rawValue: Inp, fn: (value: Inp) => Out, errorMessage: string): Out { + try { + return fn(rawValue); + } catch (err) { + if (err instanceof ZodError) { + throw new SDKValidationError(errorMessage, err, rawValue); + } + throw err; + } +} + +/** + * Utility function that executes some code which may result in a ZodError. It + * intercepts this error and converts it to an SDKValidationError so as to not + * leak Zod implementation details to user code. + */ +export function safeParse( + rawValue: Inp, + fn: (value: Inp) => Out, + errorMessage: string +): Result { + try { + return OK(fn(rawValue)); + } catch (err) { + return ERR(new SDKValidationError(errorMessage, err, rawValue)); + } +} + +export function collectExtraKeys< + Shape extends ZodRawShape, + Catchall extends ZodTypeAny, + K extends string +>( + obj: ZodObject, + extrasKey: K +): ZodEffects< + typeof obj, + output> & { + [k in K]: Record>; + } +> { + return obj.transform((val) => { + const extras: Record> = {}; + const { shape } = obj; + for (const [key] of Object.entries(val)) { + if (key in shape) { + continue; + } + + const v = val[key]; + if (typeof v === "undefined") { + continue; + } + + extras[key] = v; + delete val[key]; + } + + return { ...val, [extrasKey]: extras }; + }); +} diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts new file mode 100644 index 0000000..51b49bd --- /dev/null +++ b/src/lib/sdks.ts @@ -0,0 +1,357 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + HTTPClient, + matchContentType, + matchStatusCode, + isAbortError, + isTimeoutError, + isConnectionError, +} from "./http.js"; +import { SecurityState } from "./security.js"; +import { retry, RetryConfig } from "./retries.js"; +import { Logger } from "./logger.js"; +import { encodeForm } from "./encodings.js"; +import { stringToBase64 } from "./base64.js"; +import { SDKOptions, SDK_METADATA, serverURLFromOptions } from "./config.js"; +import { SDKHooks } from "../hooks/hooks.js"; +import { HookContext } from "../hooks/types.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ERR, OK, Result } from "../types/fp.js"; + +export type RequestOptions = { + /** + * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If + * `fetchOptions.signal` is set then it will take precedence over this option. + */ + timeoutMs?: number; + /** + * Set or override a retry policy on HTTP calls. + */ + retries?: RetryConfig; + /** + * Specifies the status codes which should be retried using the given retry policy. + */ + retryCodes?: string[]; + /** + * Sets various request options on the `fetch` call made by an SDK method. + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} + */ + fetchOptions?: Omit; +}; + +type RequestConfig = { + method: string; + path: string; + baseURL?: string | URL; + query?: string; + body?: RequestInit["body"]; + headers?: HeadersInit; + security?: SecurityState | null; + uaHeader?: string; + timeoutMs?: number; +}; + +const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; +const webWorkerLike = + typeof gt === "object" && + gt != null && + "importScripts" in gt && + typeof gt["importScripts"] === "function"; +const isBrowserLike = + webWorkerLike || + (typeof navigator !== "undefined" && "serviceWorker" in navigator) || + (typeof window === "object" && typeof window.document !== "undefined"); + +export class ClientSDK { + private readonly httpClient: HTTPClient; + protected readonly baseURL: URL | null; + protected readonly hooks$: SDKHooks; + protected readonly logger?: Logger | undefined; + public readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + this.hooks$ = opt.hooks; + } else { + this.hooks$ = new SDKHooks(); + } + this.options$ = { ...options, hooks: this.hooks$ }; + + const url = serverURLFromOptions(options); + if (url) { + url.pathname = url.pathname.replace(/\/+$/, "") + "/"; + } + const { baseURL, client } = this.hooks$.sdkInit({ + baseURL: url, + client: options.httpClient || new HTTPClient(), + }); + this.baseURL = baseURL; + this.httpClient = client; + this.logger = options.debugLogger; + } + + public createRequest$( + context: HookContext, + conf: RequestConfig, + options?: RequestOptions + ): Result { + const { method, path, query, headers: opHeaders, security } = conf; + + const base = conf.baseURL ?? this.baseURL; + if (!base) { + return ERR(new InvalidRequestError("No base URL provided for operation")); + } + const reqURL = new URL(base); + const inputURL = new URL(path, reqURL); + + if (path) { + reqURL.pathname += inputURL.pathname.replace(/^\/+/, ""); + } + + let finalQuery = query || ""; + + const secQuery: string[] = []; + for (const [k, v] of Object.entries(security?.queryParams || {})) { + secQuery.push(encodeForm(k, v, { charEncoding: "percent" })); + } + if (secQuery.length) { + finalQuery += `&${secQuery.join("&")}`; + } + + if (finalQuery) { + const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; + reqURL.search = `?${q}`; + } + + const headers = new Headers(opHeaders); + + const username = security?.basic.username; + const password = security?.basic.password; + if (username != null || password != null) { + const encoded = stringToBase64([username || "", password || ""].join(":")); + headers.set("Authorization", `Basic ${encoded}`); + } + + const securityHeaders = new Headers(security?.headers || {}); + for (const [k, v] of securityHeaders) { + headers.set(k, v); + } + + let cookie = headers.get("cookie") || ""; + for (const [k, v] of Object.entries(security?.cookies || {})) { + cookie += `; ${k}=${v}`; + } + cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; + headers.set("cookie", cookie); + + const userHeaders = new Headers(options?.fetchOptions?.headers); + for (const [k, v] of userHeaders) { + headers.set(k, v); + } + + // Only set user agent header in non-browser-like environments since CORS + // policy disallows setting it in browsers e.g. Chrome throws an error. + if (!isBrowserLike) { + headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent); + } + + let fetchOptions = options?.fetchOptions; + if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { + const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); + if (!fetchOptions) { + fetchOptions = { signal: timeoutSignal }; + } else { + fetchOptions.signal = timeoutSignal; + } + } + + let input; + try { + input = this.hooks$.beforeCreateRequest(context, { + url: reqURL, + options: { + ...fetchOptions, + body: conf.body ?? null, + headers, + method, + }, + }); + } catch (err: unknown) { + return ERR( + new UnexpectedClientError("Create request hook failed to execute", { cause: err }) + ); + } + + return OK(new Request(input.url, input.options)); + } + + public async do$( + request: Request, + options: { + context: HookContext; + errorCodes: number | string | (number | string)[]; + retryConfig?: RetryConfig | undefined; + retryCodes?: string[] | undefined; + } + ): Promise< + Result< + Response, + RequestAbortedError | RequestTimeoutError | ConnectionError | UnexpectedClientError + > + > { + const { context, errorCodes } = options; + const retryConfig = options.retryConfig || { strategy: "none" }; + const retryCodes = options.retryCodes || []; + + return retry( + async () => { + const req = await this.hooks$.beforeRequest(context, request.clone()); + await logRequest(this.logger, req).catch((e) => + this.logger?.log("Failed to log request:", e) + ); + + let response = await this.httpClient.request(req); + + if (matchStatusCode(response, errorCodes)) { + const result = await this.hooks$.afterError(context, response, null); + if (result.error) { + throw result.error; + } + response = result.response || response; + } else { + response = await this.hooks$.afterSuccess(context, response); + } + + await logResponse(this.logger, response, req).catch((e) => + this.logger?.log("Failed to log response:", e) + ); + + return response; + }, + { config: retryConfig, statusCodes: retryCodes } + ).then( + (r) => OK(r), + (err) => { + switch (true) { + case isAbortError(err): + return ERR( + new RequestAbortedError("Request aborted by client", { cause: err }) + ); + case isTimeoutError(err): + return ERR(new RequestTimeoutError("Request timed out", { cause: err })); + case isConnectionError(err): + return ERR(new ConnectionError("Unable to make request", { cause: err })); + default: + return ERR( + new UnexpectedClientError("Unexpected HTTP client error", { + cause: err, + }) + ); + } + } + ); + } +} + +const jsonLikeContentTypeRE = /^application\/(?:.{0,100}\+)?json/; +async function logRequest(logger: Logger | undefined, req: Request) { + if (!logger) { + return; + } + + const contentType = req.headers.get("content-type"); + const ct = contentType?.split(";")[0] || ""; + + logger.group(`> Request: ${req.method} ${req.url}`); + + logger.group("Headers:"); + for (const [k, v] of req.headers.entries()) { + logger.log(`${k}: ${v}`); + } + logger.groupEnd(); + + logger.group("Body:"); + switch (true) { + case jsonLikeContentTypeRE.test(ct): + logger.log(await req.clone().json()); + break; + case ct.startsWith("text/"): + logger.log(await req.clone().text()); + break; + case ct === "multipart/form-data": { + const body = await req.clone().formData(); + for (const [k, v] of body) { + const vlabel = v instanceof Blob ? "" : v; + logger.log(`${k}: ${vlabel}`); + } + break; + } + default: + logger.log(`<${contentType}>`); + break; + } + logger.groupEnd(); + + logger.groupEnd(); +} + +async function logResponse(logger: Logger | undefined, res: Response, req: Request) { + if (!logger) { + return; + } + + const contentType = res.headers.get("content-type"); + const ct = contentType?.split(";")[0] || ""; + + logger.group(`< Response: ${req.method} ${req.url}`); + logger.log("Status Code:", res.status, res.statusText); + + logger.group("Headers:"); + for (const [k, v] of res.headers.entries()) { + logger.log(`${k}: ${v}`); + } + logger.groupEnd(); + + logger.group("Body:"); + switch (true) { + case matchContentType(res, "application/json") || jsonLikeContentTypeRE.test(ct): + logger.log(await res.clone().json()); + break; + case matchContentType(res, "text/event-stream"): + logger.log(`<${contentType}>`); + break; + case matchContentType(res, "text/*"): + logger.log(await res.clone().text()); + break; + case matchContentType(res, "multipart/form-data"): { + const body = await res.clone().formData(); + for (const [k, v] of body) { + const vlabel = v instanceof Blob ? "" : v; + logger.log(`${k}: ${vlabel}`); + } + break; + } + default: + logger.log(`<${contentType}>`); + break; + } + logger.groupEnd(); + + logger.groupEnd(); +} diff --git a/src/lib/security.ts b/src/lib/security.ts new file mode 100644 index 0000000..e740623 --- /dev/null +++ b/src/lib/security.ts @@ -0,0 +1,203 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../models/components/index.js"; + +export enum SecurityErrorCode { + Incomplete = "incomplete", + UnrecognisedSecurityType = "unrecognized_security_type", +} + +export class SecurityError extends Error { + constructor(public code: SecurityErrorCode, message: string) { + super(message); + this.name = "SecurityError"; + } + + static incomplete(): SecurityError { + return new SecurityError( + SecurityErrorCode.Incomplete, + "Security requirements not met in order to perform the operation" + ); + } + static unrecognizedType(type: string): SecurityError { + return new SecurityError( + SecurityErrorCode.UnrecognisedSecurityType, + `Unrecognised security type: ${type}` + ); + } +} + +export type SecurityState = { + basic: { username?: string | undefined; password?: string | undefined }; + headers: Record; + queryParams: Record; + cookies: Record; +}; + +type SecurityInputBasic = { + type: "http:basic"; + value: { username?: string | undefined; password?: string | undefined } | null | undefined; +}; + +type SecurityInputBearer = { + type: "http:bearer"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputAPIKey = { + type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOIDC = { + type: "openIdConnect"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOAuth2 = { + type: "oauth2"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOAuth2ClientCredentials = { + type: "oauth2:client_credentials"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputCustom = { + type: "http:custom"; + value: any | null | undefined; + fieldName: string; +}; + +export type SecurityInput = + | SecurityInputBasic + | SecurityInputBearer + | SecurityInputAPIKey + | SecurityInputOAuth2 + | SecurityInputOAuth2ClientCredentials + | SecurityInputOIDC + | SecurityInputCustom; + +export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null { + const state: SecurityState = { + basic: { username: "", password: "" }, + headers: {}, + queryParams: {}, + cookies: {}, + }; + + const option = options.find((opts) => { + return opts.every((o) => { + if (o.value == null) { + return false; + } else if (o.type === "http:basic") { + return o.value.username != null || o.value.password != null; + } else if (o.type === "http:custom") { + return null; + } else if (typeof o.value === "string") { + return !!o.value; + } else { + throw new Error( + `Unrecognized security type: ${o.type} (value type: ${typeof o.value})` + ); + } + }); + }); + if (option == null) { + return null; + } + + option.forEach((spec) => { + if (spec.value == null) { + return; + } + + const { type } = spec; + + switch (type) { + case "apiKey:header": + state.headers[spec.fieldName] = spec.value; + break; + case "apiKey:query": + state.queryParams[spec.fieldName] = spec.value; + break; + case "apiKey:cookie": + state.cookies[spec.fieldName] = spec.value; + break; + case "http:basic": + applyBasic(state, spec); + break; + case "http:custom": + break; + case "http:bearer": + applyBearer(state, spec); + break; + case "oauth2": + applyBearer(state, spec); + break; + case "oauth2:client_credentials": + break; + case "openIdConnect": + applyBearer(state, spec); + break; + default: + spec satisfies never; + throw SecurityError.unrecognizedType(type); + } + }); + + return state; +} + +function applyBasic(state: SecurityState, spec: SecurityInputBasic) { + if (spec.value == null) { + return; + } + + state.basic = spec.value; +} + +function applyBearer( + state: SecurityState, + spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC +) { + if (spec.value == null) { + return; + } + + let value = spec.value; + if (value.slice(0, 7).toLowerCase() !== "bearer ") { + value = `Bearer ${value}`; + } + + state.headers[spec.fieldName] = value; +} +export function resolveGlobalSecurity( + security: Partial | null | undefined +): SecurityState | null { + return resolveSecurity([ + { + fieldName: "x-glacier-api-key", + type: "apiKey:header", + value: security?.apiKey, + }, + ]); +} + +export async function extractSecurity>( + sec: T | (() => Promise) | undefined +): Promise { + if (sec == null) { + return; + } + + return typeof sec === "function" ? sec() : sec; +} diff --git a/src/lib/url.ts b/src/lib/url.ts new file mode 100644 index 0000000..6bc6356 --- /dev/null +++ b/src/lib/url.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +const hasOwn = Object.prototype.hasOwnProperty; + +export type Params = Partial>; + +export function pathToFunc( + pathPattern: string, + options?: { charEncoding?: "percent" | "none" }, +): (params?: Params) => string { + const paramRE = /\{([a-zA-Z0-9_]+?)\}/g; + + return function buildURLPath(params: Record = {}): string { + return pathPattern.replace(paramRE, function (_, placeholder) { + if (!hasOwn.call(params, placeholder)) { + throw new Error(`Parameter '${placeholder}' is required`); + } + + const value = params[placeholder]; + if (typeof value !== "string" && typeof value !== "number") { + throw new Error( + `Parameter '${placeholder}' must be a string or number`, + ); + } + + return options?.charEncoding === "percent" + ? encodeURIComponent(`${value}`) + : `${value}`; + }); + }; +} diff --git a/src/models/components/activedelegatordetails.ts b/src/models/components/activedelegatordetails.ts new file mode 100644 index 0000000..472677b --- /dev/null +++ b/src/models/components/activedelegatordetails.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const ActiveDelegatorDetailsDelegationStatus = { + Active: "active", +} as const; +export type ActiveDelegatorDetailsDelegationStatus = ClosedEnum< + typeof ActiveDelegatorDetailsDelegationStatus +>; + +export type ActiveDelegatorDetails = { + txHash: string; + nodeId: string; + rewardAddresses: Array; + amountDelegated: string; + delegationFee: string; + startTimestamp: number; + endTimestamp: number; + estimatedGrossReward: string; + estimatedNetReward: string; + delegationStatus: ActiveDelegatorDetailsDelegationStatus; +}; + +/** @internal */ +export const ActiveDelegatorDetailsDelegationStatus$inboundSchema: z.ZodNativeEnum< + typeof ActiveDelegatorDetailsDelegationStatus +> = z.nativeEnum(ActiveDelegatorDetailsDelegationStatus); + +/** @internal */ +export const ActiveDelegatorDetailsDelegationStatus$outboundSchema: z.ZodNativeEnum< + typeof ActiveDelegatorDetailsDelegationStatus +> = ActiveDelegatorDetailsDelegationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActiveDelegatorDetailsDelegationStatus$ { + /** @deprecated use `ActiveDelegatorDetailsDelegationStatus$inboundSchema` instead. */ + export const inboundSchema = ActiveDelegatorDetailsDelegationStatus$inboundSchema; + /** @deprecated use `ActiveDelegatorDetailsDelegationStatus$outboundSchema` instead. */ + export const outboundSchema = ActiveDelegatorDetailsDelegationStatus$outboundSchema; +} + +/** @internal */ +export const ActiveDelegatorDetails$inboundSchema: z.ZodType< + ActiveDelegatorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + rewardAddresses: z.array(z.string()), + amountDelegated: z.string(), + delegationFee: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + estimatedGrossReward: z.string(), + estimatedNetReward: z.string(), + delegationStatus: ActiveDelegatorDetailsDelegationStatus$inboundSchema, +}); + +/** @internal */ +export type ActiveDelegatorDetails$Outbound = { + txHash: string; + nodeId: string; + rewardAddresses: Array; + amountDelegated: string; + delegationFee: string; + startTimestamp: number; + endTimestamp: number; + estimatedGrossReward: string; + estimatedNetReward: string; + delegationStatus: string; +}; + +/** @internal */ +export const ActiveDelegatorDetails$outboundSchema: z.ZodType< + ActiveDelegatorDetails$Outbound, + z.ZodTypeDef, + ActiveDelegatorDetails +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + rewardAddresses: z.array(z.string()), + amountDelegated: z.string(), + delegationFee: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + estimatedGrossReward: z.string(), + estimatedNetReward: z.string(), + delegationStatus: ActiveDelegatorDetailsDelegationStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActiveDelegatorDetails$ { + /** @deprecated use `ActiveDelegatorDetails$inboundSchema` instead. */ + export const inboundSchema = ActiveDelegatorDetails$inboundSchema; + /** @deprecated use `ActiveDelegatorDetails$outboundSchema` instead. */ + export const outboundSchema = ActiveDelegatorDetails$outboundSchema; + /** @deprecated use `ActiveDelegatorDetails$Outbound` instead. */ + export type Outbound = ActiveDelegatorDetails$Outbound; +} diff --git a/src/models/components/activevalidatordetails.ts b/src/models/components/activevalidatordetails.ts new file mode 100644 index 0000000..2df7824 --- /dev/null +++ b/src/models/components/activevalidatordetails.ts @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + BlsCredentials, + BlsCredentials$inboundSchema, + BlsCredentials$Outbound, + BlsCredentials$outboundSchema, +} from "./blscredentials.js"; +import { + Rewards, + Rewards$inboundSchema, + Rewards$Outbound, + Rewards$outboundSchema, +} from "./rewards.js"; +import { + ValidatorHealthDetails, + ValidatorHealthDetails$inboundSchema, + ValidatorHealthDetails$Outbound, + ValidatorHealthDetails$outboundSchema, +} from "./validatorhealthdetails.js"; +import * as z from "zod"; + +export const ActiveValidatorDetailsValidationStatus = { + Active: "active", +} as const; +export type ActiveValidatorDetailsValidationStatus = ClosedEnum< + typeof ActiveValidatorDetailsValidationStatus +>; + +export type ActiveValidatorDetails = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + /** + * Present for AddPermissionlessValidatorTx + */ + blsCredentials?: BlsCredentials | undefined; + stakePercentage: number; + delegatorCount: number; + amountDelegated?: string | undefined; + uptimePerformance: number; + avalancheGoVersion?: string | undefined; + delegationCapacity?: string | undefined; + potentialRewards: Rewards; + validationStatus: ActiveValidatorDetailsValidationStatus; + validatorHealth: ValidatorHealthDetails; +}; + +/** @internal */ +export const ActiveValidatorDetailsValidationStatus$inboundSchema: z.ZodNativeEnum< + typeof ActiveValidatorDetailsValidationStatus +> = z.nativeEnum(ActiveValidatorDetailsValidationStatus); + +/** @internal */ +export const ActiveValidatorDetailsValidationStatus$outboundSchema: z.ZodNativeEnum< + typeof ActiveValidatorDetailsValidationStatus +> = ActiveValidatorDetailsValidationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActiveValidatorDetailsValidationStatus$ { + /** @deprecated use `ActiveValidatorDetailsValidationStatus$inboundSchema` instead. */ + export const inboundSchema = ActiveValidatorDetailsValidationStatus$inboundSchema; + /** @deprecated use `ActiveValidatorDetailsValidationStatus$outboundSchema` instead. */ + export const outboundSchema = ActiveValidatorDetailsValidationStatus$outboundSchema; +} + +/** @internal */ +export const ActiveValidatorDetails$inboundSchema: z.ZodType< + ActiveValidatorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$inboundSchema.optional(), + stakePercentage: z.number(), + delegatorCount: z.number(), + amountDelegated: z.string().optional(), + uptimePerformance: z.number(), + avalancheGoVersion: z.string().optional(), + delegationCapacity: z.string().optional(), + potentialRewards: Rewards$inboundSchema, + validationStatus: ActiveValidatorDetailsValidationStatus$inboundSchema, + validatorHealth: ValidatorHealthDetails$inboundSchema, +}); + +/** @internal */ +export type ActiveValidatorDetails$Outbound = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + blsCredentials?: BlsCredentials$Outbound | undefined; + stakePercentage: number; + delegatorCount: number; + amountDelegated?: string | undefined; + uptimePerformance: number; + avalancheGoVersion?: string | undefined; + delegationCapacity?: string | undefined; + potentialRewards: Rewards$Outbound; + validationStatus: string; + validatorHealth: ValidatorHealthDetails$Outbound; +}; + +/** @internal */ +export const ActiveValidatorDetails$outboundSchema: z.ZodType< + ActiveValidatorDetails$Outbound, + z.ZodTypeDef, + ActiveValidatorDetails +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$outboundSchema.optional(), + stakePercentage: z.number(), + delegatorCount: z.number(), + amountDelegated: z.string().optional(), + uptimePerformance: z.number(), + avalancheGoVersion: z.string().optional(), + delegationCapacity: z.string().optional(), + potentialRewards: Rewards$outboundSchema, + validationStatus: ActiveValidatorDetailsValidationStatus$outboundSchema, + validatorHealth: ValidatorHealthDetails$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActiveValidatorDetails$ { + /** @deprecated use `ActiveValidatorDetails$inboundSchema` instead. */ + export const inboundSchema = ActiveValidatorDetails$inboundSchema; + /** @deprecated use `ActiveValidatorDetails$outboundSchema` instead. */ + export const outboundSchema = ActiveValidatorDetails$outboundSchema; + /** @deprecated use `ActiveValidatorDetails$Outbound` instead. */ + export type Outbound = ActiveValidatorDetails$Outbound; +} diff --git a/src/models/components/addressactivitymetadata.ts b/src/models/components/addressactivitymetadata.ts new file mode 100644 index 0000000..ed22b5c --- /dev/null +++ b/src/models/components/addressactivitymetadata.ts @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type AddressActivityMetadata = { + /** + * Ethereum address(es) for the address_activity event type + */ + addresses: Array; + /** + * Array of hexadecimal strings of the event signatures. + */ + eventSignatures?: Array | undefined; +}; + +/** @internal */ +export const AddressActivityMetadata$inboundSchema: z.ZodType< + AddressActivityMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.array(z.string()), + eventSignatures: z.array(z.string()).optional(), +}); + +/** @internal */ +export type AddressActivityMetadata$Outbound = { + addresses: Array; + eventSignatures?: Array | undefined; +}; + +/** @internal */ +export const AddressActivityMetadata$outboundSchema: z.ZodType< + AddressActivityMetadata$Outbound, + z.ZodTypeDef, + AddressActivityMetadata +> = z.object({ + addresses: z.array(z.string()), + eventSignatures: z.array(z.string()).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddressActivityMetadata$ { + /** @deprecated use `AddressActivityMetadata$inboundSchema` instead. */ + export const inboundSchema = AddressActivityMetadata$inboundSchema; + /** @deprecated use `AddressActivityMetadata$outboundSchema` instead. */ + export const outboundSchema = AddressActivityMetadata$outboundSchema; + /** @deprecated use `AddressActivityMetadata$Outbound` instead. */ + export type Outbound = AddressActivityMetadata$Outbound; +} diff --git a/src/models/components/addresseschangerequest.ts b/src/models/components/addresseschangerequest.ts new file mode 100644 index 0000000..3bcf9b5 --- /dev/null +++ b/src/models/components/addresseschangerequest.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type AddressesChangeRequest = { + /** + * Ethereum address(es) for the address_activity event type + */ + addresses: Array; +}; + +/** @internal */ +export const AddressesChangeRequest$inboundSchema: z.ZodType< + AddressesChangeRequest, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.array(z.string()), +}); + +/** @internal */ +export type AddressesChangeRequest$Outbound = { + addresses: Array; +}; + +/** @internal */ +export const AddressesChangeRequest$outboundSchema: z.ZodType< + AddressesChangeRequest$Outbound, + z.ZodTypeDef, + AddressesChangeRequest +> = z.object({ + addresses: z.array(z.string()), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddressesChangeRequest$ { + /** @deprecated use `AddressesChangeRequest$inboundSchema` instead. */ + export const inboundSchema = AddressesChangeRequest$inboundSchema; + /** @deprecated use `AddressesChangeRequest$outboundSchema` instead. */ + export const outboundSchema = AddressesChangeRequest$outboundSchema; + /** @deprecated use `AddressesChangeRequest$Outbound` instead. */ + export type Outbound = AddressesChangeRequest$Outbound; +} diff --git a/src/models/components/aggregatedassetamount.ts b/src/models/components/aggregatedassetamount.ts new file mode 100644 index 0000000..27435ad --- /dev/null +++ b/src/models/components/aggregatedassetamount.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkAssetType, + PrimaryNetworkAssetType$inboundSchema, + PrimaryNetworkAssetType$outboundSchema, +} from "./primarynetworkassettype.js"; +import * as z from "zod"; + +export type AggregatedAssetAmount = { + /** + * Unique ID for an asset. + */ + assetId: string; + /** + * Name of this asset. + */ + name: string; + /** + * Symbol for this asset (max 4 characters). + */ + symbol: string; + /** + * Denomination of this asset to represent fungibility. + */ + denomination: number; + /** + * Type of asset like SECP256K1 or NFT. + */ + type: PrimaryNetworkAssetType; + /** + * Amount of the asset. + */ + amount: string; + utxoCount: number; +}; + +/** @internal */ +export const AggregatedAssetAmount$inboundSchema: z.ZodType< + AggregatedAssetAmount, + z.ZodTypeDef, + unknown +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$inboundSchema, + amount: z.string(), + utxoCount: z.number(), +}); + +/** @internal */ +export type AggregatedAssetAmount$Outbound = { + assetId: string; + name: string; + symbol: string; + denomination: number; + type: string; + amount: string; + utxoCount: number; +}; + +/** @internal */ +export const AggregatedAssetAmount$outboundSchema: z.ZodType< + AggregatedAssetAmount$Outbound, + z.ZodTypeDef, + AggregatedAssetAmount +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$outboundSchema, + amount: z.string(), + utxoCount: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AggregatedAssetAmount$ { + /** @deprecated use `AggregatedAssetAmount$inboundSchema` instead. */ + export const inboundSchema = AggregatedAssetAmount$inboundSchema; + /** @deprecated use `AggregatedAssetAmount$outboundSchema` instead. */ + export const outboundSchema = AggregatedAssetAmount$outboundSchema; + /** @deprecated use `AggregatedAssetAmount$Outbound` instead. */ + export type Outbound = AggregatedAssetAmount$Outbound; +} diff --git a/src/models/components/assetamount.ts b/src/models/components/assetamount.ts new file mode 100644 index 0000000..f646112 --- /dev/null +++ b/src/models/components/assetamount.ts @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkAssetType, + PrimaryNetworkAssetType$inboundSchema, + PrimaryNetworkAssetType$outboundSchema, +} from "./primarynetworkassettype.js"; +import * as z from "zod"; + +export type AssetAmount = { + /** + * Unique ID for an asset. + */ + assetId: string; + /** + * Name of this asset. + */ + name: string; + /** + * Symbol for this asset (max 4 characters). + */ + symbol: string; + /** + * Denomination of this asset to represent fungibility. + */ + denomination: number; + /** + * Type of asset like SECP256K1 or NFT. + */ + type: PrimaryNetworkAssetType; + /** + * Amount of the asset. + */ + amount: string; +}; + +/** @internal */ +export const AssetAmount$inboundSchema: z.ZodType = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$inboundSchema, + amount: z.string(), +}); + +/** @internal */ +export type AssetAmount$Outbound = { + assetId: string; + name: string; + symbol: string; + denomination: number; + type: string; + amount: string; +}; + +/** @internal */ +export const AssetAmount$outboundSchema: z.ZodType< + AssetAmount$Outbound, + z.ZodTypeDef, + AssetAmount +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$outboundSchema, + amount: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AssetAmount$ { + /** @deprecated use `AssetAmount$inboundSchema` instead. */ + export const inboundSchema = AssetAmount$inboundSchema; + /** @deprecated use `AssetAmount$outboundSchema` instead. */ + export const outboundSchema = AssetAmount$outboundSchema; + /** @deprecated use `AssetAmount$Outbound` instead. */ + export type Outbound = AssetAmount$Outbound; +} diff --git a/src/models/components/assetwithpriceinfo.ts b/src/models/components/assetwithpriceinfo.ts new file mode 100644 index 0000000..eb65aa2 --- /dev/null +++ b/src/models/components/assetwithpriceinfo.ts @@ -0,0 +1,96 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Money, Money$inboundSchema, Money$Outbound, Money$outboundSchema } from "./money.js"; +import { + PrimaryNetworkAssetType, + PrimaryNetworkAssetType$inboundSchema, + PrimaryNetworkAssetType$outboundSchema, +} from "./primarynetworkassettype.js"; +import * as z from "zod"; + +export type AssetWithPriceInfo = { + /** + * Unique ID for an asset. + */ + assetId: string; + /** + * Name of this asset. + */ + name: string; + /** + * Symbol for this asset (max 4 characters). + */ + symbol: string; + /** + * Denomination of this asset to represent fungibility. + */ + denomination: number; + /** + * Type of asset like SECP256K1 or NFT. + */ + type: PrimaryNetworkAssetType; + /** + * Amount of the asset. + */ + amount: string; + /** + * The historical asset price at the time the reward was granted, if available. Note, this is only provided if the reward occured more than 24 hours ago. + */ + historicalPrice?: Money | undefined; +}; + +/** @internal */ +export const AssetWithPriceInfo$inboundSchema: z.ZodType< + AssetWithPriceInfo, + z.ZodTypeDef, + unknown +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$inboundSchema, + amount: z.string(), + historicalPrice: Money$inboundSchema.optional(), +}); + +/** @internal */ +export type AssetWithPriceInfo$Outbound = { + assetId: string; + name: string; + symbol: string; + denomination: number; + type: string; + amount: string; + historicalPrice?: Money$Outbound | undefined; +}; + +/** @internal */ +export const AssetWithPriceInfo$outboundSchema: z.ZodType< + AssetWithPriceInfo$Outbound, + z.ZodTypeDef, + AssetWithPriceInfo +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$outboundSchema, + amount: z.string(), + historicalPrice: Money$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AssetWithPriceInfo$ { + /** @deprecated use `AssetWithPriceInfo$inboundSchema` instead. */ + export const inboundSchema = AssetWithPriceInfo$inboundSchema; + /** @deprecated use `AssetWithPriceInfo$outboundSchema` instead. */ + export const outboundSchema = AssetWithPriceInfo$outboundSchema; + /** @deprecated use `AssetWithPriceInfo$Outbound` instead. */ + export type Outbound = AssetWithPriceInfo$Outbound; +} diff --git a/src/models/components/blockchain.ts b/src/models/components/blockchain.ts new file mode 100644 index 0000000..bf8e2ca --- /dev/null +++ b/src/models/components/blockchain.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type Blockchain = { + createBlockTimestamp: number; + createBlockNumber: string; + blockchainId: string; + vmId: string; + subnetId: string; + blockchainName: string; +}; + +/** @internal */ +export const Blockchain$inboundSchema: z.ZodType = z.object({ + createBlockTimestamp: z.number(), + createBlockNumber: z.string(), + blockchainId: z.string(), + vmId: z.string(), + subnetId: z.string(), + blockchainName: z.string(), +}); + +/** @internal */ +export type Blockchain$Outbound = { + createBlockTimestamp: number; + createBlockNumber: string; + blockchainId: string; + vmId: string; + subnetId: string; + blockchainName: string; +}; + +/** @internal */ +export const Blockchain$outboundSchema: z.ZodType = + z.object({ + createBlockTimestamp: z.number(), + createBlockNumber: z.string(), + blockchainId: z.string(), + vmId: z.string(), + subnetId: z.string(), + blockchainName: z.string(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Blockchain$ { + /** @deprecated use `Blockchain$inboundSchema` instead. */ + export const inboundSchema = Blockchain$inboundSchema; + /** @deprecated use `Blockchain$outboundSchema` instead. */ + export const outboundSchema = Blockchain$outboundSchema; + /** @deprecated use `Blockchain$Outbound` instead. */ + export type Outbound = Blockchain$Outbound; +} diff --git a/src/models/components/blockchainid.ts b/src/models/components/blockchainid.ts new file mode 100644 index 0000000..2cc02ff --- /dev/null +++ b/src/models/components/blockchainid.ts @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const BlockchainId = { + ElevenNonillionOneHundredAndElevenOctillionOneHundredAndElevenSeptillionOneHundredAndElevenSextillionOneHundredAndElevenQuintillionOneHundredAndElevenQuadrillionOneHundredAndElevenTrillionOneHundredAndElevenBillionOneHundredAndElevenMillionOneHundredAndElevenThousandOneHundredAndElevenLpoYY: + "11111111111111111111111111111111LpoYY", + TwooYmbnv4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM: + "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + TwoJVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm: + "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm", + Twoq9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAx5UQxse55x1Q5: + "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", + YH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp: + "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp", + PChain: "p-chain", + XChain: "x-chain", + CChain: "c-chain", +} as const; +export type BlockchainId = ClosedEnum; + +/** @internal */ +export const BlockchainId$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(BlockchainId); + +/** @internal */ +export const BlockchainId$outboundSchema: z.ZodNativeEnum = + BlockchainId$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BlockchainId$ { + /** @deprecated use `BlockchainId$inboundSchema` instead. */ + export const inboundSchema = BlockchainId$inboundSchema; + /** @deprecated use `BlockchainId$outboundSchema` instead. */ + export const outboundSchema = BlockchainId$outboundSchema; +} diff --git a/src/models/components/blockchainids.ts b/src/models/components/blockchainids.ts new file mode 100644 index 0000000..f38611d --- /dev/null +++ b/src/models/components/blockchainids.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const BlockchainIds = { + ElevenNonillionOneHundredAndElevenOctillionOneHundredAndElevenSeptillionOneHundredAndElevenSextillionOneHundredAndElevenQuintillionOneHundredAndElevenQuadrillionOneHundredAndElevenTrillionOneHundredAndElevenBillionOneHundredAndElevenMillionOneHundredAndElevenThousandOneHundredAndElevenLpoYY: + "11111111111111111111111111111111LpoYY", + TwooYmbnv4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM: + "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + TwoJVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm: + "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm", + Twoq9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAx5UQxse55x1Q5: + "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", + YH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp: + "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp", +} as const; +export type BlockchainIds = ClosedEnum; + +/** @internal */ +export const BlockchainIds$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(BlockchainIds); + +/** @internal */ +export const BlockchainIds$outboundSchema: z.ZodNativeEnum = + BlockchainIds$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BlockchainIds$ { + /** @deprecated use `BlockchainIds$inboundSchema` instead. */ + export const inboundSchema = BlockchainIds$inboundSchema; + /** @deprecated use `BlockchainIds$outboundSchema` instead. */ + export const outboundSchema = BlockchainIds$outboundSchema; +} diff --git a/src/models/components/blockchaininfo.ts b/src/models/components/blockchaininfo.ts new file mode 100644 index 0000000..7d1784a --- /dev/null +++ b/src/models/components/blockchaininfo.ts @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type BlockchainInfo = { + blockchainId: string; +}; + +/** @internal */ +export const BlockchainInfo$inboundSchema: z.ZodType = + z.object({ + blockchainId: z.string(), + }); + +/** @internal */ +export type BlockchainInfo$Outbound = { + blockchainId: string; +}; + +/** @internal */ +export const BlockchainInfo$outboundSchema: z.ZodType< + BlockchainInfo$Outbound, + z.ZodTypeDef, + BlockchainInfo +> = z.object({ + blockchainId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BlockchainInfo$ { + /** @deprecated use `BlockchainInfo$inboundSchema` instead. */ + export const inboundSchema = BlockchainInfo$inboundSchema; + /** @deprecated use `BlockchainInfo$outboundSchema` instead. */ + export const outboundSchema = BlockchainInfo$outboundSchema; + /** @deprecated use `BlockchainInfo$Outbound` instead. */ + export type Outbound = BlockchainInfo$Outbound; +} diff --git a/src/models/components/blscredentials.ts b/src/models/components/blscredentials.ts new file mode 100644 index 0000000..526227b --- /dev/null +++ b/src/models/components/blscredentials.ts @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type BlsCredentials = { + publicKey: string; + proofOfPossession: string; +}; + +/** @internal */ +export const BlsCredentials$inboundSchema: z.ZodType = + z.object({ + publicKey: z.string(), + proofOfPossession: z.string(), + }); + +/** @internal */ +export type BlsCredentials$Outbound = { + publicKey: string; + proofOfPossession: string; +}; + +/** @internal */ +export const BlsCredentials$outboundSchema: z.ZodType< + BlsCredentials$Outbound, + z.ZodTypeDef, + BlsCredentials +> = z.object({ + publicKey: z.string(), + proofOfPossession: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BlsCredentials$ { + /** @deprecated use `BlsCredentials$inboundSchema` instead. */ + export const inboundSchema = BlsCredentials$inboundSchema; + /** @deprecated use `BlsCredentials$outboundSchema` instead. */ + export const outboundSchema = BlsCredentials$outboundSchema; + /** @deprecated use `BlsCredentials$Outbound` instead. */ + export type Outbound = BlsCredentials$Outbound; +} diff --git a/src/models/components/cchainatomicbalances.ts b/src/models/components/cchainatomicbalances.ts new file mode 100644 index 0000000..40a0d0f --- /dev/null +++ b/src/models/components/cchainatomicbalances.ts @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + CChainSharedAssetBalance, + CChainSharedAssetBalance$inboundSchema, + CChainSharedAssetBalance$Outbound, + CChainSharedAssetBalance$outboundSchema, +} from "./cchainsharedassetbalance.js"; +import * as z from "zod"; + +export type CChainAtomicBalances = { + atomicMemoryUnlocked: Array; + atomicMemoryLocked: Array; +}; + +/** @internal */ +export const CChainAtomicBalances$inboundSchema: z.ZodType< + CChainAtomicBalances, + z.ZodTypeDef, + unknown +> = z.object({ + atomicMemoryUnlocked: z.array(CChainSharedAssetBalance$inboundSchema), + atomicMemoryLocked: z.array(CChainSharedAssetBalance$inboundSchema), +}); + +/** @internal */ +export type CChainAtomicBalances$Outbound = { + atomicMemoryUnlocked: Array; + atomicMemoryLocked: Array; +}; + +/** @internal */ +export const CChainAtomicBalances$outboundSchema: z.ZodType< + CChainAtomicBalances$Outbound, + z.ZodTypeDef, + CChainAtomicBalances +> = z.object({ + atomicMemoryUnlocked: z.array(CChainSharedAssetBalance$outboundSchema), + atomicMemoryLocked: z.array(CChainSharedAssetBalance$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CChainAtomicBalances$ { + /** @deprecated use `CChainAtomicBalances$inboundSchema` instead. */ + export const inboundSchema = CChainAtomicBalances$inboundSchema; + /** @deprecated use `CChainAtomicBalances$outboundSchema` instead. */ + export const outboundSchema = CChainAtomicBalances$outboundSchema; + /** @deprecated use `CChainAtomicBalances$Outbound` instead. */ + export type Outbound = CChainAtomicBalances$Outbound; +} diff --git a/src/models/components/cchainexporttransaction.ts b/src/models/components/cchainexporttransaction.ts new file mode 100644 index 0000000..ca7659e --- /dev/null +++ b/src/models/components/cchainexporttransaction.ts @@ -0,0 +1,161 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { + EVMInput, + EVMInput$inboundSchema, + EVMInput$Outbound, + EVMInput$outboundSchema, +} from "./evminput.js"; +import { Utxo, Utxo$inboundSchema, Utxo$Outbound, Utxo$outboundSchema } from "./utxo.js"; +import * as z from "zod"; + +/** + * Type of transaction. + */ +export const TxType = { + ExportTx: "ExportTx", +} as const; +/** + * Type of transaction. + */ +export type TxType = ClosedEnum; + +export type CChainExportTransaction = { + /** + * Unique ID for this transaction. + */ + txHash: string; + /** + * Height of the block this transaction belongs to. + */ + blockHeight: number; + /** + * Hash of the block this transaction belongs to. + */ + blockHash: string; + /** + * Latest timestamp in seconds this transaction was accepted. + */ + timestamp: number; + /** + * Hex encoded memo bytes for this transaction. + */ + memo: string; + /** + * Assets unlocked by inputs of this transaction. + */ + amountUnlocked: Array; + /** + * Assets created by outputs of this transaction. + */ + amountCreated: Array; + /** + * Source chain for an atomic transaction. + */ + sourceChain: string; + /** + * Destination chain for an atomic transaction. + */ + destinationChain: string; + /** + * Type of transaction. + */ + txType: TxType; + evmInputs: Array; + emittedUtxos: Array; +}; + +/** @internal */ +export const TxType$inboundSchema: z.ZodNativeEnum = z.nativeEnum(TxType); + +/** @internal */ +export const TxType$outboundSchema: z.ZodNativeEnum = TxType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TxType$ { + /** @deprecated use `TxType$inboundSchema` instead. */ + export const inboundSchema = TxType$inboundSchema; + /** @deprecated use `TxType$outboundSchema` instead. */ + export const outboundSchema = TxType$outboundSchema; +} + +/** @internal */ +export const CChainExportTransaction$inboundSchema: z.ZodType< + CChainExportTransaction, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + blockHeight: z.number(), + blockHash: z.string(), + timestamp: z.number(), + memo: z.string(), + amountUnlocked: z.array(AssetAmount$inboundSchema), + amountCreated: z.array(AssetAmount$inboundSchema), + sourceChain: z.string(), + destinationChain: z.string(), + txType: TxType$inboundSchema, + evmInputs: z.array(EVMInput$inboundSchema), + emittedUtxos: z.array(Utxo$inboundSchema), +}); + +/** @internal */ +export type CChainExportTransaction$Outbound = { + txHash: string; + blockHeight: number; + blockHash: string; + timestamp: number; + memo: string; + amountUnlocked: Array; + amountCreated: Array; + sourceChain: string; + destinationChain: string; + txType: string; + evmInputs: Array; + emittedUtxos: Array; +}; + +/** @internal */ +export const CChainExportTransaction$outboundSchema: z.ZodType< + CChainExportTransaction$Outbound, + z.ZodTypeDef, + CChainExportTransaction +> = z.object({ + txHash: z.string(), + blockHeight: z.number(), + blockHash: z.string(), + timestamp: z.number(), + memo: z.string(), + amountUnlocked: z.array(AssetAmount$outboundSchema), + amountCreated: z.array(AssetAmount$outboundSchema), + sourceChain: z.string(), + destinationChain: z.string(), + txType: TxType$outboundSchema, + evmInputs: z.array(EVMInput$outboundSchema), + emittedUtxos: z.array(Utxo$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CChainExportTransaction$ { + /** @deprecated use `CChainExportTransaction$inboundSchema` instead. */ + export const inboundSchema = CChainExportTransaction$inboundSchema; + /** @deprecated use `CChainExportTransaction$outboundSchema` instead. */ + export const outboundSchema = CChainExportTransaction$outboundSchema; + /** @deprecated use `CChainExportTransaction$Outbound` instead. */ + export type Outbound = CChainExportTransaction$Outbound; +} diff --git a/src/models/components/cchainimporttransaction.ts b/src/models/components/cchainimporttransaction.ts new file mode 100644 index 0000000..33efc4b --- /dev/null +++ b/src/models/components/cchainimporttransaction.ts @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { + EVMOutput, + EVMOutput$inboundSchema, + EVMOutput$Outbound, + EVMOutput$outboundSchema, +} from "./evmoutput.js"; +import { Utxo, Utxo$inboundSchema, Utxo$Outbound, Utxo$outboundSchema } from "./utxo.js"; +import * as z from "zod"; + +/** + * Type of transaction. + */ +export const CChainImportTransactionTxType = { + ImportTx: "ImportTx", +} as const; +/** + * Type of transaction. + */ +export type CChainImportTransactionTxType = ClosedEnum; + +export type CChainImportTransaction = { + /** + * Unique ID for this transaction. + */ + txHash: string; + /** + * Height of the block this transaction belongs to. + */ + blockHeight: number; + /** + * Hash of the block this transaction belongs to. + */ + blockHash: string; + /** + * Latest timestamp in seconds this transaction was accepted. + */ + timestamp: number; + /** + * Hex encoded memo bytes for this transaction. + */ + memo: string; + /** + * Assets unlocked by inputs of this transaction. + */ + amountUnlocked: Array; + /** + * Assets created by outputs of this transaction. + */ + amountCreated: Array; + /** + * Source chain for an atomic transaction. + */ + sourceChain: string; + /** + * Destination chain for an atomic transaction. + */ + destinationChain: string; + /** + * Type of transaction. + */ + txType: CChainImportTransactionTxType; + evmOutputs: Array; + consumedUtxos: Array; +}; + +/** @internal */ +export const CChainImportTransactionTxType$inboundSchema: z.ZodNativeEnum< + typeof CChainImportTransactionTxType +> = z.nativeEnum(CChainImportTransactionTxType); + +/** @internal */ +export const CChainImportTransactionTxType$outboundSchema: z.ZodNativeEnum< + typeof CChainImportTransactionTxType +> = CChainImportTransactionTxType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CChainImportTransactionTxType$ { + /** @deprecated use `CChainImportTransactionTxType$inboundSchema` instead. */ + export const inboundSchema = CChainImportTransactionTxType$inboundSchema; + /** @deprecated use `CChainImportTransactionTxType$outboundSchema` instead. */ + export const outboundSchema = CChainImportTransactionTxType$outboundSchema; +} + +/** @internal */ +export const CChainImportTransaction$inboundSchema: z.ZodType< + CChainImportTransaction, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + blockHeight: z.number(), + blockHash: z.string(), + timestamp: z.number(), + memo: z.string(), + amountUnlocked: z.array(AssetAmount$inboundSchema), + amountCreated: z.array(AssetAmount$inboundSchema), + sourceChain: z.string(), + destinationChain: z.string(), + txType: CChainImportTransactionTxType$inboundSchema, + evmOutputs: z.array(EVMOutput$inboundSchema), + consumedUtxos: z.array(Utxo$inboundSchema), +}); + +/** @internal */ +export type CChainImportTransaction$Outbound = { + txHash: string; + blockHeight: number; + blockHash: string; + timestamp: number; + memo: string; + amountUnlocked: Array; + amountCreated: Array; + sourceChain: string; + destinationChain: string; + txType: string; + evmOutputs: Array; + consumedUtxos: Array; +}; + +/** @internal */ +export const CChainImportTransaction$outboundSchema: z.ZodType< + CChainImportTransaction$Outbound, + z.ZodTypeDef, + CChainImportTransaction +> = z.object({ + txHash: z.string(), + blockHeight: z.number(), + blockHash: z.string(), + timestamp: z.number(), + memo: z.string(), + amountUnlocked: z.array(AssetAmount$outboundSchema), + amountCreated: z.array(AssetAmount$outboundSchema), + sourceChain: z.string(), + destinationChain: z.string(), + txType: CChainImportTransactionTxType$outboundSchema, + evmOutputs: z.array(EVMOutput$outboundSchema), + consumedUtxos: z.array(Utxo$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CChainImportTransaction$ { + /** @deprecated use `CChainImportTransaction$inboundSchema` instead. */ + export const inboundSchema = CChainImportTransaction$inboundSchema; + /** @deprecated use `CChainImportTransaction$outboundSchema` instead. */ + export const outboundSchema = CChainImportTransaction$outboundSchema; + /** @deprecated use `CChainImportTransaction$Outbound` instead. */ + export type Outbound = CChainImportTransaction$Outbound; +} diff --git a/src/models/components/cchainsharedassetbalance.ts b/src/models/components/cchainsharedassetbalance.ts new file mode 100644 index 0000000..723c280 --- /dev/null +++ b/src/models/components/cchainsharedassetbalance.ts @@ -0,0 +1,96 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkAssetType, + PrimaryNetworkAssetType$inboundSchema, + PrimaryNetworkAssetType$outboundSchema, +} from "./primarynetworkassettype.js"; +import * as z from "zod"; + +export type CChainSharedAssetBalance = { + /** + * Unique ID for an asset. + */ + assetId: string; + /** + * Name of this asset. + */ + name: string; + /** + * Symbol for this asset (max 4 characters). + */ + symbol: string; + /** + * Denomination of this asset to represent fungibility. + */ + denomination: number; + /** + * Type of asset like SECP256K1 or NFT. + */ + type: PrimaryNetworkAssetType; + /** + * Amount of the asset. + */ + amount: string; + utxoCount: number; + sharedWithChainId: string; +}; + +/** @internal */ +export const CChainSharedAssetBalance$inboundSchema: z.ZodType< + CChainSharedAssetBalance, + z.ZodTypeDef, + unknown +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$inboundSchema, + amount: z.string(), + utxoCount: z.number(), + sharedWithChainId: z.string(), +}); + +/** @internal */ +export type CChainSharedAssetBalance$Outbound = { + assetId: string; + name: string; + symbol: string; + denomination: number; + type: string; + amount: string; + utxoCount: number; + sharedWithChainId: string; +}; + +/** @internal */ +export const CChainSharedAssetBalance$outboundSchema: z.ZodType< + CChainSharedAssetBalance$Outbound, + z.ZodTypeDef, + CChainSharedAssetBalance +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$outboundSchema, + amount: z.string(), + utxoCount: z.number(), + sharedWithChainId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CChainSharedAssetBalance$ { + /** @deprecated use `CChainSharedAssetBalance$inboundSchema` instead. */ + export const inboundSchema = CChainSharedAssetBalance$inboundSchema; + /** @deprecated use `CChainSharedAssetBalance$outboundSchema` instead. */ + export const outboundSchema = CChainSharedAssetBalance$outboundSchema; + /** @deprecated use `CChainSharedAssetBalance$Outbound` instead. */ + export type Outbound = CChainSharedAssetBalance$Outbound; +} diff --git a/src/models/components/chainaddresschainidmap.ts b/src/models/components/chainaddresschainidmap.ts new file mode 100644 index 0000000..093023f --- /dev/null +++ b/src/models/components/chainaddresschainidmap.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + BlockchainIds, + BlockchainIds$inboundSchema, + BlockchainIds$outboundSchema, +} from "./blockchainids.js"; +import * as z from "zod"; + +export type ChainAddressChainIdMap = { + address: string; + blockchainIds: Array; +}; + +/** @internal */ +export const ChainAddressChainIdMap$inboundSchema: z.ZodType< + ChainAddressChainIdMap, + z.ZodTypeDef, + unknown +> = z.object({ + address: z.string(), + blockchainIds: z.array(BlockchainIds$inboundSchema), +}); + +/** @internal */ +export type ChainAddressChainIdMap$Outbound = { + address: string; + blockchainIds: Array; +}; + +/** @internal */ +export const ChainAddressChainIdMap$outboundSchema: z.ZodType< + ChainAddressChainIdMap$Outbound, + z.ZodTypeDef, + ChainAddressChainIdMap +> = z.object({ + address: z.string(), + blockchainIds: z.array(BlockchainIds$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChainAddressChainIdMap$ { + /** @deprecated use `ChainAddressChainIdMap$inboundSchema` instead. */ + export const inboundSchema = ChainAddressChainIdMap$inboundSchema; + /** @deprecated use `ChainAddressChainIdMap$outboundSchema` instead. */ + export const outboundSchema = ChainAddressChainIdMap$outboundSchema; + /** @deprecated use `ChainAddressChainIdMap$Outbound` instead. */ + export type Outbound = ChainAddressChainIdMap$Outbound; +} diff --git a/src/models/components/chainaddresschainidmaplistresponse.ts b/src/models/components/chainaddresschainidmaplistresponse.ts new file mode 100644 index 0000000..19b3f6b --- /dev/null +++ b/src/models/components/chainaddresschainidmaplistresponse.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + ChainAddressChainIdMap, + ChainAddressChainIdMap$inboundSchema, + ChainAddressChainIdMap$Outbound, + ChainAddressChainIdMap$outboundSchema, +} from "./chainaddresschainidmap.js"; +import * as z from "zod"; + +export type ChainAddressChainIdMapListResponse = { + addresses: Array; +}; + +/** @internal */ +export const ChainAddressChainIdMapListResponse$inboundSchema: z.ZodType< + ChainAddressChainIdMapListResponse, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.array(ChainAddressChainIdMap$inboundSchema), +}); + +/** @internal */ +export type ChainAddressChainIdMapListResponse$Outbound = { + addresses: Array; +}; + +/** @internal */ +export const ChainAddressChainIdMapListResponse$outboundSchema: z.ZodType< + ChainAddressChainIdMapListResponse$Outbound, + z.ZodTypeDef, + ChainAddressChainIdMapListResponse +> = z.object({ + addresses: z.array(ChainAddressChainIdMap$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChainAddressChainIdMapListResponse$ { + /** @deprecated use `ChainAddressChainIdMapListResponse$inboundSchema` instead. */ + export const inboundSchema = ChainAddressChainIdMapListResponse$inboundSchema; + /** @deprecated use `ChainAddressChainIdMapListResponse$outboundSchema` instead. */ + export const outboundSchema = ChainAddressChainIdMapListResponse$outboundSchema; + /** @deprecated use `ChainAddressChainIdMapListResponse$Outbound` instead. */ + export type Outbound = ChainAddressChainIdMapListResponse$Outbound; +} diff --git a/src/models/components/chaininfo.ts b/src/models/components/chaininfo.ts new file mode 100644 index 0000000..e185a6f --- /dev/null +++ b/src/models/components/chaininfo.ts @@ -0,0 +1,149 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + ChainStatus, + ChainStatus$inboundSchema, + ChainStatus$outboundSchema, +} from "./chainstatus.js"; +import { + NetworkToken, + NetworkToken$inboundSchema, + NetworkToken$Outbound, + NetworkToken$outboundSchema, +} from "./networktoken.js"; +import { + UtilityAddresses, + UtilityAddresses$inboundSchema, + UtilityAddresses$Outbound, + UtilityAddresses$outboundSchema, +} from "./utilityaddresses.js"; +import { VmName, VmName$inboundSchema, VmName$outboundSchema } from "./vmname.js"; +import * as z from "zod"; + +export const EnabledFeatures = { + NftIndexing: "nftIndexing", + Webhooks: "webhooks", +} as const; +export type EnabledFeatures = ClosedEnum; + +export type ChainInfo = { + chainId: string; + /** + * Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors. + */ + status: ChainStatus; + chainName: string; + description: string; + platformChainId?: string | undefined; + subnetId?: string | undefined; + vmId?: string | undefined; + vmName: VmName; + explorerUrl?: string | undefined; + rpcUrl: string; + wsUrl?: string | undefined; + isTestnet: boolean; + utilityAddresses?: UtilityAddresses | undefined; + networkToken: NetworkToken; + chainLogoUri?: string | undefined; + private?: boolean | undefined; + enabledFeatures?: Array | undefined; +}; + +/** @internal */ +export const EnabledFeatures$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(EnabledFeatures); + +/** @internal */ +export const EnabledFeatures$outboundSchema: z.ZodNativeEnum = + EnabledFeatures$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EnabledFeatures$ { + /** @deprecated use `EnabledFeatures$inboundSchema` instead. */ + export const inboundSchema = EnabledFeatures$inboundSchema; + /** @deprecated use `EnabledFeatures$outboundSchema` instead. */ + export const outboundSchema = EnabledFeatures$outboundSchema; +} + +/** @internal */ +export const ChainInfo$inboundSchema: z.ZodType = z.object({ + chainId: z.string(), + status: ChainStatus$inboundSchema, + chainName: z.string(), + description: z.string(), + platformChainId: z.string().optional(), + subnetId: z.string().optional(), + vmId: z.string().optional(), + vmName: VmName$inboundSchema, + explorerUrl: z.string().optional(), + rpcUrl: z.string(), + wsUrl: z.string().optional(), + isTestnet: z.boolean(), + utilityAddresses: UtilityAddresses$inboundSchema.optional(), + networkToken: NetworkToken$inboundSchema, + chainLogoUri: z.string().optional(), + private: z.boolean().optional(), + enabledFeatures: z.array(EnabledFeatures$inboundSchema).optional(), +}); + +/** @internal */ +export type ChainInfo$Outbound = { + chainId: string; + status: string; + chainName: string; + description: string; + platformChainId?: string | undefined; + subnetId?: string | undefined; + vmId?: string | undefined; + vmName: string; + explorerUrl?: string | undefined; + rpcUrl: string; + wsUrl?: string | undefined; + isTestnet: boolean; + utilityAddresses?: UtilityAddresses$Outbound | undefined; + networkToken: NetworkToken$Outbound; + chainLogoUri?: string | undefined; + private?: boolean | undefined; + enabledFeatures?: Array | undefined; +}; + +/** @internal */ +export const ChainInfo$outboundSchema: z.ZodType = + z.object({ + chainId: z.string(), + status: ChainStatus$outboundSchema, + chainName: z.string(), + description: z.string(), + platformChainId: z.string().optional(), + subnetId: z.string().optional(), + vmId: z.string().optional(), + vmName: VmName$outboundSchema, + explorerUrl: z.string().optional(), + rpcUrl: z.string(), + wsUrl: z.string().optional(), + isTestnet: z.boolean(), + utilityAddresses: UtilityAddresses$outboundSchema.optional(), + networkToken: NetworkToken$outboundSchema, + chainLogoUri: z.string().optional(), + private: z.boolean().optional(), + enabledFeatures: z.array(EnabledFeatures$outboundSchema).optional(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChainInfo$ { + /** @deprecated use `ChainInfo$inboundSchema` instead. */ + export const inboundSchema = ChainInfo$inboundSchema; + /** @deprecated use `ChainInfo$outboundSchema` instead. */ + export const outboundSchema = ChainInfo$outboundSchema; + /** @deprecated use `ChainInfo$Outbound` instead. */ + export type Outbound = ChainInfo$Outbound; +} diff --git a/src/models/components/chainstatus.ts b/src/models/components/chainstatus.ts new file mode 100644 index 0000000..ad85026 --- /dev/null +++ b/src/models/components/chainstatus.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors. + */ +export const ChainStatus = { + Ok: "OK", + Unavailable: "UNAVAILABLE", +} as const; +/** + * Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors. + */ +export type ChainStatus = ClosedEnum; + +/** @internal */ +export const ChainStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(ChainStatus); + +/** @internal */ +export const ChainStatus$outboundSchema: z.ZodNativeEnum = + ChainStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChainStatus$ { + /** @deprecated use `ChainStatus$inboundSchema` instead. */ + export const inboundSchema = ChainStatus$inboundSchema; + /** @deprecated use `ChainStatus$outboundSchema` instead. */ + export const outboundSchema = ChainStatus$outboundSchema; +} diff --git a/src/models/components/completeddelegatordetails.ts b/src/models/components/completeddelegatordetails.ts new file mode 100644 index 0000000..153101b --- /dev/null +++ b/src/models/components/completeddelegatordetails.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const DelegationStatus = { + Completed: "completed", +} as const; +export type DelegationStatus = ClosedEnum; + +export type CompletedDelegatorDetails = { + txHash: string; + nodeId: string; + rewardAddresses: Array; + amountDelegated: string; + delegationFee: string; + startTimestamp: number; + endTimestamp: number; + grossReward: string; + netReward: string; + delegationStatus: DelegationStatus; +}; + +/** @internal */ +export const DelegationStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(DelegationStatus); + +/** @internal */ +export const DelegationStatus$outboundSchema: z.ZodNativeEnum = + DelegationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DelegationStatus$ { + /** @deprecated use `DelegationStatus$inboundSchema` instead. */ + export const inboundSchema = DelegationStatus$inboundSchema; + /** @deprecated use `DelegationStatus$outboundSchema` instead. */ + export const outboundSchema = DelegationStatus$outboundSchema; +} + +/** @internal */ +export const CompletedDelegatorDetails$inboundSchema: z.ZodType< + CompletedDelegatorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + rewardAddresses: z.array(z.string()), + amountDelegated: z.string(), + delegationFee: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + grossReward: z.string(), + netReward: z.string(), + delegationStatus: DelegationStatus$inboundSchema, +}); + +/** @internal */ +export type CompletedDelegatorDetails$Outbound = { + txHash: string; + nodeId: string; + rewardAddresses: Array; + amountDelegated: string; + delegationFee: string; + startTimestamp: number; + endTimestamp: number; + grossReward: string; + netReward: string; + delegationStatus: string; +}; + +/** @internal */ +export const CompletedDelegatorDetails$outboundSchema: z.ZodType< + CompletedDelegatorDetails$Outbound, + z.ZodTypeDef, + CompletedDelegatorDetails +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + rewardAddresses: z.array(z.string()), + amountDelegated: z.string(), + delegationFee: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + grossReward: z.string(), + netReward: z.string(), + delegationStatus: DelegationStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompletedDelegatorDetails$ { + /** @deprecated use `CompletedDelegatorDetails$inboundSchema` instead. */ + export const inboundSchema = CompletedDelegatorDetails$inboundSchema; + /** @deprecated use `CompletedDelegatorDetails$outboundSchema` instead. */ + export const outboundSchema = CompletedDelegatorDetails$outboundSchema; + /** @deprecated use `CompletedDelegatorDetails$Outbound` instead. */ + export type Outbound = CompletedDelegatorDetails$Outbound; +} diff --git a/src/models/components/completedvalidatordetails.ts b/src/models/components/completedvalidatordetails.ts new file mode 100644 index 0000000..49d9553 --- /dev/null +++ b/src/models/components/completedvalidatordetails.ts @@ -0,0 +1,125 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + BlsCredentials, + BlsCredentials$inboundSchema, + BlsCredentials$Outbound, + BlsCredentials$outboundSchema, +} from "./blscredentials.js"; +import { + Rewards, + Rewards$inboundSchema, + Rewards$Outbound, + Rewards$outboundSchema, +} from "./rewards.js"; +import * as z from "zod"; + +export const ValidationStatus = { + Completed: "completed", +} as const; +export type ValidationStatus = ClosedEnum; + +export type CompletedValidatorDetails = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + /** + * Present for AddPermissionlessValidatorTx + */ + blsCredentials?: BlsCredentials | undefined; + delegatorCount: number; + rewards: Rewards; + validationStatus: ValidationStatus; +}; + +/** @internal */ +export const ValidationStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(ValidationStatus); + +/** @internal */ +export const ValidationStatus$outboundSchema: z.ZodNativeEnum = + ValidationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ValidationStatus$ { + /** @deprecated use `ValidationStatus$inboundSchema` instead. */ + export const inboundSchema = ValidationStatus$inboundSchema; + /** @deprecated use `ValidationStatus$outboundSchema` instead. */ + export const outboundSchema = ValidationStatus$outboundSchema; +} + +/** @internal */ +export const CompletedValidatorDetails$inboundSchema: z.ZodType< + CompletedValidatorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$inboundSchema.optional(), + delegatorCount: z.number(), + rewards: Rewards$inboundSchema, + validationStatus: ValidationStatus$inboundSchema, +}); + +/** @internal */ +export type CompletedValidatorDetails$Outbound = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + blsCredentials?: BlsCredentials$Outbound | undefined; + delegatorCount: number; + rewards: Rewards$Outbound; + validationStatus: string; +}; + +/** @internal */ +export const CompletedValidatorDetails$outboundSchema: z.ZodType< + CompletedValidatorDetails$Outbound, + z.ZodTypeDef, + CompletedValidatorDetails +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$outboundSchema.optional(), + delegatorCount: z.number(), + rewards: Rewards$outboundSchema, + validationStatus: ValidationStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompletedValidatorDetails$ { + /** @deprecated use `CompletedValidatorDetails$inboundSchema` instead. */ + export const inboundSchema = CompletedValidatorDetails$inboundSchema; + /** @deprecated use `CompletedValidatorDetails$outboundSchema` instead. */ + export const outboundSchema = CompletedValidatorDetails$outboundSchema; + /** @deprecated use `CompletedValidatorDetails$Outbound` instead. */ + export type Outbound = CompletedValidatorDetails$Outbound; +} diff --git a/src/models/components/contractdeploymentdetails.ts b/src/models/components/contractdeploymentdetails.ts new file mode 100644 index 0000000..de76997 --- /dev/null +++ b/src/models/components/contractdeploymentdetails.ts @@ -0,0 +1,59 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type ContractDeploymentDetails = { + txHash: string; + /** + * The address that initiated the transaction which deployed this contract. + */ + deployerAddress: string; + /** + * The contract address which deployed this contract via smart contract. This field is only populated when the contract was deployed as part of smart contract execution. + */ + deployerContractAddress?: string | undefined; +}; + +/** @internal */ +export const ContractDeploymentDetails$inboundSchema: z.ZodType< + ContractDeploymentDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + deployerAddress: z.string(), + deployerContractAddress: z.string().optional(), +}); + +/** @internal */ +export type ContractDeploymentDetails$Outbound = { + txHash: string; + deployerAddress: string; + deployerContractAddress?: string | undefined; +}; + +/** @internal */ +export const ContractDeploymentDetails$outboundSchema: z.ZodType< + ContractDeploymentDetails$Outbound, + z.ZodTypeDef, + ContractDeploymentDetails +> = z.object({ + txHash: z.string(), + deployerAddress: z.string(), + deployerContractAddress: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ContractDeploymentDetails$ { + /** @deprecated use `ContractDeploymentDetails$inboundSchema` instead. */ + export const inboundSchema = ContractDeploymentDetails$inboundSchema; + /** @deprecated use `ContractDeploymentDetails$outboundSchema` instead. */ + export const outboundSchema = ContractDeploymentDetails$outboundSchema; + /** @deprecated use `ContractDeploymentDetails$Outbound` instead. */ + export type Outbound = ContractDeploymentDetails$Outbound; +} diff --git a/src/models/components/createevmtransactionexportrequest.ts b/src/models/components/createevmtransactionexportrequest.ts new file mode 100644 index 0000000..34616be --- /dev/null +++ b/src/models/components/createevmtransactionexportrequest.ts @@ -0,0 +1,82 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + EvmNetworkOptions, + EvmNetworkOptions$inboundSchema, + EvmNetworkOptions$Outbound, + EvmNetworkOptions$outboundSchema, +} from "./evmnetworkoptions.js"; +import { + EVMOperationType, + EVMOperationType$inboundSchema, + EVMOperationType$outboundSchema, +} from "./evmoperationtype.js"; +import * as z from "zod"; + +export type CreateEvmTransactionExportRequest = { + type: EVMOperationType; + firstDate: string; + lastDate: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + startDate: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + endDate: string; + options: EvmNetworkOptions; +}; + +/** @internal */ +export const CreateEvmTransactionExportRequest$inboundSchema: z.ZodType< + CreateEvmTransactionExportRequest, + z.ZodTypeDef, + unknown +> = z.object({ + type: EVMOperationType$inboundSchema, + firstDate: z.string(), + lastDate: z.string(), + startDate: z.string(), + endDate: z.string(), + options: EvmNetworkOptions$inboundSchema, +}); + +/** @internal */ +export type CreateEvmTransactionExportRequest$Outbound = { + type: string; + firstDate: string; + lastDate: string; + startDate: string; + endDate: string; + options: EvmNetworkOptions$Outbound; +}; + +/** @internal */ +export const CreateEvmTransactionExportRequest$outboundSchema: z.ZodType< + CreateEvmTransactionExportRequest$Outbound, + z.ZodTypeDef, + CreateEvmTransactionExportRequest +> = z.object({ + type: EVMOperationType$outboundSchema, + firstDate: z.string(), + lastDate: z.string(), + startDate: z.string(), + endDate: z.string(), + options: EvmNetworkOptions$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateEvmTransactionExportRequest$ { + /** @deprecated use `CreateEvmTransactionExportRequest$inboundSchema` instead. */ + export const inboundSchema = CreateEvmTransactionExportRequest$inboundSchema; + /** @deprecated use `CreateEvmTransactionExportRequest$outboundSchema` instead. */ + export const outboundSchema = CreateEvmTransactionExportRequest$outboundSchema; + /** @deprecated use `CreateEvmTransactionExportRequest$Outbound` instead. */ + export type Outbound = CreateEvmTransactionExportRequest$Outbound; +} diff --git a/src/models/components/createprimarynetworktransactionexportrequest.ts b/src/models/components/createprimarynetworktransactionexportrequest.ts new file mode 100644 index 0000000..e3db144 --- /dev/null +++ b/src/models/components/createprimarynetworktransactionexportrequest.ts @@ -0,0 +1,82 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkOperationType, + PrimaryNetworkOperationType$inboundSchema, + PrimaryNetworkOperationType$outboundSchema, +} from "./primarynetworkoperationtype.js"; +import { + PrimaryNetworkOptions, + PrimaryNetworkOptions$inboundSchema, + PrimaryNetworkOptions$Outbound, + PrimaryNetworkOptions$outboundSchema, +} from "./primarynetworkoptions.js"; +import * as z from "zod"; + +export type CreatePrimaryNetworkTransactionExportRequest = { + type: PrimaryNetworkOperationType; + firstDate: string; + lastDate: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + startDate: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + endDate: string; + options: PrimaryNetworkOptions; +}; + +/** @internal */ +export const CreatePrimaryNetworkTransactionExportRequest$inboundSchema: z.ZodType< + CreatePrimaryNetworkTransactionExportRequest, + z.ZodTypeDef, + unknown +> = z.object({ + type: PrimaryNetworkOperationType$inboundSchema, + firstDate: z.string(), + lastDate: z.string(), + startDate: z.string(), + endDate: z.string(), + options: PrimaryNetworkOptions$inboundSchema, +}); + +/** @internal */ +export type CreatePrimaryNetworkTransactionExportRequest$Outbound = { + type: string; + firstDate: string; + lastDate: string; + startDate: string; + endDate: string; + options: PrimaryNetworkOptions$Outbound; +}; + +/** @internal */ +export const CreatePrimaryNetworkTransactionExportRequest$outboundSchema: z.ZodType< + CreatePrimaryNetworkTransactionExportRequest$Outbound, + z.ZodTypeDef, + CreatePrimaryNetworkTransactionExportRequest +> = z.object({ + type: PrimaryNetworkOperationType$outboundSchema, + firstDate: z.string(), + lastDate: z.string(), + startDate: z.string(), + endDate: z.string(), + options: PrimaryNetworkOptions$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreatePrimaryNetworkTransactionExportRequest$ { + /** @deprecated use `CreatePrimaryNetworkTransactionExportRequest$inboundSchema` instead. */ + export const inboundSchema = CreatePrimaryNetworkTransactionExportRequest$inboundSchema; + /** @deprecated use `CreatePrimaryNetworkTransactionExportRequest$outboundSchema` instead. */ + export const outboundSchema = CreatePrimaryNetworkTransactionExportRequest$outboundSchema; + /** @deprecated use `CreatePrimaryNetworkTransactionExportRequest$Outbound` instead. */ + export type Outbound = CreatePrimaryNetworkTransactionExportRequest$Outbound; +} diff --git a/src/models/components/createwebhookrequest.ts b/src/models/components/createwebhookrequest.ts new file mode 100644 index 0000000..b002c81 --- /dev/null +++ b/src/models/components/createwebhookrequest.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AddressActivityMetadata, + AddressActivityMetadata$inboundSchema, + AddressActivityMetadata$Outbound, + AddressActivityMetadata$outboundSchema, +} from "./addressactivitymetadata.js"; +import { EventType, EventType$inboundSchema, EventType$outboundSchema } from "./eventtype.js"; +import * as z from "zod"; + +export type CreateWebhookRequestMetadata = AddressActivityMetadata; + +export type CreateWebhookRequest = { + url: string; + chainId: string; + eventType: EventType; + metadata: AddressActivityMetadata; + name?: string | undefined; + description?: string | undefined; + /** + * Whether to include traces in the webhook payload. + */ + includeInternalTxs?: boolean | undefined; + /** + * Whether to include logs in the webhook payload. + */ + includeLogs?: boolean | undefined; +}; + +/** @internal */ +export const CreateWebhookRequestMetadata$inboundSchema: z.ZodType< + CreateWebhookRequestMetadata, + z.ZodTypeDef, + unknown +> = AddressActivityMetadata$inboundSchema; + +/** @internal */ +export type CreateWebhookRequestMetadata$Outbound = AddressActivityMetadata$Outbound; + +/** @internal */ +export const CreateWebhookRequestMetadata$outboundSchema: z.ZodType< + CreateWebhookRequestMetadata$Outbound, + z.ZodTypeDef, + CreateWebhookRequestMetadata +> = AddressActivityMetadata$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWebhookRequestMetadata$ { + /** @deprecated use `CreateWebhookRequestMetadata$inboundSchema` instead. */ + export const inboundSchema = CreateWebhookRequestMetadata$inboundSchema; + /** @deprecated use `CreateWebhookRequestMetadata$outboundSchema` instead. */ + export const outboundSchema = CreateWebhookRequestMetadata$outboundSchema; + /** @deprecated use `CreateWebhookRequestMetadata$Outbound` instead. */ + export type Outbound = CreateWebhookRequestMetadata$Outbound; +} + +/** @internal */ +export const CreateWebhookRequest$inboundSchema: z.ZodType< + CreateWebhookRequest, + z.ZodTypeDef, + unknown +> = z.object({ + url: z.string(), + chainId: z.string(), + eventType: EventType$inboundSchema, + metadata: AddressActivityMetadata$inboundSchema, + name: z.string().optional(), + description: z.string().optional(), + includeInternalTxs: z.boolean().optional(), + includeLogs: z.boolean().optional(), +}); + +/** @internal */ +export type CreateWebhookRequest$Outbound = { + url: string; + chainId: string; + eventType: string; + metadata: AddressActivityMetadata$Outbound; + name?: string | undefined; + description?: string | undefined; + includeInternalTxs?: boolean | undefined; + includeLogs?: boolean | undefined; +}; + +/** @internal */ +export const CreateWebhookRequest$outboundSchema: z.ZodType< + CreateWebhookRequest$Outbound, + z.ZodTypeDef, + CreateWebhookRequest +> = z.object({ + url: z.string(), + chainId: z.string(), + eventType: EventType$outboundSchema, + metadata: AddressActivityMetadata$outboundSchema, + name: z.string().optional(), + description: z.string().optional(), + includeInternalTxs: z.boolean().optional(), + includeLogs: z.boolean().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWebhookRequest$ { + /** @deprecated use `CreateWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = CreateWebhookRequest$inboundSchema; + /** @deprecated use `CreateWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = CreateWebhookRequest$outboundSchema; + /** @deprecated use `CreateWebhookRequest$Outbound` instead. */ + export type Outbound = CreateWebhookRequest$Outbound; +} diff --git a/src/models/components/currencycode.ts b/src/models/components/currencycode.ts new file mode 100644 index 0000000..003518b --- /dev/null +++ b/src/models/components/currencycode.ts @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * ISO 4217 currency code. + */ +export const CurrencyCode = { + Usd: "usd", + Eur: "eur", + Aud: "aud", + Cad: "cad", + Chf: "chf", + Clp: "clp", + Cny: "cny", + Czk: "czk", + Dkk: "dkk", + Gbp: "gbp", + Hkd: "hkd", + Huf: "huf", + Jpy: "jpy", + Nzd: "nzd", +} as const; +/** + * ISO 4217 currency code. + */ +export type CurrencyCode = ClosedEnum; + +/** @internal */ +export const CurrencyCode$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(CurrencyCode); + +/** @internal */ +export const CurrencyCode$outboundSchema: z.ZodNativeEnum = + CurrencyCode$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CurrencyCode$ { + /** @deprecated use `CurrencyCode$inboundSchema` instead. */ + export const inboundSchema = CurrencyCode$inboundSchema; + /** @deprecated use `CurrencyCode$outboundSchema` instead. */ + export const outboundSchema = CurrencyCode$outboundSchema; +} diff --git a/src/models/components/delegationstatustype.ts b/src/models/components/delegationstatustype.ts new file mode 100644 index 0000000..e53f8c8 --- /dev/null +++ b/src/models/components/delegationstatustype.ts @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const DelegationStatusType = { + Completed: "completed", + Active: "active", + Pending: "pending", +} as const; +export type DelegationStatusType = ClosedEnum; + +/** @internal */ +export const DelegationStatusType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(DelegationStatusType); + +/** @internal */ +export const DelegationStatusType$outboundSchema: z.ZodNativeEnum = + DelegationStatusType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DelegationStatusType$ { + /** @deprecated use `DelegationStatusType$inboundSchema` instead. */ + export const inboundSchema = DelegationStatusType$inboundSchema; + /** @deprecated use `DelegationStatusType$outboundSchema` instead. */ + export const outboundSchema = DelegationStatusType$outboundSchema; +} diff --git a/src/models/components/delegatorsdetails.ts b/src/models/components/delegatorsdetails.ts new file mode 100644 index 0000000..aa26497 --- /dev/null +++ b/src/models/components/delegatorsdetails.ts @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type DelegatorsDetails = { + delegatorCount: number; + totalAmountStaked: string; +}; + +/** @internal */ +export const DelegatorsDetails$inboundSchema: z.ZodType = + z.object({ + delegatorCount: z.number(), + totalAmountStaked: z.string(), + }); + +/** @internal */ +export type DelegatorsDetails$Outbound = { + delegatorCount: number; + totalAmountStaked: string; +}; + +/** @internal */ +export const DelegatorsDetails$outboundSchema: z.ZodType< + DelegatorsDetails$Outbound, + z.ZodTypeDef, + DelegatorsDetails +> = z.object({ + delegatorCount: z.number(), + totalAmountStaked: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DelegatorsDetails$ { + /** @deprecated use `DelegatorsDetails$inboundSchema` instead. */ + export const inboundSchema = DelegatorsDetails$inboundSchema; + /** @deprecated use `DelegatorsDetails$outboundSchema` instead. */ + export const outboundSchema = DelegatorsDetails$outboundSchema; + /** @deprecated use `DelegatorsDetails$Outbound` instead. */ + export type Outbound = DelegatorsDetails$Outbound; +} diff --git a/src/models/components/deliveredsourcenotindexedteleportermessage.ts b/src/models/components/deliveredsourcenotindexedteleportermessage.ts new file mode 100644 index 0000000..18b60ee --- /dev/null +++ b/src/models/components/deliveredsourcenotindexedteleportermessage.ts @@ -0,0 +1,152 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + TeleporterDestinationTransaction, + TeleporterDestinationTransaction$inboundSchema, + TeleporterDestinationTransaction$Outbound, + TeleporterDestinationTransaction$outboundSchema, +} from "./teleporterdestinationtransaction.js"; +import { + TeleporterReceipt, + TeleporterReceipt$inboundSchema, + TeleporterReceipt$Outbound, + TeleporterReceipt$outboundSchema, +} from "./teleporterreceipt.js"; +import { + TeleporterRewardDetails, + TeleporterRewardDetails$inboundSchema, + TeleporterRewardDetails$Outbound, + TeleporterRewardDetails$outboundSchema, +} from "./teleporterrewarddetails.js"; +import * as z from "zod"; + +export const DeliveredSourceNotIndexedTeleporterMessageStatus = { + DeliveredSourceNotIndexed: "delivered_source_not_indexed", +} as const; +export type DeliveredSourceNotIndexedTeleporterMessageStatus = ClosedEnum< + typeof DeliveredSourceNotIndexedTeleporterMessageStatus +>; + +export type DeliveredSourceNotIndexedTeleporterMessage = { + messageId: string; + teleporterContractAddress: string; + sourceBlockchainId: string; + destinationBlockchainId: string; + sourceEvmChainId: string; + destinationEvmChainId: string; + messageNonce: string; + from: string; + to: string; + data?: string | undefined; + messageExecuted: boolean; + receipts: Array; + receiptDelivered: boolean; + rewardDetails: TeleporterRewardDetails; + destinationTransaction: TeleporterDestinationTransaction; + status: DeliveredSourceNotIndexedTeleporterMessageStatus; +}; + +/** @internal */ +export const DeliveredSourceNotIndexedTeleporterMessageStatus$inboundSchema: z.ZodNativeEnum< + typeof DeliveredSourceNotIndexedTeleporterMessageStatus +> = z.nativeEnum(DeliveredSourceNotIndexedTeleporterMessageStatus); + +/** @internal */ +export const DeliveredSourceNotIndexedTeleporterMessageStatus$outboundSchema: z.ZodNativeEnum< + typeof DeliveredSourceNotIndexedTeleporterMessageStatus +> = DeliveredSourceNotIndexedTeleporterMessageStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeliveredSourceNotIndexedTeleporterMessageStatus$ { + /** @deprecated use `DeliveredSourceNotIndexedTeleporterMessageStatus$inboundSchema` instead. */ + export const inboundSchema = DeliveredSourceNotIndexedTeleporterMessageStatus$inboundSchema; + /** @deprecated use `DeliveredSourceNotIndexedTeleporterMessageStatus$outboundSchema` instead. */ + export const outboundSchema = DeliveredSourceNotIndexedTeleporterMessageStatus$outboundSchema; +} + +/** @internal */ +export const DeliveredSourceNotIndexedTeleporterMessage$inboundSchema: z.ZodType< + DeliveredSourceNotIndexedTeleporterMessage, + z.ZodTypeDef, + unknown +> = z.object({ + messageId: z.string(), + teleporterContractAddress: z.string(), + sourceBlockchainId: z.string(), + destinationBlockchainId: z.string(), + sourceEvmChainId: z.string(), + destinationEvmChainId: z.string(), + messageNonce: z.string(), + from: z.string(), + to: z.string(), + data: z.string().optional(), + messageExecuted: z.boolean(), + receipts: z.array(TeleporterReceipt$inboundSchema), + receiptDelivered: z.boolean(), + rewardDetails: TeleporterRewardDetails$inboundSchema, + destinationTransaction: TeleporterDestinationTransaction$inboundSchema, + status: DeliveredSourceNotIndexedTeleporterMessageStatus$inboundSchema, +}); + +/** @internal */ +export type DeliveredSourceNotIndexedTeleporterMessage$Outbound = { + messageId: string; + teleporterContractAddress: string; + sourceBlockchainId: string; + destinationBlockchainId: string; + sourceEvmChainId: string; + destinationEvmChainId: string; + messageNonce: string; + from: string; + to: string; + data?: string | undefined; + messageExecuted: boolean; + receipts: Array; + receiptDelivered: boolean; + rewardDetails: TeleporterRewardDetails$Outbound; + destinationTransaction: TeleporterDestinationTransaction$Outbound; + status: string; +}; + +/** @internal */ +export const DeliveredSourceNotIndexedTeleporterMessage$outboundSchema: z.ZodType< + DeliveredSourceNotIndexedTeleporterMessage$Outbound, + z.ZodTypeDef, + DeliveredSourceNotIndexedTeleporterMessage +> = z.object({ + messageId: z.string(), + teleporterContractAddress: z.string(), + sourceBlockchainId: z.string(), + destinationBlockchainId: z.string(), + sourceEvmChainId: z.string(), + destinationEvmChainId: z.string(), + messageNonce: z.string(), + from: z.string(), + to: z.string(), + data: z.string().optional(), + messageExecuted: z.boolean(), + receipts: z.array(TeleporterReceipt$outboundSchema), + receiptDelivered: z.boolean(), + rewardDetails: TeleporterRewardDetails$outboundSchema, + destinationTransaction: TeleporterDestinationTransaction$outboundSchema, + status: DeliveredSourceNotIndexedTeleporterMessageStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeliveredSourceNotIndexedTeleporterMessage$ { + /** @deprecated use `DeliveredSourceNotIndexedTeleporterMessage$inboundSchema` instead. */ + export const inboundSchema = DeliveredSourceNotIndexedTeleporterMessage$inboundSchema; + /** @deprecated use `DeliveredSourceNotIndexedTeleporterMessage$outboundSchema` instead. */ + export const outboundSchema = DeliveredSourceNotIndexedTeleporterMessage$outboundSchema; + /** @deprecated use `DeliveredSourceNotIndexedTeleporterMessage$Outbound` instead. */ + export type Outbound = DeliveredSourceNotIndexedTeleporterMessage$Outbound; +} diff --git a/src/models/components/deliveredteleportermessage.ts b/src/models/components/deliveredteleportermessage.ts new file mode 100644 index 0000000..dae9d0a --- /dev/null +++ b/src/models/components/deliveredteleportermessage.ts @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + TeleporterDestinationTransaction, + TeleporterDestinationTransaction$inboundSchema, + TeleporterDestinationTransaction$Outbound, + TeleporterDestinationTransaction$outboundSchema, +} from "./teleporterdestinationtransaction.js"; +import { + TeleporterReceipt, + TeleporterReceipt$inboundSchema, + TeleporterReceipt$Outbound, + TeleporterReceipt$outboundSchema, +} from "./teleporterreceipt.js"; +import { + TeleporterRewardDetails, + TeleporterRewardDetails$inboundSchema, + TeleporterRewardDetails$Outbound, + TeleporterRewardDetails$outboundSchema, +} from "./teleporterrewarddetails.js"; +import { + TeleporterSourceTransaction, + TeleporterSourceTransaction$inboundSchema, + TeleporterSourceTransaction$Outbound, + TeleporterSourceTransaction$outboundSchema, +} from "./teleportersourcetransaction.js"; +import * as z from "zod"; + +export const DeliveredTeleporterMessageStatus = { + Delivered: "delivered", +} as const; +export type DeliveredTeleporterMessageStatus = ClosedEnum; + +export type DeliveredTeleporterMessage = { + messageId: string; + teleporterContractAddress: string; + sourceBlockchainId: string; + destinationBlockchainId: string; + sourceEvmChainId: string; + destinationEvmChainId: string; + messageNonce: string; + from: string; + to: string; + data?: string | undefined; + messageExecuted: boolean; + receipts: Array; + receiptDelivered: boolean; + rewardDetails: TeleporterRewardDetails; + sourceTransaction: TeleporterSourceTransaction; + destinationTransaction: TeleporterDestinationTransaction; + status: DeliveredTeleporterMessageStatus; +}; + +/** @internal */ +export const DeliveredTeleporterMessageStatus$inboundSchema: z.ZodNativeEnum< + typeof DeliveredTeleporterMessageStatus +> = z.nativeEnum(DeliveredTeleporterMessageStatus); + +/** @internal */ +export const DeliveredTeleporterMessageStatus$outboundSchema: z.ZodNativeEnum< + typeof DeliveredTeleporterMessageStatus +> = DeliveredTeleporterMessageStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeliveredTeleporterMessageStatus$ { + /** @deprecated use `DeliveredTeleporterMessageStatus$inboundSchema` instead. */ + export const inboundSchema = DeliveredTeleporterMessageStatus$inboundSchema; + /** @deprecated use `DeliveredTeleporterMessageStatus$outboundSchema` instead. */ + export const outboundSchema = DeliveredTeleporterMessageStatus$outboundSchema; +} + +/** @internal */ +export const DeliveredTeleporterMessage$inboundSchema: z.ZodType< + DeliveredTeleporterMessage, + z.ZodTypeDef, + unknown +> = z.object({ + messageId: z.string(), + teleporterContractAddress: z.string(), + sourceBlockchainId: z.string(), + destinationBlockchainId: z.string(), + sourceEvmChainId: z.string(), + destinationEvmChainId: z.string(), + messageNonce: z.string(), + from: z.string(), + to: z.string(), + data: z.string().optional(), + messageExecuted: z.boolean(), + receipts: z.array(TeleporterReceipt$inboundSchema), + receiptDelivered: z.boolean(), + rewardDetails: TeleporterRewardDetails$inboundSchema, + sourceTransaction: TeleporterSourceTransaction$inboundSchema, + destinationTransaction: TeleporterDestinationTransaction$inboundSchema, + status: DeliveredTeleporterMessageStatus$inboundSchema, +}); + +/** @internal */ +export type DeliveredTeleporterMessage$Outbound = { + messageId: string; + teleporterContractAddress: string; + sourceBlockchainId: string; + destinationBlockchainId: string; + sourceEvmChainId: string; + destinationEvmChainId: string; + messageNonce: string; + from: string; + to: string; + data?: string | undefined; + messageExecuted: boolean; + receipts: Array; + receiptDelivered: boolean; + rewardDetails: TeleporterRewardDetails$Outbound; + sourceTransaction: TeleporterSourceTransaction$Outbound; + destinationTransaction: TeleporterDestinationTransaction$Outbound; + status: string; +}; + +/** @internal */ +export const DeliveredTeleporterMessage$outboundSchema: z.ZodType< + DeliveredTeleporterMessage$Outbound, + z.ZodTypeDef, + DeliveredTeleporterMessage +> = z.object({ + messageId: z.string(), + teleporterContractAddress: z.string(), + sourceBlockchainId: z.string(), + destinationBlockchainId: z.string(), + sourceEvmChainId: z.string(), + destinationEvmChainId: z.string(), + messageNonce: z.string(), + from: z.string(), + to: z.string(), + data: z.string().optional(), + messageExecuted: z.boolean(), + receipts: z.array(TeleporterReceipt$outboundSchema), + receiptDelivered: z.boolean(), + rewardDetails: TeleporterRewardDetails$outboundSchema, + sourceTransaction: TeleporterSourceTransaction$outboundSchema, + destinationTransaction: TeleporterDestinationTransaction$outboundSchema, + status: DeliveredTeleporterMessageStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeliveredTeleporterMessage$ { + /** @deprecated use `DeliveredTeleporterMessage$inboundSchema` instead. */ + export const inboundSchema = DeliveredTeleporterMessage$inboundSchema; + /** @deprecated use `DeliveredTeleporterMessage$outboundSchema` instead. */ + export const outboundSchema = DeliveredTeleporterMessage$outboundSchema; + /** @deprecated use `DeliveredTeleporterMessage$Outbound` instead. */ + export type Outbound = DeliveredTeleporterMessage$Outbound; +} diff --git a/src/models/components/erc1155contract.ts b/src/models/components/erc1155contract.ts new file mode 100644 index 0000000..55fbcc6 --- /dev/null +++ b/src/models/components/erc1155contract.ts @@ -0,0 +1,152 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + ContractDeploymentDetails, + ContractDeploymentDetails$inboundSchema, + ContractDeploymentDetails$Outbound, + ContractDeploymentDetails$outboundSchema, +} from "./contractdeploymentdetails.js"; +import { + ImageAsset, + ImageAsset$inboundSchema, + ImageAsset$Outbound, + ImageAsset$outboundSchema, +} from "./imageasset.js"; +import { + PricingProviders, + PricingProviders$inboundSchema, + PricingProviders$Outbound, + PricingProviders$outboundSchema, +} from "./pricingproviders.js"; +import { + ResourceLink, + ResourceLink$inboundSchema, + ResourceLink$Outbound, + ResourceLink$outboundSchema, +} from "./resourcelink.js"; +import * as z from "zod"; + +export const Erc1155ContractErcType = { + Erc1155: "ERC-1155", +} as const; +export type Erc1155ContractErcType = ClosedEnum; + +export type Erc1155Contract = { + /** + * The contract name. + */ + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset | undefined; + bannerAsset?: ImageAsset | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + deploymentDetails: ContractDeploymentDetails; + ercType: Erc1155ContractErcType; + /** + * The contract symbol. + */ + symbol?: string | undefined; + pricingProviders?: PricingProviders | undefined; +}; + +/** @internal */ +export const Erc1155ContractErcType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(Erc1155ContractErcType); + +/** @internal */ +export const Erc1155ContractErcType$outboundSchema: z.ZodNativeEnum = + Erc1155ContractErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155ContractErcType$ { + /** @deprecated use `Erc1155ContractErcType$inboundSchema` instead. */ + export const inboundSchema = Erc1155ContractErcType$inboundSchema; + /** @deprecated use `Erc1155ContractErcType$outboundSchema` instead. */ + export const outboundSchema = Erc1155ContractErcType$outboundSchema; +} + +/** @internal */ +export const Erc1155Contract$inboundSchema: z.ZodType = + z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$inboundSchema.optional(), + bannerAsset: ImageAsset$inboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$inboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$inboundSchema, + ercType: Erc1155ContractErcType$inboundSchema, + symbol: z.string().optional(), + pricingProviders: PricingProviders$inboundSchema.optional(), + }); + +/** @internal */ +export type Erc1155Contract$Outbound = { + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset$Outbound | undefined; + bannerAsset?: ImageAsset$Outbound | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + address: string; + deploymentDetails: ContractDeploymentDetails$Outbound; + ercType: string; + symbol?: string | undefined; + pricingProviders?: PricingProviders$Outbound | undefined; +}; + +/** @internal */ +export const Erc1155Contract$outboundSchema: z.ZodType< + Erc1155Contract$Outbound, + z.ZodTypeDef, + Erc1155Contract +> = z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$outboundSchema.optional(), + bannerAsset: ImageAsset$outboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$outboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$outboundSchema, + ercType: Erc1155ContractErcType$outboundSchema, + symbol: z.string().optional(), + pricingProviders: PricingProviders$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155Contract$ { + /** @deprecated use `Erc1155Contract$inboundSchema` instead. */ + export const inboundSchema = Erc1155Contract$inboundSchema; + /** @deprecated use `Erc1155Contract$outboundSchema` instead. */ + export const outboundSchema = Erc1155Contract$outboundSchema; + /** @deprecated use `Erc1155Contract$Outbound` instead. */ + export type Outbound = Erc1155Contract$Outbound; +} diff --git a/src/models/components/erc1155token.ts b/src/models/components/erc1155token.ts new file mode 100644 index 0000000..1b266ba --- /dev/null +++ b/src/models/components/erc1155token.ts @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + Erc1155TokenMetadata, + Erc1155TokenMetadata$inboundSchema, + Erc1155TokenMetadata$Outbound, + Erc1155TokenMetadata$outboundSchema, +} from "./erc1155tokenmetadata.js"; +import * as z from "zod"; + +export const Erc1155TokenErcType = { + Erc1155: "ERC-1155", +} as const; +export type Erc1155TokenErcType = ClosedEnum; + +export type Erc1155Token = { + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + ercType: Erc1155TokenErcType; + tokenId: string; + tokenUri: string; + metadata: Erc1155TokenMetadata; +}; + +/** @internal */ +export const Erc1155TokenErcType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(Erc1155TokenErcType); + +/** @internal */ +export const Erc1155TokenErcType$outboundSchema: z.ZodNativeEnum = + Erc1155TokenErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155TokenErcType$ { + /** @deprecated use `Erc1155TokenErcType$inboundSchema` instead. */ + export const inboundSchema = Erc1155TokenErcType$inboundSchema; + /** @deprecated use `Erc1155TokenErcType$outboundSchema` instead. */ + export const outboundSchema = Erc1155TokenErcType$outboundSchema; +} + +/** @internal */ +export const Erc1155Token$inboundSchema: z.ZodType = z.object({ + address: z.string(), + ercType: Erc1155TokenErcType$inboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc1155TokenMetadata$inboundSchema, +}); + +/** @internal */ +export type Erc1155Token$Outbound = { + address: string; + ercType: string; + tokenId: string; + tokenUri: string; + metadata: Erc1155TokenMetadata$Outbound; +}; + +/** @internal */ +export const Erc1155Token$outboundSchema: z.ZodType< + Erc1155Token$Outbound, + z.ZodTypeDef, + Erc1155Token +> = z.object({ + address: z.string(), + ercType: Erc1155TokenErcType$outboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc1155TokenMetadata$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155Token$ { + /** @deprecated use `Erc1155Token$inboundSchema` instead. */ + export const inboundSchema = Erc1155Token$inboundSchema; + /** @deprecated use `Erc1155Token$outboundSchema` instead. */ + export const outboundSchema = Erc1155Token$outboundSchema; + /** @deprecated use `Erc1155Token$Outbound` instead. */ + export type Outbound = Erc1155Token$Outbound; +} diff --git a/src/models/components/erc1155tokenbalance.ts b/src/models/components/erc1155tokenbalance.ts new file mode 100644 index 0000000..d5644ed --- /dev/null +++ b/src/models/components/erc1155tokenbalance.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + Erc1155TokenMetadata, + Erc1155TokenMetadata$inboundSchema, + Erc1155TokenMetadata$Outbound, + Erc1155TokenMetadata$outboundSchema, +} from "./erc1155tokenmetadata.js"; +import * as z from "zod"; + +export const Erc1155TokenBalanceErcType = { + Erc1155: "ERC-1155", +} as const; +export type Erc1155TokenBalanceErcType = ClosedEnum; + +export type Erc1155TokenBalance = { + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + ercType: Erc1155TokenBalanceErcType; + tokenId: string; + tokenUri: string; + metadata: Erc1155TokenMetadata; + /** + * The evm chain id. + */ + chainId: string; + /** + * The address balance for the token, in units specified by the `decimals` value for the contract. + */ + balance: string; +}; + +/** @internal */ +export const Erc1155TokenBalanceErcType$inboundSchema: z.ZodNativeEnum< + typeof Erc1155TokenBalanceErcType +> = z.nativeEnum(Erc1155TokenBalanceErcType); + +/** @internal */ +export const Erc1155TokenBalanceErcType$outboundSchema: z.ZodNativeEnum< + typeof Erc1155TokenBalanceErcType +> = Erc1155TokenBalanceErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155TokenBalanceErcType$ { + /** @deprecated use `Erc1155TokenBalanceErcType$inboundSchema` instead. */ + export const inboundSchema = Erc1155TokenBalanceErcType$inboundSchema; + /** @deprecated use `Erc1155TokenBalanceErcType$outboundSchema` instead. */ + export const outboundSchema = Erc1155TokenBalanceErcType$outboundSchema; +} + +/** @internal */ +export const Erc1155TokenBalance$inboundSchema: z.ZodType< + Erc1155TokenBalance, + z.ZodTypeDef, + unknown +> = z.object({ + address: z.string(), + ercType: Erc1155TokenBalanceErcType$inboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc1155TokenMetadata$inboundSchema, + chainId: z.string(), + balance: z.string(), +}); + +/** @internal */ +export type Erc1155TokenBalance$Outbound = { + address: string; + ercType: string; + tokenId: string; + tokenUri: string; + metadata: Erc1155TokenMetadata$Outbound; + chainId: string; + balance: string; +}; + +/** @internal */ +export const Erc1155TokenBalance$outboundSchema: z.ZodType< + Erc1155TokenBalance$Outbound, + z.ZodTypeDef, + Erc1155TokenBalance +> = z.object({ + address: z.string(), + ercType: Erc1155TokenBalanceErcType$outboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc1155TokenMetadata$outboundSchema, + chainId: z.string(), + balance: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155TokenBalance$ { + /** @deprecated use `Erc1155TokenBalance$inboundSchema` instead. */ + export const inboundSchema = Erc1155TokenBalance$inboundSchema; + /** @deprecated use `Erc1155TokenBalance$outboundSchema` instead. */ + export const outboundSchema = Erc1155TokenBalance$outboundSchema; + /** @deprecated use `Erc1155TokenBalance$Outbound` instead. */ + export type Outbound = Erc1155TokenBalance$Outbound; +} diff --git a/src/models/components/erc1155tokenmetadata.ts b/src/models/components/erc1155tokenmetadata.ts new file mode 100644 index 0000000..a4768cc --- /dev/null +++ b/src/models/components/erc1155tokenmetadata.ts @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + NftTokenMetadataStatus, + NftTokenMetadataStatus$inboundSchema, + NftTokenMetadataStatus$outboundSchema, +} from "./nfttokenmetadatastatus.js"; +import * as z from "zod"; + +export type Erc1155TokenMetadata = { + /** + * The metadata indexing status of the nft. + */ + indexStatus: NftTokenMetadataStatus; + metadataLastUpdatedTimestamp?: number | undefined; + name?: string | undefined; + symbol?: string | undefined; + imageUri?: string | undefined; + description?: string | undefined; + animationUri?: string | undefined; + externalUrl?: string | undefined; + background?: string | undefined; + decimals?: number | undefined; + properties?: string | undefined; +}; + +/** @internal */ +export const Erc1155TokenMetadata$inboundSchema: z.ZodType< + Erc1155TokenMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + indexStatus: NftTokenMetadataStatus$inboundSchema, + metadataLastUpdatedTimestamp: z.number().optional(), + name: z.string().optional(), + symbol: z.string().optional(), + imageUri: z.string().optional(), + description: z.string().optional(), + animationUri: z.string().optional(), + externalUrl: z.string().optional(), + background: z.string().optional(), + decimals: z.number().optional(), + properties: z.string().optional(), +}); + +/** @internal */ +export type Erc1155TokenMetadata$Outbound = { + indexStatus: string; + metadataLastUpdatedTimestamp?: number | undefined; + name?: string | undefined; + symbol?: string | undefined; + imageUri?: string | undefined; + description?: string | undefined; + animationUri?: string | undefined; + externalUrl?: string | undefined; + background?: string | undefined; + decimals?: number | undefined; + properties?: string | undefined; +}; + +/** @internal */ +export const Erc1155TokenMetadata$outboundSchema: z.ZodType< + Erc1155TokenMetadata$Outbound, + z.ZodTypeDef, + Erc1155TokenMetadata +> = z.object({ + indexStatus: NftTokenMetadataStatus$outboundSchema, + metadataLastUpdatedTimestamp: z.number().optional(), + name: z.string().optional(), + symbol: z.string().optional(), + imageUri: z.string().optional(), + description: z.string().optional(), + animationUri: z.string().optional(), + externalUrl: z.string().optional(), + background: z.string().optional(), + decimals: z.number().optional(), + properties: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155TokenMetadata$ { + /** @deprecated use `Erc1155TokenMetadata$inboundSchema` instead. */ + export const inboundSchema = Erc1155TokenMetadata$inboundSchema; + /** @deprecated use `Erc1155TokenMetadata$outboundSchema` instead. */ + export const outboundSchema = Erc1155TokenMetadata$outboundSchema; + /** @deprecated use `Erc1155TokenMetadata$Outbound` instead. */ + export type Outbound = Erc1155TokenMetadata$Outbound; +} diff --git a/src/models/components/erc1155transfer.ts b/src/models/components/erc1155transfer.ts new file mode 100644 index 0000000..0f8e975 --- /dev/null +++ b/src/models/components/erc1155transfer.ts @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155Token, + Erc1155Token$inboundSchema, + Erc1155Token$Outbound, + Erc1155Token$outboundSchema, +} from "./erc1155token.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type Erc1155Transfer = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The transaction hash identifier. + */ + txHash: string; + from: RichAddress; + to: RichAddress; + logIndex: number; + value: string; + erc1155Token: Erc1155Token; +}; + +/** @internal */ +export const Erc1155Transfer$inboundSchema: z.ZodType = + z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + logIndex: z.number(), + value: z.string(), + erc1155Token: Erc1155Token$inboundSchema, + }); + +/** @internal */ +export type Erc1155Transfer$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + txHash: string; + from: RichAddress$Outbound; + to: RichAddress$Outbound; + logIndex: number; + value: string; + erc1155Token: Erc1155Token$Outbound; +}; + +/** @internal */ +export const Erc1155Transfer$outboundSchema: z.ZodType< + Erc1155Transfer$Outbound, + z.ZodTypeDef, + Erc1155Transfer +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + logIndex: z.number(), + value: z.string(), + erc1155Token: Erc1155Token$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155Transfer$ { + /** @deprecated use `Erc1155Transfer$inboundSchema` instead. */ + export const inboundSchema = Erc1155Transfer$inboundSchema; + /** @deprecated use `Erc1155Transfer$outboundSchema` instead. */ + export const outboundSchema = Erc1155Transfer$outboundSchema; + /** @deprecated use `Erc1155Transfer$Outbound` instead. */ + export type Outbound = Erc1155Transfer$Outbound; +} diff --git a/src/models/components/erc1155transferdetails.ts b/src/models/components/erc1155transferdetails.ts new file mode 100644 index 0000000..c2660bf --- /dev/null +++ b/src/models/components/erc1155transferdetails.ts @@ -0,0 +1,73 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155Token, + Erc1155Token$inboundSchema, + Erc1155Token$Outbound, + Erc1155Token$outboundSchema, +} from "./erc1155token.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type Erc1155TransferDetails = { + from: RichAddress; + to: RichAddress; + logIndex: number; + value: string; + erc1155Token: Erc1155Token; +}; + +/** @internal */ +export const Erc1155TransferDetails$inboundSchema: z.ZodType< + Erc1155TransferDetails, + z.ZodTypeDef, + unknown +> = z.object({ + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + logIndex: z.number(), + value: z.string(), + erc1155Token: Erc1155Token$inboundSchema, +}); + +/** @internal */ +export type Erc1155TransferDetails$Outbound = { + from: RichAddress$Outbound; + to: RichAddress$Outbound; + logIndex: number; + value: string; + erc1155Token: Erc1155Token$Outbound; +}; + +/** @internal */ +export const Erc1155TransferDetails$outboundSchema: z.ZodType< + Erc1155TransferDetails$Outbound, + z.ZodTypeDef, + Erc1155TransferDetails +> = z.object({ + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + logIndex: z.number(), + value: z.string(), + erc1155Token: Erc1155Token$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc1155TransferDetails$ { + /** @deprecated use `Erc1155TransferDetails$inboundSchema` instead. */ + export const inboundSchema = Erc1155TransferDetails$inboundSchema; + /** @deprecated use `Erc1155TransferDetails$outboundSchema` instead. */ + export const outboundSchema = Erc1155TransferDetails$outboundSchema; + /** @deprecated use `Erc1155TransferDetails$Outbound` instead. */ + export type Outbound = Erc1155TransferDetails$Outbound; +} diff --git a/src/models/components/erc20contract.ts b/src/models/components/erc20contract.ts new file mode 100644 index 0000000..f0c1c57 --- /dev/null +++ b/src/models/components/erc20contract.ts @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + ContractDeploymentDetails, + ContractDeploymentDetails$inboundSchema, + ContractDeploymentDetails$Outbound, + ContractDeploymentDetails$outboundSchema, +} from "./contractdeploymentdetails.js"; +import { + ImageAsset, + ImageAsset$inboundSchema, + ImageAsset$Outbound, + ImageAsset$outboundSchema, +} from "./imageasset.js"; +import { + PricingProviders, + PricingProviders$inboundSchema, + PricingProviders$Outbound, + PricingProviders$outboundSchema, +} from "./pricingproviders.js"; +import { + ResourceLink, + ResourceLink$inboundSchema, + ResourceLink$Outbound, + ResourceLink$outboundSchema, +} from "./resourcelink.js"; +import * as z from "zod"; + +export const Erc20ContractErcType = { + Erc20: "ERC-20", +} as const; +export type Erc20ContractErcType = ClosedEnum; + +export type Erc20Contract = { + /** + * The contract name. + */ + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset | undefined; + bannerAsset?: ImageAsset | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + deploymentDetails: ContractDeploymentDetails; + ercType: Erc20ContractErcType; + /** + * The contract symbol. + */ + symbol?: string | undefined; + /** + * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. + */ + decimals: number; + pricingProviders?: PricingProviders | undefined; +}; + +/** @internal */ +export const Erc20ContractErcType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(Erc20ContractErcType); + +/** @internal */ +export const Erc20ContractErcType$outboundSchema: z.ZodNativeEnum = + Erc20ContractErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20ContractErcType$ { + /** @deprecated use `Erc20ContractErcType$inboundSchema` instead. */ + export const inboundSchema = Erc20ContractErcType$inboundSchema; + /** @deprecated use `Erc20ContractErcType$outboundSchema` instead. */ + export const outboundSchema = Erc20ContractErcType$outboundSchema; +} + +/** @internal */ +export const Erc20Contract$inboundSchema: z.ZodType = + z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$inboundSchema.optional(), + bannerAsset: ImageAsset$inboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$inboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$inboundSchema, + ercType: Erc20ContractErcType$inboundSchema, + symbol: z.string().optional(), + decimals: z.number(), + pricingProviders: PricingProviders$inboundSchema.optional(), + }); + +/** @internal */ +export type Erc20Contract$Outbound = { + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset$Outbound | undefined; + bannerAsset?: ImageAsset$Outbound | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + address: string; + deploymentDetails: ContractDeploymentDetails$Outbound; + ercType: string; + symbol?: string | undefined; + decimals: number; + pricingProviders?: PricingProviders$Outbound | undefined; +}; + +/** @internal */ +export const Erc20Contract$outboundSchema: z.ZodType< + Erc20Contract$Outbound, + z.ZodTypeDef, + Erc20Contract +> = z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$outboundSchema.optional(), + bannerAsset: ImageAsset$outboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$outboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$outboundSchema, + ercType: Erc20ContractErcType$outboundSchema, + symbol: z.string().optional(), + decimals: z.number(), + pricingProviders: PricingProviders$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20Contract$ { + /** @deprecated use `Erc20Contract$inboundSchema` instead. */ + export const inboundSchema = Erc20Contract$inboundSchema; + /** @deprecated use `Erc20Contract$outboundSchema` instead. */ + export const outboundSchema = Erc20Contract$outboundSchema; + /** @deprecated use `Erc20Contract$Outbound` instead. */ + export type Outbound = Erc20Contract$Outbound; +} diff --git a/src/models/components/erc20token.ts b/src/models/components/erc20token.ts new file mode 100644 index 0000000..b476670 --- /dev/null +++ b/src/models/components/erc20token.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { Money, Money$inboundSchema, Money$Outbound, Money$outboundSchema } from "./money.js"; +import * as z from "zod"; + +export const Erc20TokenErcType = { + Erc20: "ERC-20", +} as const; +export type Erc20TokenErcType = ClosedEnum; + +export type Erc20Token = { + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + /** + * The contract name. + */ + name: string; + /** + * The contract symbol. + */ + symbol: string; + /** + * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. + */ + decimals: number; + /** + * The logo uri for the address. + */ + logoUri?: string | undefined; + ercType: Erc20TokenErcType; + /** + * The token price, if available. + */ + price?: Money | undefined; +}; + +/** @internal */ +export const Erc20TokenErcType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(Erc20TokenErcType); + +/** @internal */ +export const Erc20TokenErcType$outboundSchema: z.ZodNativeEnum = + Erc20TokenErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20TokenErcType$ { + /** @deprecated use `Erc20TokenErcType$inboundSchema` instead. */ + export const inboundSchema = Erc20TokenErcType$inboundSchema; + /** @deprecated use `Erc20TokenErcType$outboundSchema` instead. */ + export const outboundSchema = Erc20TokenErcType$outboundSchema; +} + +/** @internal */ +export const Erc20Token$inboundSchema: z.ZodType = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + ercType: Erc20TokenErcType$inboundSchema, + price: Money$inboundSchema.optional(), +}); + +/** @internal */ +export type Erc20Token$Outbound = { + address: string; + name: string; + symbol: string; + decimals: number; + logoUri?: string | undefined; + ercType: string; + price?: Money$Outbound | undefined; +}; + +/** @internal */ +export const Erc20Token$outboundSchema: z.ZodType = + z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + ercType: Erc20TokenErcType$outboundSchema, + price: Money$outboundSchema.optional(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20Token$ { + /** @deprecated use `Erc20Token$inboundSchema` instead. */ + export const inboundSchema = Erc20Token$inboundSchema; + /** @deprecated use `Erc20Token$outboundSchema` instead. */ + export const outboundSchema = Erc20Token$outboundSchema; + /** @deprecated use `Erc20Token$Outbound` instead. */ + export type Outbound = Erc20Token$Outbound; +} diff --git a/src/models/components/erc20tokenbalance.ts b/src/models/components/erc20tokenbalance.ts new file mode 100644 index 0000000..73fd646 --- /dev/null +++ b/src/models/components/erc20tokenbalance.ts @@ -0,0 +1,133 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { Money, Money$inboundSchema, Money$Outbound, Money$outboundSchema } from "./money.js"; +import * as z from "zod"; + +export const Erc20TokenBalanceErcType = { + Erc20: "ERC-20", +} as const; +export type Erc20TokenBalanceErcType = ClosedEnum; + +export type Erc20TokenBalance = { + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + /** + * The contract name. + */ + name: string; + /** + * The contract symbol. + */ + symbol: string; + /** + * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. + */ + decimals: number; + /** + * The logo uri for the address. + */ + logoUri?: string | undefined; + ercType: Erc20TokenBalanceErcType; + /** + * The token price, if available. + */ + price?: Money | undefined; + /** + * The evm chain id. + */ + chainId: string; + /** + * The address balance for the token, in units specified by the `decimals` value for the contract. + */ + balance: string; + /** + * The monetary value of the balance, if a price is available for the token. + */ + balanceValue?: Money | undefined; +}; + +/** @internal */ +export const Erc20TokenBalanceErcType$inboundSchema: z.ZodNativeEnum< + typeof Erc20TokenBalanceErcType +> = z.nativeEnum(Erc20TokenBalanceErcType); + +/** @internal */ +export const Erc20TokenBalanceErcType$outboundSchema: z.ZodNativeEnum< + typeof Erc20TokenBalanceErcType +> = Erc20TokenBalanceErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20TokenBalanceErcType$ { + /** @deprecated use `Erc20TokenBalanceErcType$inboundSchema` instead. */ + export const inboundSchema = Erc20TokenBalanceErcType$inboundSchema; + /** @deprecated use `Erc20TokenBalanceErcType$outboundSchema` instead. */ + export const outboundSchema = Erc20TokenBalanceErcType$outboundSchema; +} + +/** @internal */ +export const Erc20TokenBalance$inboundSchema: z.ZodType = + z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + ercType: Erc20TokenBalanceErcType$inboundSchema, + price: Money$inboundSchema.optional(), + chainId: z.string(), + balance: z.string(), + balanceValue: Money$inboundSchema.optional(), + }); + +/** @internal */ +export type Erc20TokenBalance$Outbound = { + address: string; + name: string; + symbol: string; + decimals: number; + logoUri?: string | undefined; + ercType: string; + price?: Money$Outbound | undefined; + chainId: string; + balance: string; + balanceValue?: Money$Outbound | undefined; +}; + +/** @internal */ +export const Erc20TokenBalance$outboundSchema: z.ZodType< + Erc20TokenBalance$Outbound, + z.ZodTypeDef, + Erc20TokenBalance +> = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + ercType: Erc20TokenBalanceErcType$outboundSchema, + price: Money$outboundSchema.optional(), + chainId: z.string(), + balance: z.string(), + balanceValue: Money$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20TokenBalance$ { + /** @deprecated use `Erc20TokenBalance$inboundSchema` instead. */ + export const inboundSchema = Erc20TokenBalance$inboundSchema; + /** @deprecated use `Erc20TokenBalance$outboundSchema` instead. */ + export const outboundSchema = Erc20TokenBalance$outboundSchema; + /** @deprecated use `Erc20TokenBalance$Outbound` instead. */ + export type Outbound = Erc20TokenBalance$Outbound; +} diff --git a/src/models/components/erc20transfer.ts b/src/models/components/erc20transfer.ts new file mode 100644 index 0000000..cbcaf53 --- /dev/null +++ b/src/models/components/erc20transfer.ts @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc20Token, + Erc20Token$inboundSchema, + Erc20Token$Outbound, + Erc20Token$outboundSchema, +} from "./erc20token.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type Erc20Transfer = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The transaction hash identifier. + */ + txHash: string; + from: RichAddress; + to: RichAddress; + logIndex: number; + value: string; + erc20Token: Erc20Token; +}; + +/** @internal */ +export const Erc20Transfer$inboundSchema: z.ZodType = + z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + logIndex: z.number(), + value: z.string(), + erc20Token: Erc20Token$inboundSchema, + }); + +/** @internal */ +export type Erc20Transfer$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + txHash: string; + from: RichAddress$Outbound; + to: RichAddress$Outbound; + logIndex: number; + value: string; + erc20Token: Erc20Token$Outbound; +}; + +/** @internal */ +export const Erc20Transfer$outboundSchema: z.ZodType< + Erc20Transfer$Outbound, + z.ZodTypeDef, + Erc20Transfer +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + logIndex: z.number(), + value: z.string(), + erc20Token: Erc20Token$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20Transfer$ { + /** @deprecated use `Erc20Transfer$inboundSchema` instead. */ + export const inboundSchema = Erc20Transfer$inboundSchema; + /** @deprecated use `Erc20Transfer$outboundSchema` instead. */ + export const outboundSchema = Erc20Transfer$outboundSchema; + /** @deprecated use `Erc20Transfer$Outbound` instead. */ + export type Outbound = Erc20Transfer$Outbound; +} diff --git a/src/models/components/erc20transferdetails.ts b/src/models/components/erc20transferdetails.ts new file mode 100644 index 0000000..8e7c1f4 --- /dev/null +++ b/src/models/components/erc20transferdetails.ts @@ -0,0 +1,73 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc20Token, + Erc20Token$inboundSchema, + Erc20Token$Outbound, + Erc20Token$outboundSchema, +} from "./erc20token.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type Erc20TransferDetails = { + from: RichAddress; + to: RichAddress; + logIndex: number; + value: string; + erc20Token: Erc20Token; +}; + +/** @internal */ +export const Erc20TransferDetails$inboundSchema: z.ZodType< + Erc20TransferDetails, + z.ZodTypeDef, + unknown +> = z.object({ + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + logIndex: z.number(), + value: z.string(), + erc20Token: Erc20Token$inboundSchema, +}); + +/** @internal */ +export type Erc20TransferDetails$Outbound = { + from: RichAddress$Outbound; + to: RichAddress$Outbound; + logIndex: number; + value: string; + erc20Token: Erc20Token$Outbound; +}; + +/** @internal */ +export const Erc20TransferDetails$outboundSchema: z.ZodType< + Erc20TransferDetails$Outbound, + z.ZodTypeDef, + Erc20TransferDetails +> = z.object({ + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + logIndex: z.number(), + value: z.string(), + erc20Token: Erc20Token$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc20TransferDetails$ { + /** @deprecated use `Erc20TransferDetails$inboundSchema` instead. */ + export const inboundSchema = Erc20TransferDetails$inboundSchema; + /** @deprecated use `Erc20TransferDetails$outboundSchema` instead. */ + export const outboundSchema = Erc20TransferDetails$outboundSchema; + /** @deprecated use `Erc20TransferDetails$Outbound` instead. */ + export type Outbound = Erc20TransferDetails$Outbound; +} diff --git a/src/models/components/erc721contract.ts b/src/models/components/erc721contract.ts new file mode 100644 index 0000000..965bd7c --- /dev/null +++ b/src/models/components/erc721contract.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + ContractDeploymentDetails, + ContractDeploymentDetails$inboundSchema, + ContractDeploymentDetails$Outbound, + ContractDeploymentDetails$outboundSchema, +} from "./contractdeploymentdetails.js"; +import { + ImageAsset, + ImageAsset$inboundSchema, + ImageAsset$Outbound, + ImageAsset$outboundSchema, +} from "./imageasset.js"; +import { + ResourceLink, + ResourceLink$inboundSchema, + ResourceLink$Outbound, + ResourceLink$outboundSchema, +} from "./resourcelink.js"; +import * as z from "zod"; + +export const Erc721ContractErcType = { + Erc721: "ERC-721", +} as const; +export type Erc721ContractErcType = ClosedEnum; + +export type Erc721Contract = { + /** + * The contract name. + */ + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset | undefined; + bannerAsset?: ImageAsset | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + deploymentDetails: ContractDeploymentDetails; + ercType: Erc721ContractErcType; + /** + * The contract symbol. + */ + symbol?: string | undefined; +}; + +/** @internal */ +export const Erc721ContractErcType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(Erc721ContractErcType); + +/** @internal */ +export const Erc721ContractErcType$outboundSchema: z.ZodNativeEnum = + Erc721ContractErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721ContractErcType$ { + /** @deprecated use `Erc721ContractErcType$inboundSchema` instead. */ + export const inboundSchema = Erc721ContractErcType$inboundSchema; + /** @deprecated use `Erc721ContractErcType$outboundSchema` instead. */ + export const outboundSchema = Erc721ContractErcType$outboundSchema; +} + +/** @internal */ +export const Erc721Contract$inboundSchema: z.ZodType = + z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$inboundSchema.optional(), + bannerAsset: ImageAsset$inboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$inboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$inboundSchema, + ercType: Erc721ContractErcType$inboundSchema, + symbol: z.string().optional(), + }); + +/** @internal */ +export type Erc721Contract$Outbound = { + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset$Outbound | undefined; + bannerAsset?: ImageAsset$Outbound | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + address: string; + deploymentDetails: ContractDeploymentDetails$Outbound; + ercType: string; + symbol?: string | undefined; +}; + +/** @internal */ +export const Erc721Contract$outboundSchema: z.ZodType< + Erc721Contract$Outbound, + z.ZodTypeDef, + Erc721Contract +> = z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$outboundSchema.optional(), + bannerAsset: ImageAsset$outboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$outboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$outboundSchema, + ercType: Erc721ContractErcType$outboundSchema, + symbol: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721Contract$ { + /** @deprecated use `Erc721Contract$inboundSchema` instead. */ + export const inboundSchema = Erc721Contract$inboundSchema; + /** @deprecated use `Erc721Contract$outboundSchema` instead. */ + export const outboundSchema = Erc721Contract$outboundSchema; + /** @deprecated use `Erc721Contract$Outbound` instead. */ + export type Outbound = Erc721Contract$Outbound; +} diff --git a/src/models/components/erc721token.ts b/src/models/components/erc721token.ts new file mode 100644 index 0000000..52c7dd4 --- /dev/null +++ b/src/models/components/erc721token.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + Erc721TokenMetadata, + Erc721TokenMetadata$inboundSchema, + Erc721TokenMetadata$Outbound, + Erc721TokenMetadata$outboundSchema, +} from "./erc721tokenmetadata.js"; +import * as z from "zod"; + +export const ErcType = { + Erc721: "ERC-721", +} as const; +export type ErcType = ClosedEnum; + +export type Erc721Token = { + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + /** + * The contract name. + */ + name: string; + /** + * The contract symbol. + */ + symbol: string; + ercType: ErcType; + tokenId: string; + tokenUri: string; + metadata: Erc721TokenMetadata; + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + ownerAddress?: string | undefined; +}; + +/** @internal */ +export const ErcType$inboundSchema: z.ZodNativeEnum = z.nativeEnum(ErcType); + +/** @internal */ +export const ErcType$outboundSchema: z.ZodNativeEnum = ErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ErcType$ { + /** @deprecated use `ErcType$inboundSchema` instead. */ + export const inboundSchema = ErcType$inboundSchema; + /** @deprecated use `ErcType$outboundSchema` instead. */ + export const outboundSchema = ErcType$outboundSchema; +} + +/** @internal */ +export const Erc721Token$inboundSchema: z.ZodType = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + ercType: ErcType$inboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc721TokenMetadata$inboundSchema, + ownerAddress: z.string().optional(), +}); + +/** @internal */ +export type Erc721Token$Outbound = { + address: string; + name: string; + symbol: string; + ercType: string; + tokenId: string; + tokenUri: string; + metadata: Erc721TokenMetadata$Outbound; + ownerAddress?: string | undefined; +}; + +/** @internal */ +export const Erc721Token$outboundSchema: z.ZodType< + Erc721Token$Outbound, + z.ZodTypeDef, + Erc721Token +> = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + ercType: ErcType$outboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc721TokenMetadata$outboundSchema, + ownerAddress: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721Token$ { + /** @deprecated use `Erc721Token$inboundSchema` instead. */ + export const inboundSchema = Erc721Token$inboundSchema; + /** @deprecated use `Erc721Token$outboundSchema` instead. */ + export const outboundSchema = Erc721Token$outboundSchema; + /** @deprecated use `Erc721Token$Outbound` instead. */ + export type Outbound = Erc721Token$Outbound; +} diff --git a/src/models/components/erc721tokenbalance.ts b/src/models/components/erc721tokenbalance.ts new file mode 100644 index 0000000..2d43319 --- /dev/null +++ b/src/models/components/erc721tokenbalance.ts @@ -0,0 +1,125 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + Erc721TokenMetadata, + Erc721TokenMetadata$inboundSchema, + Erc721TokenMetadata$Outbound, + Erc721TokenMetadata$outboundSchema, +} from "./erc721tokenmetadata.js"; +import * as z from "zod"; + +export const Erc721TokenBalanceErcType = { + Erc721: "ERC-721", +} as const; +export type Erc721TokenBalanceErcType = ClosedEnum; + +export type Erc721TokenBalance = { + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + /** + * The contract name. + */ + name: string; + /** + * The contract symbol. + */ + symbol: string; + ercType: Erc721TokenBalanceErcType; + tokenId: string; + tokenUri: string; + metadata: Erc721TokenMetadata; + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + ownerAddress?: string | undefined; + /** + * The evm chain id. + */ + chainId: string; +}; + +/** @internal */ +export const Erc721TokenBalanceErcType$inboundSchema: z.ZodNativeEnum< + typeof Erc721TokenBalanceErcType +> = z.nativeEnum(Erc721TokenBalanceErcType); + +/** @internal */ +export const Erc721TokenBalanceErcType$outboundSchema: z.ZodNativeEnum< + typeof Erc721TokenBalanceErcType +> = Erc721TokenBalanceErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721TokenBalanceErcType$ { + /** @deprecated use `Erc721TokenBalanceErcType$inboundSchema` instead. */ + export const inboundSchema = Erc721TokenBalanceErcType$inboundSchema; + /** @deprecated use `Erc721TokenBalanceErcType$outboundSchema` instead. */ + export const outboundSchema = Erc721TokenBalanceErcType$outboundSchema; +} + +/** @internal */ +export const Erc721TokenBalance$inboundSchema: z.ZodType< + Erc721TokenBalance, + z.ZodTypeDef, + unknown +> = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + ercType: Erc721TokenBalanceErcType$inboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc721TokenMetadata$inboundSchema, + ownerAddress: z.string().optional(), + chainId: z.string(), +}); + +/** @internal */ +export type Erc721TokenBalance$Outbound = { + address: string; + name: string; + symbol: string; + ercType: string; + tokenId: string; + tokenUri: string; + metadata: Erc721TokenMetadata$Outbound; + ownerAddress?: string | undefined; + chainId: string; +}; + +/** @internal */ +export const Erc721TokenBalance$outboundSchema: z.ZodType< + Erc721TokenBalance$Outbound, + z.ZodTypeDef, + Erc721TokenBalance +> = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + ercType: Erc721TokenBalanceErcType$outboundSchema, + tokenId: z.string(), + tokenUri: z.string(), + metadata: Erc721TokenMetadata$outboundSchema, + ownerAddress: z.string().optional(), + chainId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721TokenBalance$ { + /** @deprecated use `Erc721TokenBalance$inboundSchema` instead. */ + export const inboundSchema = Erc721TokenBalance$inboundSchema; + /** @deprecated use `Erc721TokenBalance$outboundSchema` instead. */ + export const outboundSchema = Erc721TokenBalance$outboundSchema; + /** @deprecated use `Erc721TokenBalance$Outbound` instead. */ + export type Outbound = Erc721TokenBalance$Outbound; +} diff --git a/src/models/components/erc721tokenmetadata.ts b/src/models/components/erc721tokenmetadata.ts new file mode 100644 index 0000000..69334d2 --- /dev/null +++ b/src/models/components/erc721tokenmetadata.ts @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + NftTokenMetadataStatus, + NftTokenMetadataStatus$inboundSchema, + NftTokenMetadataStatus$outboundSchema, +} from "./nfttokenmetadatastatus.js"; +import * as z from "zod"; + +export type Erc721TokenMetadata = { + /** + * The metadata indexing status of the nft. + */ + indexStatus: NftTokenMetadataStatus; + metadataLastUpdatedTimestamp?: number | undefined; + name?: string | undefined; + symbol?: string | undefined; + imageUri?: string | undefined; + description?: string | undefined; + animationUri?: string | undefined; + externalUrl?: string | undefined; + background?: string | undefined; + attributes?: string | undefined; +}; + +/** @internal */ +export const Erc721TokenMetadata$inboundSchema: z.ZodType< + Erc721TokenMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + indexStatus: NftTokenMetadataStatus$inboundSchema, + metadataLastUpdatedTimestamp: z.number().optional(), + name: z.string().optional(), + symbol: z.string().optional(), + imageUri: z.string().optional(), + description: z.string().optional(), + animationUri: z.string().optional(), + externalUrl: z.string().optional(), + background: z.string().optional(), + attributes: z.string().optional(), +}); + +/** @internal */ +export type Erc721TokenMetadata$Outbound = { + indexStatus: string; + metadataLastUpdatedTimestamp?: number | undefined; + name?: string | undefined; + symbol?: string | undefined; + imageUri?: string | undefined; + description?: string | undefined; + animationUri?: string | undefined; + externalUrl?: string | undefined; + background?: string | undefined; + attributes?: string | undefined; +}; + +/** @internal */ +export const Erc721TokenMetadata$outboundSchema: z.ZodType< + Erc721TokenMetadata$Outbound, + z.ZodTypeDef, + Erc721TokenMetadata +> = z.object({ + indexStatus: NftTokenMetadataStatus$outboundSchema, + metadataLastUpdatedTimestamp: z.number().optional(), + name: z.string().optional(), + symbol: z.string().optional(), + imageUri: z.string().optional(), + description: z.string().optional(), + animationUri: z.string().optional(), + externalUrl: z.string().optional(), + background: z.string().optional(), + attributes: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721TokenMetadata$ { + /** @deprecated use `Erc721TokenMetadata$inboundSchema` instead. */ + export const inboundSchema = Erc721TokenMetadata$inboundSchema; + /** @deprecated use `Erc721TokenMetadata$outboundSchema` instead. */ + export const outboundSchema = Erc721TokenMetadata$outboundSchema; + /** @deprecated use `Erc721TokenMetadata$Outbound` instead. */ + export type Outbound = Erc721TokenMetadata$Outbound; +} diff --git a/src/models/components/erc721transfer.ts b/src/models/components/erc721transfer.ts new file mode 100644 index 0000000..6b4fd4d --- /dev/null +++ b/src/models/components/erc721transfer.ts @@ -0,0 +1,94 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc721Token, + Erc721Token$inboundSchema, + Erc721Token$Outbound, + Erc721Token$outboundSchema, +} from "./erc721token.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type Erc721Transfer = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The transaction hash identifier. + */ + txHash: string; + from: RichAddress; + to: RichAddress; + logIndex: number; + erc721Token: Erc721Token; +}; + +/** @internal */ +export const Erc721Transfer$inboundSchema: z.ZodType = + z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + logIndex: z.number(), + erc721Token: Erc721Token$inboundSchema, + }); + +/** @internal */ +export type Erc721Transfer$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + txHash: string; + from: RichAddress$Outbound; + to: RichAddress$Outbound; + logIndex: number; + erc721Token: Erc721Token$Outbound; +}; + +/** @internal */ +export const Erc721Transfer$outboundSchema: z.ZodType< + Erc721Transfer$Outbound, + z.ZodTypeDef, + Erc721Transfer +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + logIndex: z.number(), + erc721Token: Erc721Token$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721Transfer$ { + /** @deprecated use `Erc721Transfer$inboundSchema` instead. */ + export const inboundSchema = Erc721Transfer$inboundSchema; + /** @deprecated use `Erc721Transfer$outboundSchema` instead. */ + export const outboundSchema = Erc721Transfer$outboundSchema; + /** @deprecated use `Erc721Transfer$Outbound` instead. */ + export type Outbound = Erc721Transfer$Outbound; +} diff --git a/src/models/components/erc721transferdetails.ts b/src/models/components/erc721transferdetails.ts new file mode 100644 index 0000000..015186f --- /dev/null +++ b/src/models/components/erc721transferdetails.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc721Token, + Erc721Token$inboundSchema, + Erc721Token$Outbound, + Erc721Token$outboundSchema, +} from "./erc721token.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type Erc721TransferDetails = { + from: RichAddress; + to: RichAddress; + logIndex: number; + erc721Token: Erc721Token; +}; + +/** @internal */ +export const Erc721TransferDetails$inboundSchema: z.ZodType< + Erc721TransferDetails, + z.ZodTypeDef, + unknown +> = z.object({ + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + logIndex: z.number(), + erc721Token: Erc721Token$inboundSchema, +}); + +/** @internal */ +export type Erc721TransferDetails$Outbound = { + from: RichAddress$Outbound; + to: RichAddress$Outbound; + logIndex: number; + erc721Token: Erc721Token$Outbound; +}; + +/** @internal */ +export const Erc721TransferDetails$outboundSchema: z.ZodType< + Erc721TransferDetails$Outbound, + z.ZodTypeDef, + Erc721TransferDetails +> = z.object({ + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + logIndex: z.number(), + erc721Token: Erc721Token$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Erc721TransferDetails$ { + /** @deprecated use `Erc721TransferDetails$inboundSchema` instead. */ + export const inboundSchema = Erc721TransferDetails$inboundSchema; + /** @deprecated use `Erc721TransferDetails$outboundSchema` instead. */ + export const outboundSchema = Erc721TransferDetails$outboundSchema; + /** @deprecated use `Erc721TransferDetails$Outbound` instead. */ + export type Outbound = Erc721TransferDetails$Outbound; +} diff --git a/src/models/components/eventtype.ts b/src/models/components/eventtype.ts new file mode 100644 index 0000000..4db9bc0 --- /dev/null +++ b/src/models/components/eventtype.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const EventType = { + AddressActivity: "address_activity", +} as const; +export type EventType = ClosedEnum; + +/** @internal */ +export const EventType$inboundSchema: z.ZodNativeEnum = z.nativeEnum(EventType); + +/** @internal */ +export const EventType$outboundSchema: z.ZodNativeEnum = EventType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EventType$ { + /** @deprecated use `EventType$inboundSchema` instead. */ + export const inboundSchema = EventType$inboundSchema; + /** @deprecated use `EventType$outboundSchema` instead. */ + export const outboundSchema = EventType$outboundSchema; +} diff --git a/src/models/components/evmblock.ts b/src/models/components/evmblock.ts new file mode 100644 index 0000000..9a71c33 --- /dev/null +++ b/src/models/components/evmblock.ts @@ -0,0 +1,108 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type EvmBlock = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The number of evm transactions in the block. + */ + txCount: number; + /** + * The base gas fee for a transaction to be included in the block. + */ + baseFee: string; + /** + * The gas used for transactions in the block. + */ + gasUsed: string; + /** + * The total gas limit set for transactions in the block. + */ + gasLimit: string; + gasCost: string; + /** + * The hash of the parent block. + */ + parentHash: string; + /** + * The amount of fees spent/burned for transactions in the block. + */ + feesSpent: string; + /** + * The cumulative number of transactions for the chain including this block. + */ + cumulativeTransactions: string; +}; + +/** @internal */ +export const EvmBlock$inboundSchema: z.ZodType = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txCount: z.number(), + baseFee: z.string(), + gasUsed: z.string(), + gasLimit: z.string(), + gasCost: z.string(), + parentHash: z.string(), + feesSpent: z.string(), + cumulativeTransactions: z.string(), +}); + +/** @internal */ +export type EvmBlock$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + txCount: number; + baseFee: string; + gasUsed: string; + gasLimit: string; + gasCost: string; + parentHash: string; + feesSpent: string; + cumulativeTransactions: string; +}; + +/** @internal */ +export const EvmBlock$outboundSchema: z.ZodType = + z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txCount: z.number(), + baseFee: z.string(), + gasUsed: z.string(), + gasLimit: z.string(), + gasCost: z.string(), + parentHash: z.string(), + feesSpent: z.string(), + cumulativeTransactions: z.string(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EvmBlock$ { + /** @deprecated use `EvmBlock$inboundSchema` instead. */ + export const inboundSchema = EvmBlock$inboundSchema; + /** @deprecated use `EvmBlock$outboundSchema` instead. */ + export const outboundSchema = EvmBlock$outboundSchema; + /** @deprecated use `EvmBlock$Outbound` instead. */ + export type Outbound = EvmBlock$Outbound; +} diff --git a/src/models/components/evminput.ts b/src/models/components/evminput.ts new file mode 100644 index 0000000..7b5181a --- /dev/null +++ b/src/models/components/evminput.ts @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { + UtxoCredential, + UtxoCredential$inboundSchema, + UtxoCredential$Outbound, + UtxoCredential$outboundSchema, +} from "./utxocredential.js"; +import * as z from "zod"; + +export type EVMInput = { + /** + * EVM address from which the asset is exported in ExportTx. + */ + fromAddress: string; + /** + * AssetAmount details for the asset being transferred. + */ + asset: AssetAmount; + /** + * Credentials that signed this transaction. + */ + credentials: Array; +}; + +/** @internal */ +export const EVMInput$inboundSchema: z.ZodType = z.object({ + fromAddress: z.string(), + asset: AssetAmount$inboundSchema, + credentials: z.array(UtxoCredential$inboundSchema), +}); + +/** @internal */ +export type EVMInput$Outbound = { + fromAddress: string; + asset: AssetAmount$Outbound; + credentials: Array; +}; + +/** @internal */ +export const EVMInput$outboundSchema: z.ZodType = + z.object({ + fromAddress: z.string(), + asset: AssetAmount$outboundSchema, + credentials: z.array(UtxoCredential$outboundSchema), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EVMInput$ { + /** @deprecated use `EVMInput$inboundSchema` instead. */ + export const inboundSchema = EVMInput$inboundSchema; + /** @deprecated use `EVMInput$outboundSchema` instead. */ + export const outboundSchema = EVMInput$outboundSchema; + /** @deprecated use `EVMInput$Outbound` instead. */ + export type Outbound = EVMInput$Outbound; +} diff --git a/src/models/components/evmnetworkoptions.ts b/src/models/components/evmnetworkoptions.ts new file mode 100644 index 0000000..5a17222 --- /dev/null +++ b/src/models/components/evmnetworkoptions.ts @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type EvmNetworkOptions = { + addresses: Array; + includeChains: Array; +}; + +/** @internal */ +export const EvmNetworkOptions$inboundSchema: z.ZodType = + z.object({ + addresses: z.array(z.string()), + includeChains: z.array(z.string()), + }); + +/** @internal */ +export type EvmNetworkOptions$Outbound = { + addresses: Array; + includeChains: Array; +}; + +/** @internal */ +export const EvmNetworkOptions$outboundSchema: z.ZodType< + EvmNetworkOptions$Outbound, + z.ZodTypeDef, + EvmNetworkOptions +> = z.object({ + addresses: z.array(z.string()), + includeChains: z.array(z.string()), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EvmNetworkOptions$ { + /** @deprecated use `EvmNetworkOptions$inboundSchema` instead. */ + export const inboundSchema = EvmNetworkOptions$inboundSchema; + /** @deprecated use `EvmNetworkOptions$outboundSchema` instead. */ + export const outboundSchema = EvmNetworkOptions$outboundSchema; + /** @deprecated use `EvmNetworkOptions$Outbound` instead. */ + export type Outbound = EvmNetworkOptions$Outbound; +} diff --git a/src/models/components/evmoperationtype.ts b/src/models/components/evmoperationtype.ts new file mode 100644 index 0000000..3427274 --- /dev/null +++ b/src/models/components/evmoperationtype.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const EVMOperationType = { + TransactionExportEvm: "TRANSACTION_EXPORT_EVM", +} as const; +export type EVMOperationType = ClosedEnum; + +/** @internal */ +export const EVMOperationType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(EVMOperationType); + +/** @internal */ +export const EVMOperationType$outboundSchema: z.ZodNativeEnum = + EVMOperationType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EVMOperationType$ { + /** @deprecated use `EVMOperationType$inboundSchema` instead. */ + export const inboundSchema = EVMOperationType$inboundSchema; + /** @deprecated use `EVMOperationType$outboundSchema` instead. */ + export const outboundSchema = EVMOperationType$outboundSchema; +} diff --git a/src/models/components/evmoutput.ts b/src/models/components/evmoutput.ts new file mode 100644 index 0000000..18e2405 --- /dev/null +++ b/src/models/components/evmoutput.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import * as z from "zod"; + +export type EVMOutput = { + /** + * EVM address to which the asset is imported in ImportTx + */ + toAddress: string; + /** + * AssetAmount details for the asset being transferred. + */ + asset: AssetAmount; +}; + +/** @internal */ +export const EVMOutput$inboundSchema: z.ZodType = z.object({ + toAddress: z.string(), + asset: AssetAmount$inboundSchema, +}); + +/** @internal */ +export type EVMOutput$Outbound = { + toAddress: string; + asset: AssetAmount$Outbound; +}; + +/** @internal */ +export const EVMOutput$outboundSchema: z.ZodType = + z.object({ + toAddress: z.string(), + asset: AssetAmount$outboundSchema, + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EVMOutput$ { + /** @deprecated use `EVMOutput$inboundSchema` instead. */ + export const inboundSchema = EVMOutput$inboundSchema; + /** @deprecated use `EVMOutput$outboundSchema` instead. */ + export const outboundSchema = EVMOutput$outboundSchema; + /** @deprecated use `EVMOutput$Outbound` instead. */ + export type Outbound = EVMOutput$Outbound; +} diff --git a/src/models/components/fullnativetransactiondetails.ts b/src/models/components/fullnativetransactiondetails.ts new file mode 100644 index 0000000..e87a990 --- /dev/null +++ b/src/models/components/fullnativetransactiondetails.ts @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Method, Method$inboundSchema, Method$Outbound, Method$outboundSchema } from "./method.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type FullNativeTransactionDetails = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The index at which the transaction occured in the block (0-indexed). + */ + blockIndex: number; + /** + * The transaction hash identifier. + */ + txHash: string; + /** + * The transaction status, which is either 0 (failed) or 1 (successful). + */ + txStatus: string; + /** + * The transaction type. + */ + txType: number; + /** + * The gas limit set for the transaction. + */ + gasLimit: string; + /** + * The amount of gas used. + */ + gasUsed: string; + /** + * The gas price denominated by the number of decimals of the native token. + */ + gasPrice: string; + /** + * The nonce used by the sender of the transaction. + */ + nonce: string; + from: RichAddress; + to: RichAddress; + method?: Method | undefined; + value: string; + /** + * The data sent for the transaction. + */ + input: string; + baseFeePerGas: string; + maxFeePerGas?: string | undefined; + maxPriorityFeePerGas?: string | undefined; +}; + +/** @internal */ +export const FullNativeTransactionDetails$inboundSchema: z.ZodType< + FullNativeTransactionDetails, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + blockIndex: z.number(), + txHash: z.string(), + txStatus: z.string(), + txType: z.number(), + gasLimit: z.string(), + gasUsed: z.string(), + gasPrice: z.string(), + nonce: z.string(), + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + method: Method$inboundSchema.optional(), + value: z.string(), + input: z.string(), + baseFeePerGas: z.string(), + maxFeePerGas: z.string().optional(), + maxPriorityFeePerGas: z.string().optional(), +}); + +/** @internal */ +export type FullNativeTransactionDetails$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + blockIndex: number; + txHash: string; + txStatus: string; + txType: number; + gasLimit: string; + gasUsed: string; + gasPrice: string; + nonce: string; + from: RichAddress$Outbound; + to: RichAddress$Outbound; + method?: Method$Outbound | undefined; + value: string; + input: string; + baseFeePerGas: string; + maxFeePerGas?: string | undefined; + maxPriorityFeePerGas?: string | undefined; +}; + +/** @internal */ +export const FullNativeTransactionDetails$outboundSchema: z.ZodType< + FullNativeTransactionDetails$Outbound, + z.ZodTypeDef, + FullNativeTransactionDetails +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + blockIndex: z.number(), + txHash: z.string(), + txStatus: z.string(), + txType: z.number(), + gasLimit: z.string(), + gasUsed: z.string(), + gasPrice: z.string(), + nonce: z.string(), + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + method: Method$outboundSchema.optional(), + value: z.string(), + input: z.string(), + baseFeePerGas: z.string(), + maxFeePerGas: z.string().optional(), + maxPriorityFeePerGas: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FullNativeTransactionDetails$ { + /** @deprecated use `FullNativeTransactionDetails$inboundSchema` instead. */ + export const inboundSchema = FullNativeTransactionDetails$inboundSchema; + /** @deprecated use `FullNativeTransactionDetails$outboundSchema` instead. */ + export const outboundSchema = FullNativeTransactionDetails$outboundSchema; + /** @deprecated use `FullNativeTransactionDetails$Outbound` instead. */ + export type Outbound = FullNativeTransactionDetails$Outbound; +} diff --git a/src/models/components/getchainresponse.ts b/src/models/components/getchainresponse.ts new file mode 100644 index 0000000..030aff5 --- /dev/null +++ b/src/models/components/getchainresponse.ts @@ -0,0 +1,155 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + ChainStatus, + ChainStatus$inboundSchema, + ChainStatus$outboundSchema, +} from "./chainstatus.js"; +import { + NetworkToken, + NetworkToken$inboundSchema, + NetworkToken$Outbound, + NetworkToken$outboundSchema, +} from "./networktoken.js"; +import { + UtilityAddresses, + UtilityAddresses$inboundSchema, + UtilityAddresses$Outbound, + UtilityAddresses$outboundSchema, +} from "./utilityaddresses.js"; +import { VmName, VmName$inboundSchema, VmName$outboundSchema } from "./vmname.js"; +import * as z from "zod"; + +export const GetChainResponseEnabledFeatures = { + NftIndexing: "nftIndexing", + Webhooks: "webhooks", +} as const; +export type GetChainResponseEnabledFeatures = ClosedEnum; + +export type GetChainResponse = { + chainId: string; + /** + * Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors. + */ + status: ChainStatus; + chainName: string; + description: string; + platformChainId?: string | undefined; + subnetId?: string | undefined; + vmId?: string | undefined; + vmName: VmName; + explorerUrl?: string | undefined; + rpcUrl: string; + wsUrl?: string | undefined; + isTestnet: boolean; + utilityAddresses?: UtilityAddresses | undefined; + networkToken: NetworkToken; + chainLogoUri?: string | undefined; + private?: boolean | undefined; + enabledFeatures?: Array | undefined; +}; + +/** @internal */ +export const GetChainResponseEnabledFeatures$inboundSchema: z.ZodNativeEnum< + typeof GetChainResponseEnabledFeatures +> = z.nativeEnum(GetChainResponseEnabledFeatures); + +/** @internal */ +export const GetChainResponseEnabledFeatures$outboundSchema: z.ZodNativeEnum< + typeof GetChainResponseEnabledFeatures +> = GetChainResponseEnabledFeatures$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetChainResponseEnabledFeatures$ { + /** @deprecated use `GetChainResponseEnabledFeatures$inboundSchema` instead. */ + export const inboundSchema = GetChainResponseEnabledFeatures$inboundSchema; + /** @deprecated use `GetChainResponseEnabledFeatures$outboundSchema` instead. */ + export const outboundSchema = GetChainResponseEnabledFeatures$outboundSchema; +} + +/** @internal */ +export const GetChainResponse$inboundSchema: z.ZodType = + z.object({ + chainId: z.string(), + status: ChainStatus$inboundSchema, + chainName: z.string(), + description: z.string(), + platformChainId: z.string().optional(), + subnetId: z.string().optional(), + vmId: z.string().optional(), + vmName: VmName$inboundSchema, + explorerUrl: z.string().optional(), + rpcUrl: z.string(), + wsUrl: z.string().optional(), + isTestnet: z.boolean(), + utilityAddresses: UtilityAddresses$inboundSchema.optional(), + networkToken: NetworkToken$inboundSchema, + chainLogoUri: z.string().optional(), + private: z.boolean().optional(), + enabledFeatures: z.array(GetChainResponseEnabledFeatures$inboundSchema).optional(), + }); + +/** @internal */ +export type GetChainResponse$Outbound = { + chainId: string; + status: string; + chainName: string; + description: string; + platformChainId?: string | undefined; + subnetId?: string | undefined; + vmId?: string | undefined; + vmName: string; + explorerUrl?: string | undefined; + rpcUrl: string; + wsUrl?: string | undefined; + isTestnet: boolean; + utilityAddresses?: UtilityAddresses$Outbound | undefined; + networkToken: NetworkToken$Outbound; + chainLogoUri?: string | undefined; + private?: boolean | undefined; + enabledFeatures?: Array | undefined; +}; + +/** @internal */ +export const GetChainResponse$outboundSchema: z.ZodType< + GetChainResponse$Outbound, + z.ZodTypeDef, + GetChainResponse +> = z.object({ + chainId: z.string(), + status: ChainStatus$outboundSchema, + chainName: z.string(), + description: z.string(), + platformChainId: z.string().optional(), + subnetId: z.string().optional(), + vmId: z.string().optional(), + vmName: VmName$outboundSchema, + explorerUrl: z.string().optional(), + rpcUrl: z.string(), + wsUrl: z.string().optional(), + isTestnet: z.boolean(), + utilityAddresses: UtilityAddresses$outboundSchema.optional(), + networkToken: NetworkToken$outboundSchema, + chainLogoUri: z.string().optional(), + private: z.boolean().optional(), + enabledFeatures: z.array(GetChainResponseEnabledFeatures$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetChainResponse$ { + /** @deprecated use `GetChainResponse$inboundSchema` instead. */ + export const inboundSchema = GetChainResponse$inboundSchema; + /** @deprecated use `GetChainResponse$outboundSchema` instead. */ + export const outboundSchema = GetChainResponse$outboundSchema; + /** @deprecated use `GetChainResponse$Outbound` instead. */ + export type Outbound = GetChainResponse$Outbound; +} diff --git a/src/models/components/getevmblockresponse.ts b/src/models/components/getevmblockresponse.ts new file mode 100644 index 0000000..e0dd56a --- /dev/null +++ b/src/models/components/getevmblockresponse.ts @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetEvmBlockResponse = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The number of evm transactions in the block. + */ + txCount: number; + /** + * The base gas fee for a transaction to be included in the block. + */ + baseFee: string; + /** + * The gas used for transactions in the block. + */ + gasUsed: string; + /** + * The total gas limit set for transactions in the block. + */ + gasLimit: string; + gasCost: string; + /** + * The hash of the parent block. + */ + parentHash: string; + /** + * The amount of fees spent/burned for transactions in the block. + */ + feesSpent: string; + /** + * The cumulative number of transactions for the chain including this block. + */ + cumulativeTransactions: string; +}; + +/** @internal */ +export const GetEvmBlockResponse$inboundSchema: z.ZodType< + GetEvmBlockResponse, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txCount: z.number(), + baseFee: z.string(), + gasUsed: z.string(), + gasLimit: z.string(), + gasCost: z.string(), + parentHash: z.string(), + feesSpent: z.string(), + cumulativeTransactions: z.string(), +}); + +/** @internal */ +export type GetEvmBlockResponse$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + txCount: number; + baseFee: string; + gasUsed: string; + gasLimit: string; + gasCost: string; + parentHash: string; + feesSpent: string; + cumulativeTransactions: string; +}; + +/** @internal */ +export const GetEvmBlockResponse$outboundSchema: z.ZodType< + GetEvmBlockResponse$Outbound, + z.ZodTypeDef, + GetEvmBlockResponse +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txCount: z.number(), + baseFee: z.string(), + gasUsed: z.string(), + gasLimit: z.string(), + gasCost: z.string(), + parentHash: z.string(), + feesSpent: z.string(), + cumulativeTransactions: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetEvmBlockResponse$ { + /** @deprecated use `GetEvmBlockResponse$inboundSchema` instead. */ + export const inboundSchema = GetEvmBlockResponse$inboundSchema; + /** @deprecated use `GetEvmBlockResponse$outboundSchema` instead. */ + export const outboundSchema = GetEvmBlockResponse$outboundSchema; + /** @deprecated use `GetEvmBlockResponse$Outbound` instead. */ + export type Outbound = GetEvmBlockResponse$Outbound; +} diff --git a/src/models/components/getnativebalanceresponse.ts b/src/models/components/getnativebalanceresponse.ts new file mode 100644 index 0000000..f9e113a --- /dev/null +++ b/src/models/components/getnativebalanceresponse.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + NativeTokenBalance, + NativeTokenBalance$inboundSchema, + NativeTokenBalance$Outbound, + NativeTokenBalance$outboundSchema, +} from "./nativetokenbalance.js"; +import * as z from "zod"; + +export type GetNativeBalanceResponse = { + /** + * The native token balance for the address. + */ + nativeTokenBalance: NativeTokenBalance; +}; + +/** @internal */ +export const GetNativeBalanceResponse$inboundSchema: z.ZodType< + GetNativeBalanceResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nativeTokenBalance: NativeTokenBalance$inboundSchema, +}); + +/** @internal */ +export type GetNativeBalanceResponse$Outbound = { + nativeTokenBalance: NativeTokenBalance$Outbound; +}; + +/** @internal */ +export const GetNativeBalanceResponse$outboundSchema: z.ZodType< + GetNativeBalanceResponse$Outbound, + z.ZodTypeDef, + GetNativeBalanceResponse +> = z.object({ + nativeTokenBalance: NativeTokenBalance$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetNativeBalanceResponse$ { + /** @deprecated use `GetNativeBalanceResponse$inboundSchema` instead. */ + export const inboundSchema = GetNativeBalanceResponse$inboundSchema; + /** @deprecated use `GetNativeBalanceResponse$outboundSchema` instead. */ + export const outboundSchema = GetNativeBalanceResponse$outboundSchema; + /** @deprecated use `GetNativeBalanceResponse$Outbound` instead. */ + export type Outbound = GetNativeBalanceResponse$Outbound; +} diff --git a/src/models/components/getnetworkdetailsresponse.ts b/src/models/components/getnetworkdetailsresponse.ts new file mode 100644 index 0000000..02c6ad7 --- /dev/null +++ b/src/models/components/getnetworkdetailsresponse.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + DelegatorsDetails, + DelegatorsDetails$inboundSchema, + DelegatorsDetails$Outbound, + DelegatorsDetails$outboundSchema, +} from "./delegatorsdetails.js"; +import { + ValidatorsDetails, + ValidatorsDetails$inboundSchema, + ValidatorsDetails$Outbound, + ValidatorsDetails$outboundSchema, +} from "./validatorsdetails.js"; +import * as z from "zod"; + +export type GetNetworkDetailsResponse = { + validatorDetails: ValidatorsDetails; + delegatorDetails: DelegatorsDetails; +}; + +/** @internal */ +export const GetNetworkDetailsResponse$inboundSchema: z.ZodType< + GetNetworkDetailsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + validatorDetails: ValidatorsDetails$inboundSchema, + delegatorDetails: DelegatorsDetails$inboundSchema, +}); + +/** @internal */ +export type GetNetworkDetailsResponse$Outbound = { + validatorDetails: ValidatorsDetails$Outbound; + delegatorDetails: DelegatorsDetails$Outbound; +}; + +/** @internal */ +export const GetNetworkDetailsResponse$outboundSchema: z.ZodType< + GetNetworkDetailsResponse$Outbound, + z.ZodTypeDef, + GetNetworkDetailsResponse +> = z.object({ + validatorDetails: ValidatorsDetails$outboundSchema, + delegatorDetails: DelegatorsDetails$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetNetworkDetailsResponse$ { + /** @deprecated use `GetNetworkDetailsResponse$inboundSchema` instead. */ + export const inboundSchema = GetNetworkDetailsResponse$inboundSchema; + /** @deprecated use `GetNetworkDetailsResponse$outboundSchema` instead. */ + export const outboundSchema = GetNetworkDetailsResponse$outboundSchema; + /** @deprecated use `GetNetworkDetailsResponse$Outbound` instead. */ + export type Outbound = GetNetworkDetailsResponse$Outbound; +} diff --git a/src/models/components/getprimarynetworkblockresponse.ts b/src/models/components/getprimarynetworkblockresponse.ts new file mode 100644 index 0000000..8936a3c --- /dev/null +++ b/src/models/components/getprimarynetworkblockresponse.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + ProposerDetails, + ProposerDetails$inboundSchema, + ProposerDetails$Outbound, + ProposerDetails$outboundSchema, +} from "./proposerdetails.js"; +import * as z from "zod"; + +export type GetPrimaryNetworkBlockResponse = { + blockNumber: string; + blockHash: string; + parentHash: string; + blockTimestamp: number; + blockType: string; + txCount: number; + transactions: Array; + blockSizeBytes: number; + currentSupply?: string | undefined; + proposerDetails?: ProposerDetails | undefined; +}; + +/** @internal */ +export const GetPrimaryNetworkBlockResponse$inboundSchema: z.ZodType< + GetPrimaryNetworkBlockResponse, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string(), + blockHash: z.string(), + parentHash: z.string(), + blockTimestamp: z.number(), + blockType: z.string(), + txCount: z.number(), + transactions: z.array(z.string()), + blockSizeBytes: z.number(), + currentSupply: z.string().optional(), + proposerDetails: ProposerDetails$inboundSchema.optional(), +}); + +/** @internal */ +export type GetPrimaryNetworkBlockResponse$Outbound = { + blockNumber: string; + blockHash: string; + parentHash: string; + blockTimestamp: number; + blockType: string; + txCount: number; + transactions: Array; + blockSizeBytes: number; + currentSupply?: string | undefined; + proposerDetails?: ProposerDetails$Outbound | undefined; +}; + +/** @internal */ +export const GetPrimaryNetworkBlockResponse$outboundSchema: z.ZodType< + GetPrimaryNetworkBlockResponse$Outbound, + z.ZodTypeDef, + GetPrimaryNetworkBlockResponse +> = z.object({ + blockNumber: z.string(), + blockHash: z.string(), + parentHash: z.string(), + blockTimestamp: z.number(), + blockType: z.string(), + txCount: z.number(), + transactions: z.array(z.string()), + blockSizeBytes: z.number(), + currentSupply: z.string().optional(), + proposerDetails: ProposerDetails$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetPrimaryNetworkBlockResponse$ { + /** @deprecated use `GetPrimaryNetworkBlockResponse$inboundSchema` instead. */ + export const inboundSchema = GetPrimaryNetworkBlockResponse$inboundSchema; + /** @deprecated use `GetPrimaryNetworkBlockResponse$outboundSchema` instead. */ + export const outboundSchema = GetPrimaryNetworkBlockResponse$outboundSchema; + /** @deprecated use `GetPrimaryNetworkBlockResponse$Outbound` instead. */ + export type Outbound = GetPrimaryNetworkBlockResponse$Outbound; +} diff --git a/src/models/components/gettransactionresponse.ts b/src/models/components/gettransactionresponse.ts new file mode 100644 index 0000000..bbf1add --- /dev/null +++ b/src/models/components/gettransactionresponse.ts @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155TransferDetails, + Erc1155TransferDetails$inboundSchema, + Erc1155TransferDetails$Outbound, + Erc1155TransferDetails$outboundSchema, +} from "./erc1155transferdetails.js"; +import { + Erc20TransferDetails, + Erc20TransferDetails$inboundSchema, + Erc20TransferDetails$Outbound, + Erc20TransferDetails$outboundSchema, +} from "./erc20transferdetails.js"; +import { + Erc721TransferDetails, + Erc721TransferDetails$inboundSchema, + Erc721TransferDetails$Outbound, + Erc721TransferDetails$outboundSchema, +} from "./erc721transferdetails.js"; +import { + FullNativeTransactionDetails, + FullNativeTransactionDetails$inboundSchema, + FullNativeTransactionDetails$Outbound, + FullNativeTransactionDetails$outboundSchema, +} from "./fullnativetransactiondetails.js"; +import { + InternalTransactionDetails, + InternalTransactionDetails$inboundSchema, + InternalTransactionDetails$Outbound, + InternalTransactionDetails$outboundSchema, +} from "./internaltransactiondetails.js"; +import { + NetworkTokenDetails, + NetworkTokenDetails$inboundSchema, + NetworkTokenDetails$Outbound, + NetworkTokenDetails$outboundSchema, +} from "./networktokendetails.js"; +import * as z from "zod"; + +export type GetTransactionResponse = { + /** + * The list of ERC-20 transfers. + */ + erc20Transfers?: Array | undefined; + /** + * The list of ERC-721 transfers. + */ + erc721Transfers?: Array | undefined; + /** + * The list of ERC-1155 transfers. + */ + erc1155Transfers?: Array | undefined; + /** + * The list of internal transactions. Note that this list only includes CALL and CALLCODE internal transactions that had a non-zero value and CREATE/CREATE2 calls. Use a client provider to recieve a full debug trace of the transaction. + */ + internalTransactions?: Array | undefined; + networkTokenDetails: NetworkTokenDetails; + nativeTransaction: FullNativeTransactionDetails; +}; + +/** @internal */ +export const GetTransactionResponse$inboundSchema: z.ZodType< + GetTransactionResponse, + z.ZodTypeDef, + unknown +> = z.object({ + erc20Transfers: z.array(Erc20TransferDetails$inboundSchema).optional(), + erc721Transfers: z.array(Erc721TransferDetails$inboundSchema).optional(), + erc1155Transfers: z.array(Erc1155TransferDetails$inboundSchema).optional(), + internalTransactions: z.array(InternalTransactionDetails$inboundSchema).optional(), + networkTokenDetails: NetworkTokenDetails$inboundSchema, + nativeTransaction: FullNativeTransactionDetails$inboundSchema, +}); + +/** @internal */ +export type GetTransactionResponse$Outbound = { + erc20Transfers?: Array | undefined; + erc721Transfers?: Array | undefined; + erc1155Transfers?: Array | undefined; + internalTransactions?: Array | undefined; + networkTokenDetails: NetworkTokenDetails$Outbound; + nativeTransaction: FullNativeTransactionDetails$Outbound; +}; + +/** @internal */ +export const GetTransactionResponse$outboundSchema: z.ZodType< + GetTransactionResponse$Outbound, + z.ZodTypeDef, + GetTransactionResponse +> = z.object({ + erc20Transfers: z.array(Erc20TransferDetails$outboundSchema).optional(), + erc721Transfers: z.array(Erc721TransferDetails$outboundSchema).optional(), + erc1155Transfers: z.array(Erc1155TransferDetails$outboundSchema).optional(), + internalTransactions: z.array(InternalTransactionDetails$outboundSchema).optional(), + networkTokenDetails: NetworkTokenDetails$outboundSchema, + nativeTransaction: FullNativeTransactionDetails$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTransactionResponse$ { + /** @deprecated use `GetTransactionResponse$inboundSchema` instead. */ + export const inboundSchema = GetTransactionResponse$inboundSchema; + /** @deprecated use `GetTransactionResponse$outboundSchema` instead. */ + export const outboundSchema = GetTransactionResponse$outboundSchema; + /** @deprecated use `GetTransactionResponse$Outbound` instead. */ + export type Outbound = GetTransactionResponse$Outbound; +} diff --git a/src/models/components/glacierapifeature.ts b/src/models/components/glacierapifeature.ts new file mode 100644 index 0000000..fe9a516 --- /dev/null +++ b/src/models/components/glacierapifeature.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const GlacierApiFeature = { + NftIndexing: "nftIndexing", + Webhooks: "webhooks", +} as const; +export type GlacierApiFeature = ClosedEnum; + +/** @internal */ +export const GlacierApiFeature$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(GlacierApiFeature); + +/** @internal */ +export const GlacierApiFeature$outboundSchema: z.ZodNativeEnum = + GlacierApiFeature$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GlacierApiFeature$ { + /** @deprecated use `GlacierApiFeature$inboundSchema` instead. */ + export const inboundSchema = GlacierApiFeature$inboundSchema; + /** @deprecated use `GlacierApiFeature$outboundSchema` instead. */ + export const outboundSchema = GlacierApiFeature$outboundSchema; +} diff --git a/src/models/components/glacierlistchainsresponse.ts b/src/models/components/glacierlistchainsresponse.ts new file mode 100644 index 0000000..df8be92 --- /dev/null +++ b/src/models/components/glacierlistchainsresponse.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + ChainInfo, + ChainInfo$inboundSchema, + ChainInfo$Outbound, + ChainInfo$outboundSchema, +} from "./chaininfo.js"; +import * as z from "zod"; + +export type GlacierListChainsResponse = { + chains: Array; +}; + +/** @internal */ +export const GlacierListChainsResponse$inboundSchema: z.ZodType< + GlacierListChainsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + chains: z.array(ChainInfo$inboundSchema), +}); + +/** @internal */ +export type GlacierListChainsResponse$Outbound = { + chains: Array; +}; + +/** @internal */ +export const GlacierListChainsResponse$outboundSchema: z.ZodType< + GlacierListChainsResponse$Outbound, + z.ZodTypeDef, + GlacierListChainsResponse +> = z.object({ + chains: z.array(ChainInfo$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GlacierListChainsResponse$ { + /** @deprecated use `GlacierListChainsResponse$inboundSchema` instead. */ + export const inboundSchema = GlacierListChainsResponse$inboundSchema; + /** @deprecated use `GlacierListChainsResponse$outboundSchema` instead. */ + export const outboundSchema = GlacierListChainsResponse$outboundSchema; + /** @deprecated use `GlacierListChainsResponse$Outbound` instead. */ + export type Outbound = GlacierListChainsResponse$Outbound; +} diff --git a/src/models/components/globalparamnetwork.ts b/src/models/components/globalparamnetwork.ts new file mode 100644 index 0000000..65a6b70 --- /dev/null +++ b/src/models/components/globalparamnetwork.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const GlobalParamNetwork = { + Mainnet: "mainnet", + Fuji: "fuji", +} as const; +export type GlobalParamNetwork = ClosedEnum; + +/** @internal */ +export const GlobalParamNetwork$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(GlobalParamNetwork); + +/** @internal */ +export const GlobalParamNetwork$outboundSchema: z.ZodNativeEnum = + GlobalParamNetwork$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GlobalParamNetwork$ { + /** @deprecated use `GlobalParamNetwork$inboundSchema` instead. */ + export const inboundSchema = GlobalParamNetwork$inboundSchema; + /** @deprecated use `GlobalParamNetwork$outboundSchema` instead. */ + export const outboundSchema = GlobalParamNetwork$outboundSchema; +} diff --git a/src/models/components/historicalreward.ts b/src/models/components/historicalreward.ts new file mode 100644 index 0000000..94cabbe --- /dev/null +++ b/src/models/components/historicalreward.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AssetWithPriceInfo, + AssetWithPriceInfo$inboundSchema, + AssetWithPriceInfo$Outbound, + AssetWithPriceInfo$outboundSchema, +} from "./assetwithpriceinfo.js"; +import { RewardType, RewardType$inboundSchema, RewardType$outboundSchema } from "./rewardtype.js"; +import * as z from "zod"; + +export type HistoricalReward = { + /** + * An array of P-Chain wallet addresses. + */ + addresses: Array; + txHash: string; + amountStaked: string; + nodeId: string; + startTimestamp: number; + endTimestamp: number; + rewardType: RewardType; + utxoId: string; + outputIndex: number; + reward: AssetWithPriceInfo; + rewardTxHash: string; +}; + +/** @internal */ +export const HistoricalReward$inboundSchema: z.ZodType = + z.object({ + addresses: z.array(z.string()), + txHash: z.string(), + amountStaked: z.string(), + nodeId: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + rewardType: RewardType$inboundSchema, + utxoId: z.string(), + outputIndex: z.number(), + reward: AssetWithPriceInfo$inboundSchema, + rewardTxHash: z.string(), + }); + +/** @internal */ +export type HistoricalReward$Outbound = { + addresses: Array; + txHash: string; + amountStaked: string; + nodeId: string; + startTimestamp: number; + endTimestamp: number; + rewardType: string; + utxoId: string; + outputIndex: number; + reward: AssetWithPriceInfo$Outbound; + rewardTxHash: string; +}; + +/** @internal */ +export const HistoricalReward$outboundSchema: z.ZodType< + HistoricalReward$Outbound, + z.ZodTypeDef, + HistoricalReward +> = z.object({ + addresses: z.array(z.string()), + txHash: z.string(), + amountStaked: z.string(), + nodeId: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + rewardType: RewardType$outboundSchema, + utxoId: z.string(), + outputIndex: z.number(), + reward: AssetWithPriceInfo$outboundSchema, + rewardTxHash: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace HistoricalReward$ { + /** @deprecated use `HistoricalReward$inboundSchema` instead. */ + export const inboundSchema = HistoricalReward$inboundSchema; + /** @deprecated use `HistoricalReward$outboundSchema` instead. */ + export const outboundSchema = HistoricalReward$outboundSchema; + /** @deprecated use `HistoricalReward$Outbound` instead. */ + export type Outbound = HistoricalReward$Outbound; +} diff --git a/src/models/components/imageasset.ts b/src/models/components/imageasset.ts new file mode 100644 index 0000000..5bbcdb7 --- /dev/null +++ b/src/models/components/imageasset.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type ImageAsset = { + assetId?: string | undefined; + /** + * OUTPUT ONLY + */ + imageUri?: string | undefined; +}; + +/** @internal */ +export const ImageAsset$inboundSchema: z.ZodType = z.object({ + assetId: z.string().optional(), + imageUri: z.string().optional(), +}); + +/** @internal */ +export type ImageAsset$Outbound = { + assetId?: string | undefined; + imageUri?: string | undefined; +}; + +/** @internal */ +export const ImageAsset$outboundSchema: z.ZodType = + z.object({ + assetId: z.string().optional(), + imageUri: z.string().optional(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ImageAsset$ { + /** @deprecated use `ImageAsset$inboundSchema` instead. */ + export const inboundSchema = ImageAsset$inboundSchema; + /** @deprecated use `ImageAsset$outboundSchema` instead. */ + export const outboundSchema = ImageAsset$outboundSchema; + /** @deprecated use `ImageAsset$Outbound` instead. */ + export type Outbound = ImageAsset$Outbound; +} diff --git a/src/models/components/index.ts b/src/models/components/index.ts new file mode 100644 index 0000000..febd2d7 --- /dev/null +++ b/src/models/components/index.ts @@ -0,0 +1,191 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export * from "./activedelegatordetails.js"; +export * from "./activevalidatordetails.js"; +export * from "./addressactivitymetadata.js"; +export * from "./addresseschangerequest.js"; +export * from "./aggregatedassetamount.js"; +export * from "./assetamount.js"; +export * from "./assetwithpriceinfo.js"; +export * from "./blockchain.js"; +export * from "./blockchainid.js"; +export * from "./blockchainids.js"; +export * from "./blockchaininfo.js"; +export * from "./blscredentials.js"; +export * from "./cchainatomicbalances.js"; +export * from "./cchainexporttransaction.js"; +export * from "./cchainimporttransaction.js"; +export * from "./cchainsharedassetbalance.js"; +export * from "./chainaddresschainidmap.js"; +export * from "./chainaddresschainidmaplistresponse.js"; +export * from "./chaininfo.js"; +export * from "./chainstatus.js"; +export * from "./completeddelegatordetails.js"; +export * from "./completedvalidatordetails.js"; +export * from "./contractdeploymentdetails.js"; +export * from "./createevmtransactionexportrequest.js"; +export * from "./createprimarynetworktransactionexportrequest.js"; +export * from "./createwebhookrequest.js"; +export * from "./currencycode.js"; +export * from "./delegationstatustype.js"; +export * from "./delegatorsdetails.js"; +export * from "./deliveredsourcenotindexedteleportermessage.js"; +export * from "./deliveredteleportermessage.js"; +export * from "./erc1155contract.js"; +export * from "./erc1155token.js"; +export * from "./erc1155tokenbalance.js"; +export * from "./erc1155tokenmetadata.js"; +export * from "./erc1155transfer.js"; +export * from "./erc1155transferdetails.js"; +export * from "./erc20contract.js"; +export * from "./erc20token.js"; +export * from "./erc20tokenbalance.js"; +export * from "./erc20transfer.js"; +export * from "./erc20transferdetails.js"; +export * from "./erc721contract.js"; +export * from "./erc721token.js"; +export * from "./erc721tokenbalance.js"; +export * from "./erc721tokenmetadata.js"; +export * from "./erc721transfer.js"; +export * from "./erc721transferdetails.js"; +export * from "./eventtype.js"; +export * from "./evmblock.js"; +export * from "./evminput.js"; +export * from "./evmnetworkoptions.js"; +export * from "./evmoperationtype.js"; +export * from "./evmoutput.js"; +export * from "./fullnativetransactiondetails.js"; +export * from "./getchainresponse.js"; +export * from "./getevmblockresponse.js"; +export * from "./getnativebalanceresponse.js"; +export * from "./getnetworkdetailsresponse.js"; +export * from "./getprimarynetworkblockresponse.js"; +export * from "./gettransactionresponse.js"; +export * from "./glacierapifeature.js"; +export * from "./glacierlistchainsresponse.js"; +export * from "./globalparamnetwork.js"; +export * from "./historicalreward.js"; +export * from "./imageasset.js"; +export * from "./internaltransaction.js"; +export * from "./internaltransactiondetails.js"; +export * from "./internaltransactionopcall.js"; +export * from "./listblockchainsresponse.js"; +export * from "./listcchainatomicbalancesresponse.js"; +export * from "./listcchainatomictransactionsresponse.js"; +export * from "./listcollectiblebalancesresponse.js"; +export * from "./listcontractsresponse.js"; +export * from "./listdelegatordetailsresponse.js"; +export * from "./listerc1155balancesresponse.js"; +export * from "./listerc1155transactionsresponse.js"; +export * from "./listerc20balancesresponse.js"; +export * from "./listerc20transactionsresponse.js"; +export * from "./listerc721balancesresponse.js"; +export * from "./listerc721transactionsresponse.js"; +export * from "./listevmblocksresponse.js"; +export * from "./listhistoricalrewardsresponse.js"; +export * from "./listinternaltransactionsresponse.js"; +export * from "./listnativetransactionsresponse.js"; +export * from "./listnfttokens.js"; +export * from "./listpchainbalancesresponse.js"; +export * from "./listpchaintransactionsresponse.js"; +export * from "./listpchainutxosresponse.js"; +export * from "./listpendingrewardsresponse.js"; +export * from "./listprimarynetworkblocksresponse.js"; +export * from "./listsubnetsresponse.js"; +export * from "./listteleportermessagesresponse.js"; +export * from "./listtransactiondetailsresponse.js"; +export * from "./listtransfersresponse.js"; +export * from "./listutxosresponse.js"; +export * from "./listvalidatordetailsresponse.js"; +export * from "./listwebhookaddressesresponse.js"; +export * from "./listwebhooksresponse.js"; +export * from "./listxchainbalancesresponse.js"; +export * from "./listxchaintransactionsresponse.js"; +export * from "./listxchainverticesresponse.js"; +export * from "./logsformat.js"; +export * from "./logsformatmetadata.js"; +export * from "./logsresponsedto.js"; +export * from "./method.js"; +export * from "./metric.js"; +export * from "./money.js"; +export * from "./nativetokenbalance.js"; +export * from "./nativetransaction.js"; +export * from "./networktoken.js"; +export * from "./networktokendetails.js"; +export * from "./networktype.js"; +export * from "./nfttokenmetadatastatus.js"; +export * from "./operationstatus.js"; +export * from "./operationstatuscode.js"; +export * from "./operationstatusresponse.js"; +export * from "./operationtype.js"; +export * from "./pchainbalance.js"; +export * from "./pchainid.js"; +export * from "./pchainsharedasset.js"; +export * from "./pchaintransaction.js"; +export * from "./pchaintransactiontype.js"; +export * from "./pchainutxo.js"; +export * from "./pendingdelegatordetails.js"; +export * from "./pendingreward.js"; +export * from "./pendingteleportermessage.js"; +export * from "./pendingvalidatordetails.js"; +export * from "./pricingproviders.js"; +export * from "./primarynetwork.js"; +export * from "./primarynetworkassetcap.js"; +export * from "./primarynetworkassettype.js"; +export * from "./primarynetworkblock.js"; +export * from "./primarynetworkchaininfo.js"; +export * from "./primarynetworkchainname.js"; +export * from "./primarynetworkoperationtype.js"; +export * from "./primarynetworkoptions.js"; +export * from "./primarynetworktxtype.js"; +export * from "./proposerdetails.js"; +export * from "./removedvalidatordetails.js"; +export * from "./requesttype.js"; +export * from "./resourcelink.js"; +export * from "./resourcelinktype.js"; +export * from "./rewards.js"; +export * from "./rewardtype.js"; +export * from "./richaddress.js"; +export * from "./security.js"; +export * from "./sharedsecretsresponse.js"; +export * from "./sortbyoption.js"; +export * from "./sortorder.js"; +export * from "./stakingdistribution.js"; +export * from "./subnet.js"; +export * from "./subnetownershipinfo.js"; +export * from "./teleporterdestinationtransaction.js"; +export * from "./teleporterreceipt.js"; +export * from "./teleporterrewarddetails.js"; +export * from "./teleportersourcetransaction.js"; +export * from "./timeintervalgranularityextended.js"; +export * from "./transactiondetails.js"; +export * from "./transactionexportmetadata.js"; +export * from "./transactionmethodtype.js"; +export * from "./transactionstatus.js"; +export * from "./transactionvertexdetail.js"; +export * from "./unknowncontract.js"; +export * from "./updatewebhookrequest.js"; +export * from "./usagemetricsgroupbyenum.js"; +export * from "./usagemetricsresponsedto.js"; +export * from "./usagemetricsvaluedto.js"; +export * from "./utilityaddresses.js"; +export * from "./utxo.js"; +export * from "./utxocredential.js"; +export * from "./utxotype.js"; +export * from "./validationstatustype.js"; +export * from "./validatorhealthdetails.js"; +export * from "./validatorsdetails.js"; +export * from "./vmname.js"; +export * from "./webhookresponse.js"; +export * from "./webhookstatus.js"; +export * from "./webhookstatustype.js"; +export * from "./xchainassetdetails.js"; +export * from "./xchainbalances.js"; +export * from "./xchainid.js"; +export * from "./xchainlineartransaction.js"; +export * from "./xchainnonlineartransaction.js"; +export * from "./xchainsharedassetbalance.js"; +export * from "./xchaintransactiontype.js"; +export * from "./xchainvertex.js"; diff --git a/src/models/components/internaltransaction.ts b/src/models/components/internaltransaction.ts new file mode 100644 index 0000000..09aa0cd --- /dev/null +++ b/src/models/components/internaltransaction.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + InternalTransactionOpCall, + InternalTransactionOpCall$inboundSchema, + InternalTransactionOpCall$outboundSchema, +} from "./internaltransactionopcall.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type InternalTransaction = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The transaction hash identifier. + */ + txHash: string; + from: RichAddress; + to: RichAddress; + internalTxType: InternalTransactionOpCall; + value: string; + /** + * True if the internal transaction was reverted. + */ + isReverted: boolean; + gasUsed: string; + gasLimit: string; +}; + +/** @internal */ +export const InternalTransaction$inboundSchema: z.ZodType< + InternalTransaction, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + internalTxType: InternalTransactionOpCall$inboundSchema, + value: z.string(), + isReverted: z.boolean(), + gasUsed: z.string(), + gasLimit: z.string(), +}); + +/** @internal */ +export type InternalTransaction$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + txHash: string; + from: RichAddress$Outbound; + to: RichAddress$Outbound; + internalTxType: string; + value: string; + isReverted: boolean; + gasUsed: string; + gasLimit: string; +}; + +/** @internal */ +export const InternalTransaction$outboundSchema: z.ZodType< + InternalTransaction$Outbound, + z.ZodTypeDef, + InternalTransaction +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + txHash: z.string(), + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + internalTxType: InternalTransactionOpCall$outboundSchema, + value: z.string(), + isReverted: z.boolean(), + gasUsed: z.string(), + gasLimit: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InternalTransaction$ { + /** @deprecated use `InternalTransaction$inboundSchema` instead. */ + export const inboundSchema = InternalTransaction$inboundSchema; + /** @deprecated use `InternalTransaction$outboundSchema` instead. */ + export const outboundSchema = InternalTransaction$outboundSchema; + /** @deprecated use `InternalTransaction$Outbound` instead. */ + export type Outbound = InternalTransaction$Outbound; +} diff --git a/src/models/components/internaltransactiondetails.ts b/src/models/components/internaltransactiondetails.ts new file mode 100644 index 0000000..a45f99c --- /dev/null +++ b/src/models/components/internaltransactiondetails.ts @@ -0,0 +1,83 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + InternalTransactionOpCall, + InternalTransactionOpCall$inboundSchema, + InternalTransactionOpCall$outboundSchema, +} from "./internaltransactionopcall.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type InternalTransactionDetails = { + from: RichAddress; + to: RichAddress; + internalTxType: InternalTransactionOpCall; + value: string; + /** + * True if the internal transaction was reverted. + */ + isReverted: boolean; + gasUsed: string; + gasLimit: string; +}; + +/** @internal */ +export const InternalTransactionDetails$inboundSchema: z.ZodType< + InternalTransactionDetails, + z.ZodTypeDef, + unknown +> = z.object({ + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + internalTxType: InternalTransactionOpCall$inboundSchema, + value: z.string(), + isReverted: z.boolean(), + gasUsed: z.string(), + gasLimit: z.string(), +}); + +/** @internal */ +export type InternalTransactionDetails$Outbound = { + from: RichAddress$Outbound; + to: RichAddress$Outbound; + internalTxType: string; + value: string; + isReverted: boolean; + gasUsed: string; + gasLimit: string; +}; + +/** @internal */ +export const InternalTransactionDetails$outboundSchema: z.ZodType< + InternalTransactionDetails$Outbound, + z.ZodTypeDef, + InternalTransactionDetails +> = z.object({ + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + internalTxType: InternalTransactionOpCall$outboundSchema, + value: z.string(), + isReverted: z.boolean(), + gasUsed: z.string(), + gasLimit: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InternalTransactionDetails$ { + /** @deprecated use `InternalTransactionDetails$inboundSchema` instead. */ + export const inboundSchema = InternalTransactionDetails$inboundSchema; + /** @deprecated use `InternalTransactionDetails$outboundSchema` instead. */ + export const outboundSchema = InternalTransactionDetails$outboundSchema; + /** @deprecated use `InternalTransactionDetails$Outbound` instead. */ + export type Outbound = InternalTransactionDetails$Outbound; +} diff --git a/src/models/components/internaltransactionopcall.ts b/src/models/components/internaltransactionopcall.ts new file mode 100644 index 0000000..0ee8e3a --- /dev/null +++ b/src/models/components/internaltransactionopcall.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const InternalTransactionOpCall = { + Unknown: "UNKNOWN", + Call: "CALL", + Create: "CREATE", + Create2: "CREATE2", + Callcode: "CALLCODE", + Delegatecall: "DELEGATECALL", + Staticcall: "STATICCALL", +} as const; +export type InternalTransactionOpCall = ClosedEnum; + +/** @internal */ +export const InternalTransactionOpCall$inboundSchema: z.ZodNativeEnum< + typeof InternalTransactionOpCall +> = z.nativeEnum(InternalTransactionOpCall); + +/** @internal */ +export const InternalTransactionOpCall$outboundSchema: z.ZodNativeEnum< + typeof InternalTransactionOpCall +> = InternalTransactionOpCall$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InternalTransactionOpCall$ { + /** @deprecated use `InternalTransactionOpCall$inboundSchema` instead. */ + export const inboundSchema = InternalTransactionOpCall$inboundSchema; + /** @deprecated use `InternalTransactionOpCall$outboundSchema` instead. */ + export const outboundSchema = InternalTransactionOpCall$outboundSchema; +} diff --git a/src/models/components/listblockchainsresponse.ts b/src/models/components/listblockchainsresponse.ts new file mode 100644 index 0000000..60bd2e4 --- /dev/null +++ b/src/models/components/listblockchainsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Blockchain, + Blockchain$inboundSchema, + Blockchain$Outbound, + Blockchain$outboundSchema, +} from "./blockchain.js"; +import * as z from "zod"; + +export type ListBlockchainsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + blockchains: Array; +}; + +/** @internal */ +export const ListBlockchainsResponse$inboundSchema: z.ZodType< + ListBlockchainsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + blockchains: z.array(Blockchain$inboundSchema), +}); + +/** @internal */ +export type ListBlockchainsResponse$Outbound = { + nextPageToken?: string | undefined; + blockchains: Array; +}; + +/** @internal */ +export const ListBlockchainsResponse$outboundSchema: z.ZodType< + ListBlockchainsResponse$Outbound, + z.ZodTypeDef, + ListBlockchainsResponse +> = z.object({ + nextPageToken: z.string().optional(), + blockchains: z.array(Blockchain$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListBlockchainsResponse$ { + /** @deprecated use `ListBlockchainsResponse$inboundSchema` instead. */ + export const inboundSchema = ListBlockchainsResponse$inboundSchema; + /** @deprecated use `ListBlockchainsResponse$outboundSchema` instead. */ + export const outboundSchema = ListBlockchainsResponse$outboundSchema; + /** @deprecated use `ListBlockchainsResponse$Outbound` instead. */ + export type Outbound = ListBlockchainsResponse$Outbound; +} diff --git a/src/models/components/listcchainatomicbalancesresponse.ts b/src/models/components/listcchainatomicbalancesresponse.ts new file mode 100644 index 0000000..1ecd5c6 --- /dev/null +++ b/src/models/components/listcchainatomicbalancesresponse.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + CChainAtomicBalances, + CChainAtomicBalances$inboundSchema, + CChainAtomicBalances$Outbound, + CChainAtomicBalances$outboundSchema, +} from "./cchainatomicbalances.js"; +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import * as z from "zod"; + +export type ListCChainAtomicBalancesResponse = { + balances: CChainAtomicBalances; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListCChainAtomicBalancesResponse$inboundSchema: z.ZodType< + ListCChainAtomicBalancesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + balances: CChainAtomicBalances$inboundSchema, + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListCChainAtomicBalancesResponse$Outbound = { + balances: CChainAtomicBalances$Outbound; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListCChainAtomicBalancesResponse$outboundSchema: z.ZodType< + ListCChainAtomicBalancesResponse$Outbound, + z.ZodTypeDef, + ListCChainAtomicBalancesResponse +> = z.object({ + balances: CChainAtomicBalances$outboundSchema, + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCChainAtomicBalancesResponse$ { + /** @deprecated use `ListCChainAtomicBalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListCChainAtomicBalancesResponse$inboundSchema; + /** @deprecated use `ListCChainAtomicBalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListCChainAtomicBalancesResponse$outboundSchema; + /** @deprecated use `ListCChainAtomicBalancesResponse$Outbound` instead. */ + export type Outbound = ListCChainAtomicBalancesResponse$Outbound; +} diff --git a/src/models/components/listcchainatomictransactionsresponse.ts b/src/models/components/listcchainatomictransactionsresponse.ts new file mode 100644 index 0000000..2128b76 --- /dev/null +++ b/src/models/components/listcchainatomictransactionsresponse.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + CChainExportTransaction, + CChainExportTransaction$inboundSchema, + CChainExportTransaction$Outbound, + CChainExportTransaction$outboundSchema, +} from "./cchainexporttransaction.js"; +import { + CChainImportTransaction, + CChainImportTransaction$inboundSchema, + CChainImportTransaction$Outbound, + CChainImportTransaction$outboundSchema, +} from "./cchainimporttransaction.js"; +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import * as z from "zod"; + +export type ListCChainAtomicTransactionsResponseTransactions = + | CChainExportTransaction + | CChainImportTransaction; + +export type ListCChainAtomicTransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListCChainAtomicTransactionsResponseTransactions$inboundSchema: z.ZodType< + ListCChainAtomicTransactionsResponseTransactions, + z.ZodTypeDef, + unknown +> = z.union([CChainExportTransaction$inboundSchema, CChainImportTransaction$inboundSchema]); + +/** @internal */ +export type ListCChainAtomicTransactionsResponseTransactions$Outbound = + | CChainExportTransaction$Outbound + | CChainImportTransaction$Outbound; + +/** @internal */ +export const ListCChainAtomicTransactionsResponseTransactions$outboundSchema: z.ZodType< + ListCChainAtomicTransactionsResponseTransactions$Outbound, + z.ZodTypeDef, + ListCChainAtomicTransactionsResponseTransactions +> = z.union([CChainExportTransaction$outboundSchema, CChainImportTransaction$outboundSchema]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCChainAtomicTransactionsResponseTransactions$ { + /** @deprecated use `ListCChainAtomicTransactionsResponseTransactions$inboundSchema` instead. */ + export const inboundSchema = ListCChainAtomicTransactionsResponseTransactions$inboundSchema; + /** @deprecated use `ListCChainAtomicTransactionsResponseTransactions$outboundSchema` instead. */ + export const outboundSchema = ListCChainAtomicTransactionsResponseTransactions$outboundSchema; + /** @deprecated use `ListCChainAtomicTransactionsResponseTransactions$Outbound` instead. */ + export type Outbound = ListCChainAtomicTransactionsResponseTransactions$Outbound; +} + +/** @internal */ +export const ListCChainAtomicTransactionsResponse$inboundSchema: z.ZodType< + ListCChainAtomicTransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array( + z.union([CChainExportTransaction$inboundSchema, CChainImportTransaction$inboundSchema]) + ), + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListCChainAtomicTransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListCChainAtomicTransactionsResponse$outboundSchema: z.ZodType< + ListCChainAtomicTransactionsResponse$Outbound, + z.ZodTypeDef, + ListCChainAtomicTransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array( + z.union([CChainExportTransaction$outboundSchema, CChainImportTransaction$outboundSchema]) + ), + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCChainAtomicTransactionsResponse$ { + /** @deprecated use `ListCChainAtomicTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListCChainAtomicTransactionsResponse$inboundSchema; + /** @deprecated use `ListCChainAtomicTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListCChainAtomicTransactionsResponse$outboundSchema; + /** @deprecated use `ListCChainAtomicTransactionsResponse$Outbound` instead. */ + export type Outbound = ListCChainAtomicTransactionsResponse$Outbound; +} diff --git a/src/models/components/listcollectiblebalancesresponse.ts b/src/models/components/listcollectiblebalancesresponse.ts new file mode 100644 index 0000000..4148719 --- /dev/null +++ b/src/models/components/listcollectiblebalancesresponse.ts @@ -0,0 +1,105 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155TokenBalance, + Erc1155TokenBalance$inboundSchema, + Erc1155TokenBalance$Outbound, + Erc1155TokenBalance$outboundSchema, +} from "./erc1155tokenbalance.js"; +import { + Erc721TokenBalance, + Erc721TokenBalance$inboundSchema, + Erc721TokenBalance$Outbound, + Erc721TokenBalance$outboundSchema, +} from "./erc721tokenbalance.js"; +import * as z from "zod"; + +export type CollectibleBalances = Erc1155TokenBalance | Erc721TokenBalance; + +export type ListCollectibleBalancesResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + /** + * The list of ERC-721 and ERC-1155 token balances for the address. + */ + collectibleBalances: Array; +}; + +/** @internal */ +export const CollectibleBalances$inboundSchema: z.ZodType< + CollectibleBalances, + z.ZodTypeDef, + unknown +> = z.union([Erc1155TokenBalance$inboundSchema, Erc721TokenBalance$inboundSchema]); + +/** @internal */ +export type CollectibleBalances$Outbound = + | Erc1155TokenBalance$Outbound + | Erc721TokenBalance$Outbound; + +/** @internal */ +export const CollectibleBalances$outboundSchema: z.ZodType< + CollectibleBalances$Outbound, + z.ZodTypeDef, + CollectibleBalances +> = z.union([Erc1155TokenBalance$outboundSchema, Erc721TokenBalance$outboundSchema]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CollectibleBalances$ { + /** @deprecated use `CollectibleBalances$inboundSchema` instead. */ + export const inboundSchema = CollectibleBalances$inboundSchema; + /** @deprecated use `CollectibleBalances$outboundSchema` instead. */ + export const outboundSchema = CollectibleBalances$outboundSchema; + /** @deprecated use `CollectibleBalances$Outbound` instead. */ + export type Outbound = CollectibleBalances$Outbound; +} + +/** @internal */ +export const ListCollectibleBalancesResponse$inboundSchema: z.ZodType< + ListCollectibleBalancesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + collectibleBalances: z.array( + z.union([Erc1155TokenBalance$inboundSchema, Erc721TokenBalance$inboundSchema]) + ), +}); + +/** @internal */ +export type ListCollectibleBalancesResponse$Outbound = { + nextPageToken?: string | undefined; + collectibleBalances: Array; +}; + +/** @internal */ +export const ListCollectibleBalancesResponse$outboundSchema: z.ZodType< + ListCollectibleBalancesResponse$Outbound, + z.ZodTypeDef, + ListCollectibleBalancesResponse +> = z.object({ + nextPageToken: z.string().optional(), + collectibleBalances: z.array( + z.union([Erc1155TokenBalance$outboundSchema, Erc721TokenBalance$outboundSchema]) + ), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCollectibleBalancesResponse$ { + /** @deprecated use `ListCollectibleBalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListCollectibleBalancesResponse$inboundSchema; + /** @deprecated use `ListCollectibleBalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListCollectibleBalancesResponse$outboundSchema; + /** @deprecated use `ListCollectibleBalancesResponse$Outbound` instead. */ + export type Outbound = ListCollectibleBalancesResponse$Outbound; +} diff --git a/src/models/components/listcontractsresponse.ts b/src/models/components/listcontractsresponse.ts new file mode 100644 index 0000000..c4de6f6 --- /dev/null +++ b/src/models/components/listcontractsresponse.ts @@ -0,0 +1,191 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155Contract, + Erc1155Contract$inboundSchema, + Erc1155Contract$Outbound, + Erc1155Contract$outboundSchema, +} from "./erc1155contract.js"; +import { + Erc20Contract, + Erc20Contract$inboundSchema, + Erc20Contract$Outbound, + Erc20Contract$outboundSchema, +} from "./erc20contract.js"; +import { + Erc721Contract, + Erc721Contract$inboundSchema, + Erc721Contract$Outbound, + Erc721Contract$outboundSchema, +} from "./erc721contract.js"; +import { + UnknownContract, + UnknownContract$inboundSchema, + UnknownContract$Outbound, + UnknownContract$outboundSchema, +} from "./unknowncontract.js"; +import * as z from "zod"; + +export type Contracts = + | (UnknownContract & { ercType: "UNKNOWN" }) + | (Erc721Contract & { ercType: "ERC-721" }) + | (Erc1155Contract & { ercType: "ERC-1155" }) + | (Erc20Contract & { ercType: "ERC-20" }); + +export type ListContractsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + contracts: Array< + | (UnknownContract & { ercType: "UNKNOWN" }) + | (Erc721Contract & { ercType: "ERC-721" }) + | (Erc1155Contract & { ercType: "ERC-1155" }) + | (Erc20Contract & { ercType: "ERC-20" }) + >; +}; + +/** @internal */ +export const Contracts$inboundSchema: z.ZodType = z.union([ + UnknownContract$inboundSchema.and( + z.object({ ercType: z.literal("UNKNOWN") }).transform((v) => ({ ercType: v.ercType })) + ), + Erc721Contract$inboundSchema.and( + z.object({ ercType: z.literal("ERC-721") }).transform((v) => ({ ercType: v.ercType })) + ), + Erc1155Contract$inboundSchema.and( + z.object({ ercType: z.literal("ERC-1155") }).transform((v) => ({ ercType: v.ercType })) + ), + Erc20Contract$inboundSchema.and( + z.object({ ercType: z.literal("ERC-20") }).transform((v) => ({ ercType: v.ercType })) + ), +]); + +/** @internal */ +export type Contracts$Outbound = + | (UnknownContract$Outbound & { ercType: "UNKNOWN" }) + | (Erc721Contract$Outbound & { ercType: "ERC-721" }) + | (Erc1155Contract$Outbound & { ercType: "ERC-1155" }) + | (Erc20Contract$Outbound & { ercType: "ERC-20" }); + +/** @internal */ +export const Contracts$outboundSchema: z.ZodType = + z.union([ + UnknownContract$outboundSchema.and( + z.object({ ercType: z.literal("UNKNOWN") }).transform((v) => ({ ercType: v.ercType })) + ), + Erc721Contract$outboundSchema.and( + z.object({ ercType: z.literal("ERC-721") }).transform((v) => ({ ercType: v.ercType })) + ), + Erc1155Contract$outboundSchema.and( + z.object({ ercType: z.literal("ERC-1155") }).transform((v) => ({ ercType: v.ercType })) + ), + Erc20Contract$outboundSchema.and( + z.object({ ercType: z.literal("ERC-20") }).transform((v) => ({ ercType: v.ercType })) + ), + ]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Contracts$ { + /** @deprecated use `Contracts$inboundSchema` instead. */ + export const inboundSchema = Contracts$inboundSchema; + /** @deprecated use `Contracts$outboundSchema` instead. */ + export const outboundSchema = Contracts$outboundSchema; + /** @deprecated use `Contracts$Outbound` instead. */ + export type Outbound = Contracts$Outbound; +} + +/** @internal */ +export const ListContractsResponse$inboundSchema: z.ZodType< + ListContractsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + contracts: z.array( + z.union([ + UnknownContract$inboundSchema.and( + z + .object({ ercType: z.literal("UNKNOWN") }) + .transform((v) => ({ ercType: v.ercType })) + ), + Erc721Contract$inboundSchema.and( + z + .object({ ercType: z.literal("ERC-721") }) + .transform((v) => ({ ercType: v.ercType })) + ), + Erc1155Contract$inboundSchema.and( + z + .object({ ercType: z.literal("ERC-1155") }) + .transform((v) => ({ ercType: v.ercType })) + ), + Erc20Contract$inboundSchema.and( + z + .object({ ercType: z.literal("ERC-20") }) + .transform((v) => ({ ercType: v.ercType })) + ), + ]) + ), +}); + +/** @internal */ +export type ListContractsResponse$Outbound = { + nextPageToken?: string | undefined; + contracts: Array< + | (UnknownContract$Outbound & { ercType: "UNKNOWN" }) + | (Erc721Contract$Outbound & { ercType: "ERC-721" }) + | (Erc1155Contract$Outbound & { ercType: "ERC-1155" }) + | (Erc20Contract$Outbound & { ercType: "ERC-20" }) + >; +}; + +/** @internal */ +export const ListContractsResponse$outboundSchema: z.ZodType< + ListContractsResponse$Outbound, + z.ZodTypeDef, + ListContractsResponse +> = z.object({ + nextPageToken: z.string().optional(), + contracts: z.array( + z.union([ + UnknownContract$outboundSchema.and( + z + .object({ ercType: z.literal("UNKNOWN") }) + .transform((v) => ({ ercType: v.ercType })) + ), + Erc721Contract$outboundSchema.and( + z + .object({ ercType: z.literal("ERC-721") }) + .transform((v) => ({ ercType: v.ercType })) + ), + Erc1155Contract$outboundSchema.and( + z + .object({ ercType: z.literal("ERC-1155") }) + .transform((v) => ({ ercType: v.ercType })) + ), + Erc20Contract$outboundSchema.and( + z + .object({ ercType: z.literal("ERC-20") }) + .transform((v) => ({ ercType: v.ercType })) + ), + ]) + ), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListContractsResponse$ { + /** @deprecated use `ListContractsResponse$inboundSchema` instead. */ + export const inboundSchema = ListContractsResponse$inboundSchema; + /** @deprecated use `ListContractsResponse$outboundSchema` instead. */ + export const outboundSchema = ListContractsResponse$outboundSchema; + /** @deprecated use `ListContractsResponse$Outbound` instead. */ + export type Outbound = ListContractsResponse$Outbound; +} diff --git a/src/models/components/listdelegatordetailsresponse.ts b/src/models/components/listdelegatordetailsresponse.ts new file mode 100644 index 0000000..d1f507f --- /dev/null +++ b/src/models/components/listdelegatordetailsresponse.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + ActiveDelegatorDetails, + ActiveDelegatorDetails$inboundSchema, + ActiveDelegatorDetails$Outbound, + ActiveDelegatorDetails$outboundSchema, +} from "./activedelegatordetails.js"; +import { + CompletedDelegatorDetails, + CompletedDelegatorDetails$inboundSchema, + CompletedDelegatorDetails$Outbound, + CompletedDelegatorDetails$outboundSchema, +} from "./completeddelegatordetails.js"; +import { + PendingDelegatorDetails, + PendingDelegatorDetails$inboundSchema, + PendingDelegatorDetails$Outbound, + PendingDelegatorDetails$outboundSchema, +} from "./pendingdelegatordetails.js"; +import * as z from "zod"; + +export type Delegators = + | (ActiveDelegatorDetails & { delegationStatus: "active" }) + | (PendingDelegatorDetails & { delegationStatus: "pending" }) + | (CompletedDelegatorDetails & { delegationStatus: "completed" }); + +export type ListDelegatorDetailsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + /** + * The list of Delegator Details. + */ + delegators: Array< + | (ActiveDelegatorDetails & { delegationStatus: "active" }) + | (PendingDelegatorDetails & { delegationStatus: "pending" }) + | (CompletedDelegatorDetails & { delegationStatus: "completed" }) + >; +}; + +/** @internal */ +export const Delegators$inboundSchema: z.ZodType = z.union([ + ActiveDelegatorDetails$inboundSchema.and( + z + .object({ delegationStatus: z.literal("active") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + PendingDelegatorDetails$inboundSchema.and( + z + .object({ delegationStatus: z.literal("pending") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + CompletedDelegatorDetails$inboundSchema.and( + z + .object({ delegationStatus: z.literal("completed") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), +]); + +/** @internal */ +export type Delegators$Outbound = + | (ActiveDelegatorDetails$Outbound & { delegationStatus: "active" }) + | (PendingDelegatorDetails$Outbound & { delegationStatus: "pending" }) + | (CompletedDelegatorDetails$Outbound & { delegationStatus: "completed" }); + +/** @internal */ +export const Delegators$outboundSchema: z.ZodType = + z.union([ + ActiveDelegatorDetails$outboundSchema.and( + z + .object({ delegationStatus: z.literal("active") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + PendingDelegatorDetails$outboundSchema.and( + z + .object({ delegationStatus: z.literal("pending") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + CompletedDelegatorDetails$outboundSchema.and( + z + .object({ delegationStatus: z.literal("completed") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + ]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Delegators$ { + /** @deprecated use `Delegators$inboundSchema` instead. */ + export const inboundSchema = Delegators$inboundSchema; + /** @deprecated use `Delegators$outboundSchema` instead. */ + export const outboundSchema = Delegators$outboundSchema; + /** @deprecated use `Delegators$Outbound` instead. */ + export type Outbound = Delegators$Outbound; +} + +/** @internal */ +export const ListDelegatorDetailsResponse$inboundSchema: z.ZodType< + ListDelegatorDetailsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + delegators: z.array( + z.union([ + ActiveDelegatorDetails$inboundSchema.and( + z + .object({ delegationStatus: z.literal("active") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + PendingDelegatorDetails$inboundSchema.and( + z + .object({ delegationStatus: z.literal("pending") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + CompletedDelegatorDetails$inboundSchema.and( + z + .object({ delegationStatus: z.literal("completed") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + ]) + ), +}); + +/** @internal */ +export type ListDelegatorDetailsResponse$Outbound = { + nextPageToken?: string | undefined; + delegators: Array< + | (ActiveDelegatorDetails$Outbound & { delegationStatus: "active" }) + | (PendingDelegatorDetails$Outbound & { delegationStatus: "pending" }) + | (CompletedDelegatorDetails$Outbound & { delegationStatus: "completed" }) + >; +}; + +/** @internal */ +export const ListDelegatorDetailsResponse$outboundSchema: z.ZodType< + ListDelegatorDetailsResponse$Outbound, + z.ZodTypeDef, + ListDelegatorDetailsResponse +> = z.object({ + nextPageToken: z.string().optional(), + delegators: z.array( + z.union([ + ActiveDelegatorDetails$outboundSchema.and( + z + .object({ delegationStatus: z.literal("active") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + PendingDelegatorDetails$outboundSchema.and( + z + .object({ delegationStatus: z.literal("pending") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + CompletedDelegatorDetails$outboundSchema.and( + z + .object({ delegationStatus: z.literal("completed") }) + .transform((v) => ({ delegationStatus: v.delegationStatus })) + ), + ]) + ), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListDelegatorDetailsResponse$ { + /** @deprecated use `ListDelegatorDetailsResponse$inboundSchema` instead. */ + export const inboundSchema = ListDelegatorDetailsResponse$inboundSchema; + /** @deprecated use `ListDelegatorDetailsResponse$outboundSchema` instead. */ + export const outboundSchema = ListDelegatorDetailsResponse$outboundSchema; + /** @deprecated use `ListDelegatorDetailsResponse$Outbound` instead. */ + export type Outbound = ListDelegatorDetailsResponse$Outbound; +} diff --git a/src/models/components/listerc1155balancesresponse.ts b/src/models/components/listerc1155balancesresponse.ts new file mode 100644 index 0000000..0bbfeb7 --- /dev/null +++ b/src/models/components/listerc1155balancesresponse.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155TokenBalance, + Erc1155TokenBalance$inboundSchema, + Erc1155TokenBalance$Outbound, + Erc1155TokenBalance$outboundSchema, +} from "./erc1155tokenbalance.js"; +import * as z from "zod"; + +export type ListErc1155BalancesResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + /** + * The list of ERC-1155 token balances for the address. + */ + erc1155TokenBalances: Array; +}; + +/** @internal */ +export const ListErc1155BalancesResponse$inboundSchema: z.ZodType< + ListErc1155BalancesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + erc1155TokenBalances: z.array(Erc1155TokenBalance$inboundSchema), +}); + +/** @internal */ +export type ListErc1155BalancesResponse$Outbound = { + nextPageToken?: string | undefined; + erc1155TokenBalances: Array; +}; + +/** @internal */ +export const ListErc1155BalancesResponse$outboundSchema: z.ZodType< + ListErc1155BalancesResponse$Outbound, + z.ZodTypeDef, + ListErc1155BalancesResponse +> = z.object({ + nextPageToken: z.string().optional(), + erc1155TokenBalances: z.array(Erc1155TokenBalance$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155BalancesResponse$ { + /** @deprecated use `ListErc1155BalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc1155BalancesResponse$inboundSchema; + /** @deprecated use `ListErc1155BalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc1155BalancesResponse$outboundSchema; + /** @deprecated use `ListErc1155BalancesResponse$Outbound` instead. */ + export type Outbound = ListErc1155BalancesResponse$Outbound; +} diff --git a/src/models/components/listerc1155transactionsresponse.ts b/src/models/components/listerc1155transactionsresponse.ts new file mode 100644 index 0000000..5c689ca --- /dev/null +++ b/src/models/components/listerc1155transactionsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155Transfer, + Erc1155Transfer$inboundSchema, + Erc1155Transfer$Outbound, + Erc1155Transfer$outboundSchema, +} from "./erc1155transfer.js"; +import * as z from "zod"; + +export type ListErc1155TransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListErc1155TransactionsResponse$inboundSchema: z.ZodType< + ListErc1155TransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(Erc1155Transfer$inboundSchema), +}); + +/** @internal */ +export type ListErc1155TransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListErc1155TransactionsResponse$outboundSchema: z.ZodType< + ListErc1155TransactionsResponse$Outbound, + z.ZodTypeDef, + ListErc1155TransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(Erc1155Transfer$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155TransactionsResponse$ { + /** @deprecated use `ListErc1155TransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc1155TransactionsResponse$inboundSchema; + /** @deprecated use `ListErc1155TransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc1155TransactionsResponse$outboundSchema; + /** @deprecated use `ListErc1155TransactionsResponse$Outbound` instead. */ + export type Outbound = ListErc1155TransactionsResponse$Outbound; +} diff --git a/src/models/components/listerc20balancesresponse.ts b/src/models/components/listerc20balancesresponse.ts new file mode 100644 index 0000000..4dc3ff0 --- /dev/null +++ b/src/models/components/listerc20balancesresponse.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc20TokenBalance, + Erc20TokenBalance$inboundSchema, + Erc20TokenBalance$Outbound, + Erc20TokenBalance$outboundSchema, +} from "./erc20tokenbalance.js"; +import * as z from "zod"; + +export type ListErc20BalancesResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + /** + * The list of ERC-20 token balances for the address. + */ + erc20TokenBalances: Array; +}; + +/** @internal */ +export const ListErc20BalancesResponse$inboundSchema: z.ZodType< + ListErc20BalancesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + erc20TokenBalances: z.array(Erc20TokenBalance$inboundSchema), +}); + +/** @internal */ +export type ListErc20BalancesResponse$Outbound = { + nextPageToken?: string | undefined; + erc20TokenBalances: Array; +}; + +/** @internal */ +export const ListErc20BalancesResponse$outboundSchema: z.ZodType< + ListErc20BalancesResponse$Outbound, + z.ZodTypeDef, + ListErc20BalancesResponse +> = z.object({ + nextPageToken: z.string().optional(), + erc20TokenBalances: z.array(Erc20TokenBalance$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20BalancesResponse$ { + /** @deprecated use `ListErc20BalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc20BalancesResponse$inboundSchema; + /** @deprecated use `ListErc20BalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc20BalancesResponse$outboundSchema; + /** @deprecated use `ListErc20BalancesResponse$Outbound` instead. */ + export type Outbound = ListErc20BalancesResponse$Outbound; +} diff --git a/src/models/components/listerc20transactionsresponse.ts b/src/models/components/listerc20transactionsresponse.ts new file mode 100644 index 0000000..0ed425e --- /dev/null +++ b/src/models/components/listerc20transactionsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc20Transfer, + Erc20Transfer$inboundSchema, + Erc20Transfer$Outbound, + Erc20Transfer$outboundSchema, +} from "./erc20transfer.js"; +import * as z from "zod"; + +export type ListErc20TransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListErc20TransactionsResponse$inboundSchema: z.ZodType< + ListErc20TransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(Erc20Transfer$inboundSchema), +}); + +/** @internal */ +export type ListErc20TransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListErc20TransactionsResponse$outboundSchema: z.ZodType< + ListErc20TransactionsResponse$Outbound, + z.ZodTypeDef, + ListErc20TransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(Erc20Transfer$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20TransactionsResponse$ { + /** @deprecated use `ListErc20TransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc20TransactionsResponse$inboundSchema; + /** @deprecated use `ListErc20TransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc20TransactionsResponse$outboundSchema; + /** @deprecated use `ListErc20TransactionsResponse$Outbound` instead. */ + export type Outbound = ListErc20TransactionsResponse$Outbound; +} diff --git a/src/models/components/listerc721balancesresponse.ts b/src/models/components/listerc721balancesresponse.ts new file mode 100644 index 0000000..52c76c1 --- /dev/null +++ b/src/models/components/listerc721balancesresponse.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc721TokenBalance, + Erc721TokenBalance$inboundSchema, + Erc721TokenBalance$Outbound, + Erc721TokenBalance$outboundSchema, +} from "./erc721tokenbalance.js"; +import * as z from "zod"; + +export type ListErc721BalancesResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + /** + * The list of ERC-721 token balances for the address. + */ + erc721TokenBalances: Array; +}; + +/** @internal */ +export const ListErc721BalancesResponse$inboundSchema: z.ZodType< + ListErc721BalancesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + erc721TokenBalances: z.array(Erc721TokenBalance$inboundSchema), +}); + +/** @internal */ +export type ListErc721BalancesResponse$Outbound = { + nextPageToken?: string | undefined; + erc721TokenBalances: Array; +}; + +/** @internal */ +export const ListErc721BalancesResponse$outboundSchema: z.ZodType< + ListErc721BalancesResponse$Outbound, + z.ZodTypeDef, + ListErc721BalancesResponse +> = z.object({ + nextPageToken: z.string().optional(), + erc721TokenBalances: z.array(Erc721TokenBalance$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721BalancesResponse$ { + /** @deprecated use `ListErc721BalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc721BalancesResponse$inboundSchema; + /** @deprecated use `ListErc721BalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc721BalancesResponse$outboundSchema; + /** @deprecated use `ListErc721BalancesResponse$Outbound` instead. */ + export type Outbound = ListErc721BalancesResponse$Outbound; +} diff --git a/src/models/components/listerc721transactionsresponse.ts b/src/models/components/listerc721transactionsresponse.ts new file mode 100644 index 0000000..45e6423 --- /dev/null +++ b/src/models/components/listerc721transactionsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc721Transfer, + Erc721Transfer$inboundSchema, + Erc721Transfer$Outbound, + Erc721Transfer$outboundSchema, +} from "./erc721transfer.js"; +import * as z from "zod"; + +export type ListErc721TransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListErc721TransactionsResponse$inboundSchema: z.ZodType< + ListErc721TransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(Erc721Transfer$inboundSchema), +}); + +/** @internal */ +export type ListErc721TransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListErc721TransactionsResponse$outboundSchema: z.ZodType< + ListErc721TransactionsResponse$Outbound, + z.ZodTypeDef, + ListErc721TransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(Erc721Transfer$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721TransactionsResponse$ { + /** @deprecated use `ListErc721TransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc721TransactionsResponse$inboundSchema; + /** @deprecated use `ListErc721TransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc721TransactionsResponse$outboundSchema; + /** @deprecated use `ListErc721TransactionsResponse$Outbound` instead. */ + export type Outbound = ListErc721TransactionsResponse$Outbound; +} diff --git a/src/models/components/listevmblocksresponse.ts b/src/models/components/listevmblocksresponse.ts new file mode 100644 index 0000000..9bc10b6 --- /dev/null +++ b/src/models/components/listevmblocksresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + EvmBlock, + EvmBlock$inboundSchema, + EvmBlock$Outbound, + EvmBlock$outboundSchema, +} from "./evmblock.js"; +import * as z from "zod"; + +export type ListEvmBlocksResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + blocks: Array; +}; + +/** @internal */ +export const ListEvmBlocksResponse$inboundSchema: z.ZodType< + ListEvmBlocksResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + blocks: z.array(EvmBlock$inboundSchema), +}); + +/** @internal */ +export type ListEvmBlocksResponse$Outbound = { + nextPageToken?: string | undefined; + blocks: Array; +}; + +/** @internal */ +export const ListEvmBlocksResponse$outboundSchema: z.ZodType< + ListEvmBlocksResponse$Outbound, + z.ZodTypeDef, + ListEvmBlocksResponse +> = z.object({ + nextPageToken: z.string().optional(), + blocks: z.array(EvmBlock$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListEvmBlocksResponse$ { + /** @deprecated use `ListEvmBlocksResponse$inboundSchema` instead. */ + export const inboundSchema = ListEvmBlocksResponse$inboundSchema; + /** @deprecated use `ListEvmBlocksResponse$outboundSchema` instead. */ + export const outboundSchema = ListEvmBlocksResponse$outboundSchema; + /** @deprecated use `ListEvmBlocksResponse$Outbound` instead. */ + export type Outbound = ListEvmBlocksResponse$Outbound; +} diff --git a/src/models/components/listhistoricalrewardsresponse.ts b/src/models/components/listhistoricalrewardsresponse.ts new file mode 100644 index 0000000..e3de357 --- /dev/null +++ b/src/models/components/listhistoricalrewardsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + HistoricalReward, + HistoricalReward$inboundSchema, + HistoricalReward$Outbound, + HistoricalReward$outboundSchema, +} from "./historicalreward.js"; +import * as z from "zod"; + +export type ListHistoricalRewardsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + historicalRewards: Array; +}; + +/** @internal */ +export const ListHistoricalRewardsResponse$inboundSchema: z.ZodType< + ListHistoricalRewardsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + historicalRewards: z.array(HistoricalReward$inboundSchema), +}); + +/** @internal */ +export type ListHistoricalRewardsResponse$Outbound = { + nextPageToken?: string | undefined; + historicalRewards: Array; +}; + +/** @internal */ +export const ListHistoricalRewardsResponse$outboundSchema: z.ZodType< + ListHistoricalRewardsResponse$Outbound, + z.ZodTypeDef, + ListHistoricalRewardsResponse +> = z.object({ + nextPageToken: z.string().optional(), + historicalRewards: z.array(HistoricalReward$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListHistoricalRewardsResponse$ { + /** @deprecated use `ListHistoricalRewardsResponse$inboundSchema` instead. */ + export const inboundSchema = ListHistoricalRewardsResponse$inboundSchema; + /** @deprecated use `ListHistoricalRewardsResponse$outboundSchema` instead. */ + export const outboundSchema = ListHistoricalRewardsResponse$outboundSchema; + /** @deprecated use `ListHistoricalRewardsResponse$Outbound` instead. */ + export type Outbound = ListHistoricalRewardsResponse$Outbound; +} diff --git a/src/models/components/listinternaltransactionsresponse.ts b/src/models/components/listinternaltransactionsresponse.ts new file mode 100644 index 0000000..9626f37 --- /dev/null +++ b/src/models/components/listinternaltransactionsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + InternalTransaction, + InternalTransaction$inboundSchema, + InternalTransaction$Outbound, + InternalTransaction$outboundSchema, +} from "./internaltransaction.js"; +import * as z from "zod"; + +export type ListInternalTransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListInternalTransactionsResponse$inboundSchema: z.ZodType< + ListInternalTransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(InternalTransaction$inboundSchema), +}); + +/** @internal */ +export type ListInternalTransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListInternalTransactionsResponse$outboundSchema: z.ZodType< + ListInternalTransactionsResponse$Outbound, + z.ZodTypeDef, + ListInternalTransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(InternalTransaction$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListInternalTransactionsResponse$ { + /** @deprecated use `ListInternalTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListInternalTransactionsResponse$inboundSchema; + /** @deprecated use `ListInternalTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListInternalTransactionsResponse$outboundSchema; + /** @deprecated use `ListInternalTransactionsResponse$Outbound` instead. */ + export type Outbound = ListInternalTransactionsResponse$Outbound; +} diff --git a/src/models/components/listnativetransactionsresponse.ts b/src/models/components/listnativetransactionsresponse.ts new file mode 100644 index 0000000..cfcdccf --- /dev/null +++ b/src/models/components/listnativetransactionsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + NativeTransaction, + NativeTransaction$inboundSchema, + NativeTransaction$Outbound, + NativeTransaction$outboundSchema, +} from "./nativetransaction.js"; +import * as z from "zod"; + +export type ListNativeTransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListNativeTransactionsResponse$inboundSchema: z.ZodType< + ListNativeTransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(NativeTransaction$inboundSchema), +}); + +/** @internal */ +export type ListNativeTransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListNativeTransactionsResponse$outboundSchema: z.ZodType< + ListNativeTransactionsResponse$Outbound, + z.ZodTypeDef, + ListNativeTransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(NativeTransaction$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListNativeTransactionsResponse$ { + /** @deprecated use `ListNativeTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListNativeTransactionsResponse$inboundSchema; + /** @deprecated use `ListNativeTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListNativeTransactionsResponse$outboundSchema; + /** @deprecated use `ListNativeTransactionsResponse$Outbound` instead. */ + export type Outbound = ListNativeTransactionsResponse$Outbound; +} diff --git a/src/models/components/listnfttokens.ts b/src/models/components/listnfttokens.ts new file mode 100644 index 0000000..077abb6 --- /dev/null +++ b/src/models/components/listnfttokens.ts @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155Token, + Erc1155Token$inboundSchema, + Erc1155Token$Outbound, + Erc1155Token$outboundSchema, +} from "./erc1155token.js"; +import { + Erc721Token, + Erc721Token$inboundSchema, + Erc721Token$Outbound, + Erc721Token$outboundSchema, +} from "./erc721token.js"; +import * as z from "zod"; + +export type Tokens = Erc1155Token | Erc721Token; + +export type ListNftTokens = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + tokens: Array; +}; + +/** @internal */ +export const Tokens$inboundSchema: z.ZodType = z.union([ + Erc1155Token$inboundSchema, + Erc721Token$inboundSchema, +]); + +/** @internal */ +export type Tokens$Outbound = Erc1155Token$Outbound | Erc721Token$Outbound; + +/** @internal */ +export const Tokens$outboundSchema: z.ZodType = z.union([ + Erc1155Token$outboundSchema, + Erc721Token$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Tokens$ { + /** @deprecated use `Tokens$inboundSchema` instead. */ + export const inboundSchema = Tokens$inboundSchema; + /** @deprecated use `Tokens$outboundSchema` instead. */ + export const outboundSchema = Tokens$outboundSchema; + /** @deprecated use `Tokens$Outbound` instead. */ + export type Outbound = Tokens$Outbound; +} + +/** @internal */ +export const ListNftTokens$inboundSchema: z.ZodType = + z.object({ + nextPageToken: z.string().optional(), + tokens: z.array(z.union([Erc1155Token$inboundSchema, Erc721Token$inboundSchema])), + }); + +/** @internal */ +export type ListNftTokens$Outbound = { + nextPageToken?: string | undefined; + tokens: Array; +}; + +/** @internal */ +export const ListNftTokens$outboundSchema: z.ZodType< + ListNftTokens$Outbound, + z.ZodTypeDef, + ListNftTokens +> = z.object({ + nextPageToken: z.string().optional(), + tokens: z.array(z.union([Erc1155Token$outboundSchema, Erc721Token$outboundSchema])), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListNftTokens$ { + /** @deprecated use `ListNftTokens$inboundSchema` instead. */ + export const inboundSchema = ListNftTokens$inboundSchema; + /** @deprecated use `ListNftTokens$outboundSchema` instead. */ + export const outboundSchema = ListNftTokens$outboundSchema; + /** @deprecated use `ListNftTokens$Outbound` instead. */ + export type Outbound = ListNftTokens$Outbound; +} diff --git a/src/models/components/listpchainbalancesresponse.ts b/src/models/components/listpchainbalancesresponse.ts new file mode 100644 index 0000000..793f2fb --- /dev/null +++ b/src/models/components/listpchainbalancesresponse.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PChainBalance, + PChainBalance$inboundSchema, + PChainBalance$Outbound, + PChainBalance$outboundSchema, +} from "./pchainbalance.js"; +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import * as z from "zod"; + +export type ListPChainBalancesResponse = { + balances: PChainBalance; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListPChainBalancesResponse$inboundSchema: z.ZodType< + ListPChainBalancesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + balances: PChainBalance$inboundSchema, + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListPChainBalancesResponse$Outbound = { + balances: PChainBalance$Outbound; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListPChainBalancesResponse$outboundSchema: z.ZodType< + ListPChainBalancesResponse$Outbound, + z.ZodTypeDef, + ListPChainBalancesResponse +> = z.object({ + balances: PChainBalance$outboundSchema, + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPChainBalancesResponse$ { + /** @deprecated use `ListPChainBalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListPChainBalancesResponse$inboundSchema; + /** @deprecated use `ListPChainBalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListPChainBalancesResponse$outboundSchema; + /** @deprecated use `ListPChainBalancesResponse$Outbound` instead. */ + export type Outbound = ListPChainBalancesResponse$Outbound; +} diff --git a/src/models/components/listpchaintransactionsresponse.ts b/src/models/components/listpchaintransactionsresponse.ts new file mode 100644 index 0000000..178a104 --- /dev/null +++ b/src/models/components/listpchaintransactionsresponse.ts @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PChainTransaction, + PChainTransaction$inboundSchema, + PChainTransaction$Outbound, + PChainTransaction$outboundSchema, +} from "./pchaintransaction.js"; +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import * as z from "zod"; + +export type ListPChainTransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListPChainTransactionsResponse$inboundSchema: z.ZodType< + ListPChainTransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(PChainTransaction$inboundSchema), + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListPChainTransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListPChainTransactionsResponse$outboundSchema: z.ZodType< + ListPChainTransactionsResponse$Outbound, + z.ZodTypeDef, + ListPChainTransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(PChainTransaction$outboundSchema), + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPChainTransactionsResponse$ { + /** @deprecated use `ListPChainTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListPChainTransactionsResponse$inboundSchema; + /** @deprecated use `ListPChainTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListPChainTransactionsResponse$outboundSchema; + /** @deprecated use `ListPChainTransactionsResponse$Outbound` instead. */ + export type Outbound = ListPChainTransactionsResponse$Outbound; +} diff --git a/src/models/components/listpchainutxosresponse.ts b/src/models/components/listpchainutxosresponse.ts new file mode 100644 index 0000000..e535234 --- /dev/null +++ b/src/models/components/listpchainutxosresponse.ts @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PChainUtxo, + PChainUtxo$inboundSchema, + PChainUtxo$Outbound, + PChainUtxo$outboundSchema, +} from "./pchainutxo.js"; +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import * as z from "zod"; + +export type ListPChainUtxosResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + utxos: Array; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListPChainUtxosResponse$inboundSchema: z.ZodType< + ListPChainUtxosResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + utxos: z.array(PChainUtxo$inboundSchema), + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListPChainUtxosResponse$Outbound = { + nextPageToken?: string | undefined; + utxos: Array; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListPChainUtxosResponse$outboundSchema: z.ZodType< + ListPChainUtxosResponse$Outbound, + z.ZodTypeDef, + ListPChainUtxosResponse +> = z.object({ + nextPageToken: z.string().optional(), + utxos: z.array(PChainUtxo$outboundSchema), + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPChainUtxosResponse$ { + /** @deprecated use `ListPChainUtxosResponse$inboundSchema` instead. */ + export const inboundSchema = ListPChainUtxosResponse$inboundSchema; + /** @deprecated use `ListPChainUtxosResponse$outboundSchema` instead. */ + export const outboundSchema = ListPChainUtxosResponse$outboundSchema; + /** @deprecated use `ListPChainUtxosResponse$Outbound` instead. */ + export type Outbound = ListPChainUtxosResponse$Outbound; +} diff --git a/src/models/components/listpendingrewardsresponse.ts b/src/models/components/listpendingrewardsresponse.ts new file mode 100644 index 0000000..4a9ce81 --- /dev/null +++ b/src/models/components/listpendingrewardsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PendingReward, + PendingReward$inboundSchema, + PendingReward$Outbound, + PendingReward$outboundSchema, +} from "./pendingreward.js"; +import * as z from "zod"; + +export type ListPendingRewardsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + pendingRewards: Array; +}; + +/** @internal */ +export const ListPendingRewardsResponse$inboundSchema: z.ZodType< + ListPendingRewardsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + pendingRewards: z.array(PendingReward$inboundSchema), +}); + +/** @internal */ +export type ListPendingRewardsResponse$Outbound = { + nextPageToken?: string | undefined; + pendingRewards: Array; +}; + +/** @internal */ +export const ListPendingRewardsResponse$outboundSchema: z.ZodType< + ListPendingRewardsResponse$Outbound, + z.ZodTypeDef, + ListPendingRewardsResponse +> = z.object({ + nextPageToken: z.string().optional(), + pendingRewards: z.array(PendingReward$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPendingRewardsResponse$ { + /** @deprecated use `ListPendingRewardsResponse$inboundSchema` instead. */ + export const inboundSchema = ListPendingRewardsResponse$inboundSchema; + /** @deprecated use `ListPendingRewardsResponse$outboundSchema` instead. */ + export const outboundSchema = ListPendingRewardsResponse$outboundSchema; + /** @deprecated use `ListPendingRewardsResponse$Outbound` instead. */ + export type Outbound = ListPendingRewardsResponse$Outbound; +} diff --git a/src/models/components/listprimarynetworkblocksresponse.ts b/src/models/components/listprimarynetworkblocksresponse.ts new file mode 100644 index 0000000..c4ef4a7 --- /dev/null +++ b/src/models/components/listprimarynetworkblocksresponse.ts @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkBlock, + PrimaryNetworkBlock$inboundSchema, + PrimaryNetworkBlock$Outbound, + PrimaryNetworkBlock$outboundSchema, +} from "./primarynetworkblock.js"; +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import * as z from "zod"; + +export type ListPrimaryNetworkBlocksResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + blocks: Array; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListPrimaryNetworkBlocksResponse$inboundSchema: z.ZodType< + ListPrimaryNetworkBlocksResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + blocks: z.array(PrimaryNetworkBlock$inboundSchema), + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListPrimaryNetworkBlocksResponse$Outbound = { + nextPageToken?: string | undefined; + blocks: Array; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListPrimaryNetworkBlocksResponse$outboundSchema: z.ZodType< + ListPrimaryNetworkBlocksResponse$Outbound, + z.ZodTypeDef, + ListPrimaryNetworkBlocksResponse +> = z.object({ + nextPageToken: z.string().optional(), + blocks: z.array(PrimaryNetworkBlock$outboundSchema), + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPrimaryNetworkBlocksResponse$ { + /** @deprecated use `ListPrimaryNetworkBlocksResponse$inboundSchema` instead. */ + export const inboundSchema = ListPrimaryNetworkBlocksResponse$inboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksResponse$outboundSchema` instead. */ + export const outboundSchema = ListPrimaryNetworkBlocksResponse$outboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksResponse$Outbound` instead. */ + export type Outbound = ListPrimaryNetworkBlocksResponse$Outbound; +} diff --git a/src/models/components/listsubnetsresponse.ts b/src/models/components/listsubnetsresponse.ts new file mode 100644 index 0000000..a5f6c74 --- /dev/null +++ b/src/models/components/listsubnetsresponse.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Subnet, Subnet$inboundSchema, Subnet$Outbound, Subnet$outboundSchema } from "./subnet.js"; +import * as z from "zod"; + +export type ListSubnetsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + subnets: Array; +}; + +/** @internal */ +export const ListSubnetsResponse$inboundSchema: z.ZodType< + ListSubnetsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + subnets: z.array(Subnet$inboundSchema), +}); + +/** @internal */ +export type ListSubnetsResponse$Outbound = { + nextPageToken?: string | undefined; + subnets: Array; +}; + +/** @internal */ +export const ListSubnetsResponse$outboundSchema: z.ZodType< + ListSubnetsResponse$Outbound, + z.ZodTypeDef, + ListSubnetsResponse +> = z.object({ + nextPageToken: z.string().optional(), + subnets: z.array(Subnet$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListSubnetsResponse$ { + /** @deprecated use `ListSubnetsResponse$inboundSchema` instead. */ + export const inboundSchema = ListSubnetsResponse$inboundSchema; + /** @deprecated use `ListSubnetsResponse$outboundSchema` instead. */ + export const outboundSchema = ListSubnetsResponse$outboundSchema; + /** @deprecated use `ListSubnetsResponse$Outbound` instead. */ + export type Outbound = ListSubnetsResponse$Outbound; +} diff --git a/src/models/components/listteleportermessagesresponse.ts b/src/models/components/listteleportermessagesresponse.ts new file mode 100644 index 0000000..67712be --- /dev/null +++ b/src/models/components/listteleportermessagesresponse.ts @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + DeliveredTeleporterMessage, + DeliveredTeleporterMessage$inboundSchema, + DeliveredTeleporterMessage$Outbound, + DeliveredTeleporterMessage$outboundSchema, +} from "./deliveredteleportermessage.js"; +import { + PendingTeleporterMessage, + PendingTeleporterMessage$inboundSchema, + PendingTeleporterMessage$Outbound, + PendingTeleporterMessage$outboundSchema, +} from "./pendingteleportermessage.js"; +import * as z from "zod"; + +export type Messages = + | (PendingTeleporterMessage & { status: "pending" }) + | (DeliveredTeleporterMessage & { status: "delivered" }); + +export type ListTeleporterMessagesResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + messages: Array< + | (PendingTeleporterMessage & { status: "pending" }) + | (DeliveredTeleporterMessage & { status: "delivered" }) + >; +}; + +/** @internal */ +export const Messages$inboundSchema: z.ZodType = z.union([ + PendingTeleporterMessage$inboundSchema.and( + z.object({ status: z.literal("pending") }).transform((v) => ({ status: v.status })) + ), + DeliveredTeleporterMessage$inboundSchema.and( + z.object({ status: z.literal("delivered") }).transform((v) => ({ status: v.status })) + ), +]); + +/** @internal */ +export type Messages$Outbound = + | (PendingTeleporterMessage$Outbound & { status: "pending" }) + | (DeliveredTeleporterMessage$Outbound & { status: "delivered" }); + +/** @internal */ +export const Messages$outboundSchema: z.ZodType = + z.union([ + PendingTeleporterMessage$outboundSchema.and( + z.object({ status: z.literal("pending") }).transform((v) => ({ status: v.status })) + ), + DeliveredTeleporterMessage$outboundSchema.and( + z.object({ status: z.literal("delivered") }).transform((v) => ({ status: v.status })) + ), + ]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Messages$ { + /** @deprecated use `Messages$inboundSchema` instead. */ + export const inboundSchema = Messages$inboundSchema; + /** @deprecated use `Messages$outboundSchema` instead. */ + export const outboundSchema = Messages$outboundSchema; + /** @deprecated use `Messages$Outbound` instead. */ + export type Outbound = Messages$Outbound; +} + +/** @internal */ +export const ListTeleporterMessagesResponse$inboundSchema: z.ZodType< + ListTeleporterMessagesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + messages: z.array( + z.union([ + PendingTeleporterMessage$inboundSchema.and( + z.object({ status: z.literal("pending") }).transform((v) => ({ status: v.status })) + ), + DeliveredTeleporterMessage$inboundSchema.and( + z + .object({ status: z.literal("delivered") }) + .transform((v) => ({ status: v.status })) + ), + ]) + ), +}); + +/** @internal */ +export type ListTeleporterMessagesResponse$Outbound = { + nextPageToken?: string | undefined; + messages: Array< + | (PendingTeleporterMessage$Outbound & { status: "pending" }) + | (DeliveredTeleporterMessage$Outbound & { status: "delivered" }) + >; +}; + +/** @internal */ +export const ListTeleporterMessagesResponse$outboundSchema: z.ZodType< + ListTeleporterMessagesResponse$Outbound, + z.ZodTypeDef, + ListTeleporterMessagesResponse +> = z.object({ + nextPageToken: z.string().optional(), + messages: z.array( + z.union([ + PendingTeleporterMessage$outboundSchema.and( + z.object({ status: z.literal("pending") }).transform((v) => ({ status: v.status })) + ), + DeliveredTeleporterMessage$outboundSchema.and( + z + .object({ status: z.literal("delivered") }) + .transform((v) => ({ status: v.status })) + ), + ]) + ), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTeleporterMessagesResponse$ { + /** @deprecated use `ListTeleporterMessagesResponse$inboundSchema` instead. */ + export const inboundSchema = ListTeleporterMessagesResponse$inboundSchema; + /** @deprecated use `ListTeleporterMessagesResponse$outboundSchema` instead. */ + export const outboundSchema = ListTeleporterMessagesResponse$outboundSchema; + /** @deprecated use `ListTeleporterMessagesResponse$Outbound` instead. */ + export type Outbound = ListTeleporterMessagesResponse$Outbound; +} diff --git a/src/models/components/listtransactiondetailsresponse.ts b/src/models/components/listtransactiondetailsresponse.ts new file mode 100644 index 0000000..4c2656a --- /dev/null +++ b/src/models/components/listtransactiondetailsresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + TransactionDetails, + TransactionDetails$inboundSchema, + TransactionDetails$Outbound, + TransactionDetails$outboundSchema, +} from "./transactiondetails.js"; +import * as z from "zod"; + +export type ListTransactionDetailsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListTransactionDetailsResponse$inboundSchema: z.ZodType< + ListTransactionDetailsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(TransactionDetails$inboundSchema), +}); + +/** @internal */ +export type ListTransactionDetailsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; +}; + +/** @internal */ +export const ListTransactionDetailsResponse$outboundSchema: z.ZodType< + ListTransactionDetailsResponse$Outbound, + z.ZodTypeDef, + ListTransactionDetailsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array(TransactionDetails$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransactionDetailsResponse$ { + /** @deprecated use `ListTransactionDetailsResponse$inboundSchema` instead. */ + export const inboundSchema = ListTransactionDetailsResponse$inboundSchema; + /** @deprecated use `ListTransactionDetailsResponse$outboundSchema` instead. */ + export const outboundSchema = ListTransactionDetailsResponse$outboundSchema; + /** @deprecated use `ListTransactionDetailsResponse$Outbound` instead. */ + export type Outbound = ListTransactionDetailsResponse$Outbound; +} diff --git a/src/models/components/listtransfersresponse.ts b/src/models/components/listtransfersresponse.ts new file mode 100644 index 0000000..0c48346 --- /dev/null +++ b/src/models/components/listtransfersresponse.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155Transfer, + Erc1155Transfer$inboundSchema, + Erc1155Transfer$Outbound, + Erc1155Transfer$outboundSchema, +} from "./erc1155transfer.js"; +import { + Erc20Transfer, + Erc20Transfer$inboundSchema, + Erc20Transfer$Outbound, + Erc20Transfer$outboundSchema, +} from "./erc20transfer.js"; +import { + Erc721Transfer, + Erc721Transfer$inboundSchema, + Erc721Transfer$Outbound, + Erc721Transfer$outboundSchema, +} from "./erc721transfer.js"; +import * as z from "zod"; + +export type Transfers = Erc721Transfer | Erc20Transfer | Erc1155Transfer; + +export type ListTransfersResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transfers: Array; +}; + +/** @internal */ +export const Transfers$inboundSchema: z.ZodType = z.union([ + Erc721Transfer$inboundSchema, + Erc20Transfer$inboundSchema, + Erc1155Transfer$inboundSchema, +]); + +/** @internal */ +export type Transfers$Outbound = + | Erc721Transfer$Outbound + | Erc20Transfer$Outbound + | Erc1155Transfer$Outbound; + +/** @internal */ +export const Transfers$outboundSchema: z.ZodType = + z.union([ + Erc721Transfer$outboundSchema, + Erc20Transfer$outboundSchema, + Erc1155Transfer$outboundSchema, + ]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Transfers$ { + /** @deprecated use `Transfers$inboundSchema` instead. */ + export const inboundSchema = Transfers$inboundSchema; + /** @deprecated use `Transfers$outboundSchema` instead. */ + export const outboundSchema = Transfers$outboundSchema; + /** @deprecated use `Transfers$Outbound` instead. */ + export type Outbound = Transfers$Outbound; +} + +/** @internal */ +export const ListTransfersResponse$inboundSchema: z.ZodType< + ListTransfersResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transfers: z.array( + z.union([ + Erc721Transfer$inboundSchema, + Erc20Transfer$inboundSchema, + Erc1155Transfer$inboundSchema, + ]) + ), +}); + +/** @internal */ +export type ListTransfersResponse$Outbound = { + nextPageToken?: string | undefined; + transfers: Array; +}; + +/** @internal */ +export const ListTransfersResponse$outboundSchema: z.ZodType< + ListTransfersResponse$Outbound, + z.ZodTypeDef, + ListTransfersResponse +> = z.object({ + nextPageToken: z.string().optional(), + transfers: z.array( + z.union([ + Erc721Transfer$outboundSchema, + Erc20Transfer$outboundSchema, + Erc1155Transfer$outboundSchema, + ]) + ), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransfersResponse$ { + /** @deprecated use `ListTransfersResponse$inboundSchema` instead. */ + export const inboundSchema = ListTransfersResponse$inboundSchema; + /** @deprecated use `ListTransfersResponse$outboundSchema` instead. */ + export const outboundSchema = ListTransfersResponse$outboundSchema; + /** @deprecated use `ListTransfersResponse$Outbound` instead. */ + export type Outbound = ListTransfersResponse$Outbound; +} diff --git a/src/models/components/listutxosresponse.ts b/src/models/components/listutxosresponse.ts new file mode 100644 index 0000000..efd985f --- /dev/null +++ b/src/models/components/listutxosresponse.ts @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import { Utxo, Utxo$inboundSchema, Utxo$Outbound, Utxo$outboundSchema } from "./utxo.js"; +import * as z from "zod"; + +export type ListUtxosResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + utxos: Array; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListUtxosResponse$inboundSchema: z.ZodType = + z.object({ + nextPageToken: z.string().optional(), + utxos: z.array(Utxo$inboundSchema), + chainInfo: PrimaryNetworkChainInfo$inboundSchema, + }); + +/** @internal */ +export type ListUtxosResponse$Outbound = { + nextPageToken?: string | undefined; + utxos: Array; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListUtxosResponse$outboundSchema: z.ZodType< + ListUtxosResponse$Outbound, + z.ZodTypeDef, + ListUtxosResponse +> = z.object({ + nextPageToken: z.string().optional(), + utxos: z.array(Utxo$outboundSchema), + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUtxosResponse$ { + /** @deprecated use `ListUtxosResponse$inboundSchema` instead. */ + export const inboundSchema = ListUtxosResponse$inboundSchema; + /** @deprecated use `ListUtxosResponse$outboundSchema` instead. */ + export const outboundSchema = ListUtxosResponse$outboundSchema; + /** @deprecated use `ListUtxosResponse$Outbound` instead. */ + export type Outbound = ListUtxosResponse$Outbound; +} diff --git a/src/models/components/listvalidatordetailsresponse.ts b/src/models/components/listvalidatordetailsresponse.ts new file mode 100644 index 0000000..4222585 --- /dev/null +++ b/src/models/components/listvalidatordetailsresponse.ts @@ -0,0 +1,210 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + ActiveValidatorDetails, + ActiveValidatorDetails$inboundSchema, + ActiveValidatorDetails$Outbound, + ActiveValidatorDetails$outboundSchema, +} from "./activevalidatordetails.js"; +import { + CompletedValidatorDetails, + CompletedValidatorDetails$inboundSchema, + CompletedValidatorDetails$Outbound, + CompletedValidatorDetails$outboundSchema, +} from "./completedvalidatordetails.js"; +import { + PendingValidatorDetails, + PendingValidatorDetails$inboundSchema, + PendingValidatorDetails$Outbound, + PendingValidatorDetails$outboundSchema, +} from "./pendingvalidatordetails.js"; +import { + RemovedValidatorDetails, + RemovedValidatorDetails$inboundSchema, + RemovedValidatorDetails$Outbound, + RemovedValidatorDetails$outboundSchema, +} from "./removedvalidatordetails.js"; +import * as z from "zod"; + +export type Validators = + | (PendingValidatorDetails & { validationStatus: "pending" }) + | (CompletedValidatorDetails & { validationStatus: "completed" }) + | (RemovedValidatorDetails & { validationStatus: "removed" }) + | (ActiveValidatorDetails & { validationStatus: "active" }); + +export type ListValidatorDetailsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + /** + * The list of validator Details. + */ + validators: Array< + | (PendingValidatorDetails & { validationStatus: "pending" }) + | (CompletedValidatorDetails & { validationStatus: "completed" }) + | (RemovedValidatorDetails & { validationStatus: "removed" }) + | (ActiveValidatorDetails & { validationStatus: "active" }) + >; +}; + +/** @internal */ +export const Validators$inboundSchema: z.ZodType = z.union([ + PendingValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("pending") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + CompletedValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("completed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + RemovedValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("removed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + ActiveValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("active") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), +]); + +/** @internal */ +export type Validators$Outbound = + | (PendingValidatorDetails$Outbound & { validationStatus: "pending" }) + | (CompletedValidatorDetails$Outbound & { validationStatus: "completed" }) + | (RemovedValidatorDetails$Outbound & { validationStatus: "removed" }) + | (ActiveValidatorDetails$Outbound & { validationStatus: "active" }); + +/** @internal */ +export const Validators$outboundSchema: z.ZodType = + z.union([ + PendingValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("pending") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + CompletedValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("completed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + RemovedValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("removed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + ActiveValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("active") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + ]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Validators$ { + /** @deprecated use `Validators$inboundSchema` instead. */ + export const inboundSchema = Validators$inboundSchema; + /** @deprecated use `Validators$outboundSchema` instead. */ + export const outboundSchema = Validators$outboundSchema; + /** @deprecated use `Validators$Outbound` instead. */ + export type Outbound = Validators$Outbound; +} + +/** @internal */ +export const ListValidatorDetailsResponse$inboundSchema: z.ZodType< + ListValidatorDetailsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + validators: z.array( + z.union([ + PendingValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("pending") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + CompletedValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("completed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + RemovedValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("removed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + ActiveValidatorDetails$inboundSchema.and( + z + .object({ validationStatus: z.literal("active") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + ]) + ), +}); + +/** @internal */ +export type ListValidatorDetailsResponse$Outbound = { + nextPageToken?: string | undefined; + validators: Array< + | (PendingValidatorDetails$Outbound & { validationStatus: "pending" }) + | (CompletedValidatorDetails$Outbound & { validationStatus: "completed" }) + | (RemovedValidatorDetails$Outbound & { validationStatus: "removed" }) + | (ActiveValidatorDetails$Outbound & { validationStatus: "active" }) + >; +}; + +/** @internal */ +export const ListValidatorDetailsResponse$outboundSchema: z.ZodType< + ListValidatorDetailsResponse$Outbound, + z.ZodTypeDef, + ListValidatorDetailsResponse +> = z.object({ + nextPageToken: z.string().optional(), + validators: z.array( + z.union([ + PendingValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("pending") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + CompletedValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("completed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + RemovedValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("removed") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + ActiveValidatorDetails$outboundSchema.and( + z + .object({ validationStatus: z.literal("active") }) + .transform((v) => ({ validationStatus: v.validationStatus })) + ), + ]) + ), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListValidatorDetailsResponse$ { + /** @deprecated use `ListValidatorDetailsResponse$inboundSchema` instead. */ + export const inboundSchema = ListValidatorDetailsResponse$inboundSchema; + /** @deprecated use `ListValidatorDetailsResponse$outboundSchema` instead. */ + export const outboundSchema = ListValidatorDetailsResponse$outboundSchema; + /** @deprecated use `ListValidatorDetailsResponse$Outbound` instead. */ + export type Outbound = ListValidatorDetailsResponse$Outbound; +} diff --git a/src/models/components/listwebhookaddressesresponse.ts b/src/models/components/listwebhookaddressesresponse.ts new file mode 100644 index 0000000..29fec14 --- /dev/null +++ b/src/models/components/listwebhookaddressesresponse.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type ListWebhookAddressesResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + addresses: Array; + totalAddresses: number; +}; + +/** @internal */ +export const ListWebhookAddressesResponse$inboundSchema: z.ZodType< + ListWebhookAddressesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + addresses: z.array(z.string()), + totalAddresses: z.number(), +}); + +/** @internal */ +export type ListWebhookAddressesResponse$Outbound = { + nextPageToken?: string | undefined; + addresses: Array; + totalAddresses: number; +}; + +/** @internal */ +export const ListWebhookAddressesResponse$outboundSchema: z.ZodType< + ListWebhookAddressesResponse$Outbound, + z.ZodTypeDef, + ListWebhookAddressesResponse +> = z.object({ + nextPageToken: z.string().optional(), + addresses: z.array(z.string()), + totalAddresses: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListWebhookAddressesResponse$ { + /** @deprecated use `ListWebhookAddressesResponse$inboundSchema` instead. */ + export const inboundSchema = ListWebhookAddressesResponse$inboundSchema; + /** @deprecated use `ListWebhookAddressesResponse$outboundSchema` instead. */ + export const outboundSchema = ListWebhookAddressesResponse$outboundSchema; + /** @deprecated use `ListWebhookAddressesResponse$Outbound` instead. */ + export type Outbound = ListWebhookAddressesResponse$Outbound; +} diff --git a/src/models/components/listwebhooksresponse.ts b/src/models/components/listwebhooksresponse.ts new file mode 100644 index 0000000..e06832c --- /dev/null +++ b/src/models/components/listwebhooksresponse.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + WebhookResponse, + WebhookResponse$inboundSchema, + WebhookResponse$Outbound, + WebhookResponse$outboundSchema, +} from "./webhookresponse.js"; +import * as z from "zod"; + +export type ListWebhooksResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + webhooks: Array; +}; + +/** @internal */ +export const ListWebhooksResponse$inboundSchema: z.ZodType< + ListWebhooksResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + webhooks: z.array(WebhookResponse$inboundSchema), +}); + +/** @internal */ +export type ListWebhooksResponse$Outbound = { + nextPageToken?: string | undefined; + webhooks: Array; +}; + +/** @internal */ +export const ListWebhooksResponse$outboundSchema: z.ZodType< + ListWebhooksResponse$Outbound, + z.ZodTypeDef, + ListWebhooksResponse +> = z.object({ + nextPageToken: z.string().optional(), + webhooks: z.array(WebhookResponse$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListWebhooksResponse$ { + /** @deprecated use `ListWebhooksResponse$inboundSchema` instead. */ + export const inboundSchema = ListWebhooksResponse$inboundSchema; + /** @deprecated use `ListWebhooksResponse$outboundSchema` instead. */ + export const outboundSchema = ListWebhooksResponse$outboundSchema; + /** @deprecated use `ListWebhooksResponse$Outbound` instead. */ + export type Outbound = ListWebhooksResponse$Outbound; +} diff --git a/src/models/components/listxchainbalancesresponse.ts b/src/models/components/listxchainbalancesresponse.ts new file mode 100644 index 0000000..8cc9402 --- /dev/null +++ b/src/models/components/listxchainbalancesresponse.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import { + XChainBalances, + XChainBalances$inboundSchema, + XChainBalances$Outbound, + XChainBalances$outboundSchema, +} from "./xchainbalances.js"; +import * as z from "zod"; + +export type ListXChainBalancesResponse = { + balances: XChainBalances; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListXChainBalancesResponse$inboundSchema: z.ZodType< + ListXChainBalancesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + balances: XChainBalances$inboundSchema, + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListXChainBalancesResponse$Outbound = { + balances: XChainBalances$Outbound; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListXChainBalancesResponse$outboundSchema: z.ZodType< + ListXChainBalancesResponse$Outbound, + z.ZodTypeDef, + ListXChainBalancesResponse +> = z.object({ + balances: XChainBalances$outboundSchema, + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListXChainBalancesResponse$ { + /** @deprecated use `ListXChainBalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListXChainBalancesResponse$inboundSchema; + /** @deprecated use `ListXChainBalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListXChainBalancesResponse$outboundSchema; + /** @deprecated use `ListXChainBalancesResponse$Outbound` instead. */ + export type Outbound = ListXChainBalancesResponse$Outbound; +} diff --git a/src/models/components/listxchaintransactionsresponse.ts b/src/models/components/listxchaintransactionsresponse.ts new file mode 100644 index 0000000..ccac7da --- /dev/null +++ b/src/models/components/listxchaintransactionsresponse.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import { + XChainLinearTransaction, + XChainLinearTransaction$inboundSchema, + XChainLinearTransaction$Outbound, + XChainLinearTransaction$outboundSchema, +} from "./xchainlineartransaction.js"; +import { + XChainNonLinearTransaction, + XChainNonLinearTransaction$inboundSchema, + XChainNonLinearTransaction$Outbound, + XChainNonLinearTransaction$outboundSchema, +} from "./xchainnonlineartransaction.js"; +import * as z from "zod"; + +export type Transactions = XChainNonLinearTransaction | XChainLinearTransaction; + +export type ListXChainTransactionsResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + transactions: Array; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const Transactions$inboundSchema: z.ZodType = z.union([ + XChainNonLinearTransaction$inboundSchema, + XChainLinearTransaction$inboundSchema, +]); + +/** @internal */ +export type Transactions$Outbound = + | XChainNonLinearTransaction$Outbound + | XChainLinearTransaction$Outbound; + +/** @internal */ +export const Transactions$outboundSchema: z.ZodType< + Transactions$Outbound, + z.ZodTypeDef, + Transactions +> = z.union([XChainNonLinearTransaction$outboundSchema, XChainLinearTransaction$outboundSchema]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Transactions$ { + /** @deprecated use `Transactions$inboundSchema` instead. */ + export const inboundSchema = Transactions$inboundSchema; + /** @deprecated use `Transactions$outboundSchema` instead. */ + export const outboundSchema = Transactions$outboundSchema; + /** @deprecated use `Transactions$Outbound` instead. */ + export type Outbound = Transactions$Outbound; +} + +/** @internal */ +export const ListXChainTransactionsResponse$inboundSchema: z.ZodType< + ListXChainTransactionsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array( + z.union([XChainNonLinearTransaction$inboundSchema, XChainLinearTransaction$inboundSchema]) + ), + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListXChainTransactionsResponse$Outbound = { + nextPageToken?: string | undefined; + transactions: Array; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListXChainTransactionsResponse$outboundSchema: z.ZodType< + ListXChainTransactionsResponse$Outbound, + z.ZodTypeDef, + ListXChainTransactionsResponse +> = z.object({ + nextPageToken: z.string().optional(), + transactions: z.array( + z.union([XChainNonLinearTransaction$outboundSchema, XChainLinearTransaction$outboundSchema]) + ), + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListXChainTransactionsResponse$ { + /** @deprecated use `ListXChainTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListXChainTransactionsResponse$inboundSchema; + /** @deprecated use `ListXChainTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListXChainTransactionsResponse$outboundSchema; + /** @deprecated use `ListXChainTransactionsResponse$Outbound` instead. */ + export type Outbound = ListXChainTransactionsResponse$Outbound; +} diff --git a/src/models/components/listxchainverticesresponse.ts b/src/models/components/listxchainverticesresponse.ts new file mode 100644 index 0000000..7418714 --- /dev/null +++ b/src/models/components/listxchainverticesresponse.ts @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkChainInfo, + PrimaryNetworkChainInfo$inboundSchema, + PrimaryNetworkChainInfo$Outbound, + PrimaryNetworkChainInfo$outboundSchema, +} from "./primarynetworkchaininfo.js"; +import { + XChainVertex, + XChainVertex$inboundSchema, + XChainVertex$Outbound, + XChainVertex$outboundSchema, +} from "./xchainvertex.js"; +import * as z from "zod"; + +export type ListXChainVerticesResponse = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + vertices: Array; + chainInfo: PrimaryNetworkChainInfo; +}; + +/** @internal */ +export const ListXChainVerticesResponse$inboundSchema: z.ZodType< + ListXChainVerticesResponse, + z.ZodTypeDef, + unknown +> = z.object({ + nextPageToken: z.string().optional(), + vertices: z.array(XChainVertex$inboundSchema), + chainInfo: PrimaryNetworkChainInfo$inboundSchema, +}); + +/** @internal */ +export type ListXChainVerticesResponse$Outbound = { + nextPageToken?: string | undefined; + vertices: Array; + chainInfo: PrimaryNetworkChainInfo$Outbound; +}; + +/** @internal */ +export const ListXChainVerticesResponse$outboundSchema: z.ZodType< + ListXChainVerticesResponse$Outbound, + z.ZodTypeDef, + ListXChainVerticesResponse +> = z.object({ + nextPageToken: z.string().optional(), + vertices: z.array(XChainVertex$outboundSchema), + chainInfo: PrimaryNetworkChainInfo$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListXChainVerticesResponse$ { + /** @deprecated use `ListXChainVerticesResponse$inboundSchema` instead. */ + export const inboundSchema = ListXChainVerticesResponse$inboundSchema; + /** @deprecated use `ListXChainVerticesResponse$outboundSchema` instead. */ + export const outboundSchema = ListXChainVerticesResponse$outboundSchema; + /** @deprecated use `ListXChainVerticesResponse$Outbound` instead. */ + export type Outbound = ListXChainVerticesResponse$Outbound; +} diff --git a/src/models/components/logsformat.ts b/src/models/components/logsformat.ts new file mode 100644 index 0000000..90513d2 --- /dev/null +++ b/src/models/components/logsformat.ts @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + LogsFormatMetadata, + LogsFormatMetadata$inboundSchema, + LogsFormatMetadata$Outbound, + LogsFormatMetadata$outboundSchema, +} from "./logsformatmetadata.js"; +import { + RequestType, + RequestType$inboundSchema, + RequestType$outboundSchema, +} from "./requesttype.js"; +import * as z from "zod"; + +export type LogsFormat = { + /** + * The organization id of the request. + */ + orgId: string; + /** + * The unique log id of the request. + */ + logId: string; + /** + * The timestamp of the request. + */ + eventTimestamp: number; + /** + * The apiKey used to make the request. + */ + apiKeyId: string; + /** + * The alias of the apiKey used to make the request. + */ + apiKeyAlias: string; + /** + * The region of the host for the request made by the client. + */ + hostRegion: string; + /** + * The type of request made by the client. + */ + requestType: RequestType; + /** + * The path of the request made by the client. + */ + requestPath: string; + /** + * The number of API credits consumed by the request. + */ + apiCreditsConsumed: number; + /** + * The duration of the request in milliseconds. + */ + requestDurationMsecs: number; + /** + * The response code of the request. + */ + responseCode: number; + /** + * The chain id of the request. + */ + chainId?: string | undefined; + /** + * The rpc method of the request. + */ + rpcMethod?: string | undefined; + /** + * The metadata of the request. + */ + metadata: LogsFormatMetadata; +}; + +/** @internal */ +export const LogsFormat$inboundSchema: z.ZodType = z.object({ + orgId: z.string(), + logId: z.string(), + eventTimestamp: z.number(), + apiKeyId: z.string(), + apiKeyAlias: z.string(), + hostRegion: z.string(), + requestType: RequestType$inboundSchema, + requestPath: z.string(), + apiCreditsConsumed: z.number(), + requestDurationMsecs: z.number(), + responseCode: z.number(), + chainId: z.string().optional(), + rpcMethod: z.string().optional(), + metadata: LogsFormatMetadata$inboundSchema, +}); + +/** @internal */ +export type LogsFormat$Outbound = { + orgId: string; + logId: string; + eventTimestamp: number; + apiKeyId: string; + apiKeyAlias: string; + hostRegion: string; + requestType: string; + requestPath: string; + apiCreditsConsumed: number; + requestDurationMsecs: number; + responseCode: number; + chainId?: string | undefined; + rpcMethod?: string | undefined; + metadata: LogsFormatMetadata$Outbound; +}; + +/** @internal */ +export const LogsFormat$outboundSchema: z.ZodType = + z.object({ + orgId: z.string(), + logId: z.string(), + eventTimestamp: z.number(), + apiKeyId: z.string(), + apiKeyAlias: z.string(), + hostRegion: z.string(), + requestType: RequestType$outboundSchema, + requestPath: z.string(), + apiCreditsConsumed: z.number(), + requestDurationMsecs: z.number(), + responseCode: z.number(), + chainId: z.string().optional(), + rpcMethod: z.string().optional(), + metadata: LogsFormatMetadata$outboundSchema, + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LogsFormat$ { + /** @deprecated use `LogsFormat$inboundSchema` instead. */ + export const inboundSchema = LogsFormat$inboundSchema; + /** @deprecated use `LogsFormat$outboundSchema` instead. */ + export const outboundSchema = LogsFormat$outboundSchema; + /** @deprecated use `LogsFormat$Outbound` instead. */ + export type Outbound = LogsFormat$Outbound; +} diff --git a/src/models/components/logsformatmetadata.ts b/src/models/components/logsformatmetadata.ts new file mode 100644 index 0000000..b195399 --- /dev/null +++ b/src/models/components/logsformatmetadata.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type LogsFormatMetadata = { + /** + * The IP address of the client that made the request. + */ + ipAddress: string; + /** + * The host for the request made by the client. + */ + host: string; + /** + * The user agent of the client that made the request. + */ + userAgent: string; +}; + +/** @internal */ +export const LogsFormatMetadata$inboundSchema: z.ZodType< + LogsFormatMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + ipAddress: z.string(), + host: z.string(), + userAgent: z.string(), +}); + +/** @internal */ +export type LogsFormatMetadata$Outbound = { + ipAddress: string; + host: string; + userAgent: string; +}; + +/** @internal */ +export const LogsFormatMetadata$outboundSchema: z.ZodType< + LogsFormatMetadata$Outbound, + z.ZodTypeDef, + LogsFormatMetadata +> = z.object({ + ipAddress: z.string(), + host: z.string(), + userAgent: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LogsFormatMetadata$ { + /** @deprecated use `LogsFormatMetadata$inboundSchema` instead. */ + export const inboundSchema = LogsFormatMetadata$inboundSchema; + /** @deprecated use `LogsFormatMetadata$outboundSchema` instead. */ + export const outboundSchema = LogsFormatMetadata$outboundSchema; + /** @deprecated use `LogsFormatMetadata$Outbound` instead. */ + export type Outbound = LogsFormatMetadata$Outbound; +} diff --git a/src/models/components/logsresponsedto.ts b/src/models/components/logsresponsedto.ts new file mode 100644 index 0000000..2632858 --- /dev/null +++ b/src/models/components/logsresponsedto.ts @@ -0,0 +1,65 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + LogsFormat, + LogsFormat$inboundSchema, + LogsFormat$Outbound, + LogsFormat$outboundSchema, +} from "./logsformat.js"; +import * as z from "zod"; + +export type LogsResponseDTO = { + /** + * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages. + */ + nextPageToken?: string | undefined; + /** + * The organization id of the request. + */ + orgId: string; + /** + * An array of logs representing the requests made by clients. + */ + logs: Array; +}; + +/** @internal */ +export const LogsResponseDTO$inboundSchema: z.ZodType = + z.object({ + nextPageToken: z.string().optional(), + orgId: z.string(), + logs: z.array(LogsFormat$inboundSchema), + }); + +/** @internal */ +export type LogsResponseDTO$Outbound = { + nextPageToken?: string | undefined; + orgId: string; + logs: Array; +}; + +/** @internal */ +export const LogsResponseDTO$outboundSchema: z.ZodType< + LogsResponseDTO$Outbound, + z.ZodTypeDef, + LogsResponseDTO +> = z.object({ + nextPageToken: z.string().optional(), + orgId: z.string(), + logs: z.array(LogsFormat$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LogsResponseDTO$ { + /** @deprecated use `LogsResponseDTO$inboundSchema` instead. */ + export const inboundSchema = LogsResponseDTO$inboundSchema; + /** @deprecated use `LogsResponseDTO$outboundSchema` instead. */ + export const outboundSchema = LogsResponseDTO$outboundSchema; + /** @deprecated use `LogsResponseDTO$Outbound` instead. */ + export type Outbound = LogsResponseDTO$Outbound; +} diff --git a/src/models/components/method.ts b/src/models/components/method.ts new file mode 100644 index 0000000..62a147a --- /dev/null +++ b/src/models/components/method.ts @@ -0,0 +1,59 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + TransactionMethodType, + TransactionMethodType$inboundSchema, + TransactionMethodType$outboundSchema, +} from "./transactionmethodtype.js"; +import * as z from "zod"; + +export type Method = { + /** + * The contract call type. NATIVE_TRANSFER indicates a transfer of the native token without any smart-contract interaction. CONTRACT_CALL indicates a smart-contract interaction. CONTRACT_CREATION indicates a smart-contract creation. + */ + callType: TransactionMethodType; + /** + * The contract method hash identifier. The method hash is only set if the `callType` is `CONTRACT_CALL`. + */ + methodHash: string; + /** + * The contract method name including parameter types. If the `callType` is `NATIVE_TRANSFER` this is set to 'Native Transfer'. If the `callType` is `CONTRACT_CREATION` this is set to 'Contract Created'. + */ + methodName?: string | undefined; +}; + +/** @internal */ +export const Method$inboundSchema: z.ZodType = z.object({ + callType: TransactionMethodType$inboundSchema, + methodHash: z.string(), + methodName: z.string().optional(), +}); + +/** @internal */ +export type Method$Outbound = { + callType: string; + methodHash: string; + methodName?: string | undefined; +}; + +/** @internal */ +export const Method$outboundSchema: z.ZodType = z.object({ + callType: TransactionMethodType$outboundSchema, + methodHash: z.string(), + methodName: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Method$ { + /** @deprecated use `Method$inboundSchema` instead. */ + export const inboundSchema = Method$inboundSchema; + /** @deprecated use `Method$outboundSchema` instead. */ + export const outboundSchema = Method$outboundSchema; + /** @deprecated use `Method$Outbound` instead. */ + export type Outbound = Method$Outbound; +} diff --git a/src/models/components/metric.ts b/src/models/components/metric.ts new file mode 100644 index 0000000..32365d1 --- /dev/null +++ b/src/models/components/metric.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + UsageMetricsValueDTO, + UsageMetricsValueDTO$inboundSchema, + UsageMetricsValueDTO$Outbound, + UsageMetricsValueDTO$outboundSchema, +} from "./usagemetricsvaluedto.js"; +import * as z from "zod"; + +export type Metric = { + /** + * The timestamp of the metrics value + */ + timestamp: number; + /** + * The metrics values for the timestamp + */ + values: Array; +}; + +/** @internal */ +export const Metric$inboundSchema: z.ZodType = z.object({ + timestamp: z.number(), + values: z.array(UsageMetricsValueDTO$inboundSchema), +}); + +/** @internal */ +export type Metric$Outbound = { + timestamp: number; + values: Array; +}; + +/** @internal */ +export const Metric$outboundSchema: z.ZodType = z.object({ + timestamp: z.number(), + values: z.array(UsageMetricsValueDTO$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Metric$ { + /** @deprecated use `Metric$inboundSchema` instead. */ + export const inboundSchema = Metric$inboundSchema; + /** @deprecated use `Metric$outboundSchema` instead. */ + export const outboundSchema = Metric$outboundSchema; + /** @deprecated use `Metric$Outbound` instead. */ + export type Outbound = Metric$Outbound; +} diff --git a/src/models/components/money.ts b/src/models/components/money.ts new file mode 100644 index 0000000..b50b21e --- /dev/null +++ b/src/models/components/money.ts @@ -0,0 +1,52 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + CurrencyCode, + CurrencyCode$inboundSchema, + CurrencyCode$outboundSchema, +} from "./currencycode.js"; +import * as z from "zod"; + +export type Money = { + /** + * ISO 4217 currency code. + */ + currencyCode: CurrencyCode; + /** + * Monetary value in base 10 decimals. + */ + value: number; +}; + +/** @internal */ +export const Money$inboundSchema: z.ZodType = z.object({ + currencyCode: CurrencyCode$inboundSchema, + value: z.number(), +}); + +/** @internal */ +export type Money$Outbound = { + currencyCode: string; + value: number; +}; + +/** @internal */ +export const Money$outboundSchema: z.ZodType = z.object({ + currencyCode: CurrencyCode$outboundSchema, + value: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Money$ { + /** @deprecated use `Money$inboundSchema` instead. */ + export const inboundSchema = Money$inboundSchema; + /** @deprecated use `Money$outboundSchema` instead. */ + export const outboundSchema = Money$outboundSchema; + /** @deprecated use `Money$Outbound` instead. */ + export type Outbound = Money$Outbound; +} diff --git a/src/models/components/nativetokenbalance.ts b/src/models/components/nativetokenbalance.ts new file mode 100644 index 0000000..00d1612 --- /dev/null +++ b/src/models/components/nativetokenbalance.ts @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Money, Money$inboundSchema, Money$Outbound, Money$outboundSchema } from "./money.js"; +import * as z from "zod"; + +export type NativeTokenBalance = { + /** + * The contract name. + */ + name: string; + /** + * The contract symbol. + */ + symbol: string; + /** + * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. + */ + decimals: number; + /** + * The logo uri for the address. + */ + logoUri?: string | undefined; + /** + * The evm chain id. + */ + chainId: string; + /** + * The token price, if available. + */ + price?: Money | undefined; + /** + * The address balance for the token, in units specified by the `decimals` value for the contract. + */ + balance: string; + /** + * The monetary value of the balance, if a price is available for the token. + */ + balanceValue?: Money | undefined; +}; + +/** @internal */ +export const NativeTokenBalance$inboundSchema: z.ZodType< + NativeTokenBalance, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + chainId: z.string(), + price: Money$inboundSchema.optional(), + balance: z.string(), + balanceValue: Money$inboundSchema.optional(), +}); + +/** @internal */ +export type NativeTokenBalance$Outbound = { + name: string; + symbol: string; + decimals: number; + logoUri?: string | undefined; + chainId: string; + price?: Money$Outbound | undefined; + balance: string; + balanceValue?: Money$Outbound | undefined; +}; + +/** @internal */ +export const NativeTokenBalance$outboundSchema: z.ZodType< + NativeTokenBalance$Outbound, + z.ZodTypeDef, + NativeTokenBalance +> = z.object({ + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + chainId: z.string(), + price: Money$outboundSchema.optional(), + balance: z.string(), + balanceValue: Money$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NativeTokenBalance$ { + /** @deprecated use `NativeTokenBalance$inboundSchema` instead. */ + export const inboundSchema = NativeTokenBalance$inboundSchema; + /** @deprecated use `NativeTokenBalance$outboundSchema` instead. */ + export const outboundSchema = NativeTokenBalance$outboundSchema; + /** @deprecated use `NativeTokenBalance$Outbound` instead. */ + export type Outbound = NativeTokenBalance$Outbound; +} diff --git a/src/models/components/nativetransaction.ts b/src/models/components/nativetransaction.ts new file mode 100644 index 0000000..87f0580 --- /dev/null +++ b/src/models/components/nativetransaction.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Method, Method$inboundSchema, Method$Outbound, Method$outboundSchema } from "./method.js"; +import { + RichAddress, + RichAddress$inboundSchema, + RichAddress$Outbound, + RichAddress$outboundSchema, +} from "./richaddress.js"; +import * as z from "zod"; + +export type NativeTransaction = { + /** + * The block number on the chain. + */ + blockNumber: string; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + /** + * The block hash identifier. + */ + blockHash: string; + /** + * The index at which the transaction occured in the block (0-indexed). + */ + blockIndex: number; + /** + * The transaction hash identifier. + */ + txHash: string; + /** + * The transaction status, which is either 0 (failed) or 1 (successful). + */ + txStatus: string; + /** + * The transaction type. + */ + txType: number; + /** + * The gas limit set for the transaction. + */ + gasLimit: string; + /** + * The amount of gas used. + */ + gasUsed: string; + /** + * The gas price denominated by the number of decimals of the native token. + */ + gasPrice: string; + /** + * The nonce used by the sender of the transaction. + */ + nonce: string; + from: RichAddress; + to: RichAddress; + method?: Method | undefined; + value: string; +}; + +/** @internal */ +export const NativeTransaction$inboundSchema: z.ZodType = + z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + blockIndex: z.number(), + txHash: z.string(), + txStatus: z.string(), + txType: z.number(), + gasLimit: z.string(), + gasUsed: z.string(), + gasPrice: z.string(), + nonce: z.string(), + from: RichAddress$inboundSchema, + to: RichAddress$inboundSchema, + method: Method$inboundSchema.optional(), + value: z.string(), + }); + +/** @internal */ +export type NativeTransaction$Outbound = { + blockNumber: string; + blockTimestamp: number; + blockHash: string; + blockIndex: number; + txHash: string; + txStatus: string; + txType: number; + gasLimit: string; + gasUsed: string; + gasPrice: string; + nonce: string; + from: RichAddress$Outbound; + to: RichAddress$Outbound; + method?: Method$Outbound | undefined; + value: string; +}; + +/** @internal */ +export const NativeTransaction$outboundSchema: z.ZodType< + NativeTransaction$Outbound, + z.ZodTypeDef, + NativeTransaction +> = z.object({ + blockNumber: z.string(), + blockTimestamp: z.number(), + blockHash: z.string(), + blockIndex: z.number(), + txHash: z.string(), + txStatus: z.string(), + txType: z.number(), + gasLimit: z.string(), + gasUsed: z.string(), + gasPrice: z.string(), + nonce: z.string(), + from: RichAddress$outboundSchema, + to: RichAddress$outboundSchema, + method: Method$outboundSchema.optional(), + value: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NativeTransaction$ { + /** @deprecated use `NativeTransaction$inboundSchema` instead. */ + export const inboundSchema = NativeTransaction$inboundSchema; + /** @deprecated use `NativeTransaction$outboundSchema` instead. */ + export const outboundSchema = NativeTransaction$outboundSchema; + /** @deprecated use `NativeTransaction$Outbound` instead. */ + export type Outbound = NativeTransaction$Outbound; +} diff --git a/src/models/components/networktoken.ts b/src/models/components/networktoken.ts new file mode 100644 index 0000000..7b7b048 --- /dev/null +++ b/src/models/components/networktoken.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type NetworkToken = { + /** + * The contract name. + */ + name: string; + /** + * The contract symbol. + */ + symbol: string; + /** + * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. + */ + decimals: number; + /** + * The logo uri for the address. + */ + logoUri?: string | undefined; + description?: string | undefined; +}; + +/** @internal */ +export const NetworkToken$inboundSchema: z.ZodType = z.object({ + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + description: z.string().optional(), +}); + +/** @internal */ +export type NetworkToken$Outbound = { + name: string; + symbol: string; + decimals: number; + logoUri?: string | undefined; + description?: string | undefined; +}; + +/** @internal */ +export const NetworkToken$outboundSchema: z.ZodType< + NetworkToken$Outbound, + z.ZodTypeDef, + NetworkToken +> = z.object({ + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + description: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NetworkToken$ { + /** @deprecated use `NetworkToken$inboundSchema` instead. */ + export const inboundSchema = NetworkToken$inboundSchema; + /** @deprecated use `NetworkToken$outboundSchema` instead. */ + export const outboundSchema = NetworkToken$outboundSchema; + /** @deprecated use `NetworkToken$Outbound` instead. */ + export type Outbound = NetworkToken$Outbound; +} diff --git a/src/models/components/networktokendetails.ts b/src/models/components/networktokendetails.ts new file mode 100644 index 0000000..b5a2660 --- /dev/null +++ b/src/models/components/networktokendetails.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Money, Money$inboundSchema, Money$Outbound, Money$outboundSchema } from "./money.js"; +import { + NetworkToken, + NetworkToken$inboundSchema, + NetworkToken$Outbound, + NetworkToken$outboundSchema, +} from "./networktoken.js"; +import * as z from "zod"; + +export type NetworkTokenDetails = { + networkToken: NetworkToken; + /** + * The current token price, if available. + */ + currentPrice?: Money | undefined; + /** + * The historical token price at the time the transaction occured, if available. Note, this is only provided if the transaction occured more than 24 hours ago. + */ + historicalPrice?: Money | undefined; +}; + +/** @internal */ +export const NetworkTokenDetails$inboundSchema: z.ZodType< + NetworkTokenDetails, + z.ZodTypeDef, + unknown +> = z.object({ + networkToken: NetworkToken$inboundSchema, + currentPrice: Money$inboundSchema.optional(), + historicalPrice: Money$inboundSchema.optional(), +}); + +/** @internal */ +export type NetworkTokenDetails$Outbound = { + networkToken: NetworkToken$Outbound; + currentPrice?: Money$Outbound | undefined; + historicalPrice?: Money$Outbound | undefined; +}; + +/** @internal */ +export const NetworkTokenDetails$outboundSchema: z.ZodType< + NetworkTokenDetails$Outbound, + z.ZodTypeDef, + NetworkTokenDetails +> = z.object({ + networkToken: NetworkToken$outboundSchema, + currentPrice: Money$outboundSchema.optional(), + historicalPrice: Money$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NetworkTokenDetails$ { + /** @deprecated use `NetworkTokenDetails$inboundSchema` instead. */ + export const inboundSchema = NetworkTokenDetails$inboundSchema; + /** @deprecated use `NetworkTokenDetails$outboundSchema` instead. */ + export const outboundSchema = NetworkTokenDetails$outboundSchema; + /** @deprecated use `NetworkTokenDetails$Outbound` instead. */ + export type Outbound = NetworkTokenDetails$Outbound; +} diff --git a/src/models/components/networktype.ts b/src/models/components/networktype.ts new file mode 100644 index 0000000..4f44942 --- /dev/null +++ b/src/models/components/networktype.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const NetworkType = { + Mainnet: "mainnet", + Testnet: "testnet", +} as const; +export type NetworkType = ClosedEnum; + +/** @internal */ +export const NetworkType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(NetworkType); + +/** @internal */ +export const NetworkType$outboundSchema: z.ZodNativeEnum = + NetworkType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NetworkType$ { + /** @deprecated use `NetworkType$inboundSchema` instead. */ + export const inboundSchema = NetworkType$inboundSchema; + /** @deprecated use `NetworkType$outboundSchema` instead. */ + export const outboundSchema = NetworkType$outboundSchema; +} diff --git a/src/models/components/nfttokenmetadatastatus.ts b/src/models/components/nfttokenmetadatastatus.ts new file mode 100644 index 0000000..5d24ba9 --- /dev/null +++ b/src/models/components/nfttokenmetadatastatus.ts @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * The metadata indexing status of the nft. + */ +export const NftTokenMetadataStatus = { + Unknown: "UNKNOWN", + MissingToken: "MISSING_TOKEN", + InvalidTokenUri: "INVALID_TOKEN_URI", + InvalidTokenUriScheme: "INVALID_TOKEN_URI_SCHEME", + UnreachableTokenUri: "UNREACHABLE_TOKEN_URI", + ThrottledTokenUri: "THROTTLED_TOKEN_URI", + MetadataContentTooLarge: "METADATA_CONTENT_TOO_LARGE", + InvalidMetadata: "INVALID_METADATA", + InvalidMetadataJson: "INVALID_METADATA_JSON", + Indexed: "INDEXED", + Unindexed: "UNINDEXED", +} as const; +/** + * The metadata indexing status of the nft. + */ +export type NftTokenMetadataStatus = ClosedEnum; + +/** @internal */ +export const NftTokenMetadataStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(NftTokenMetadataStatus); + +/** @internal */ +export const NftTokenMetadataStatus$outboundSchema: z.ZodNativeEnum = + NftTokenMetadataStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NftTokenMetadataStatus$ { + /** @deprecated use `NftTokenMetadataStatus$inboundSchema` instead. */ + export const inboundSchema = NftTokenMetadataStatus$inboundSchema; + /** @deprecated use `NftTokenMetadataStatus$outboundSchema` instead. */ + export const outboundSchema = NftTokenMetadataStatus$outboundSchema; +} diff --git a/src/models/components/operationstatus.ts b/src/models/components/operationstatus.ts new file mode 100644 index 0000000..5689724 --- /dev/null +++ b/src/models/components/operationstatus.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const OperationStatus = { + Running: "RUNNING", + Completed: "COMPLETED", + CompletedWithWarning: "COMPLETED_WITH_WARNING", + Failed: "FAILED", +} as const; +export type OperationStatus = ClosedEnum; + +/** @internal */ +export const OperationStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(OperationStatus); + +/** @internal */ +export const OperationStatus$outboundSchema: z.ZodNativeEnum = + OperationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OperationStatus$ { + /** @deprecated use `OperationStatus$inboundSchema` instead. */ + export const inboundSchema = OperationStatus$inboundSchema; + /** @deprecated use `OperationStatus$outboundSchema` instead. */ + export const outboundSchema = OperationStatus$outboundSchema; +} diff --git a/src/models/components/operationstatuscode.ts b/src/models/components/operationstatuscode.ts new file mode 100644 index 0000000..74abb3f --- /dev/null +++ b/src/models/components/operationstatuscode.ts @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const OperationStatusCode = { + ErrInvalidRequest: "ErrInvalidRequest", + ErrInternal: "ErrInternal", + WarnTruncatedExport: "WarnTruncatedExport", +} as const; +export type OperationStatusCode = ClosedEnum; + +/** @internal */ +export const OperationStatusCode$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(OperationStatusCode); + +/** @internal */ +export const OperationStatusCode$outboundSchema: z.ZodNativeEnum = + OperationStatusCode$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OperationStatusCode$ { + /** @deprecated use `OperationStatusCode$inboundSchema` instead. */ + export const inboundSchema = OperationStatusCode$inboundSchema; + /** @deprecated use `OperationStatusCode$outboundSchema` instead. */ + export const outboundSchema = OperationStatusCode$outboundSchema; +} diff --git a/src/models/components/operationstatusresponse.ts b/src/models/components/operationstatusresponse.ts new file mode 100644 index 0000000..2995707 --- /dev/null +++ b/src/models/components/operationstatusresponse.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + OperationStatus, + OperationStatus$inboundSchema, + OperationStatus$outboundSchema, +} from "./operationstatus.js"; +import { + OperationType, + OperationType$inboundSchema, + OperationType$outboundSchema, +} from "./operationtype.js"; +import { + TransactionExportMetadata, + TransactionExportMetadata$inboundSchema, + TransactionExportMetadata$Outbound, + TransactionExportMetadata$outboundSchema, +} from "./transactionexportmetadata.js"; +import * as z from "zod"; + +export type Metadata = TransactionExportMetadata; + +export type OperationStatusResponse = { + operationId: string; + operationType: OperationType; + operationStatus: OperationStatus; + message?: string | undefined; + metadata: TransactionExportMetadata; + createdAtTimestamp: number; + updatedAtTimestamp: number; +}; + +/** @internal */ +export const Metadata$inboundSchema: z.ZodType = + TransactionExportMetadata$inboundSchema; + +/** @internal */ +export type Metadata$Outbound = TransactionExportMetadata$Outbound; + +/** @internal */ +export const Metadata$outboundSchema: z.ZodType = + TransactionExportMetadata$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Metadata$ { + /** @deprecated use `Metadata$inboundSchema` instead. */ + export const inboundSchema = Metadata$inboundSchema; + /** @deprecated use `Metadata$outboundSchema` instead. */ + export const outboundSchema = Metadata$outboundSchema; + /** @deprecated use `Metadata$Outbound` instead. */ + export type Outbound = Metadata$Outbound; +} + +/** @internal */ +export const OperationStatusResponse$inboundSchema: z.ZodType< + OperationStatusResponse, + z.ZodTypeDef, + unknown +> = z.object({ + operationId: z.string(), + operationType: OperationType$inboundSchema, + operationStatus: OperationStatus$inboundSchema, + message: z.string().optional(), + metadata: TransactionExportMetadata$inboundSchema, + createdAtTimestamp: z.number(), + updatedAtTimestamp: z.number(), +}); + +/** @internal */ +export type OperationStatusResponse$Outbound = { + operationId: string; + operationType: string; + operationStatus: string; + message?: string | undefined; + metadata: TransactionExportMetadata$Outbound; + createdAtTimestamp: number; + updatedAtTimestamp: number; +}; + +/** @internal */ +export const OperationStatusResponse$outboundSchema: z.ZodType< + OperationStatusResponse$Outbound, + z.ZodTypeDef, + OperationStatusResponse +> = z.object({ + operationId: z.string(), + operationType: OperationType$outboundSchema, + operationStatus: OperationStatus$outboundSchema, + message: z.string().optional(), + metadata: TransactionExportMetadata$outboundSchema, + createdAtTimestamp: z.number(), + updatedAtTimestamp: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OperationStatusResponse$ { + /** @deprecated use `OperationStatusResponse$inboundSchema` instead. */ + export const inboundSchema = OperationStatusResponse$inboundSchema; + /** @deprecated use `OperationStatusResponse$outboundSchema` instead. */ + export const outboundSchema = OperationStatusResponse$outboundSchema; + /** @deprecated use `OperationStatusResponse$Outbound` instead. */ + export type Outbound = OperationStatusResponse$Outbound; +} diff --git a/src/models/components/operationtype.ts b/src/models/components/operationtype.ts new file mode 100644 index 0000000..7b77967 --- /dev/null +++ b/src/models/components/operationtype.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const OperationType = { + TransactionExportPrimaryNetwork: "TRANSACTION_EXPORT_PRIMARY_NETWORK", + TransactionExportPrimaryNetworkStaking: "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING", + TransactionExportPrimaryNetworkSimple: "TRANSACTION_EXPORT_PRIMARY_NETWORK_SIMPLE", + TransactionExportEvm: "TRANSACTION_EXPORT_EVM", +} as const; +export type OperationType = ClosedEnum; + +/** @internal */ +export const OperationType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(OperationType); + +/** @internal */ +export const OperationType$outboundSchema: z.ZodNativeEnum = + OperationType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OperationType$ { + /** @deprecated use `OperationType$inboundSchema` instead. */ + export const inboundSchema = OperationType$inboundSchema; + /** @deprecated use `OperationType$outboundSchema` instead. */ + export const outboundSchema = OperationType$outboundSchema; +} diff --git a/src/models/components/pchainbalance.ts b/src/models/components/pchainbalance.ts new file mode 100644 index 0000000..c7eb425 --- /dev/null +++ b/src/models/components/pchainbalance.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AggregatedAssetAmount, + AggregatedAssetAmount$inboundSchema, + AggregatedAssetAmount$Outbound, + AggregatedAssetAmount$outboundSchema, +} from "./aggregatedassetamount.js"; +import { + PChainSharedAsset, + PChainSharedAsset$inboundSchema, + PChainSharedAsset$Outbound, + PChainSharedAsset$outboundSchema, +} from "./pchainsharedasset.js"; +import * as z from "zod"; + +export type PChainBalance = { + /** + * A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is consumable by any transaction. + */ + unlockedUnstaked: Array; + /** + * A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax that is consumable by any transaction when the staking period ends. + */ + unlockedStaked: Array; + /** + * A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is locked at the platform level and not consumable by any transaction at the current time. + */ + lockedPlatform: Array; + /** + * A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is locked at the platform level and only consumeable for staking transactions. + */ + lockedStakeable: Array; + /** + * A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax that will be locked when the staking period ends. + */ + lockedStaked: Array; + /** + * A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax whose staking period has not yet started. + */ + pendingStaked: Array; + /** + * A list of objects containing P-chain Asset basic info, amount and utxo count of that Asset ID. Denotes the amount of unlocked Avax in the atomic memory between P-Chain and other chain. + */ + atomicMemoryUnlocked: Array; + /** + * A list of objects containing P-chain Asset basic info, amount and utxo count of that Asset ID. Denotes the amount of locked Avax in the atomic memory between P-Chain and other chain. + */ + atomicMemoryLocked: Array; +}; + +/** @internal */ +export const PChainBalance$inboundSchema: z.ZodType = + z.object({ + unlockedUnstaked: z.array(AggregatedAssetAmount$inboundSchema), + unlockedStaked: z.array(AggregatedAssetAmount$inboundSchema), + lockedPlatform: z.array(AggregatedAssetAmount$inboundSchema), + lockedStakeable: z.array(AggregatedAssetAmount$inboundSchema), + lockedStaked: z.array(AggregatedAssetAmount$inboundSchema), + pendingStaked: z.array(AggregatedAssetAmount$inboundSchema), + atomicMemoryUnlocked: z.array(PChainSharedAsset$inboundSchema), + atomicMemoryLocked: z.array(PChainSharedAsset$inboundSchema), + }); + +/** @internal */ +export type PChainBalance$Outbound = { + unlockedUnstaked: Array; + unlockedStaked: Array; + lockedPlatform: Array; + lockedStakeable: Array; + lockedStaked: Array; + pendingStaked: Array; + atomicMemoryUnlocked: Array; + atomicMemoryLocked: Array; +}; + +/** @internal */ +export const PChainBalance$outboundSchema: z.ZodType< + PChainBalance$Outbound, + z.ZodTypeDef, + PChainBalance +> = z.object({ + unlockedUnstaked: z.array(AggregatedAssetAmount$outboundSchema), + unlockedStaked: z.array(AggregatedAssetAmount$outboundSchema), + lockedPlatform: z.array(AggregatedAssetAmount$outboundSchema), + lockedStakeable: z.array(AggregatedAssetAmount$outboundSchema), + lockedStaked: z.array(AggregatedAssetAmount$outboundSchema), + pendingStaked: z.array(AggregatedAssetAmount$outboundSchema), + atomicMemoryUnlocked: z.array(PChainSharedAsset$outboundSchema), + atomicMemoryLocked: z.array(PChainSharedAsset$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PChainBalance$ { + /** @deprecated use `PChainBalance$inboundSchema` instead. */ + export const inboundSchema = PChainBalance$inboundSchema; + /** @deprecated use `PChainBalance$outboundSchema` instead. */ + export const outboundSchema = PChainBalance$outboundSchema; + /** @deprecated use `PChainBalance$Outbound` instead. */ + export type Outbound = PChainBalance$Outbound; +} diff --git a/src/models/components/pchainid.ts b/src/models/components/pchainid.ts new file mode 100644 index 0000000..dd9d33b --- /dev/null +++ b/src/models/components/pchainid.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const PChainId = { + ElevenNonillionOneHundredAndElevenOctillionOneHundredAndElevenSeptillionOneHundredAndElevenSextillionOneHundredAndElevenQuintillionOneHundredAndElevenQuadrillionOneHundredAndElevenTrillionOneHundredAndElevenBillionOneHundredAndElevenMillionOneHundredAndElevenThousandOneHundredAndElevenLpoYY: + "11111111111111111111111111111111LpoYY", + PChain: "p-chain", +} as const; +export type PChainId = ClosedEnum; + +/** @internal */ +export const PChainId$inboundSchema: z.ZodNativeEnum = z.nativeEnum(PChainId); + +/** @internal */ +export const PChainId$outboundSchema: z.ZodNativeEnum = PChainId$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PChainId$ { + /** @deprecated use `PChainId$inboundSchema` instead. */ + export const inboundSchema = PChainId$inboundSchema; + /** @deprecated use `PChainId$outboundSchema` instead. */ + export const outboundSchema = PChainId$outboundSchema; +} diff --git a/src/models/components/pchainsharedasset.ts b/src/models/components/pchainsharedasset.ts new file mode 100644 index 0000000..2496790 --- /dev/null +++ b/src/models/components/pchainsharedasset.ts @@ -0,0 +1,97 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkAssetType, + PrimaryNetworkAssetType$inboundSchema, + PrimaryNetworkAssetType$outboundSchema, +} from "./primarynetworkassettype.js"; +import * as z from "zod"; + +export type PChainSharedAsset = { + /** + * Unique ID for an asset. + */ + assetId: string; + /** + * Name of this asset. + */ + name: string; + /** + * Symbol for this asset (max 4 characters). + */ + symbol: string; + /** + * Denomination of this asset to represent fungibility. + */ + denomination: number; + /** + * Type of asset like SECP256K1 or NFT. + */ + type: PrimaryNetworkAssetType; + /** + * Amount of the asset. + */ + amount: string; + utxoCount: number; + sharedWithChainId: string; + status: string; +}; + +/** @internal */ +export const PChainSharedAsset$inboundSchema: z.ZodType = + z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$inboundSchema, + amount: z.string(), + utxoCount: z.number(), + sharedWithChainId: z.string(), + status: z.string(), + }); + +/** @internal */ +export type PChainSharedAsset$Outbound = { + assetId: string; + name: string; + symbol: string; + denomination: number; + type: string; + amount: string; + utxoCount: number; + sharedWithChainId: string; + status: string; +}; + +/** @internal */ +export const PChainSharedAsset$outboundSchema: z.ZodType< + PChainSharedAsset$Outbound, + z.ZodTypeDef, + PChainSharedAsset +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$outboundSchema, + amount: z.string(), + utxoCount: z.number(), + sharedWithChainId: z.string(), + status: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PChainSharedAsset$ { + /** @deprecated use `PChainSharedAsset$inboundSchema` instead. */ + export const inboundSchema = PChainSharedAsset$inboundSchema; + /** @deprecated use `PChainSharedAsset$outboundSchema` instead. */ + export const outboundSchema = PChainSharedAsset$outboundSchema; + /** @deprecated use `PChainSharedAsset$Outbound` instead. */ + export type Outbound = PChainSharedAsset$Outbound; +} diff --git a/src/models/components/pchaintransaction.ts b/src/models/components/pchaintransaction.ts new file mode 100644 index 0000000..67fbb62 --- /dev/null +++ b/src/models/components/pchaintransaction.ts @@ -0,0 +1,211 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { + BlsCredentials, + BlsCredentials$inboundSchema, + BlsCredentials$Outbound, + BlsCredentials$outboundSchema, +} from "./blscredentials.js"; +import { + PChainTransactionType, + PChainTransactionType$inboundSchema, + PChainTransactionType$outboundSchema, +} from "./pchaintransactiontype.js"; +import { + PChainUtxo, + PChainUtxo$inboundSchema, + PChainUtxo$Outbound, + PChainUtxo$outboundSchema, +} from "./pchainutxo.js"; +import { + SubnetOwnershipInfo, + SubnetOwnershipInfo$inboundSchema, + SubnetOwnershipInfo$Outbound, + SubnetOwnershipInfo$outboundSchema, +} from "./subnetownershipinfo.js"; +import * as z from "zod"; + +export type PChainTransaction = { + /** + * A P-Chain transaction hash. + */ + txHash: string; + txType: PChainTransactionType; + /** + * The block finality timestamp. + */ + blockTimestamp: number; + blockNumber: string; + blockHash: string; + consumedUtxos: Array; + emittedUtxos: Array; + /** + * Source chain for an atomic transaction. + */ + sourceChain?: string | undefined; + /** + * Destination chain for an atomic transaction. + */ + destinationChain?: string | undefined; + /** + * A list of objects containing P-chain Asset basic info and the amount of that Asset ID. + */ + value: Array; + /** + * A list of objects containing P-chain Asset basic info and the amount of that Asset ID. + */ + amountBurned: Array; + /** + * A list of objects containing P-chain Asset basic info and the amount of that Asset ID. Present for AddValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx + */ + amountStaked: Array; + /** + * Present for AddValidatorTx, AddSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx + */ + startTimestamp?: number | undefined; + /** + * Present for AddValidatorTx, AddSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx + */ + endTimestamp?: number | undefined; + /** + * Present for AddValidatorTx, AddPermissionlessValidatorTx + */ + delegationFeePercent?: string | undefined; + /** + * Present for AddValidatorTx, AddSubnetValidatorTx, RemoveSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx + */ + nodeId?: string | undefined; + /** + * Present for AddValidatorTx, AddSubnetValidatorTx, RemoveSubnetValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx, CreateChainTx, CreateSubnetTx + */ + subnetId?: string | undefined; + /** + * Present for AddValidatorTx, AddPermissionlessValidatorTx, AddDelegatorTx + */ + estimatedReward?: string | undefined; + rewardTxHash?: string | undefined; + rewardAddresses?: Array | undefined; + memo?: string | undefined; + /** + * Present for RewardValidatorTx + */ + stakingTxHash?: string | undefined; + /** + * Subnet owner details for the CreateSubnetTx or TransferSubnetOwnershipTx + */ + subnetOwnershipInfo?: SubnetOwnershipInfo | undefined; + /** + * Present for AddPermissionlessValidatorTx + */ + blsCredentials?: BlsCredentials | undefined; +}; + +/** @internal */ +export const PChainTransaction$inboundSchema: z.ZodType = + z.object({ + txHash: z.string(), + txType: PChainTransactionType$inboundSchema, + blockTimestamp: z.number(), + blockNumber: z.string(), + blockHash: z.string(), + consumedUtxos: z.array(PChainUtxo$inboundSchema), + emittedUtxos: z.array(PChainUtxo$inboundSchema), + sourceChain: z.string().optional(), + destinationChain: z.string().optional(), + value: z.array(AssetAmount$inboundSchema), + amountBurned: z.array(AssetAmount$inboundSchema), + amountStaked: z.array(AssetAmount$inboundSchema), + startTimestamp: z.number().optional(), + endTimestamp: z.number().optional(), + delegationFeePercent: z.string().optional(), + nodeId: z.string().optional(), + subnetId: z.string().optional(), + estimatedReward: z.string().optional(), + rewardTxHash: z.string().optional(), + rewardAddresses: z.array(z.string()).optional(), + memo: z.string().optional(), + stakingTxHash: z.string().optional(), + subnetOwnershipInfo: SubnetOwnershipInfo$inboundSchema.optional(), + blsCredentials: BlsCredentials$inboundSchema.optional(), + }); + +/** @internal */ +export type PChainTransaction$Outbound = { + txHash: string; + txType: string; + blockTimestamp: number; + blockNumber: string; + blockHash: string; + consumedUtxos: Array; + emittedUtxos: Array; + sourceChain?: string | undefined; + destinationChain?: string | undefined; + value: Array; + amountBurned: Array; + amountStaked: Array; + startTimestamp?: number | undefined; + endTimestamp?: number | undefined; + delegationFeePercent?: string | undefined; + nodeId?: string | undefined; + subnetId?: string | undefined; + estimatedReward?: string | undefined; + rewardTxHash?: string | undefined; + rewardAddresses?: Array | undefined; + memo?: string | undefined; + stakingTxHash?: string | undefined; + subnetOwnershipInfo?: SubnetOwnershipInfo$Outbound | undefined; + blsCredentials?: BlsCredentials$Outbound | undefined; +}; + +/** @internal */ +export const PChainTransaction$outboundSchema: z.ZodType< + PChainTransaction$Outbound, + z.ZodTypeDef, + PChainTransaction +> = z.object({ + txHash: z.string(), + txType: PChainTransactionType$outboundSchema, + blockTimestamp: z.number(), + blockNumber: z.string(), + blockHash: z.string(), + consumedUtxos: z.array(PChainUtxo$outboundSchema), + emittedUtxos: z.array(PChainUtxo$outboundSchema), + sourceChain: z.string().optional(), + destinationChain: z.string().optional(), + value: z.array(AssetAmount$outboundSchema), + amountBurned: z.array(AssetAmount$outboundSchema), + amountStaked: z.array(AssetAmount$outboundSchema), + startTimestamp: z.number().optional(), + endTimestamp: z.number().optional(), + delegationFeePercent: z.string().optional(), + nodeId: z.string().optional(), + subnetId: z.string().optional(), + estimatedReward: z.string().optional(), + rewardTxHash: z.string().optional(), + rewardAddresses: z.array(z.string()).optional(), + memo: z.string().optional(), + stakingTxHash: z.string().optional(), + subnetOwnershipInfo: SubnetOwnershipInfo$outboundSchema.optional(), + blsCredentials: BlsCredentials$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PChainTransaction$ { + /** @deprecated use `PChainTransaction$inboundSchema` instead. */ + export const inboundSchema = PChainTransaction$inboundSchema; + /** @deprecated use `PChainTransaction$outboundSchema` instead. */ + export const outboundSchema = PChainTransaction$outboundSchema; + /** @deprecated use `PChainTransaction$Outbound` instead. */ + export type Outbound = PChainTransaction$Outbound; +} diff --git a/src/models/components/pchaintransactiontype.ts b/src/models/components/pchaintransactiontype.ts new file mode 100644 index 0000000..bfe5012 --- /dev/null +++ b/src/models/components/pchaintransactiontype.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const PChainTransactionType = { + AddValidatorTx: "AddValidatorTx", + AddSubnetValidatorTx: "AddSubnetValidatorTx", + AddDelegatorTx: "AddDelegatorTx", + CreateChainTx: "CreateChainTx", + CreateSubnetTx: "CreateSubnetTx", + ImportTx: "ImportTx", + ExportTx: "ExportTx", + AdvanceTimeTx: "AdvanceTimeTx", + RewardValidatorTx: "RewardValidatorTx", + RemoveSubnetValidatorTx: "RemoveSubnetValidatorTx", + TransformSubnetTx: "TransformSubnetTx", + AddPermissionlessValidatorTx: "AddPermissionlessValidatorTx", + AddPermissionlessDelegatorTx: "AddPermissionlessDelegatorTx", + BaseTx: "BaseTx", + TransferSubnetOwnershipTx: "TransferSubnetOwnershipTx", + Unknown: "UNKNOWN", +} as const; +export type PChainTransactionType = ClosedEnum; + +/** @internal */ +export const PChainTransactionType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(PChainTransactionType); + +/** @internal */ +export const PChainTransactionType$outboundSchema: z.ZodNativeEnum = + PChainTransactionType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PChainTransactionType$ { + /** @deprecated use `PChainTransactionType$inboundSchema` instead. */ + export const inboundSchema = PChainTransactionType$inboundSchema; + /** @deprecated use `PChainTransactionType$outboundSchema` instead. */ + export const outboundSchema = PChainTransactionType$outboundSchema; +} diff --git a/src/models/components/pchainutxo.ts b/src/models/components/pchainutxo.ts new file mode 100644 index 0000000..6301490 --- /dev/null +++ b/src/models/components/pchainutxo.ts @@ -0,0 +1,151 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { RewardType, RewardType$inboundSchema, RewardType$outboundSchema } from "./rewardtype.js"; +import { UtxoType, UtxoType$inboundSchema, UtxoType$outboundSchema } from "./utxotype.js"; +import * as z from "zod"; + +export type PChainUtxo = { + /** + * Addresses that are eligible to sign the consumption of this output. + */ + addresses: Array; + asset: AssetAmount; + /** + * Blockchain ID on which this output is consumed on. + */ + consumedOnChainId: string; + /** + * Transaction ID that consumed this output. + */ + consumingTxHash?: string | undefined; + /** + * Blockchain ID on which this output is created on. + */ + createdOnChainId: string; + /** + * UTXO ID for this output. + */ + utxoId: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + amount: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + assetId: string; + blockNumber: string; + blockTimestamp: number; + consumingBlockNumber?: string | undefined; + consumingBlockTimestamp?: number | undefined; + platformLocktime?: number | undefined; + outputIndex: number; + rewardType?: RewardType | undefined; + stakeableLocktime?: number | undefined; + staked?: boolean | undefined; + threshold?: number | undefined; + txHash: string; + utxoEndTimestamp?: number | undefined; + utxoStartTimestamp?: number | undefined; + utxoType: UtxoType; +}; + +/** @internal */ +export const PChainUtxo$inboundSchema: z.ZodType = z.object({ + addresses: z.array(z.string()), + asset: AssetAmount$inboundSchema, + consumedOnChainId: z.string(), + consumingTxHash: z.string().optional(), + createdOnChainId: z.string(), + utxoId: z.string(), + amount: z.string(), + assetId: z.string(), + blockNumber: z.string(), + blockTimestamp: z.number(), + consumingBlockNumber: z.string().optional(), + consumingBlockTimestamp: z.number().optional(), + platformLocktime: z.number().optional(), + outputIndex: z.number(), + rewardType: RewardType$inboundSchema.optional(), + stakeableLocktime: z.number().optional(), + staked: z.boolean().optional(), + threshold: z.number().optional(), + txHash: z.string(), + utxoEndTimestamp: z.number().optional(), + utxoStartTimestamp: z.number().optional(), + utxoType: UtxoType$inboundSchema, +}); + +/** @internal */ +export type PChainUtxo$Outbound = { + addresses: Array; + asset: AssetAmount$Outbound; + consumedOnChainId: string; + consumingTxHash?: string | undefined; + createdOnChainId: string; + utxoId: string; + amount: string; + assetId: string; + blockNumber: string; + blockTimestamp: number; + consumingBlockNumber?: string | undefined; + consumingBlockTimestamp?: number | undefined; + platformLocktime?: number | undefined; + outputIndex: number; + rewardType?: string | undefined; + stakeableLocktime?: number | undefined; + staked?: boolean | undefined; + threshold?: number | undefined; + txHash: string; + utxoEndTimestamp?: number | undefined; + utxoStartTimestamp?: number | undefined; + utxoType: string; +}; + +/** @internal */ +export const PChainUtxo$outboundSchema: z.ZodType = + z.object({ + addresses: z.array(z.string()), + asset: AssetAmount$outboundSchema, + consumedOnChainId: z.string(), + consumingTxHash: z.string().optional(), + createdOnChainId: z.string(), + utxoId: z.string(), + amount: z.string(), + assetId: z.string(), + blockNumber: z.string(), + blockTimestamp: z.number(), + consumingBlockNumber: z.string().optional(), + consumingBlockTimestamp: z.number().optional(), + platformLocktime: z.number().optional(), + outputIndex: z.number(), + rewardType: RewardType$outboundSchema.optional(), + stakeableLocktime: z.number().optional(), + staked: z.boolean().optional(), + threshold: z.number().optional(), + txHash: z.string(), + utxoEndTimestamp: z.number().optional(), + utxoStartTimestamp: z.number().optional(), + utxoType: UtxoType$outboundSchema, + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PChainUtxo$ { + /** @deprecated use `PChainUtxo$inboundSchema` instead. */ + export const inboundSchema = PChainUtxo$inboundSchema; + /** @deprecated use `PChainUtxo$outboundSchema` instead. */ + export const outboundSchema = PChainUtxo$outboundSchema; + /** @deprecated use `PChainUtxo$Outbound` instead. */ + export type Outbound = PChainUtxo$Outbound; +} diff --git a/src/models/components/pendingdelegatordetails.ts b/src/models/components/pendingdelegatordetails.ts new file mode 100644 index 0000000..f24089a --- /dev/null +++ b/src/models/components/pendingdelegatordetails.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const PendingDelegatorDetailsDelegationStatus = { + Pending: "pending", +} as const; +export type PendingDelegatorDetailsDelegationStatus = ClosedEnum< + typeof PendingDelegatorDetailsDelegationStatus +>; + +export type PendingDelegatorDetails = { + txHash: string; + nodeId: string; + rewardAddresses: Array; + amountDelegated: string; + delegationFee: string; + startTimestamp: number; + endTimestamp: number; + estimatedGrossReward: string; + estimatedNetReward: string; + delegationStatus: PendingDelegatorDetailsDelegationStatus; +}; + +/** @internal */ +export const PendingDelegatorDetailsDelegationStatus$inboundSchema: z.ZodNativeEnum< + typeof PendingDelegatorDetailsDelegationStatus +> = z.nativeEnum(PendingDelegatorDetailsDelegationStatus); + +/** @internal */ +export const PendingDelegatorDetailsDelegationStatus$outboundSchema: z.ZodNativeEnum< + typeof PendingDelegatorDetailsDelegationStatus +> = PendingDelegatorDetailsDelegationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PendingDelegatorDetailsDelegationStatus$ { + /** @deprecated use `PendingDelegatorDetailsDelegationStatus$inboundSchema` instead. */ + export const inboundSchema = PendingDelegatorDetailsDelegationStatus$inboundSchema; + /** @deprecated use `PendingDelegatorDetailsDelegationStatus$outboundSchema` instead. */ + export const outboundSchema = PendingDelegatorDetailsDelegationStatus$outboundSchema; +} + +/** @internal */ +export const PendingDelegatorDetails$inboundSchema: z.ZodType< + PendingDelegatorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + rewardAddresses: z.array(z.string()), + amountDelegated: z.string(), + delegationFee: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + estimatedGrossReward: z.string(), + estimatedNetReward: z.string(), + delegationStatus: PendingDelegatorDetailsDelegationStatus$inboundSchema, +}); + +/** @internal */ +export type PendingDelegatorDetails$Outbound = { + txHash: string; + nodeId: string; + rewardAddresses: Array; + amountDelegated: string; + delegationFee: string; + startTimestamp: number; + endTimestamp: number; + estimatedGrossReward: string; + estimatedNetReward: string; + delegationStatus: string; +}; + +/** @internal */ +export const PendingDelegatorDetails$outboundSchema: z.ZodType< + PendingDelegatorDetails$Outbound, + z.ZodTypeDef, + PendingDelegatorDetails +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + rewardAddresses: z.array(z.string()), + amountDelegated: z.string(), + delegationFee: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + estimatedGrossReward: z.string(), + estimatedNetReward: z.string(), + delegationStatus: PendingDelegatorDetailsDelegationStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PendingDelegatorDetails$ { + /** @deprecated use `PendingDelegatorDetails$inboundSchema` instead. */ + export const inboundSchema = PendingDelegatorDetails$inboundSchema; + /** @deprecated use `PendingDelegatorDetails$outboundSchema` instead. */ + export const outboundSchema = PendingDelegatorDetails$outboundSchema; + /** @deprecated use `PendingDelegatorDetails$Outbound` instead. */ + export type Outbound = PendingDelegatorDetails$Outbound; +} diff --git a/src/models/components/pendingreward.ts b/src/models/components/pendingreward.ts new file mode 100644 index 0000000..0cc603f --- /dev/null +++ b/src/models/components/pendingreward.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { RewardType, RewardType$inboundSchema, RewardType$outboundSchema } from "./rewardtype.js"; +import * as z from "zod"; + +export type PendingReward = { + /** + * An array of P-Chain wallet addresses. + */ + addresses: Array; + txHash: string; + amountStaked: string; + nodeId: string; + startTimestamp: number; + endTimestamp: number; + rewardType: RewardType; + progress: number; + /** + * An object containing P-chain Asset basic info and the amount of that Asset ID. + */ + estimatedReward: AssetAmount; +}; + +/** @internal */ +export const PendingReward$inboundSchema: z.ZodType = + z.object({ + addresses: z.array(z.string()), + txHash: z.string(), + amountStaked: z.string(), + nodeId: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + rewardType: RewardType$inboundSchema, + progress: z.number(), + estimatedReward: AssetAmount$inboundSchema, + }); + +/** @internal */ +export type PendingReward$Outbound = { + addresses: Array; + txHash: string; + amountStaked: string; + nodeId: string; + startTimestamp: number; + endTimestamp: number; + rewardType: string; + progress: number; + estimatedReward: AssetAmount$Outbound; +}; + +/** @internal */ +export const PendingReward$outboundSchema: z.ZodType< + PendingReward$Outbound, + z.ZodTypeDef, + PendingReward +> = z.object({ + addresses: z.array(z.string()), + txHash: z.string(), + amountStaked: z.string(), + nodeId: z.string(), + startTimestamp: z.number(), + endTimestamp: z.number(), + rewardType: RewardType$outboundSchema, + progress: z.number(), + estimatedReward: AssetAmount$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PendingReward$ { + /** @deprecated use `PendingReward$inboundSchema` instead. */ + export const inboundSchema = PendingReward$inboundSchema; + /** @deprecated use `PendingReward$outboundSchema` instead. */ + export const outboundSchema = PendingReward$outboundSchema; + /** @deprecated use `PendingReward$Outbound` instead. */ + export type Outbound = PendingReward$Outbound; +} diff --git a/src/models/components/pendingteleportermessage.ts b/src/models/components/pendingteleportermessage.ts new file mode 100644 index 0000000..b01cbc6 --- /dev/null +++ b/src/models/components/pendingteleportermessage.ts @@ -0,0 +1,146 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + TeleporterReceipt, + TeleporterReceipt$inboundSchema, + TeleporterReceipt$Outbound, + TeleporterReceipt$outboundSchema, +} from "./teleporterreceipt.js"; +import { + TeleporterRewardDetails, + TeleporterRewardDetails$inboundSchema, + TeleporterRewardDetails$Outbound, + TeleporterRewardDetails$outboundSchema, +} from "./teleporterrewarddetails.js"; +import { + TeleporterSourceTransaction, + TeleporterSourceTransaction$inboundSchema, + TeleporterSourceTransaction$Outbound, + TeleporterSourceTransaction$outboundSchema, +} from "./teleportersourcetransaction.js"; +import * as z from "zod"; + +export const Status = { + Pending: "pending", +} as const; +export type Status = ClosedEnum; + +export type PendingTeleporterMessage = { + messageId: string; + teleporterContractAddress: string; + sourceBlockchainId: string; + destinationBlockchainId: string; + sourceEvmChainId: string; + destinationEvmChainId: string; + messageNonce: string; + from: string; + to: string; + data?: string | undefined; + messageExecuted: boolean; + receipts: Array; + receiptDelivered: boolean; + rewardDetails: TeleporterRewardDetails; + sourceTransaction: TeleporterSourceTransaction; + status: Status; +}; + +/** @internal */ +export const Status$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Status); + +/** @internal */ +export const Status$outboundSchema: z.ZodNativeEnum = Status$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Status$ { + /** @deprecated use `Status$inboundSchema` instead. */ + export const inboundSchema = Status$inboundSchema; + /** @deprecated use `Status$outboundSchema` instead. */ + export const outboundSchema = Status$outboundSchema; +} + +/** @internal */ +export const PendingTeleporterMessage$inboundSchema: z.ZodType< + PendingTeleporterMessage, + z.ZodTypeDef, + unknown +> = z.object({ + messageId: z.string(), + teleporterContractAddress: z.string(), + sourceBlockchainId: z.string(), + destinationBlockchainId: z.string(), + sourceEvmChainId: z.string(), + destinationEvmChainId: z.string(), + messageNonce: z.string(), + from: z.string(), + to: z.string(), + data: z.string().optional(), + messageExecuted: z.boolean(), + receipts: z.array(TeleporterReceipt$inboundSchema), + receiptDelivered: z.boolean(), + rewardDetails: TeleporterRewardDetails$inboundSchema, + sourceTransaction: TeleporterSourceTransaction$inboundSchema, + status: Status$inboundSchema, +}); + +/** @internal */ +export type PendingTeleporterMessage$Outbound = { + messageId: string; + teleporterContractAddress: string; + sourceBlockchainId: string; + destinationBlockchainId: string; + sourceEvmChainId: string; + destinationEvmChainId: string; + messageNonce: string; + from: string; + to: string; + data?: string | undefined; + messageExecuted: boolean; + receipts: Array; + receiptDelivered: boolean; + rewardDetails: TeleporterRewardDetails$Outbound; + sourceTransaction: TeleporterSourceTransaction$Outbound; + status: string; +}; + +/** @internal */ +export const PendingTeleporterMessage$outboundSchema: z.ZodType< + PendingTeleporterMessage$Outbound, + z.ZodTypeDef, + PendingTeleporterMessage +> = z.object({ + messageId: z.string(), + teleporterContractAddress: z.string(), + sourceBlockchainId: z.string(), + destinationBlockchainId: z.string(), + sourceEvmChainId: z.string(), + destinationEvmChainId: z.string(), + messageNonce: z.string(), + from: z.string(), + to: z.string(), + data: z.string().optional(), + messageExecuted: z.boolean(), + receipts: z.array(TeleporterReceipt$outboundSchema), + receiptDelivered: z.boolean(), + rewardDetails: TeleporterRewardDetails$outboundSchema, + sourceTransaction: TeleporterSourceTransaction$outboundSchema, + status: Status$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PendingTeleporterMessage$ { + /** @deprecated use `PendingTeleporterMessage$inboundSchema` instead. */ + export const inboundSchema = PendingTeleporterMessage$inboundSchema; + /** @deprecated use `PendingTeleporterMessage$outboundSchema` instead. */ + export const outboundSchema = PendingTeleporterMessage$outboundSchema; + /** @deprecated use `PendingTeleporterMessage$Outbound` instead. */ + export type Outbound = PendingTeleporterMessage$Outbound; +} diff --git a/src/models/components/pendingvalidatordetails.ts b/src/models/components/pendingvalidatordetails.ts new file mode 100644 index 0000000..22a11b9 --- /dev/null +++ b/src/models/components/pendingvalidatordetails.ts @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + BlsCredentials, + BlsCredentials$inboundSchema, + BlsCredentials$Outbound, + BlsCredentials$outboundSchema, +} from "./blscredentials.js"; +import * as z from "zod"; + +export const PendingValidatorDetailsValidationStatus = { + Pending: "pending", +} as const; +export type PendingValidatorDetailsValidationStatus = ClosedEnum< + typeof PendingValidatorDetailsValidationStatus +>; + +export type PendingValidatorDetails = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + /** + * Present for AddPermissionlessValidatorTx + */ + blsCredentials?: BlsCredentials | undefined; + validationStatus: PendingValidatorDetailsValidationStatus; +}; + +/** @internal */ +export const PendingValidatorDetailsValidationStatus$inboundSchema: z.ZodNativeEnum< + typeof PendingValidatorDetailsValidationStatus +> = z.nativeEnum(PendingValidatorDetailsValidationStatus); + +/** @internal */ +export const PendingValidatorDetailsValidationStatus$outboundSchema: z.ZodNativeEnum< + typeof PendingValidatorDetailsValidationStatus +> = PendingValidatorDetailsValidationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PendingValidatorDetailsValidationStatus$ { + /** @deprecated use `PendingValidatorDetailsValidationStatus$inboundSchema` instead. */ + export const inboundSchema = PendingValidatorDetailsValidationStatus$inboundSchema; + /** @deprecated use `PendingValidatorDetailsValidationStatus$outboundSchema` instead. */ + export const outboundSchema = PendingValidatorDetailsValidationStatus$outboundSchema; +} + +/** @internal */ +export const PendingValidatorDetails$inboundSchema: z.ZodType< + PendingValidatorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$inboundSchema.optional(), + validationStatus: PendingValidatorDetailsValidationStatus$inboundSchema, +}); + +/** @internal */ +export type PendingValidatorDetails$Outbound = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + blsCredentials?: BlsCredentials$Outbound | undefined; + validationStatus: string; +}; + +/** @internal */ +export const PendingValidatorDetails$outboundSchema: z.ZodType< + PendingValidatorDetails$Outbound, + z.ZodTypeDef, + PendingValidatorDetails +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$outboundSchema.optional(), + validationStatus: PendingValidatorDetailsValidationStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PendingValidatorDetails$ { + /** @deprecated use `PendingValidatorDetails$inboundSchema` instead. */ + export const inboundSchema = PendingValidatorDetails$inboundSchema; + /** @deprecated use `PendingValidatorDetails$outboundSchema` instead. */ + export const outboundSchema = PendingValidatorDetails$outboundSchema; + /** @deprecated use `PendingValidatorDetails$Outbound` instead. */ + export type Outbound = PendingValidatorDetails$Outbound; +} diff --git a/src/models/components/pricingproviders.ts b/src/models/components/pricingproviders.ts new file mode 100644 index 0000000..6fd8770 --- /dev/null +++ b/src/models/components/pricingproviders.ts @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type PricingProviders = { + coingeckoCoinId?: string | undefined; +}; + +/** @internal */ +export const PricingProviders$inboundSchema: z.ZodType = + z.object({ + coingeckoCoinId: z.string().optional(), + }); + +/** @internal */ +export type PricingProviders$Outbound = { + coingeckoCoinId?: string | undefined; +}; + +/** @internal */ +export const PricingProviders$outboundSchema: z.ZodType< + PricingProviders$Outbound, + z.ZodTypeDef, + PricingProviders +> = z.object({ + coingeckoCoinId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PricingProviders$ { + /** @deprecated use `PricingProviders$inboundSchema` instead. */ + export const inboundSchema = PricingProviders$inboundSchema; + /** @deprecated use `PricingProviders$outboundSchema` instead. */ + export const outboundSchema = PricingProviders$outboundSchema; + /** @deprecated use `PricingProviders$Outbound` instead. */ + export type Outbound = PricingProviders$Outbound; +} diff --git a/src/models/components/primarynetwork.ts b/src/models/components/primarynetwork.ts new file mode 100644 index 0000000..e4c70ff --- /dev/null +++ b/src/models/components/primarynetwork.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const PrimaryNetwork = { + Mainnet: "mainnet", + Fuji: "fuji", +} as const; +export type PrimaryNetwork = ClosedEnum; + +/** @internal */ +export const PrimaryNetwork$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(PrimaryNetwork); + +/** @internal */ +export const PrimaryNetwork$outboundSchema: z.ZodNativeEnum = + PrimaryNetwork$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetwork$ { + /** @deprecated use `PrimaryNetwork$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetwork$inboundSchema; + /** @deprecated use `PrimaryNetwork$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetwork$outboundSchema; +} diff --git a/src/models/components/primarynetworkassetcap.ts b/src/models/components/primarynetworkassetcap.ts new file mode 100644 index 0000000..1b66409 --- /dev/null +++ b/src/models/components/primarynetworkassetcap.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * Cap represents if an asset is a variable or fixed cap asset. + */ +export const PrimaryNetworkAssetCap = { + Fixed: "fixed", + Variable: "variable", +} as const; +/** + * Cap represents if an asset is a variable or fixed cap asset. + */ +export type PrimaryNetworkAssetCap = ClosedEnum; + +/** @internal */ +export const PrimaryNetworkAssetCap$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(PrimaryNetworkAssetCap); + +/** @internal */ +export const PrimaryNetworkAssetCap$outboundSchema: z.ZodNativeEnum = + PrimaryNetworkAssetCap$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkAssetCap$ { + /** @deprecated use `PrimaryNetworkAssetCap$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkAssetCap$inboundSchema; + /** @deprecated use `PrimaryNetworkAssetCap$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkAssetCap$outboundSchema; +} diff --git a/src/models/components/primarynetworkassettype.ts b/src/models/components/primarynetworkassettype.ts new file mode 100644 index 0000000..0a2f35f --- /dev/null +++ b/src/models/components/primarynetworkassettype.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * Type of asset like SECP256K1 or NFT. + */ +export const PrimaryNetworkAssetType = { + Secp256k1: "secp256k1", + Nft: "nft", +} as const; +/** + * Type of asset like SECP256K1 or NFT. + */ +export type PrimaryNetworkAssetType = ClosedEnum; + +/** @internal */ +export const PrimaryNetworkAssetType$inboundSchema: z.ZodNativeEnum< + typeof PrimaryNetworkAssetType +> = z.nativeEnum(PrimaryNetworkAssetType); + +/** @internal */ +export const PrimaryNetworkAssetType$outboundSchema: z.ZodNativeEnum< + typeof PrimaryNetworkAssetType +> = PrimaryNetworkAssetType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkAssetType$ { + /** @deprecated use `PrimaryNetworkAssetType$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkAssetType$inboundSchema; + /** @deprecated use `PrimaryNetworkAssetType$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkAssetType$outboundSchema; +} diff --git a/src/models/components/primarynetworkblock.ts b/src/models/components/primarynetworkblock.ts new file mode 100644 index 0000000..ed15a71 --- /dev/null +++ b/src/models/components/primarynetworkblock.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + ProposerDetails, + ProposerDetails$inboundSchema, + ProposerDetails$Outbound, + ProposerDetails$outboundSchema, +} from "./proposerdetails.js"; +import * as z from "zod"; + +export type PrimaryNetworkBlock = { + blockNumber: string; + blockHash: string; + parentHash: string; + blockTimestamp: number; + blockType: string; + txCount: number; + transactions: Array; + blockSizeBytes: number; + currentSupply?: string | undefined; + proposerDetails?: ProposerDetails | undefined; +}; + +/** @internal */ +export const PrimaryNetworkBlock$inboundSchema: z.ZodType< + PrimaryNetworkBlock, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string(), + blockHash: z.string(), + parentHash: z.string(), + blockTimestamp: z.number(), + blockType: z.string(), + txCount: z.number(), + transactions: z.array(z.string()), + blockSizeBytes: z.number(), + currentSupply: z.string().optional(), + proposerDetails: ProposerDetails$inboundSchema.optional(), +}); + +/** @internal */ +export type PrimaryNetworkBlock$Outbound = { + blockNumber: string; + blockHash: string; + parentHash: string; + blockTimestamp: number; + blockType: string; + txCount: number; + transactions: Array; + blockSizeBytes: number; + currentSupply?: string | undefined; + proposerDetails?: ProposerDetails$Outbound | undefined; +}; + +/** @internal */ +export const PrimaryNetworkBlock$outboundSchema: z.ZodType< + PrimaryNetworkBlock$Outbound, + z.ZodTypeDef, + PrimaryNetworkBlock +> = z.object({ + blockNumber: z.string(), + blockHash: z.string(), + parentHash: z.string(), + blockTimestamp: z.number(), + blockType: z.string(), + txCount: z.number(), + transactions: z.array(z.string()), + blockSizeBytes: z.number(), + currentSupply: z.string().optional(), + proposerDetails: ProposerDetails$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkBlock$ { + /** @deprecated use `PrimaryNetworkBlock$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkBlock$inboundSchema; + /** @deprecated use `PrimaryNetworkBlock$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkBlock$outboundSchema; + /** @deprecated use `PrimaryNetworkBlock$Outbound` instead. */ + export type Outbound = PrimaryNetworkBlock$Outbound; +} diff --git a/src/models/components/primarynetworkchaininfo.ts b/src/models/components/primarynetworkchaininfo.ts new file mode 100644 index 0000000..959751a --- /dev/null +++ b/src/models/components/primarynetworkchaininfo.ts @@ -0,0 +1,59 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetwork, + PrimaryNetwork$inboundSchema, + PrimaryNetwork$outboundSchema, +} from "./primarynetwork.js"; +import { + PrimaryNetworkChainName, + PrimaryNetworkChainName$inboundSchema, + PrimaryNetworkChainName$outboundSchema, +} from "./primarynetworkchainname.js"; +import * as z from "zod"; + +export type PrimaryNetworkChainInfo = { + chainName: PrimaryNetworkChainName; + network: PrimaryNetwork; +}; + +/** @internal */ +export const PrimaryNetworkChainInfo$inboundSchema: z.ZodType< + PrimaryNetworkChainInfo, + z.ZodTypeDef, + unknown +> = z.object({ + chainName: PrimaryNetworkChainName$inboundSchema, + network: PrimaryNetwork$inboundSchema, +}); + +/** @internal */ +export type PrimaryNetworkChainInfo$Outbound = { + chainName: string; + network: string; +}; + +/** @internal */ +export const PrimaryNetworkChainInfo$outboundSchema: z.ZodType< + PrimaryNetworkChainInfo$Outbound, + z.ZodTypeDef, + PrimaryNetworkChainInfo +> = z.object({ + chainName: PrimaryNetworkChainName$outboundSchema, + network: PrimaryNetwork$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkChainInfo$ { + /** @deprecated use `PrimaryNetworkChainInfo$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkChainInfo$inboundSchema; + /** @deprecated use `PrimaryNetworkChainInfo$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkChainInfo$outboundSchema; + /** @deprecated use `PrimaryNetworkChainInfo$Outbound` instead. */ + export type Outbound = PrimaryNetworkChainInfo$Outbound; +} diff --git a/src/models/components/primarynetworkchainname.ts b/src/models/components/primarynetworkchainname.ts new file mode 100644 index 0000000..f79c39a --- /dev/null +++ b/src/models/components/primarynetworkchainname.ts @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const PrimaryNetworkChainName = { + PChain: "p-chain", + XChain: "x-chain", + CChain: "c-chain", +} as const; +export type PrimaryNetworkChainName = ClosedEnum; + +/** @internal */ +export const PrimaryNetworkChainName$inboundSchema: z.ZodNativeEnum< + typeof PrimaryNetworkChainName +> = z.nativeEnum(PrimaryNetworkChainName); + +/** @internal */ +export const PrimaryNetworkChainName$outboundSchema: z.ZodNativeEnum< + typeof PrimaryNetworkChainName +> = PrimaryNetworkChainName$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkChainName$ { + /** @deprecated use `PrimaryNetworkChainName$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkChainName$inboundSchema; + /** @deprecated use `PrimaryNetworkChainName$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkChainName$outboundSchema; +} diff --git a/src/models/components/primarynetworkoperationtype.ts b/src/models/components/primarynetworkoperationtype.ts new file mode 100644 index 0000000..cb49030 --- /dev/null +++ b/src/models/components/primarynetworkoperationtype.ts @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const PrimaryNetworkOperationType = { + TransactionExportPrimaryNetwork: "TRANSACTION_EXPORT_PRIMARY_NETWORK", + TransactionExportPrimaryNetworkStaking: "TRANSACTION_EXPORT_PRIMARY_NETWORK_STAKING", + TransactionExportPrimaryNetworkSimple: "TRANSACTION_EXPORT_PRIMARY_NETWORK_SIMPLE", +} as const; +export type PrimaryNetworkOperationType = ClosedEnum; + +/** @internal */ +export const PrimaryNetworkOperationType$inboundSchema: z.ZodNativeEnum< + typeof PrimaryNetworkOperationType +> = z.nativeEnum(PrimaryNetworkOperationType); + +/** @internal */ +export const PrimaryNetworkOperationType$outboundSchema: z.ZodNativeEnum< + typeof PrimaryNetworkOperationType +> = PrimaryNetworkOperationType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkOperationType$ { + /** @deprecated use `PrimaryNetworkOperationType$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkOperationType$inboundSchema; + /** @deprecated use `PrimaryNetworkOperationType$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkOperationType$outboundSchema; +} diff --git a/src/models/components/primarynetworkoptions.ts b/src/models/components/primarynetworkoptions.ts new file mode 100644 index 0000000..7c31c9d --- /dev/null +++ b/src/models/components/primarynetworkoptions.ts @@ -0,0 +1,90 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const IncludeChains = { + ElevenNonillionOneHundredAndElevenOctillionOneHundredAndElevenSeptillionOneHundredAndElevenSextillionOneHundredAndElevenQuintillionOneHundredAndElevenQuadrillionOneHundredAndElevenTrillionOneHundredAndElevenBillionOneHundredAndElevenMillionOneHundredAndElevenThousandOneHundredAndElevenLpoYY: + "11111111111111111111111111111111LpoYY", + TwooYmbnv4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM: + "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + TwoJVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm: + "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm", + Twoq9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAx5UQxse55x1Q5: + "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", + YH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp: + "yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp", + PChain: "p-chain", + XChain: "x-chain", + CChain: "c-chain", +} as const; +export type IncludeChains = ClosedEnum; + +export type PrimaryNetworkOptions = { + addresses?: Array | undefined; + cChainEvmAddresses?: Array | undefined; + includeChains: Array; +}; + +/** @internal */ +export const IncludeChains$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(IncludeChains); + +/** @internal */ +export const IncludeChains$outboundSchema: z.ZodNativeEnum = + IncludeChains$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IncludeChains$ { + /** @deprecated use `IncludeChains$inboundSchema` instead. */ + export const inboundSchema = IncludeChains$inboundSchema; + /** @deprecated use `IncludeChains$outboundSchema` instead. */ + export const outboundSchema = IncludeChains$outboundSchema; +} + +/** @internal */ +export const PrimaryNetworkOptions$inboundSchema: z.ZodType< + PrimaryNetworkOptions, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.array(z.string()).optional(), + cChainEvmAddresses: z.array(z.string()).optional(), + includeChains: z.array(IncludeChains$inboundSchema), +}); + +/** @internal */ +export type PrimaryNetworkOptions$Outbound = { + addresses?: Array | undefined; + cChainEvmAddresses?: Array | undefined; + includeChains: Array; +}; + +/** @internal */ +export const PrimaryNetworkOptions$outboundSchema: z.ZodType< + PrimaryNetworkOptions$Outbound, + z.ZodTypeDef, + PrimaryNetworkOptions +> = z.object({ + addresses: z.array(z.string()).optional(), + cChainEvmAddresses: z.array(z.string()).optional(), + includeChains: z.array(IncludeChains$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkOptions$ { + /** @deprecated use `PrimaryNetworkOptions$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkOptions$inboundSchema; + /** @deprecated use `PrimaryNetworkOptions$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkOptions$outboundSchema; + /** @deprecated use `PrimaryNetworkOptions$Outbound` instead. */ + export type Outbound = PrimaryNetworkOptions$Outbound; +} diff --git a/src/models/components/primarynetworktxtype.ts b/src/models/components/primarynetworktxtype.ts new file mode 100644 index 0000000..b49dfd5 --- /dev/null +++ b/src/models/components/primarynetworktxtype.ts @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const PrimaryNetworkTxType = { + AddValidatorTx: "AddValidatorTx", + AddSubnetValidatorTx: "AddSubnetValidatorTx", + AddDelegatorTx: "AddDelegatorTx", + CreateChainTx: "CreateChainTx", + CreateSubnetTx: "CreateSubnetTx", + ImportTx: "ImportTx", + ExportTx: "ExportTx", + AdvanceTimeTx: "AdvanceTimeTx", + RewardValidatorTx: "RewardValidatorTx", + RemoveSubnetValidatorTx: "RemoveSubnetValidatorTx", + TransformSubnetTx: "TransformSubnetTx", + AddPermissionlessValidatorTx: "AddPermissionlessValidatorTx", + AddPermissionlessDelegatorTx: "AddPermissionlessDelegatorTx", + BaseTx: "BaseTx", + TransferSubnetOwnershipTx: "TransferSubnetOwnershipTx", + Unknown: "UNKNOWN", + CreateAssetTx: "CreateAssetTx", + OperationTx: "OperationTx", +} as const; +export type PrimaryNetworkTxType = ClosedEnum; + +/** @internal */ +export const PrimaryNetworkTxType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(PrimaryNetworkTxType); + +/** @internal */ +export const PrimaryNetworkTxType$outboundSchema: z.ZodNativeEnum = + PrimaryNetworkTxType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PrimaryNetworkTxType$ { + /** @deprecated use `PrimaryNetworkTxType$inboundSchema` instead. */ + export const inboundSchema = PrimaryNetworkTxType$inboundSchema; + /** @deprecated use `PrimaryNetworkTxType$outboundSchema` instead. */ + export const outboundSchema = PrimaryNetworkTxType$outboundSchema; +} diff --git a/src/models/components/proposerdetails.ts b/src/models/components/proposerdetails.ts new file mode 100644 index 0000000..b07b1f3 --- /dev/null +++ b/src/models/components/proposerdetails.ts @@ -0,0 +1,58 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type ProposerDetails = { + proposerId?: string | undefined; + proposerParentId?: string | undefined; + proposerNodeId?: string | undefined; + proposerPChainHeight?: number | undefined; + proposerTimestamp?: number | undefined; +}; + +/** @internal */ +export const ProposerDetails$inboundSchema: z.ZodType = + z.object({ + proposerId: z.string().optional(), + proposerParentId: z.string().optional(), + proposerNodeId: z.string().optional(), + proposerPChainHeight: z.number().optional(), + proposerTimestamp: z.number().optional(), + }); + +/** @internal */ +export type ProposerDetails$Outbound = { + proposerId?: string | undefined; + proposerParentId?: string | undefined; + proposerNodeId?: string | undefined; + proposerPChainHeight?: number | undefined; + proposerTimestamp?: number | undefined; +}; + +/** @internal */ +export const ProposerDetails$outboundSchema: z.ZodType< + ProposerDetails$Outbound, + z.ZodTypeDef, + ProposerDetails +> = z.object({ + proposerId: z.string().optional(), + proposerParentId: z.string().optional(), + proposerNodeId: z.string().optional(), + proposerPChainHeight: z.number().optional(), + proposerTimestamp: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ProposerDetails$ { + /** @deprecated use `ProposerDetails$inboundSchema` instead. */ + export const inboundSchema = ProposerDetails$inboundSchema; + /** @deprecated use `ProposerDetails$outboundSchema` instead. */ + export const outboundSchema = ProposerDetails$outboundSchema; + /** @deprecated use `ProposerDetails$Outbound` instead. */ + export type Outbound = ProposerDetails$Outbound; +} diff --git a/src/models/components/removedvalidatordetails.ts b/src/models/components/removedvalidatordetails.ts new file mode 100644 index 0000000..a039c2b --- /dev/null +++ b/src/models/components/removedvalidatordetails.ts @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + BlsCredentials, + BlsCredentials$inboundSchema, + BlsCredentials$Outbound, + BlsCredentials$outboundSchema, +} from "./blscredentials.js"; +import * as z from "zod"; + +export const RemovedValidatorDetailsValidationStatus = { + Removed: "removed", +} as const; +export type RemovedValidatorDetailsValidationStatus = ClosedEnum< + typeof RemovedValidatorDetailsValidationStatus +>; + +export type RemovedValidatorDetails = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + /** + * Present for AddPermissionlessValidatorTx + */ + blsCredentials?: BlsCredentials | undefined; + removeTxHash: string; + removeTimestamp: number; + validationStatus: RemovedValidatorDetailsValidationStatus; +}; + +/** @internal */ +export const RemovedValidatorDetailsValidationStatus$inboundSchema: z.ZodNativeEnum< + typeof RemovedValidatorDetailsValidationStatus +> = z.nativeEnum(RemovedValidatorDetailsValidationStatus); + +/** @internal */ +export const RemovedValidatorDetailsValidationStatus$outboundSchema: z.ZodNativeEnum< + typeof RemovedValidatorDetailsValidationStatus +> = RemovedValidatorDetailsValidationStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemovedValidatorDetailsValidationStatus$ { + /** @deprecated use `RemovedValidatorDetailsValidationStatus$inboundSchema` instead. */ + export const inboundSchema = RemovedValidatorDetailsValidationStatus$inboundSchema; + /** @deprecated use `RemovedValidatorDetailsValidationStatus$outboundSchema` instead. */ + export const outboundSchema = RemovedValidatorDetailsValidationStatus$outboundSchema; +} + +/** @internal */ +export const RemovedValidatorDetails$inboundSchema: z.ZodType< + RemovedValidatorDetails, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$inboundSchema.optional(), + removeTxHash: z.string(), + removeTimestamp: z.number(), + validationStatus: RemovedValidatorDetailsValidationStatus$inboundSchema, +}); + +/** @internal */ +export type RemovedValidatorDetails$Outbound = { + txHash: string; + nodeId: string; + subnetId: string; + amountStaked: string; + delegationFee?: string | undefined; + startTimestamp: number; + endTimestamp: number; + blsCredentials?: BlsCredentials$Outbound | undefined; + removeTxHash: string; + removeTimestamp: number; + validationStatus: string; +}; + +/** @internal */ +export const RemovedValidatorDetails$outboundSchema: z.ZodType< + RemovedValidatorDetails$Outbound, + z.ZodTypeDef, + RemovedValidatorDetails +> = z.object({ + txHash: z.string(), + nodeId: z.string(), + subnetId: z.string(), + amountStaked: z.string(), + delegationFee: z.string().optional(), + startTimestamp: z.number(), + endTimestamp: z.number(), + blsCredentials: BlsCredentials$outboundSchema.optional(), + removeTxHash: z.string(), + removeTimestamp: z.number(), + validationStatus: RemovedValidatorDetailsValidationStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemovedValidatorDetails$ { + /** @deprecated use `RemovedValidatorDetails$inboundSchema` instead. */ + export const inboundSchema = RemovedValidatorDetails$inboundSchema; + /** @deprecated use `RemovedValidatorDetails$outboundSchema` instead. */ + export const outboundSchema = RemovedValidatorDetails$outboundSchema; + /** @deprecated use `RemovedValidatorDetails$Outbound` instead. */ + export type Outbound = RemovedValidatorDetails$Outbound; +} diff --git a/src/models/components/requesttype.ts b/src/models/components/requesttype.ts new file mode 100644 index 0000000..be92209 --- /dev/null +++ b/src/models/components/requesttype.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * The type of request made by the client. + */ +export const RequestType = { + GlacierAPIRequest: "Glacier API Request", + GlacierRPCRequest: "Glacier RPC Request", +} as const; +/** + * The type of request made by the client. + */ +export type RequestType = ClosedEnum; + +/** @internal */ +export const RequestType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(RequestType); + +/** @internal */ +export const RequestType$outboundSchema: z.ZodNativeEnum = + RequestType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RequestType$ { + /** @deprecated use `RequestType$inboundSchema` instead. */ + export const inboundSchema = RequestType$inboundSchema; + /** @deprecated use `RequestType$outboundSchema` instead. */ + export const outboundSchema = RequestType$outboundSchema; +} diff --git a/src/models/components/resourcelink.ts b/src/models/components/resourcelink.ts new file mode 100644 index 0000000..33e87f2 --- /dev/null +++ b/src/models/components/resourcelink.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + ResourceLinkType, + ResourceLinkType$inboundSchema, + ResourceLinkType$outboundSchema, +} from "./resourcelinktype.js"; +import * as z from "zod"; + +export type ResourceLink = { + type: ResourceLinkType; + url: string; +}; + +/** @internal */ +export const ResourceLink$inboundSchema: z.ZodType = z.object({ + type: ResourceLinkType$inboundSchema, + url: z.string(), +}); + +/** @internal */ +export type ResourceLink$Outbound = { + type: string; + url: string; +}; + +/** @internal */ +export const ResourceLink$outboundSchema: z.ZodType< + ResourceLink$Outbound, + z.ZodTypeDef, + ResourceLink +> = z.object({ + type: ResourceLinkType$outboundSchema, + url: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ResourceLink$ { + /** @deprecated use `ResourceLink$inboundSchema` instead. */ + export const inboundSchema = ResourceLink$inboundSchema; + /** @deprecated use `ResourceLink$outboundSchema` instead. */ + export const outboundSchema = ResourceLink$outboundSchema; + /** @deprecated use `ResourceLink$Outbound` instead. */ + export type Outbound = ResourceLink$Outbound; +} diff --git a/src/models/components/resourcelinktype.ts b/src/models/components/resourcelinktype.ts new file mode 100644 index 0000000..ca285c1 --- /dev/null +++ b/src/models/components/resourcelinktype.ts @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const ResourceLinkType = { + Blog: "Blog", + CoinGecko: "CoinGecko", + CoinMarketCap: "CoinMarketCap", + Discord: "Discord", + Documentation: "Documentation", + Facebook: "Facebook", + Github: "Github", + Instagram: "Instagram", + LinkedIn: "LinkedIn", + Medium: "Medium", + Reddit: "Reddit", + Support: "Support", + Telegram: "Telegram", + TikTok: "TikTok", + Twitter: "Twitter", + Website: "Website", + Whitepaper: "Whitepaper", + Youtube: "Youtube", +} as const; +export type ResourceLinkType = ClosedEnum; + +/** @internal */ +export const ResourceLinkType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(ResourceLinkType); + +/** @internal */ +export const ResourceLinkType$outboundSchema: z.ZodNativeEnum = + ResourceLinkType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ResourceLinkType$ { + /** @deprecated use `ResourceLinkType$inboundSchema` instead. */ + export const inboundSchema = ResourceLinkType$inboundSchema; + /** @deprecated use `ResourceLinkType$outboundSchema` instead. */ + export const outboundSchema = ResourceLinkType$outboundSchema; +} diff --git a/src/models/components/rewards.ts b/src/models/components/rewards.ts new file mode 100644 index 0000000..fea10d1 --- /dev/null +++ b/src/models/components/rewards.ts @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type Rewards = { + validationRewardAmount: string; + delegationRewardAmount: string; + rewardAddresses?: Array | undefined; + rewardTxHash?: string | undefined; +}; + +/** @internal */ +export const Rewards$inboundSchema: z.ZodType = z.object({ + validationRewardAmount: z.string(), + delegationRewardAmount: z.string(), + rewardAddresses: z.array(z.string()).optional(), + rewardTxHash: z.string().optional(), +}); + +/** @internal */ +export type Rewards$Outbound = { + validationRewardAmount: string; + delegationRewardAmount: string; + rewardAddresses?: Array | undefined; + rewardTxHash?: string | undefined; +}; + +/** @internal */ +export const Rewards$outboundSchema: z.ZodType = z.object({ + validationRewardAmount: z.string(), + delegationRewardAmount: z.string(), + rewardAddresses: z.array(z.string()).optional(), + rewardTxHash: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Rewards$ { + /** @deprecated use `Rewards$inboundSchema` instead. */ + export const inboundSchema = Rewards$inboundSchema; + /** @deprecated use `Rewards$outboundSchema` instead. */ + export const outboundSchema = Rewards$outboundSchema; + /** @deprecated use `Rewards$Outbound` instead. */ + export type Outbound = Rewards$Outbound; +} diff --git a/src/models/components/rewardtype.ts b/src/models/components/rewardtype.ts new file mode 100644 index 0000000..a47614b --- /dev/null +++ b/src/models/components/rewardtype.ts @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const RewardType = { + Validator: "VALIDATOR", + Delegator: "DELEGATOR", + ValidatorFee: "VALIDATOR_FEE", +} as const; +export type RewardType = ClosedEnum; + +/** @internal */ +export const RewardType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(RewardType); + +/** @internal */ +export const RewardType$outboundSchema: z.ZodNativeEnum = + RewardType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RewardType$ { + /** @deprecated use `RewardType$inboundSchema` instead. */ + export const inboundSchema = RewardType$inboundSchema; + /** @deprecated use `RewardType$outboundSchema` instead. */ + export const outboundSchema = RewardType$outboundSchema; +} diff --git a/src/models/components/richaddress.ts b/src/models/components/richaddress.ts new file mode 100644 index 0000000..9d8cd33 --- /dev/null +++ b/src/models/components/richaddress.ts @@ -0,0 +1,72 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type RichAddress = { + /** + * The contract name. + */ + name?: string | undefined; + /** + * The contract symbol. + */ + symbol?: string | undefined; + /** + * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. + */ + decimals?: number | undefined; + /** + * The logo uri for the address. + */ + logoUri?: string | undefined; + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; +}; + +/** @internal */ +export const RichAddress$inboundSchema: z.ZodType = z.object({ + name: z.string().optional(), + symbol: z.string().optional(), + decimals: z.number().optional(), + logoUri: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type RichAddress$Outbound = { + name?: string | undefined; + symbol?: string | undefined; + decimals?: number | undefined; + logoUri?: string | undefined; + address: string; +}; + +/** @internal */ +export const RichAddress$outboundSchema: z.ZodType< + RichAddress$Outbound, + z.ZodTypeDef, + RichAddress +> = z.object({ + name: z.string().optional(), + symbol: z.string().optional(), + decimals: z.number().optional(), + logoUri: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RichAddress$ { + /** @deprecated use `RichAddress$inboundSchema` instead. */ + export const inboundSchema = RichAddress$inboundSchema; + /** @deprecated use `RichAddress$outboundSchema` instead. */ + export const outboundSchema = RichAddress$outboundSchema; + /** @deprecated use `RichAddress$Outbound` instead. */ + export type Outbound = RichAddress$Outbound; +} diff --git a/src/models/components/security.ts b/src/models/components/security.ts new file mode 100644 index 0000000..8ce535c --- /dev/null +++ b/src/models/components/security.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type Security = { + apiKey: string; +}; + +/** @internal */ +export const Security$inboundSchema: z.ZodType = z.object({ + apiKey: z.string(), +}); + +/** @internal */ +export type Security$Outbound = { + apiKey: string; +}; + +/** @internal */ +export const Security$outboundSchema: z.ZodType = + z.object({ + apiKey: z.string(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Security$ { + /** @deprecated use `Security$inboundSchema` instead. */ + export const inboundSchema = Security$inboundSchema; + /** @deprecated use `Security$outboundSchema` instead. */ + export const outboundSchema = Security$outboundSchema; + /** @deprecated use `Security$Outbound` instead. */ + export type Outbound = Security$Outbound; +} diff --git a/src/models/components/sharedsecretsresponse.ts b/src/models/components/sharedsecretsresponse.ts new file mode 100644 index 0000000..10f5935 --- /dev/null +++ b/src/models/components/sharedsecretsresponse.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type SharedSecretsResponse = { + secret: string; +}; + +/** @internal */ +export const SharedSecretsResponse$inboundSchema: z.ZodType< + SharedSecretsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + secret: z.string(), +}); + +/** @internal */ +export type SharedSecretsResponse$Outbound = { + secret: string; +}; + +/** @internal */ +export const SharedSecretsResponse$outboundSchema: z.ZodType< + SharedSecretsResponse$Outbound, + z.ZodTypeDef, + SharedSecretsResponse +> = z.object({ + secret: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SharedSecretsResponse$ { + /** @deprecated use `SharedSecretsResponse$inboundSchema` instead. */ + export const inboundSchema = SharedSecretsResponse$inboundSchema; + /** @deprecated use `SharedSecretsResponse$outboundSchema` instead. */ + export const outboundSchema = SharedSecretsResponse$outboundSchema; + /** @deprecated use `SharedSecretsResponse$Outbound` instead. */ + export type Outbound = SharedSecretsResponse$Outbound; +} diff --git a/src/models/components/sortbyoption.ts b/src/models/components/sortbyoption.ts new file mode 100644 index 0000000..49c3518 --- /dev/null +++ b/src/models/components/sortbyoption.ts @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const SortByOption = { + BlockIndex: "blockIndex", + DelegationCapacity: "delegationCapacity", + TimeRemaining: "timeRemaining", + DelegationFee: "delegationFee", + UptimePerformance: "uptimePerformance", +} as const; +export type SortByOption = ClosedEnum; + +/** @internal */ +export const SortByOption$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(SortByOption); + +/** @internal */ +export const SortByOption$outboundSchema: z.ZodNativeEnum = + SortByOption$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SortByOption$ { + /** @deprecated use `SortByOption$inboundSchema` instead. */ + export const inboundSchema = SortByOption$inboundSchema; + /** @deprecated use `SortByOption$outboundSchema` instead. */ + export const outboundSchema = SortByOption$outboundSchema; +} diff --git a/src/models/components/sortorder.ts b/src/models/components/sortorder.ts new file mode 100644 index 0000000..1f45f01 --- /dev/null +++ b/src/models/components/sortorder.ts @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const SortOrder = { + Asc: "asc", + Desc: "desc", +} as const; +export type SortOrder = ClosedEnum; + +/** @internal */ +export const SortOrder$inboundSchema: z.ZodNativeEnum = z.nativeEnum(SortOrder); + +/** @internal */ +export const SortOrder$outboundSchema: z.ZodNativeEnum = SortOrder$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SortOrder$ { + /** @deprecated use `SortOrder$inboundSchema` instead. */ + export const inboundSchema = SortOrder$inboundSchema; + /** @deprecated use `SortOrder$outboundSchema` instead. */ + export const outboundSchema = SortOrder$outboundSchema; +} diff --git a/src/models/components/stakingdistribution.ts b/src/models/components/stakingdistribution.ts new file mode 100644 index 0000000..cdafb86 --- /dev/null +++ b/src/models/components/stakingdistribution.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type StakingDistribution = { + version: string; + amountStaked: string; + validatorCount: number; +}; + +/** @internal */ +export const StakingDistribution$inboundSchema: z.ZodType< + StakingDistribution, + z.ZodTypeDef, + unknown +> = z.object({ + version: z.string(), + amountStaked: z.string(), + validatorCount: z.number(), +}); + +/** @internal */ +export type StakingDistribution$Outbound = { + version: string; + amountStaked: string; + validatorCount: number; +}; + +/** @internal */ +export const StakingDistribution$outboundSchema: z.ZodType< + StakingDistribution$Outbound, + z.ZodTypeDef, + StakingDistribution +> = z.object({ + version: z.string(), + amountStaked: z.string(), + validatorCount: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace StakingDistribution$ { + /** @deprecated use `StakingDistribution$inboundSchema` instead. */ + export const inboundSchema = StakingDistribution$inboundSchema; + /** @deprecated use `StakingDistribution$outboundSchema` instead. */ + export const outboundSchema = StakingDistribution$outboundSchema; + /** @deprecated use `StakingDistribution$Outbound` instead. */ + export type Outbound = StakingDistribution$Outbound; +} diff --git a/src/models/components/subnet.ts b/src/models/components/subnet.ts new file mode 100644 index 0000000..0d62ca9 --- /dev/null +++ b/src/models/components/subnet.ts @@ -0,0 +1,95 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + BlockchainInfo, + BlockchainInfo$inboundSchema, + BlockchainInfo$Outbound, + BlockchainInfo$outboundSchema, +} from "./blockchaininfo.js"; +import { + SubnetOwnershipInfo, + SubnetOwnershipInfo$inboundSchema, + SubnetOwnershipInfo$Outbound, + SubnetOwnershipInfo$outboundSchema, +} from "./subnetownershipinfo.js"; +import * as z from "zod"; + +export type Subnet = { + createBlockTimestamp: number; + createBlockIndex: string; + subnetId: string; + /** + * This field is deprecated. Use subnetOwnershipInfo instead. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + ownerAddresses: Array; + /** + * This field is deprecated. Use subnetOwnershipInfo instead. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + threshold: number; + /** + * This field is deprecated. Use subnetOwnershipInfo instead. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + locktime: number; + /** + * Latest subnet owner details for this Subnet. + */ + subnetOwnershipInfo: SubnetOwnershipInfo; + blockchains: Array; +}; + +/** @internal */ +export const Subnet$inboundSchema: z.ZodType = z.object({ + createBlockTimestamp: z.number(), + createBlockIndex: z.string(), + subnetId: z.string(), + ownerAddresses: z.array(z.string()), + threshold: z.number(), + locktime: z.number(), + subnetOwnershipInfo: SubnetOwnershipInfo$inboundSchema, + blockchains: z.array(BlockchainInfo$inboundSchema), +}); + +/** @internal */ +export type Subnet$Outbound = { + createBlockTimestamp: number; + createBlockIndex: string; + subnetId: string; + ownerAddresses: Array; + threshold: number; + locktime: number; + subnetOwnershipInfo: SubnetOwnershipInfo$Outbound; + blockchains: Array; +}; + +/** @internal */ +export const Subnet$outboundSchema: z.ZodType = z.object({ + createBlockTimestamp: z.number(), + createBlockIndex: z.string(), + subnetId: z.string(), + ownerAddresses: z.array(z.string()), + threshold: z.number(), + locktime: z.number(), + subnetOwnershipInfo: SubnetOwnershipInfo$outboundSchema, + blockchains: z.array(BlockchainInfo$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Subnet$ { + /** @deprecated use `Subnet$inboundSchema` instead. */ + export const inboundSchema = Subnet$inboundSchema; + /** @deprecated use `Subnet$outboundSchema` instead. */ + export const outboundSchema = Subnet$outboundSchema; + /** @deprecated use `Subnet$Outbound` instead. */ + export type Outbound = Subnet$Outbound; +} diff --git a/src/models/components/subnetownershipinfo.ts b/src/models/components/subnetownershipinfo.ts new file mode 100644 index 0000000..ae42128 --- /dev/null +++ b/src/models/components/subnetownershipinfo.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type SubnetOwnershipInfo = { + /** + * Locktime in seconds after which Subnet owners can control this Subnet. + */ + locktime: number; + /** + * Minimum number of signatures required to sign the Subnet update transactions. + */ + threshold: number; + /** + * Addresses that are eligible to sign the Subnet update transactions. + */ + addresses: Array; +}; + +/** @internal */ +export const SubnetOwnershipInfo$inboundSchema: z.ZodType< + SubnetOwnershipInfo, + z.ZodTypeDef, + unknown +> = z.object({ + locktime: z.number(), + threshold: z.number(), + addresses: z.array(z.string()), +}); + +/** @internal */ +export type SubnetOwnershipInfo$Outbound = { + locktime: number; + threshold: number; + addresses: Array; +}; + +/** @internal */ +export const SubnetOwnershipInfo$outboundSchema: z.ZodType< + SubnetOwnershipInfo$Outbound, + z.ZodTypeDef, + SubnetOwnershipInfo +> = z.object({ + locktime: z.number(), + threshold: z.number(), + addresses: z.array(z.string()), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubnetOwnershipInfo$ { + /** @deprecated use `SubnetOwnershipInfo$inboundSchema` instead. */ + export const inboundSchema = SubnetOwnershipInfo$inboundSchema; + /** @deprecated use `SubnetOwnershipInfo$outboundSchema` instead. */ + export const outboundSchema = SubnetOwnershipInfo$outboundSchema; + /** @deprecated use `SubnetOwnershipInfo$Outbound` instead. */ + export type Outbound = SubnetOwnershipInfo$Outbound; +} diff --git a/src/models/components/teleporterdestinationtransaction.ts b/src/models/components/teleporterdestinationtransaction.ts new file mode 100644 index 0000000..00338ee --- /dev/null +++ b/src/models/components/teleporterdestinationtransaction.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type TeleporterDestinationTransaction = { + txHash: string; + timestamp: number; + gasSpent: string; + rewardRedeemer: string; + delivererAddress: string; +}; + +/** @internal */ +export const TeleporterDestinationTransaction$inboundSchema: z.ZodType< + TeleporterDestinationTransaction, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + timestamp: z.number(), + gasSpent: z.string(), + rewardRedeemer: z.string(), + delivererAddress: z.string(), +}); + +/** @internal */ +export type TeleporterDestinationTransaction$Outbound = { + txHash: string; + timestamp: number; + gasSpent: string; + rewardRedeemer: string; + delivererAddress: string; +}; + +/** @internal */ +export const TeleporterDestinationTransaction$outboundSchema: z.ZodType< + TeleporterDestinationTransaction$Outbound, + z.ZodTypeDef, + TeleporterDestinationTransaction +> = z.object({ + txHash: z.string(), + timestamp: z.number(), + gasSpent: z.string(), + rewardRedeemer: z.string(), + delivererAddress: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TeleporterDestinationTransaction$ { + /** @deprecated use `TeleporterDestinationTransaction$inboundSchema` instead. */ + export const inboundSchema = TeleporterDestinationTransaction$inboundSchema; + /** @deprecated use `TeleporterDestinationTransaction$outboundSchema` instead. */ + export const outboundSchema = TeleporterDestinationTransaction$outboundSchema; + /** @deprecated use `TeleporterDestinationTransaction$Outbound` instead. */ + export type Outbound = TeleporterDestinationTransaction$Outbound; +} diff --git a/src/models/components/teleporterreceipt.ts b/src/models/components/teleporterreceipt.ts new file mode 100644 index 0000000..8884108 --- /dev/null +++ b/src/models/components/teleporterreceipt.ts @@ -0,0 +1,46 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type TeleporterReceipt = { + receivedMessageNonce: string; + relayerRewardAddress: string; +}; + +/** @internal */ +export const TeleporterReceipt$inboundSchema: z.ZodType = + z.object({ + receivedMessageNonce: z.string(), + relayerRewardAddress: z.string(), + }); + +/** @internal */ +export type TeleporterReceipt$Outbound = { + receivedMessageNonce: string; + relayerRewardAddress: string; +}; + +/** @internal */ +export const TeleporterReceipt$outboundSchema: z.ZodType< + TeleporterReceipt$Outbound, + z.ZodTypeDef, + TeleporterReceipt +> = z.object({ + receivedMessageNonce: z.string(), + relayerRewardAddress: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TeleporterReceipt$ { + /** @deprecated use `TeleporterReceipt$inboundSchema` instead. */ + export const inboundSchema = TeleporterReceipt$inboundSchema; + /** @deprecated use `TeleporterReceipt$outboundSchema` instead. */ + export const outboundSchema = TeleporterReceipt$outboundSchema; + /** @deprecated use `TeleporterReceipt$Outbound` instead. */ + export type Outbound = TeleporterReceipt$Outbound; +} diff --git a/src/models/components/teleporterrewarddetails.ts b/src/models/components/teleporterrewarddetails.ts new file mode 100644 index 0000000..8499bfa --- /dev/null +++ b/src/models/components/teleporterrewarddetails.ts @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { Money, Money$inboundSchema, Money$Outbound, Money$outboundSchema } from "./money.js"; +import * as z from "zod"; + +export const TeleporterRewardDetailsErcType = { + Erc20: "ERC-20", +} as const; +export type TeleporterRewardDetailsErcType = ClosedEnum; + +export type TeleporterRewardDetails = { + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + /** + * The contract name. + */ + name: string; + /** + * The contract symbol. + */ + symbol: string; + /** + * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation. + */ + decimals: number; + /** + * The logo uri for the address. + */ + logoUri?: string | undefined; + ercType: TeleporterRewardDetailsErcType; + /** + * The token price, if available. + */ + price?: Money | undefined; + value: string; +}; + +/** @internal */ +export const TeleporterRewardDetailsErcType$inboundSchema: z.ZodNativeEnum< + typeof TeleporterRewardDetailsErcType +> = z.nativeEnum(TeleporterRewardDetailsErcType); + +/** @internal */ +export const TeleporterRewardDetailsErcType$outboundSchema: z.ZodNativeEnum< + typeof TeleporterRewardDetailsErcType +> = TeleporterRewardDetailsErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TeleporterRewardDetailsErcType$ { + /** @deprecated use `TeleporterRewardDetailsErcType$inboundSchema` instead. */ + export const inboundSchema = TeleporterRewardDetailsErcType$inboundSchema; + /** @deprecated use `TeleporterRewardDetailsErcType$outboundSchema` instead. */ + export const outboundSchema = TeleporterRewardDetailsErcType$outboundSchema; +} + +/** @internal */ +export const TeleporterRewardDetails$inboundSchema: z.ZodType< + TeleporterRewardDetails, + z.ZodTypeDef, + unknown +> = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + ercType: TeleporterRewardDetailsErcType$inboundSchema, + price: Money$inboundSchema.optional(), + value: z.string(), +}); + +/** @internal */ +export type TeleporterRewardDetails$Outbound = { + address: string; + name: string; + symbol: string; + decimals: number; + logoUri?: string | undefined; + ercType: string; + price?: Money$Outbound | undefined; + value: string; +}; + +/** @internal */ +export const TeleporterRewardDetails$outboundSchema: z.ZodType< + TeleporterRewardDetails$Outbound, + z.ZodTypeDef, + TeleporterRewardDetails +> = z.object({ + address: z.string(), + name: z.string(), + symbol: z.string(), + decimals: z.number(), + logoUri: z.string().optional(), + ercType: TeleporterRewardDetailsErcType$outboundSchema, + price: Money$outboundSchema.optional(), + value: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TeleporterRewardDetails$ { + /** @deprecated use `TeleporterRewardDetails$inboundSchema` instead. */ + export const inboundSchema = TeleporterRewardDetails$inboundSchema; + /** @deprecated use `TeleporterRewardDetails$outboundSchema` instead. */ + export const outboundSchema = TeleporterRewardDetails$outboundSchema; + /** @deprecated use `TeleporterRewardDetails$Outbound` instead. */ + export type Outbound = TeleporterRewardDetails$Outbound; +} diff --git a/src/models/components/teleportersourcetransaction.ts b/src/models/components/teleportersourcetransaction.ts new file mode 100644 index 0000000..5b7f360 --- /dev/null +++ b/src/models/components/teleportersourcetransaction.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type TeleporterSourceTransaction = { + txHash: string; + timestamp: number; + gasSpent: string; +}; + +/** @internal */ +export const TeleporterSourceTransaction$inboundSchema: z.ZodType< + TeleporterSourceTransaction, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + timestamp: z.number(), + gasSpent: z.string(), +}); + +/** @internal */ +export type TeleporterSourceTransaction$Outbound = { + txHash: string; + timestamp: number; + gasSpent: string; +}; + +/** @internal */ +export const TeleporterSourceTransaction$outboundSchema: z.ZodType< + TeleporterSourceTransaction$Outbound, + z.ZodTypeDef, + TeleporterSourceTransaction +> = z.object({ + txHash: z.string(), + timestamp: z.number(), + gasSpent: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TeleporterSourceTransaction$ { + /** @deprecated use `TeleporterSourceTransaction$inboundSchema` instead. */ + export const inboundSchema = TeleporterSourceTransaction$inboundSchema; + /** @deprecated use `TeleporterSourceTransaction$outboundSchema` instead. */ + export const outboundSchema = TeleporterSourceTransaction$outboundSchema; + /** @deprecated use `TeleporterSourceTransaction$Outbound` instead. */ + export type Outbound = TeleporterSourceTransaction$Outbound; +} diff --git a/src/models/components/timeintervalgranularityextended.ts b/src/models/components/timeintervalgranularityextended.ts new file mode 100644 index 0000000..5e38e89 --- /dev/null +++ b/src/models/components/timeintervalgranularityextended.ts @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const TimeIntervalGranularityExtended = { + Minute: "minute", + Hourly: "hourly", + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", +} as const; +export type TimeIntervalGranularityExtended = ClosedEnum; + +/** @internal */ +export const TimeIntervalGranularityExtended$inboundSchema: z.ZodNativeEnum< + typeof TimeIntervalGranularityExtended +> = z.nativeEnum(TimeIntervalGranularityExtended); + +/** @internal */ +export const TimeIntervalGranularityExtended$outboundSchema: z.ZodNativeEnum< + typeof TimeIntervalGranularityExtended +> = TimeIntervalGranularityExtended$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TimeIntervalGranularityExtended$ { + /** @deprecated use `TimeIntervalGranularityExtended$inboundSchema` instead. */ + export const inboundSchema = TimeIntervalGranularityExtended$inboundSchema; + /** @deprecated use `TimeIntervalGranularityExtended$outboundSchema` instead. */ + export const outboundSchema = TimeIntervalGranularityExtended$outboundSchema; +} diff --git a/src/models/components/transactiondetails.ts b/src/models/components/transactiondetails.ts new file mode 100644 index 0000000..d93f77d --- /dev/null +++ b/src/models/components/transactiondetails.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + Erc1155TransferDetails, + Erc1155TransferDetails$inboundSchema, + Erc1155TransferDetails$Outbound, + Erc1155TransferDetails$outboundSchema, +} from "./erc1155transferdetails.js"; +import { + Erc20TransferDetails, + Erc20TransferDetails$inboundSchema, + Erc20TransferDetails$Outbound, + Erc20TransferDetails$outboundSchema, +} from "./erc20transferdetails.js"; +import { + Erc721TransferDetails, + Erc721TransferDetails$inboundSchema, + Erc721TransferDetails$Outbound, + Erc721TransferDetails$outboundSchema, +} from "./erc721transferdetails.js"; +import { + InternalTransactionDetails, + InternalTransactionDetails$inboundSchema, + InternalTransactionDetails$Outbound, + InternalTransactionDetails$outboundSchema, +} from "./internaltransactiondetails.js"; +import { + NativeTransaction, + NativeTransaction$inboundSchema, + NativeTransaction$Outbound, + NativeTransaction$outboundSchema, +} from "./nativetransaction.js"; +import * as z from "zod"; + +export type TransactionDetails = { + /** + * The native (top-level) transaction details. + */ + nativeTransaction: NativeTransaction; + /** + * The list of ERC-20 transfers. + */ + erc20Transfers?: Array | undefined; + /** + * The list of ERC-721 transfers. + */ + erc721Transfers?: Array | undefined; + /** + * The list of ERC-1155 transfers. + */ + erc1155Transfers?: Array | undefined; + /** + * The list of internal transactions. Note that this list only includes CALL and CALLCODE internal transactions that had a non-zero value and CREATE/CREATE2 calls. Use a client provider to recieve a full debug trace of the transaction. + */ + internalTransactions?: Array | undefined; +}; + +/** @internal */ +export const TransactionDetails$inboundSchema: z.ZodType< + TransactionDetails, + z.ZodTypeDef, + unknown +> = z.object({ + nativeTransaction: NativeTransaction$inboundSchema, + erc20Transfers: z.array(Erc20TransferDetails$inboundSchema).optional(), + erc721Transfers: z.array(Erc721TransferDetails$inboundSchema).optional(), + erc1155Transfers: z.array(Erc1155TransferDetails$inboundSchema).optional(), + internalTransactions: z.array(InternalTransactionDetails$inboundSchema).optional(), +}); + +/** @internal */ +export type TransactionDetails$Outbound = { + nativeTransaction: NativeTransaction$Outbound; + erc20Transfers?: Array | undefined; + erc721Transfers?: Array | undefined; + erc1155Transfers?: Array | undefined; + internalTransactions?: Array | undefined; +}; + +/** @internal */ +export const TransactionDetails$outboundSchema: z.ZodType< + TransactionDetails$Outbound, + z.ZodTypeDef, + TransactionDetails +> = z.object({ + nativeTransaction: NativeTransaction$outboundSchema, + erc20Transfers: z.array(Erc20TransferDetails$outboundSchema).optional(), + erc721Transfers: z.array(Erc721TransferDetails$outboundSchema).optional(), + erc1155Transfers: z.array(Erc1155TransferDetails$outboundSchema).optional(), + internalTransactions: z.array(InternalTransactionDetails$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TransactionDetails$ { + /** @deprecated use `TransactionDetails$inboundSchema` instead. */ + export const inboundSchema = TransactionDetails$inboundSchema; + /** @deprecated use `TransactionDetails$outboundSchema` instead. */ + export const outboundSchema = TransactionDetails$outboundSchema; + /** @deprecated use `TransactionDetails$Outbound` instead. */ + export type Outbound = TransactionDetails$Outbound; +} diff --git a/src/models/components/transactionexportmetadata.ts b/src/models/components/transactionexportmetadata.ts new file mode 100644 index 0000000..3970d7d --- /dev/null +++ b/src/models/components/transactionexportmetadata.ts @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + OperationStatusCode, + OperationStatusCode$inboundSchema, + OperationStatusCode$outboundSchema, +} from "./operationstatuscode.js"; +import * as z from "zod"; + +export type TransactionExportMetadata = { + code?: OperationStatusCode | undefined; + /** + * File download URL. Provided only for COMPLETED and COMPLETED_WITH_WARNING operations. + */ + downloadUrl?: string | undefined; + /** + * The next date (YYYY-MM-DD) to use as the firstDate in follow up requests if a request results in a transaction history exceeding the max size and has been reported as `COMPLETED_WITH_WARNING` with the warning 'WarnTruncatedExport'. + */ + nextDate?: string | undefined; +}; + +/** @internal */ +export const TransactionExportMetadata$inboundSchema: z.ZodType< + TransactionExportMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + code: OperationStatusCode$inboundSchema.optional(), + downloadUrl: z.string().optional(), + nextDate: z.string().optional(), +}); + +/** @internal */ +export type TransactionExportMetadata$Outbound = { + code?: string | undefined; + downloadUrl?: string | undefined; + nextDate?: string | undefined; +}; + +/** @internal */ +export const TransactionExportMetadata$outboundSchema: z.ZodType< + TransactionExportMetadata$Outbound, + z.ZodTypeDef, + TransactionExportMetadata +> = z.object({ + code: OperationStatusCode$outboundSchema.optional(), + downloadUrl: z.string().optional(), + nextDate: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TransactionExportMetadata$ { + /** @deprecated use `TransactionExportMetadata$inboundSchema` instead. */ + export const inboundSchema = TransactionExportMetadata$inboundSchema; + /** @deprecated use `TransactionExportMetadata$outboundSchema` instead. */ + export const outboundSchema = TransactionExportMetadata$outboundSchema; + /** @deprecated use `TransactionExportMetadata$Outbound` instead. */ + export type Outbound = TransactionExportMetadata$Outbound; +} diff --git a/src/models/components/transactionmethodtype.ts b/src/models/components/transactionmethodtype.ts new file mode 100644 index 0000000..2080e50 --- /dev/null +++ b/src/models/components/transactionmethodtype.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * The contract call type. NATIVE_TRANSFER indicates a transfer of the native token without any smart-contract interaction. CONTRACT_CALL indicates a smart-contract interaction. CONTRACT_CREATION indicates a smart-contract creation. + */ +export const TransactionMethodType = { + NativeTransfer: "NATIVE_TRANSFER", + ContractCall: "CONTRACT_CALL", + ContractCreation: "CONTRACT_CREATION", +} as const; +/** + * The contract call type. NATIVE_TRANSFER indicates a transfer of the native token without any smart-contract interaction. CONTRACT_CALL indicates a smart-contract interaction. CONTRACT_CREATION indicates a smart-contract creation. + */ +export type TransactionMethodType = ClosedEnum; + +/** @internal */ +export const TransactionMethodType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(TransactionMethodType); + +/** @internal */ +export const TransactionMethodType$outboundSchema: z.ZodNativeEnum = + TransactionMethodType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TransactionMethodType$ { + /** @deprecated use `TransactionMethodType$inboundSchema` instead. */ + export const inboundSchema = TransactionMethodType$inboundSchema; + /** @deprecated use `TransactionMethodType$outboundSchema` instead. */ + export const outboundSchema = TransactionMethodType$outboundSchema; +} diff --git a/src/models/components/transactionstatus.ts b/src/models/components/transactionstatus.ts new file mode 100644 index 0000000..0600e2d --- /dev/null +++ b/src/models/components/transactionstatus.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const TransactionStatus = { + Failed: "failed", + Success: "success", +} as const; +export type TransactionStatus = ClosedEnum; + +/** @internal */ +export const TransactionStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(TransactionStatus); + +/** @internal */ +export const TransactionStatus$outboundSchema: z.ZodNativeEnum = + TransactionStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TransactionStatus$ { + /** @deprecated use `TransactionStatus$inboundSchema` instead. */ + export const inboundSchema = TransactionStatus$inboundSchema; + /** @deprecated use `TransactionStatus$outboundSchema` instead. */ + export const outboundSchema = TransactionStatus$outboundSchema; +} diff --git a/src/models/components/transactionvertexdetail.ts b/src/models/components/transactionvertexdetail.ts new file mode 100644 index 0000000..33097d7 --- /dev/null +++ b/src/models/components/transactionvertexdetail.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type TransactionVertexDetail = { + /** + * Vertex ID of the vertex this transaction belongs to. + */ + hash: string; + /** + * Vertex height of the vertex this transaction belongs to. + */ + height: number; + /** + * Timestamp in seconds this vertex was accepted. + */ + timestamp: number; +}; + +/** @internal */ +export const TransactionVertexDetail$inboundSchema: z.ZodType< + TransactionVertexDetail, + z.ZodTypeDef, + unknown +> = z.object({ + hash: z.string(), + height: z.number(), + timestamp: z.number(), +}); + +/** @internal */ +export type TransactionVertexDetail$Outbound = { + hash: string; + height: number; + timestamp: number; +}; + +/** @internal */ +export const TransactionVertexDetail$outboundSchema: z.ZodType< + TransactionVertexDetail$Outbound, + z.ZodTypeDef, + TransactionVertexDetail +> = z.object({ + hash: z.string(), + height: z.number(), + timestamp: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TransactionVertexDetail$ { + /** @deprecated use `TransactionVertexDetail$inboundSchema` instead. */ + export const inboundSchema = TransactionVertexDetail$inboundSchema; + /** @deprecated use `TransactionVertexDetail$outboundSchema` instead. */ + export const outboundSchema = TransactionVertexDetail$outboundSchema; + /** @deprecated use `TransactionVertexDetail$Outbound` instead. */ + export type Outbound = TransactionVertexDetail$Outbound; +} diff --git a/src/models/components/unknowncontract.ts b/src/models/components/unknowncontract.ts new file mode 100644 index 0000000..cf5ecbd --- /dev/null +++ b/src/models/components/unknowncontract.ts @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + ContractDeploymentDetails, + ContractDeploymentDetails$inboundSchema, + ContractDeploymentDetails$Outbound, + ContractDeploymentDetails$outboundSchema, +} from "./contractdeploymentdetails.js"; +import { + ImageAsset, + ImageAsset$inboundSchema, + ImageAsset$Outbound, + ImageAsset$outboundSchema, +} from "./imageasset.js"; +import { + ResourceLink, + ResourceLink$inboundSchema, + ResourceLink$Outbound, + ResourceLink$outboundSchema, +} from "./resourcelink.js"; +import * as z from "zod"; + +export const UnknownContractErcType = { + Unknown: "UNKNOWN", +} as const; +export type UnknownContractErcType = ClosedEnum; + +export type UnknownContract = { + /** + * The contract name. + */ + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset | undefined; + bannerAsset?: ImageAsset | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + /** + * A wallet or contract address in mixed-case checksum encoding. + */ + address: string; + deploymentDetails: ContractDeploymentDetails; + ercType: UnknownContractErcType; +}; + +/** @internal */ +export const UnknownContractErcType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(UnknownContractErcType); + +/** @internal */ +export const UnknownContractErcType$outboundSchema: z.ZodNativeEnum = + UnknownContractErcType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UnknownContractErcType$ { + /** @deprecated use `UnknownContractErcType$inboundSchema` instead. */ + export const inboundSchema = UnknownContractErcType$inboundSchema; + /** @deprecated use `UnknownContractErcType$outboundSchema` instead. */ + export const outboundSchema = UnknownContractErcType$outboundSchema; +} + +/** @internal */ +export const UnknownContract$inboundSchema: z.ZodType = + z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$inboundSchema.optional(), + bannerAsset: ImageAsset$inboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$inboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$inboundSchema, + ercType: UnknownContractErcType$inboundSchema, + }); + +/** @internal */ +export type UnknownContract$Outbound = { + name?: string | undefined; + description?: string | undefined; + officialSite?: string | undefined; + email?: string | undefined; + logoAsset?: ImageAsset$Outbound | undefined; + bannerAsset?: ImageAsset$Outbound | undefined; + color?: string | undefined; + resourceLinks?: Array | undefined; + tags?: Array | undefined; + address: string; + deploymentDetails: ContractDeploymentDetails$Outbound; + ercType: string; +}; + +/** @internal */ +export const UnknownContract$outboundSchema: z.ZodType< + UnknownContract$Outbound, + z.ZodTypeDef, + UnknownContract +> = z.object({ + name: z.string().optional(), + description: z.string().optional(), + officialSite: z.string().optional(), + email: z.string().optional(), + logoAsset: ImageAsset$outboundSchema.optional(), + bannerAsset: ImageAsset$outboundSchema.optional(), + color: z.string().optional(), + resourceLinks: z.array(ResourceLink$outboundSchema).optional(), + tags: z.array(z.string()).optional(), + address: z.string(), + deploymentDetails: ContractDeploymentDetails$outboundSchema, + ercType: UnknownContractErcType$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UnknownContract$ { + /** @deprecated use `UnknownContract$inboundSchema` instead. */ + export const inboundSchema = UnknownContract$inboundSchema; + /** @deprecated use `UnknownContract$outboundSchema` instead. */ + export const outboundSchema = UnknownContract$outboundSchema; + /** @deprecated use `UnknownContract$Outbound` instead. */ + export type Outbound = UnknownContract$Outbound; +} diff --git a/src/models/components/updatewebhookrequest.ts b/src/models/components/updatewebhookrequest.ts new file mode 100644 index 0000000..6062e5c --- /dev/null +++ b/src/models/components/updatewebhookrequest.ts @@ -0,0 +1,70 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + WebhookStatusType, + WebhookStatusType$inboundSchema, + WebhookStatusType$outboundSchema, +} from "./webhookstatustype.js"; +import * as z from "zod"; + +export type UpdateWebhookRequest = { + name?: string | undefined; + description?: string | undefined; + url?: string | undefined; + status?: WebhookStatusType | undefined; + includeInternalTxs?: boolean | undefined; + includeLogs?: boolean | undefined; +}; + +/** @internal */ +export const UpdateWebhookRequest$inboundSchema: z.ZodType< + UpdateWebhookRequest, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string().optional(), + description: z.string().optional(), + url: z.string().optional(), + status: WebhookStatusType$inboundSchema.optional(), + includeInternalTxs: z.boolean().optional(), + includeLogs: z.boolean().optional(), +}); + +/** @internal */ +export type UpdateWebhookRequest$Outbound = { + name?: string | undefined; + description?: string | undefined; + url?: string | undefined; + status?: string | undefined; + includeInternalTxs?: boolean | undefined; + includeLogs?: boolean | undefined; +}; + +/** @internal */ +export const UpdateWebhookRequest$outboundSchema: z.ZodType< + UpdateWebhookRequest$Outbound, + z.ZodTypeDef, + UpdateWebhookRequest +> = z.object({ + name: z.string().optional(), + description: z.string().optional(), + url: z.string().optional(), + status: WebhookStatusType$outboundSchema.optional(), + includeInternalTxs: z.boolean().optional(), + includeLogs: z.boolean().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWebhookRequest$ { + /** @deprecated use `UpdateWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateWebhookRequest$inboundSchema; + /** @deprecated use `UpdateWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateWebhookRequest$outboundSchema; + /** @deprecated use `UpdateWebhookRequest$Outbound` instead. */ + export type Outbound = UpdateWebhookRequest$Outbound; +} diff --git a/src/models/components/usagemetricsgroupbyenum.ts b/src/models/components/usagemetricsgroupbyenum.ts new file mode 100644 index 0000000..5d7195c --- /dev/null +++ b/src/models/components/usagemetricsgroupbyenum.ts @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const UsageMetricsGroupByEnum = { + RequestPath: "requestPath", + ResponseCode: "responseCode", + ChainId: "chainId", + ApiKeyId: "apiKeyId", + RequestType: "requestType", +} as const; +export type UsageMetricsGroupByEnum = ClosedEnum; + +/** @internal */ +export const UsageMetricsGroupByEnum$inboundSchema: z.ZodNativeEnum< + typeof UsageMetricsGroupByEnum +> = z.nativeEnum(UsageMetricsGroupByEnum); + +/** @internal */ +export const UsageMetricsGroupByEnum$outboundSchema: z.ZodNativeEnum< + typeof UsageMetricsGroupByEnum +> = UsageMetricsGroupByEnum$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UsageMetricsGroupByEnum$ { + /** @deprecated use `UsageMetricsGroupByEnum$inboundSchema` instead. */ + export const inboundSchema = UsageMetricsGroupByEnum$inboundSchema; + /** @deprecated use `UsageMetricsGroupByEnum$outboundSchema` instead. */ + export const outboundSchema = UsageMetricsGroupByEnum$outboundSchema; +} diff --git a/src/models/components/usagemetricsresponsedto.ts b/src/models/components/usagemetricsresponsedto.ts new file mode 100644 index 0000000..e3df306 --- /dev/null +++ b/src/models/components/usagemetricsresponsedto.ts @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Metric, Metric$inboundSchema, Metric$Outbound, Metric$outboundSchema } from "./metric.js"; +import * as z from "zod"; + +export type UsageMetricsResponseDTO = { + /** + * Duration in which the metrics value is aggregated + */ + aggregateDuration: string; + /** + * Org ID for which the metrics are aggregated + */ + orgId: string; + /** + * Metrics values + */ + metrics: Array; +}; + +/** @internal */ +export const UsageMetricsResponseDTO$inboundSchema: z.ZodType< + UsageMetricsResponseDTO, + z.ZodTypeDef, + unknown +> = z.object({ + aggregateDuration: z.string(), + orgId: z.string(), + metrics: z.array(Metric$inboundSchema), +}); + +/** @internal */ +export type UsageMetricsResponseDTO$Outbound = { + aggregateDuration: string; + orgId: string; + metrics: Array; +}; + +/** @internal */ +export const UsageMetricsResponseDTO$outboundSchema: z.ZodType< + UsageMetricsResponseDTO$Outbound, + z.ZodTypeDef, + UsageMetricsResponseDTO +> = z.object({ + aggregateDuration: z.string(), + orgId: z.string(), + metrics: z.array(Metric$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UsageMetricsResponseDTO$ { + /** @deprecated use `UsageMetricsResponseDTO$inboundSchema` instead. */ + export const inboundSchema = UsageMetricsResponseDTO$inboundSchema; + /** @deprecated use `UsageMetricsResponseDTO$outboundSchema` instead. */ + export const outboundSchema = UsageMetricsResponseDTO$outboundSchema; + /** @deprecated use `UsageMetricsResponseDTO$Outbound` instead. */ + export type Outbound = UsageMetricsResponseDTO$Outbound; +} diff --git a/src/models/components/usagemetricsvaluedto.ts b/src/models/components/usagemetricsvaluedto.ts new file mode 100644 index 0000000..a39c500 --- /dev/null +++ b/src/models/components/usagemetricsvaluedto.ts @@ -0,0 +1,169 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * Column name used for data aggregation + */ +export const GroupedBy = { + RequestPath: "requestPath", + ResponseCode: "responseCode", + ChainId: "chainId", + ApiKeyId: "apiKeyId", + RequestType: "requestType", + None: "None", +} as const; +/** + * Column name used for data aggregation + */ +export type GroupedBy = ClosedEnum; + +/** + * The value of the column used for data aggregation + */ +export type GroupValue = string | number; + +export type UsageMetricsValueDTO = { + /** + * Column name used for data aggregation + */ + groupedBy: GroupedBy; + /** + * The value of the column used for data aggregation + */ + groupValue?: string | number | undefined; + /** + * The total number of requests + */ + totalRequests: number; + /** + * The number of requests per second + */ + requestsPerSecond: number; + /** + * The success rate percentage + */ + successRatePercent: number; + /** + * The median response time in milliseconds + */ + medianResponseTimeMsecs: number; + /** + * The number of invalid requests + */ + invalidRequests: number; + /** + * The number of API credits used + */ + apiCreditsUsed: number; + /** + * The number of API credits wasted on invalid requests + */ + apiCreditsWasted: number; +}; + +/** @internal */ +export const GroupedBy$inboundSchema: z.ZodNativeEnum = z.nativeEnum(GroupedBy); + +/** @internal */ +export const GroupedBy$outboundSchema: z.ZodNativeEnum = GroupedBy$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GroupedBy$ { + /** @deprecated use `GroupedBy$inboundSchema` instead. */ + export const inboundSchema = GroupedBy$inboundSchema; + /** @deprecated use `GroupedBy$outboundSchema` instead. */ + export const outboundSchema = GroupedBy$outboundSchema; +} + +/** @internal */ +export const GroupValue$inboundSchema: z.ZodType = z.union([ + z.string(), + z.number(), +]); + +/** @internal */ +export type GroupValue$Outbound = string | number; + +/** @internal */ +export const GroupValue$outboundSchema: z.ZodType = + z.union([z.string(), z.number()]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GroupValue$ { + /** @deprecated use `GroupValue$inboundSchema` instead. */ + export const inboundSchema = GroupValue$inboundSchema; + /** @deprecated use `GroupValue$outboundSchema` instead. */ + export const outboundSchema = GroupValue$outboundSchema; + /** @deprecated use `GroupValue$Outbound` instead. */ + export type Outbound = GroupValue$Outbound; +} + +/** @internal */ +export const UsageMetricsValueDTO$inboundSchema: z.ZodType< + UsageMetricsValueDTO, + z.ZodTypeDef, + unknown +> = z.object({ + groupedBy: GroupedBy$inboundSchema, + groupValue: z.union([z.string(), z.number()]).optional(), + totalRequests: z.number(), + requestsPerSecond: z.number(), + successRatePercent: z.number(), + medianResponseTimeMsecs: z.number(), + invalidRequests: z.number(), + apiCreditsUsed: z.number(), + apiCreditsWasted: z.number(), +}); + +/** @internal */ +export type UsageMetricsValueDTO$Outbound = { + groupedBy: string; + groupValue?: string | number | undefined; + totalRequests: number; + requestsPerSecond: number; + successRatePercent: number; + medianResponseTimeMsecs: number; + invalidRequests: number; + apiCreditsUsed: number; + apiCreditsWasted: number; +}; + +/** @internal */ +export const UsageMetricsValueDTO$outboundSchema: z.ZodType< + UsageMetricsValueDTO$Outbound, + z.ZodTypeDef, + UsageMetricsValueDTO +> = z.object({ + groupedBy: GroupedBy$outboundSchema, + groupValue: z.union([z.string(), z.number()]).optional(), + totalRequests: z.number(), + requestsPerSecond: z.number(), + successRatePercent: z.number(), + medianResponseTimeMsecs: z.number(), + invalidRequests: z.number(), + apiCreditsUsed: z.number(), + apiCreditsWasted: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UsageMetricsValueDTO$ { + /** @deprecated use `UsageMetricsValueDTO$inboundSchema` instead. */ + export const inboundSchema = UsageMetricsValueDTO$inboundSchema; + /** @deprecated use `UsageMetricsValueDTO$outboundSchema` instead. */ + export const outboundSchema = UsageMetricsValueDTO$outboundSchema; + /** @deprecated use `UsageMetricsValueDTO$Outbound` instead. */ + export type Outbound = UsageMetricsValueDTO$Outbound; +} diff --git a/src/models/components/utilityaddresses.ts b/src/models/components/utilityaddresses.ts new file mode 100644 index 0000000..572f872 --- /dev/null +++ b/src/models/components/utilityaddresses.ts @@ -0,0 +1,42 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type UtilityAddresses = { + multicall?: string | undefined; +}; + +/** @internal */ +export const UtilityAddresses$inboundSchema: z.ZodType = + z.object({ + multicall: z.string().optional(), + }); + +/** @internal */ +export type UtilityAddresses$Outbound = { + multicall?: string | undefined; +}; + +/** @internal */ +export const UtilityAddresses$outboundSchema: z.ZodType< + UtilityAddresses$Outbound, + z.ZodTypeDef, + UtilityAddresses +> = z.object({ + multicall: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UtilityAddresses$ { + /** @deprecated use `UtilityAddresses$inboundSchema` instead. */ + export const inboundSchema = UtilityAddresses$inboundSchema; + /** @deprecated use `UtilityAddresses$outboundSchema` instead. */ + export const outboundSchema = UtilityAddresses$outboundSchema; + /** @deprecated use `UtilityAddresses$Outbound` instead. */ + export type Outbound = UtilityAddresses$Outbound; +} diff --git a/src/models/components/utxo.ts b/src/models/components/utxo.ts new file mode 100644 index 0000000..9b854fc --- /dev/null +++ b/src/models/components/utxo.ts @@ -0,0 +1,154 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { + UtxoCredential, + UtxoCredential$inboundSchema, + UtxoCredential$Outbound, + UtxoCredential$outboundSchema, +} from "./utxocredential.js"; +import * as z from "zod"; + +export type Utxo = { + /** + * Addresses that are eligible to sign the consumption of this output. + */ + addresses: Array; + asset: AssetAmount; + /** + * Blockchain ID on which this output is consumed on. + */ + consumedOnChainId: string; + /** + * Transaction ID that consumed this output. + */ + consumingTxHash?: string | undefined; + /** + * Blockchain ID on which this output is created on. + */ + createdOnChainId: string; + /** + * UTXO ID for this output. + */ + utxoId: string; + /** + * Unix timestamp in seconds at which this output was consumed. + */ + consumingTxTimestamp?: number | undefined; + /** + * Transaction ID that created this output. + */ + creationTxHash: string; + /** + * Credentials that signed the transaction to consume this utxo + */ + credentials?: Array | undefined; + /** + * Index representing the minting set for the NFT mint output. + */ + groupId?: number | undefined; + /** + * Locktime in seconds after which this output can be consumed. + */ + locktime: number; + /** + * Postion of this output in a list of lexiographically sorted outputs of a transaction. + */ + outputIndex: string; + /** + * Hex encoded data for NFT assets. + */ + payload?: string | undefined; + /** + * Minimum number of signatures required to consume this output. + */ + threshold: number; + /** + * Unix timestamp in seconds at which this outptut was created. + */ + timestamp: number; + /** + * Type of output. + */ + utxoType: string; +}; + +/** @internal */ +export const Utxo$inboundSchema: z.ZodType = z.object({ + addresses: z.array(z.string()), + asset: AssetAmount$inboundSchema, + consumedOnChainId: z.string(), + consumingTxHash: z.string().optional(), + createdOnChainId: z.string(), + utxoId: z.string(), + consumingTxTimestamp: z.number().optional(), + creationTxHash: z.string(), + credentials: z.array(UtxoCredential$inboundSchema).optional(), + groupId: z.number().optional(), + locktime: z.number(), + outputIndex: z.string(), + payload: z.string().optional(), + threshold: z.number(), + timestamp: z.number(), + utxoType: z.string(), +}); + +/** @internal */ +export type Utxo$Outbound = { + addresses: Array; + asset: AssetAmount$Outbound; + consumedOnChainId: string; + consumingTxHash?: string | undefined; + createdOnChainId: string; + utxoId: string; + consumingTxTimestamp?: number | undefined; + creationTxHash: string; + credentials?: Array | undefined; + groupId?: number | undefined; + locktime: number; + outputIndex: string; + payload?: string | undefined; + threshold: number; + timestamp: number; + utxoType: string; +}; + +/** @internal */ +export const Utxo$outboundSchema: z.ZodType = z.object({ + addresses: z.array(z.string()), + asset: AssetAmount$outboundSchema, + consumedOnChainId: z.string(), + consumingTxHash: z.string().optional(), + createdOnChainId: z.string(), + utxoId: z.string(), + consumingTxTimestamp: z.number().optional(), + creationTxHash: z.string(), + credentials: z.array(UtxoCredential$outboundSchema).optional(), + groupId: z.number().optional(), + locktime: z.number(), + outputIndex: z.string(), + payload: z.string().optional(), + threshold: z.number(), + timestamp: z.number(), + utxoType: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Utxo$ { + /** @deprecated use `Utxo$inboundSchema` instead. */ + export const inboundSchema = Utxo$inboundSchema; + /** @deprecated use `Utxo$outboundSchema` instead. */ + export const outboundSchema = Utxo$outboundSchema; + /** @deprecated use `Utxo$Outbound` instead. */ + export type Outbound = Utxo$Outbound; +} diff --git a/src/models/components/utxocredential.ts b/src/models/components/utxocredential.ts new file mode 100644 index 0000000..551f13f --- /dev/null +++ b/src/models/components/utxocredential.ts @@ -0,0 +1,52 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type UtxoCredential = { + /** + * Signature provided to consume the output. + */ + signature?: string | undefined; + /** + * Public key associated with the signature. + */ + publicKey?: string | undefined; +}; + +/** @internal */ +export const UtxoCredential$inboundSchema: z.ZodType = + z.object({ + signature: z.string().optional(), + publicKey: z.string().optional(), + }); + +/** @internal */ +export type UtxoCredential$Outbound = { + signature?: string | undefined; + publicKey?: string | undefined; +}; + +/** @internal */ +export const UtxoCredential$outboundSchema: z.ZodType< + UtxoCredential$Outbound, + z.ZodTypeDef, + UtxoCredential +> = z.object({ + signature: z.string().optional(), + publicKey: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UtxoCredential$ { + /** @deprecated use `UtxoCredential$inboundSchema` instead. */ + export const inboundSchema = UtxoCredential$inboundSchema; + /** @deprecated use `UtxoCredential$outboundSchema` instead. */ + export const outboundSchema = UtxoCredential$outboundSchema; + /** @deprecated use `UtxoCredential$Outbound` instead. */ + export type Outbound = UtxoCredential$Outbound; +} diff --git a/src/models/components/utxotype.ts b/src/models/components/utxotype.ts new file mode 100644 index 0000000..fc4766d --- /dev/null +++ b/src/models/components/utxotype.ts @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const UtxoType = { + Stake: "STAKE", + Transfer: "TRANSFER", +} as const; +export type UtxoType = ClosedEnum; + +/** @internal */ +export const UtxoType$inboundSchema: z.ZodNativeEnum = z.nativeEnum(UtxoType); + +/** @internal */ +export const UtxoType$outboundSchema: z.ZodNativeEnum = UtxoType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UtxoType$ { + /** @deprecated use `UtxoType$inboundSchema` instead. */ + export const inboundSchema = UtxoType$inboundSchema; + /** @deprecated use `UtxoType$outboundSchema` instead. */ + export const outboundSchema = UtxoType$outboundSchema; +} diff --git a/src/models/components/validationstatustype.ts b/src/models/components/validationstatustype.ts new file mode 100644 index 0000000..ca14205 --- /dev/null +++ b/src/models/components/validationstatustype.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const ValidationStatusType = { + Completed: "completed", + Active: "active", + Pending: "pending", + Removed: "removed", +} as const; +export type ValidationStatusType = ClosedEnum; + +/** @internal */ +export const ValidationStatusType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(ValidationStatusType); + +/** @internal */ +export const ValidationStatusType$outboundSchema: z.ZodNativeEnum = + ValidationStatusType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ValidationStatusType$ { + /** @deprecated use `ValidationStatusType$inboundSchema` instead. */ + export const inboundSchema = ValidationStatusType$inboundSchema; + /** @deprecated use `ValidationStatusType$outboundSchema` instead. */ + export const outboundSchema = ValidationStatusType$outboundSchema; +} diff --git a/src/models/components/validatorhealthdetails.ts b/src/models/components/validatorhealthdetails.ts new file mode 100644 index 0000000..ad4cb64 --- /dev/null +++ b/src/models/components/validatorhealthdetails.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type ValidatorHealthDetails = { + /** + * Percent of requests responded to in last polling. + */ + reachabilityPercent: number; + /** + * Percent of requests benched on the P-Chain in last polling. + */ + benchedPChainRequestsPercent: number; + /** + * Percentage of requests benched on the X-Chain in last polling. + */ + benchedXChainRequestsPercent: number; + /** + * Percentage of requests benched on the C-Chain in last polling. + */ + benchedCChainRequestsPercent: number; +}; + +/** @internal */ +export const ValidatorHealthDetails$inboundSchema: z.ZodType< + ValidatorHealthDetails, + z.ZodTypeDef, + unknown +> = z.object({ + reachabilityPercent: z.number(), + benchedPChainRequestsPercent: z.number(), + benchedXChainRequestsPercent: z.number(), + benchedCChainRequestsPercent: z.number(), +}); + +/** @internal */ +export type ValidatorHealthDetails$Outbound = { + reachabilityPercent: number; + benchedPChainRequestsPercent: number; + benchedXChainRequestsPercent: number; + benchedCChainRequestsPercent: number; +}; + +/** @internal */ +export const ValidatorHealthDetails$outboundSchema: z.ZodType< + ValidatorHealthDetails$Outbound, + z.ZodTypeDef, + ValidatorHealthDetails +> = z.object({ + reachabilityPercent: z.number(), + benchedPChainRequestsPercent: z.number(), + benchedXChainRequestsPercent: z.number(), + benchedCChainRequestsPercent: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ValidatorHealthDetails$ { + /** @deprecated use `ValidatorHealthDetails$inboundSchema` instead. */ + export const inboundSchema = ValidatorHealthDetails$inboundSchema; + /** @deprecated use `ValidatorHealthDetails$outboundSchema` instead. */ + export const outboundSchema = ValidatorHealthDetails$outboundSchema; + /** @deprecated use `ValidatorHealthDetails$Outbound` instead. */ + export type Outbound = ValidatorHealthDetails$Outbound; +} diff --git a/src/models/components/validatorsdetails.ts b/src/models/components/validatorsdetails.ts new file mode 100644 index 0000000..cc2a21f --- /dev/null +++ b/src/models/components/validatorsdetails.ts @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + StakingDistribution, + StakingDistribution$inboundSchema, + StakingDistribution$Outbound, + StakingDistribution$outboundSchema, +} from "./stakingdistribution.js"; +import * as z from "zod"; + +export type ValidatorsDetails = { + validatorCount: number; + totalAmountStaked: string; + estimatedAnnualStakingReward: string; + stakingDistributionByVersion: Array; + stakingRatio: string; +}; + +/** @internal */ +export const ValidatorsDetails$inboundSchema: z.ZodType = + z.object({ + validatorCount: z.number(), + totalAmountStaked: z.string(), + estimatedAnnualStakingReward: z.string(), + stakingDistributionByVersion: z.array(StakingDistribution$inboundSchema), + stakingRatio: z.string(), + }); + +/** @internal */ +export type ValidatorsDetails$Outbound = { + validatorCount: number; + totalAmountStaked: string; + estimatedAnnualStakingReward: string; + stakingDistributionByVersion: Array; + stakingRatio: string; +}; + +/** @internal */ +export const ValidatorsDetails$outboundSchema: z.ZodType< + ValidatorsDetails$Outbound, + z.ZodTypeDef, + ValidatorsDetails +> = z.object({ + validatorCount: z.number(), + totalAmountStaked: z.string(), + estimatedAnnualStakingReward: z.string(), + stakingDistributionByVersion: z.array(StakingDistribution$outboundSchema), + stakingRatio: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ValidatorsDetails$ { + /** @deprecated use `ValidatorsDetails$inboundSchema` instead. */ + export const inboundSchema = ValidatorsDetails$inboundSchema; + /** @deprecated use `ValidatorsDetails$outboundSchema` instead. */ + export const outboundSchema = ValidatorsDetails$outboundSchema; + /** @deprecated use `ValidatorsDetails$Outbound` instead. */ + export type Outbound = ValidatorsDetails$Outbound; +} diff --git a/src/models/components/vmname.ts b/src/models/components/vmname.ts new file mode 100644 index 0000000..5e0019e --- /dev/null +++ b/src/models/components/vmname.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const VmName = { + Evm: "EVM", + Bitcoin: "BITCOIN", + Ethereum: "ETHEREUM", +} as const; +export type VmName = ClosedEnum; + +/** @internal */ +export const VmName$inboundSchema: z.ZodNativeEnum = z.nativeEnum(VmName); + +/** @internal */ +export const VmName$outboundSchema: z.ZodNativeEnum = VmName$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace VmName$ { + /** @deprecated use `VmName$inboundSchema` instead. */ + export const inboundSchema = VmName$inboundSchema; + /** @deprecated use `VmName$outboundSchema` instead. */ + export const outboundSchema = VmName$outboundSchema; +} diff --git a/src/models/components/webhookresponse.ts b/src/models/components/webhookresponse.ts new file mode 100644 index 0000000..099381e --- /dev/null +++ b/src/models/components/webhookresponse.ts @@ -0,0 +1,132 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AddressActivityMetadata, + AddressActivityMetadata$inboundSchema, + AddressActivityMetadata$Outbound, + AddressActivityMetadata$outboundSchema, +} from "./addressactivitymetadata.js"; +import { EventType, EventType$inboundSchema, EventType$outboundSchema } from "./eventtype.js"; +import { + WebhookStatusType, + WebhookStatusType$inboundSchema, + WebhookStatusType$outboundSchema, +} from "./webhookstatustype.js"; +import * as z from "zod"; + +export type WebhookResponseMetadata = AddressActivityMetadata; + +export type WebhookResponse = { + id: string; + eventType: EventType; + metadata: AddressActivityMetadata; + /** + * Whether to include traces in the webhook payload. + */ + includeInternalTxs?: boolean | undefined; + /** + * Whether to include logs in the webhook payload. + */ + includeLogs?: boolean | undefined; + url: string; + chainId: string; + status: WebhookStatusType; + createdAt: number; + name: string; + description: string; +}; + +/** @internal */ +export const WebhookResponseMetadata$inboundSchema: z.ZodType< + WebhookResponseMetadata, + z.ZodTypeDef, + unknown +> = AddressActivityMetadata$inboundSchema; + +/** @internal */ +export type WebhookResponseMetadata$Outbound = AddressActivityMetadata$Outbound; + +/** @internal */ +export const WebhookResponseMetadata$outboundSchema: z.ZodType< + WebhookResponseMetadata$Outbound, + z.ZodTypeDef, + WebhookResponseMetadata +> = AddressActivityMetadata$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WebhookResponseMetadata$ { + /** @deprecated use `WebhookResponseMetadata$inboundSchema` instead. */ + export const inboundSchema = WebhookResponseMetadata$inboundSchema; + /** @deprecated use `WebhookResponseMetadata$outboundSchema` instead. */ + export const outboundSchema = WebhookResponseMetadata$outboundSchema; + /** @deprecated use `WebhookResponseMetadata$Outbound` instead. */ + export type Outbound = WebhookResponseMetadata$Outbound; +} + +/** @internal */ +export const WebhookResponse$inboundSchema: z.ZodType = + z.object({ + id: z.string(), + eventType: EventType$inboundSchema, + metadata: AddressActivityMetadata$inboundSchema, + includeInternalTxs: z.boolean().optional(), + includeLogs: z.boolean().optional(), + url: z.string(), + chainId: z.string(), + status: WebhookStatusType$inboundSchema, + createdAt: z.number(), + name: z.string(), + description: z.string(), + }); + +/** @internal */ +export type WebhookResponse$Outbound = { + id: string; + eventType: string; + metadata: AddressActivityMetadata$Outbound; + includeInternalTxs?: boolean | undefined; + includeLogs?: boolean | undefined; + url: string; + chainId: string; + status: string; + createdAt: number; + name: string; + description: string; +}; + +/** @internal */ +export const WebhookResponse$outboundSchema: z.ZodType< + WebhookResponse$Outbound, + z.ZodTypeDef, + WebhookResponse +> = z.object({ + id: z.string(), + eventType: EventType$outboundSchema, + metadata: AddressActivityMetadata$outboundSchema, + includeInternalTxs: z.boolean().optional(), + includeLogs: z.boolean().optional(), + url: z.string(), + chainId: z.string(), + status: WebhookStatusType$outboundSchema, + createdAt: z.number(), + name: z.string(), + description: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WebhookResponse$ { + /** @deprecated use `WebhookResponse$inboundSchema` instead. */ + export const inboundSchema = WebhookResponse$inboundSchema; + /** @deprecated use `WebhookResponse$outboundSchema` instead. */ + export const outboundSchema = WebhookResponse$outboundSchema; + /** @deprecated use `WebhookResponse$Outbound` instead. */ + export type Outbound = WebhookResponse$Outbound; +} diff --git a/src/models/components/webhookstatus.ts b/src/models/components/webhookstatus.ts new file mode 100644 index 0000000..c3b1871 --- /dev/null +++ b/src/models/components/webhookstatus.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const WebhookStatus = { + Active: "active", + Inactive: "inactive", +} as const; +export type WebhookStatus = ClosedEnum; + +/** @internal */ +export const WebhookStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(WebhookStatus); + +/** @internal */ +export const WebhookStatus$outboundSchema: z.ZodNativeEnum = + WebhookStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WebhookStatus$ { + /** @deprecated use `WebhookStatus$inboundSchema` instead. */ + export const inboundSchema = WebhookStatus$inboundSchema; + /** @deprecated use `WebhookStatus$outboundSchema` instead. */ + export const outboundSchema = WebhookStatus$outboundSchema; +} diff --git a/src/models/components/webhookstatustype.ts b/src/models/components/webhookstatustype.ts new file mode 100644 index 0000000..882d641 --- /dev/null +++ b/src/models/components/webhookstatustype.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const WebhookStatusType = { + Active: "active", + Inactive: "inactive", +} as const; +export type WebhookStatusType = ClosedEnum; + +/** @internal */ +export const WebhookStatusType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(WebhookStatusType); + +/** @internal */ +export const WebhookStatusType$outboundSchema: z.ZodNativeEnum = + WebhookStatusType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WebhookStatusType$ { + /** @deprecated use `WebhookStatusType$inboundSchema` instead. */ + export const inboundSchema = WebhookStatusType$inboundSchema; + /** @deprecated use `WebhookStatusType$outboundSchema` instead. */ + export const outboundSchema = WebhookStatusType$outboundSchema; +} diff --git a/src/models/components/xchainassetdetails.ts b/src/models/components/xchainassetdetails.ts new file mode 100644 index 0000000..c349900 --- /dev/null +++ b/src/models/components/xchainassetdetails.ts @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkAssetCap, + PrimaryNetworkAssetCap$inboundSchema, + PrimaryNetworkAssetCap$outboundSchema, +} from "./primarynetworkassetcap.js"; +import { + PrimaryNetworkAssetType, + PrimaryNetworkAssetType$inboundSchema, + PrimaryNetworkAssetType$outboundSchema, +} from "./primarynetworkassettype.js"; +import * as z from "zod"; + +export type XChainAssetDetails = { + /** + * Unique ID for an asset. + */ + assetId: string; + /** + * Name of this asset. + */ + name: string; + /** + * Symbol for this asset (max 4 characters). + */ + symbol: string; + /** + * Denomination of this asset to represent fungibility. + */ + denomination: number; + /** + * Type of asset like SECP256K1 or NFT. + */ + type: PrimaryNetworkAssetType; + /** + * Timestamp in seconds this asset was created on. + */ + createdAtTimestamp: number; + /** + * Cap represents if an asset is a variable or fixed cap asset. + */ + cap: PrimaryNetworkAssetCap; +}; + +/** @internal */ +export const XChainAssetDetails$inboundSchema: z.ZodType< + XChainAssetDetails, + z.ZodTypeDef, + unknown +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$inboundSchema, + createdAtTimestamp: z.number(), + cap: PrimaryNetworkAssetCap$inboundSchema, +}); + +/** @internal */ +export type XChainAssetDetails$Outbound = { + assetId: string; + name: string; + symbol: string; + denomination: number; + type: string; + createdAtTimestamp: number; + cap: string; +}; + +/** @internal */ +export const XChainAssetDetails$outboundSchema: z.ZodType< + XChainAssetDetails$Outbound, + z.ZodTypeDef, + XChainAssetDetails +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$outboundSchema, + createdAtTimestamp: z.number(), + cap: PrimaryNetworkAssetCap$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainAssetDetails$ { + /** @deprecated use `XChainAssetDetails$inboundSchema` instead. */ + export const inboundSchema = XChainAssetDetails$inboundSchema; + /** @deprecated use `XChainAssetDetails$outboundSchema` instead. */ + export const outboundSchema = XChainAssetDetails$outboundSchema; + /** @deprecated use `XChainAssetDetails$Outbound` instead. */ + export type Outbound = XChainAssetDetails$Outbound; +} diff --git a/src/models/components/xchainbalances.ts b/src/models/components/xchainbalances.ts new file mode 100644 index 0000000..ba4b9df --- /dev/null +++ b/src/models/components/xchainbalances.ts @@ -0,0 +1,72 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + AggregatedAssetAmount, + AggregatedAssetAmount$inboundSchema, + AggregatedAssetAmount$Outbound, + AggregatedAssetAmount$outboundSchema, +} from "./aggregatedassetamount.js"; +import { + XChainSharedAssetBalance, + XChainSharedAssetBalance$inboundSchema, + XChainSharedAssetBalance$Outbound, + XChainSharedAssetBalance$outboundSchema, +} from "./xchainsharedassetbalance.js"; +import * as z from "zod"; + +export type XChainBalances = { + /** + * A list of objects containing X-chain Asset balance information. + */ + locked: Array; + /** + * A list of objects containing X-chain Asset balance information. + */ + unlocked: Array; + atomicMemoryUnlocked: Array; + atomicMemoryLocked: Array; +}; + +/** @internal */ +export const XChainBalances$inboundSchema: z.ZodType = + z.object({ + locked: z.array(AggregatedAssetAmount$inboundSchema), + unlocked: z.array(AggregatedAssetAmount$inboundSchema), + atomicMemoryUnlocked: z.array(XChainSharedAssetBalance$inboundSchema), + atomicMemoryLocked: z.array(XChainSharedAssetBalance$inboundSchema), + }); + +/** @internal */ +export type XChainBalances$Outbound = { + locked: Array; + unlocked: Array; + atomicMemoryUnlocked: Array; + atomicMemoryLocked: Array; +}; + +/** @internal */ +export const XChainBalances$outboundSchema: z.ZodType< + XChainBalances$Outbound, + z.ZodTypeDef, + XChainBalances +> = z.object({ + locked: z.array(AggregatedAssetAmount$outboundSchema), + unlocked: z.array(AggregatedAssetAmount$outboundSchema), + atomicMemoryUnlocked: z.array(XChainSharedAssetBalance$outboundSchema), + atomicMemoryLocked: z.array(XChainSharedAssetBalance$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainBalances$ { + /** @deprecated use `XChainBalances$inboundSchema` instead. */ + export const inboundSchema = XChainBalances$inboundSchema; + /** @deprecated use `XChainBalances$outboundSchema` instead. */ + export const outboundSchema = XChainBalances$outboundSchema; + /** @deprecated use `XChainBalances$Outbound` instead. */ + export type Outbound = XChainBalances$Outbound; +} diff --git a/src/models/components/xchainid.ts b/src/models/components/xchainid.ts new file mode 100644 index 0000000..8670268 --- /dev/null +++ b/src/models/components/xchainid.ts @@ -0,0 +1,32 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +export const XChainId = { + TwooYmbnv4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM: + "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", + TwoJVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm: + "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm", + XChain: "x-chain", +} as const; +export type XChainId = ClosedEnum; + +/** @internal */ +export const XChainId$inboundSchema: z.ZodNativeEnum = z.nativeEnum(XChainId); + +/** @internal */ +export const XChainId$outboundSchema: z.ZodNativeEnum = XChainId$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainId$ { + /** @deprecated use `XChainId$inboundSchema` instead. */ + export const inboundSchema = XChainId$inboundSchema; + /** @deprecated use `XChainId$outboundSchema` instead. */ + export const outboundSchema = XChainId$outboundSchema; +} diff --git a/src/models/components/xchainlineartransaction.ts b/src/models/components/xchainlineartransaction.ts new file mode 100644 index 0000000..f967335 --- /dev/null +++ b/src/models/components/xchainlineartransaction.ts @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { Utxo, Utxo$inboundSchema, Utxo$Outbound, Utxo$outboundSchema } from "./utxo.js"; +import { + XChainAssetDetails, + XChainAssetDetails$inboundSchema, + XChainAssetDetails$Outbound, + XChainAssetDetails$outboundSchema, +} from "./xchainassetdetails.js"; +import { + XChainTransactionType, + XChainTransactionType$inboundSchema, + XChainTransactionType$outboundSchema, +} from "./xchaintransactiontype.js"; +import * as z from "zod"; + +/** + * Represents chain format this transaction is included in. + */ +export const XChainLinearTransactionChainFormat = { + NonLinear: "non-linear", + Linear: "linear", +} as const; +/** + * Represents chain format this transaction is included in. + */ +export type XChainLinearTransactionChainFormat = ClosedEnum< + typeof XChainLinearTransactionChainFormat +>; + +export type XChainLinearTransaction = { + /** + * Unique ID for this transaction. + */ + txHash: string; + /** + * Represents chain format this transaction is included in. + */ + chainFormat: XChainLinearTransactionChainFormat; + /** + * Latest timestamp in seconds this transaction was accepted out of the same transaction accepted in other vertices. + */ + timestamp: number; + /** + * Type of transaction. + */ + txType: XChainTransactionType; + /** + * Hex encoded memo bytes for this transaction. + */ + memo: string; + consumedUtxos: Array; + emittedUtxos: Array; + /** + * Assets unlocked by inputs of this transaction. + */ + amountUnlocked: Array; + /** + * Assets created by outputs of this transaction. + */ + amountCreated: Array; + /** + * Source chain for an atomic transaction. + */ + sourceChain?: string | undefined; + /** + * Destination chain for an atomic transaction. + */ + destinationChain?: string | undefined; + /** + * AssetAmount details of the asset created in CreateAssetTx + */ + assetCreated?: XChainAssetDetails | undefined; + /** + * Height of the block this transaction belongs to. + */ + blockHeight: number; + /** + * Hash of the block this transaction belongs to. + */ + blockHash: string; +}; + +/** @internal */ +export const XChainLinearTransactionChainFormat$inboundSchema: z.ZodNativeEnum< + typeof XChainLinearTransactionChainFormat +> = z.nativeEnum(XChainLinearTransactionChainFormat); + +/** @internal */ +export const XChainLinearTransactionChainFormat$outboundSchema: z.ZodNativeEnum< + typeof XChainLinearTransactionChainFormat +> = XChainLinearTransactionChainFormat$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainLinearTransactionChainFormat$ { + /** @deprecated use `XChainLinearTransactionChainFormat$inboundSchema` instead. */ + export const inboundSchema = XChainLinearTransactionChainFormat$inboundSchema; + /** @deprecated use `XChainLinearTransactionChainFormat$outboundSchema` instead. */ + export const outboundSchema = XChainLinearTransactionChainFormat$outboundSchema; +} + +/** @internal */ +export const XChainLinearTransaction$inboundSchema: z.ZodType< + XChainLinearTransaction, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + chainFormat: XChainLinearTransactionChainFormat$inboundSchema, + timestamp: z.number(), + txType: XChainTransactionType$inboundSchema, + memo: z.string(), + consumedUtxos: z.array(Utxo$inboundSchema), + emittedUtxos: z.array(Utxo$inboundSchema), + amountUnlocked: z.array(AssetAmount$inboundSchema), + amountCreated: z.array(AssetAmount$inboundSchema), + sourceChain: z.string().optional(), + destinationChain: z.string().optional(), + assetCreated: XChainAssetDetails$inboundSchema.optional(), + blockHeight: z.number(), + blockHash: z.string(), +}); + +/** @internal */ +export type XChainLinearTransaction$Outbound = { + txHash: string; + chainFormat: string; + timestamp: number; + txType: string; + memo: string; + consumedUtxos: Array; + emittedUtxos: Array; + amountUnlocked: Array; + amountCreated: Array; + sourceChain?: string | undefined; + destinationChain?: string | undefined; + assetCreated?: XChainAssetDetails$Outbound | undefined; + blockHeight: number; + blockHash: string; +}; + +/** @internal */ +export const XChainLinearTransaction$outboundSchema: z.ZodType< + XChainLinearTransaction$Outbound, + z.ZodTypeDef, + XChainLinearTransaction +> = z.object({ + txHash: z.string(), + chainFormat: XChainLinearTransactionChainFormat$outboundSchema, + timestamp: z.number(), + txType: XChainTransactionType$outboundSchema, + memo: z.string(), + consumedUtxos: z.array(Utxo$outboundSchema), + emittedUtxos: z.array(Utxo$outboundSchema), + amountUnlocked: z.array(AssetAmount$outboundSchema), + amountCreated: z.array(AssetAmount$outboundSchema), + sourceChain: z.string().optional(), + destinationChain: z.string().optional(), + assetCreated: XChainAssetDetails$outboundSchema.optional(), + blockHeight: z.number(), + blockHash: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainLinearTransaction$ { + /** @deprecated use `XChainLinearTransaction$inboundSchema` instead. */ + export const inboundSchema = XChainLinearTransaction$inboundSchema; + /** @deprecated use `XChainLinearTransaction$outboundSchema` instead. */ + export const outboundSchema = XChainLinearTransaction$outboundSchema; + /** @deprecated use `XChainLinearTransaction$Outbound` instead. */ + export type Outbound = XChainLinearTransaction$Outbound; +} diff --git a/src/models/components/xchainnonlineartransaction.ts b/src/models/components/xchainnonlineartransaction.ts new file mode 100644 index 0000000..53c56e9 --- /dev/null +++ b/src/models/components/xchainnonlineartransaction.ts @@ -0,0 +1,182 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import { + AssetAmount, + AssetAmount$inboundSchema, + AssetAmount$Outbound, + AssetAmount$outboundSchema, +} from "./assetamount.js"; +import { + TransactionVertexDetail, + TransactionVertexDetail$inboundSchema, + TransactionVertexDetail$Outbound, + TransactionVertexDetail$outboundSchema, +} from "./transactionvertexdetail.js"; +import { Utxo, Utxo$inboundSchema, Utxo$Outbound, Utxo$outboundSchema } from "./utxo.js"; +import { + XChainAssetDetails, + XChainAssetDetails$inboundSchema, + XChainAssetDetails$Outbound, + XChainAssetDetails$outboundSchema, +} from "./xchainassetdetails.js"; +import { + XChainTransactionType, + XChainTransactionType$inboundSchema, + XChainTransactionType$outboundSchema, +} from "./xchaintransactiontype.js"; +import * as z from "zod"; + +/** + * Represents chain format this transaction is included in. + */ +export const ChainFormat = { + NonLinear: "non-linear", + Linear: "linear", +} as const; +/** + * Represents chain format this transaction is included in. + */ +export type ChainFormat = ClosedEnum; + +export type XChainNonLinearTransaction = { + /** + * Unique ID for this transaction. + */ + txHash: string; + /** + * Represents chain format this transaction is included in. + */ + chainFormat: ChainFormat; + /** + * Latest timestamp in seconds this transaction was accepted out of the same transaction accepted in other vertices. + */ + timestamp: number; + /** + * Type of transaction. + */ + txType: XChainTransactionType; + /** + * Hex encoded memo bytes for this transaction. + */ + memo: string; + consumedUtxos: Array; + emittedUtxos: Array; + /** + * Assets unlocked by inputs of this transaction. + */ + amountUnlocked: Array; + /** + * Assets created by outputs of this transaction. + */ + amountCreated: Array; + /** + * Source chain for an atomic transaction. + */ + sourceChain?: string | undefined; + /** + * Destination chain for an atomic transaction. + */ + destinationChain?: string | undefined; + /** + * AssetAmount details of the asset created in CreateAssetTx + */ + assetCreated?: XChainAssetDetails | undefined; + /** + * A transaction on X-Chain can be accepted over multiple vertices. + */ + vertices: Array; +}; + +/** @internal */ +export const ChainFormat$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(ChainFormat); + +/** @internal */ +export const ChainFormat$outboundSchema: z.ZodNativeEnum = + ChainFormat$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChainFormat$ { + /** @deprecated use `ChainFormat$inboundSchema` instead. */ + export const inboundSchema = ChainFormat$inboundSchema; + /** @deprecated use `ChainFormat$outboundSchema` instead. */ + export const outboundSchema = ChainFormat$outboundSchema; +} + +/** @internal */ +export const XChainNonLinearTransaction$inboundSchema: z.ZodType< + XChainNonLinearTransaction, + z.ZodTypeDef, + unknown +> = z.object({ + txHash: z.string(), + chainFormat: ChainFormat$inboundSchema, + timestamp: z.number(), + txType: XChainTransactionType$inboundSchema, + memo: z.string(), + consumedUtxos: z.array(Utxo$inboundSchema), + emittedUtxos: z.array(Utxo$inboundSchema), + amountUnlocked: z.array(AssetAmount$inboundSchema), + amountCreated: z.array(AssetAmount$inboundSchema), + sourceChain: z.string().optional(), + destinationChain: z.string().optional(), + assetCreated: XChainAssetDetails$inboundSchema.optional(), + vertices: z.array(TransactionVertexDetail$inboundSchema), +}); + +/** @internal */ +export type XChainNonLinearTransaction$Outbound = { + txHash: string; + chainFormat: string; + timestamp: number; + txType: string; + memo: string; + consumedUtxos: Array; + emittedUtxos: Array; + amountUnlocked: Array; + amountCreated: Array; + sourceChain?: string | undefined; + destinationChain?: string | undefined; + assetCreated?: XChainAssetDetails$Outbound | undefined; + vertices: Array; +}; + +/** @internal */ +export const XChainNonLinearTransaction$outboundSchema: z.ZodType< + XChainNonLinearTransaction$Outbound, + z.ZodTypeDef, + XChainNonLinearTransaction +> = z.object({ + txHash: z.string(), + chainFormat: ChainFormat$outboundSchema, + timestamp: z.number(), + txType: XChainTransactionType$outboundSchema, + memo: z.string(), + consumedUtxos: z.array(Utxo$outboundSchema), + emittedUtxos: z.array(Utxo$outboundSchema), + amountUnlocked: z.array(AssetAmount$outboundSchema), + amountCreated: z.array(AssetAmount$outboundSchema), + sourceChain: z.string().optional(), + destinationChain: z.string().optional(), + assetCreated: XChainAssetDetails$outboundSchema.optional(), + vertices: z.array(TransactionVertexDetail$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainNonLinearTransaction$ { + /** @deprecated use `XChainNonLinearTransaction$inboundSchema` instead. */ + export const inboundSchema = XChainNonLinearTransaction$inboundSchema; + /** @deprecated use `XChainNonLinearTransaction$outboundSchema` instead. */ + export const outboundSchema = XChainNonLinearTransaction$outboundSchema; + /** @deprecated use `XChainNonLinearTransaction$Outbound` instead. */ + export type Outbound = XChainNonLinearTransaction$Outbound; +} diff --git a/src/models/components/xchainsharedassetbalance.ts b/src/models/components/xchainsharedassetbalance.ts new file mode 100644 index 0000000..6ff3978 --- /dev/null +++ b/src/models/components/xchainsharedassetbalance.ts @@ -0,0 +1,96 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + PrimaryNetworkAssetType, + PrimaryNetworkAssetType$inboundSchema, + PrimaryNetworkAssetType$outboundSchema, +} from "./primarynetworkassettype.js"; +import * as z from "zod"; + +export type XChainSharedAssetBalance = { + /** + * Unique ID for an asset. + */ + assetId: string; + /** + * Name of this asset. + */ + name: string; + /** + * Symbol for this asset (max 4 characters). + */ + symbol: string; + /** + * Denomination of this asset to represent fungibility. + */ + denomination: number; + /** + * Type of asset like SECP256K1 or NFT. + */ + type: PrimaryNetworkAssetType; + /** + * Amount of the asset. + */ + amount: string; + utxoCount: number; + sharedWithChainId: string; +}; + +/** @internal */ +export const XChainSharedAssetBalance$inboundSchema: z.ZodType< + XChainSharedAssetBalance, + z.ZodTypeDef, + unknown +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$inboundSchema, + amount: z.string(), + utxoCount: z.number(), + sharedWithChainId: z.string(), +}); + +/** @internal */ +export type XChainSharedAssetBalance$Outbound = { + assetId: string; + name: string; + symbol: string; + denomination: number; + type: string; + amount: string; + utxoCount: number; + sharedWithChainId: string; +}; + +/** @internal */ +export const XChainSharedAssetBalance$outboundSchema: z.ZodType< + XChainSharedAssetBalance$Outbound, + z.ZodTypeDef, + XChainSharedAssetBalance +> = z.object({ + assetId: z.string(), + name: z.string(), + symbol: z.string(), + denomination: z.number(), + type: PrimaryNetworkAssetType$outboundSchema, + amount: z.string(), + utxoCount: z.number(), + sharedWithChainId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainSharedAssetBalance$ { + /** @deprecated use `XChainSharedAssetBalance$inboundSchema` instead. */ + export const inboundSchema = XChainSharedAssetBalance$inboundSchema; + /** @deprecated use `XChainSharedAssetBalance$outboundSchema` instead. */ + export const outboundSchema = XChainSharedAssetBalance$outboundSchema; + /** @deprecated use `XChainSharedAssetBalance$Outbound` instead. */ + export type Outbound = XChainSharedAssetBalance$Outbound; +} diff --git a/src/models/components/xchaintransactiontype.ts b/src/models/components/xchaintransactiontype.ts new file mode 100644 index 0000000..ea6afb1 --- /dev/null +++ b/src/models/components/xchaintransactiontype.ts @@ -0,0 +1,41 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; + +/** + * Type of transaction. + */ +export const XChainTransactionType = { + BaseTx: "BaseTx", + CreateAssetTx: "CreateAssetTx", + OperationTx: "OperationTx", + ImportTx: "ImportTx", + ExportTx: "ExportTx", + Unknown: "UNKNOWN", +} as const; +/** + * Type of transaction. + */ +export type XChainTransactionType = ClosedEnum; + +/** @internal */ +export const XChainTransactionType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(XChainTransactionType); + +/** @internal */ +export const XChainTransactionType$outboundSchema: z.ZodNativeEnum = + XChainTransactionType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainTransactionType$ { + /** @deprecated use `XChainTransactionType$inboundSchema` instead. */ + export const inboundSchema = XChainTransactionType$inboundSchema; + /** @deprecated use `XChainTransactionType$outboundSchema` instead. */ + export const outboundSchema = XChainTransactionType$outboundSchema; +} diff --git a/src/models/components/xchainvertex.ts b/src/models/components/xchainvertex.ts new file mode 100644 index 0000000..9e328f5 --- /dev/null +++ b/src/models/components/xchainvertex.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type XChainVertex = { + vertexHash: string; + parentHashes: Array; + vertexHeight: number; + vertexIndex: number; + vertexTimestamp: number; + txCount: number; + transactions: Array; + vertexSizeBytes: number; +}; + +/** @internal */ +export const XChainVertex$inboundSchema: z.ZodType = z.object({ + vertexHash: z.string(), + parentHashes: z.array(z.string()), + vertexHeight: z.number(), + vertexIndex: z.number(), + vertexTimestamp: z.number(), + txCount: z.number(), + transactions: z.array(z.string()), + vertexSizeBytes: z.number(), +}); + +/** @internal */ +export type XChainVertex$Outbound = { + vertexHash: string; + parentHashes: Array; + vertexHeight: number; + vertexIndex: number; + vertexTimestamp: number; + txCount: number; + transactions: Array; + vertexSizeBytes: number; +}; + +/** @internal */ +export const XChainVertex$outboundSchema: z.ZodType< + XChainVertex$Outbound, + z.ZodTypeDef, + XChainVertex +> = z.object({ + vertexHash: z.string(), + parentHashes: z.array(z.string()), + vertexHeight: z.number(), + vertexIndex: z.number(), + vertexTimestamp: z.number(), + txCount: z.number(), + transactions: z.array(z.string()), + vertexSizeBytes: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace XChainVertex$ { + /** @deprecated use `XChainVertex$inboundSchema` instead. */ + export const inboundSchema = XChainVertex$inboundSchema; + /** @deprecated use `XChainVertex$outboundSchema` instead. */ + export const outboundSchema = XChainVertex$outboundSchema; + /** @deprecated use `XChainVertex$Outbound` instead. */ + export type Outbound = XChainVertex$Outbound; +} diff --git a/src/models/errors/badgateway.ts b/src/models/errors/badgateway.ts new file mode 100644 index 0000000..f4d6952 --- /dev/null +++ b/src/models/errors/badgateway.ts @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type BadGatewayMessage = string | Array; + +/** + * This is an internal error indicating invalid response + * + * @remarks + * received by the client-facing proxy or gateway from the upstream server. + */ +export type BadGatewayData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * This is an internal error indicating invalid response + * + * @remarks + * received by the client-facing proxy or gateway from the upstream server. + */ +export class BadGateway extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: BadGatewayData; + + constructor(err: BadGatewayData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "BadGateway"; + } +} + +/** @internal */ +export const BadGatewayMessage$inboundSchema: z.ZodType = + z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type BadGatewayMessage$Outbound = string | Array; + +/** @internal */ +export const BadGatewayMessage$outboundSchema: z.ZodType< + BadGatewayMessage$Outbound, + z.ZodTypeDef, + BadGatewayMessage +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BadGatewayMessage$ { + /** @deprecated use `BadGatewayMessage$inboundSchema` instead. */ + export const inboundSchema = BadGatewayMessage$inboundSchema; + /** @deprecated use `BadGatewayMessage$outboundSchema` instead. */ + export const outboundSchema = BadGatewayMessage$outboundSchema; + /** @deprecated use `BadGatewayMessage$Outbound` instead. */ + export type Outbound = BadGatewayMessage$Outbound; +} + +/** @internal */ +export const BadGateway$inboundSchema: z.ZodType = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new BadGateway(v); + }); + +/** @internal */ +export type BadGateway$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const BadGateway$outboundSchema: z.ZodType = z + .instanceof(BadGateway) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BadGateway$ { + /** @deprecated use `BadGateway$inboundSchema` instead. */ + export const inboundSchema = BadGateway$inboundSchema; + /** @deprecated use `BadGateway$outboundSchema` instead. */ + export const outboundSchema = BadGateway$outboundSchema; + /** @deprecated use `BadGateway$Outbound` instead. */ + export type Outbound = BadGateway$Outbound; +} diff --git a/src/models/errors/badrequest.ts b/src/models/errors/badrequest.ts new file mode 100644 index 0000000..2cd6a93 --- /dev/null +++ b/src/models/errors/badrequest.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type Message = string | Array; + +/** + * Bad requests generally mean the client has passed invalid + * + * @remarks + * or malformed parameters. Error messages in the response could help in + * evaluating the error. + */ +export type BadRequestData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * Bad requests generally mean the client has passed invalid + * + * @remarks + * or malformed parameters. Error messages in the response could help in + * evaluating the error. + */ +export class BadRequest extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: BadRequestData; + + constructor(err: BadRequestData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "BadRequest"; + } +} + +/** @internal */ +export const Message$inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), +]); + +/** @internal */ +export type Message$Outbound = string | Array; + +/** @internal */ +export const Message$outboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Message$ { + /** @deprecated use `Message$inboundSchema` instead. */ + export const inboundSchema = Message$inboundSchema; + /** @deprecated use `Message$outboundSchema` instead. */ + export const outboundSchema = Message$outboundSchema; + /** @deprecated use `Message$Outbound` instead. */ + export type Outbound = Message$Outbound; +} + +/** @internal */ +export const BadRequest$inboundSchema: z.ZodType = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new BadRequest(v); + }); + +/** @internal */ +export type BadRequest$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const BadRequest$outboundSchema: z.ZodType = z + .instanceof(BadRequest) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BadRequest$ { + /** @deprecated use `BadRequest$inboundSchema` instead. */ + export const inboundSchema = BadRequest$inboundSchema; + /** @deprecated use `BadRequest$outboundSchema` instead. */ + export const outboundSchema = BadRequest$outboundSchema; + /** @deprecated use `BadRequest$Outbound` instead. */ + export type Outbound = BadRequest$Outbound; +} diff --git a/src/models/errors/forbidden.ts b/src/models/errors/forbidden.ts new file mode 100644 index 0000000..ed64926 --- /dev/null +++ b/src/models/errors/forbidden.ts @@ -0,0 +1,137 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type ForbiddenMessage = string | Array; + +/** + * When a client attempts to access resources with valid + * + * @remarks + * credentials but doesn't have the privilege to perform that action, + * the server responds with 403. + */ +export type ForbiddenData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * When a client attempts to access resources with valid + * + * @remarks + * credentials but doesn't have the privilege to perform that action, + * the server responds with 403. + */ +export class Forbidden extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: ForbiddenData; + + constructor(err: ForbiddenData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "Forbidden"; + } +} + +/** @internal */ +export const ForbiddenMessage$inboundSchema: z.ZodType = + z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type ForbiddenMessage$Outbound = string | Array; + +/** @internal */ +export const ForbiddenMessage$outboundSchema: z.ZodType< + ForbiddenMessage$Outbound, + z.ZodTypeDef, + ForbiddenMessage +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ForbiddenMessage$ { + /** @deprecated use `ForbiddenMessage$inboundSchema` instead. */ + export const inboundSchema = ForbiddenMessage$inboundSchema; + /** @deprecated use `ForbiddenMessage$outboundSchema` instead. */ + export const outboundSchema = ForbiddenMessage$outboundSchema; + /** @deprecated use `ForbiddenMessage$Outbound` instead. */ + export type Outbound = ForbiddenMessage$Outbound; +} + +/** @internal */ +export const Forbidden$inboundSchema: z.ZodType = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new Forbidden(v); + }); + +/** @internal */ +export type Forbidden$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const Forbidden$outboundSchema: z.ZodType = z + .instanceof(Forbidden) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Forbidden$ { + /** @deprecated use `Forbidden$inboundSchema` instead. */ + export const inboundSchema = Forbidden$inboundSchema; + /** @deprecated use `Forbidden$outboundSchema` instead. */ + export const outboundSchema = Forbidden$outboundSchema; + /** @deprecated use `Forbidden$Outbound` instead. */ + export type Outbound = Forbidden$Outbound; +} diff --git a/src/models/errors/glacierhealthcheck.ts b/src/models/errors/glacierhealthcheck.ts new file mode 100644 index 0000000..16d812e --- /dev/null +++ b/src/models/errors/glacierhealthcheck.ts @@ -0,0 +1,255 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js"; +import * as z from "zod"; + +export type Info = { + status?: string | undefined; + additionalProperties: { [k: string]: string }; +}; + +export type ErrorT = { + status?: string | undefined; + additionalProperties: { [k: string]: string }; +}; + +export type Details = { + status?: string | undefined; + additionalProperties: { [k: string]: string }; +}; + +/** + * The Health Check is not successful + */ +export type GlacierHealthCheckResponseBodyData = { + status?: string | undefined; + info?: { [k: string]: Info } | null | undefined; + error?: { [k: string]: ErrorT } | null | undefined; + details?: { [k: string]: Details } | undefined; +}; + +/** + * The Health Check is not successful + */ +export class GlacierHealthCheckResponseBody extends Error { + status?: string | undefined; + info?: { [k: string]: Info } | null | undefined; + error?: { [k: string]: ErrorT } | null | undefined; + details?: { [k: string]: Details } | undefined; + + /** The original data that was passed to this error instance. */ + data$: GlacierHealthCheckResponseBodyData; + + constructor(err: GlacierHealthCheckResponseBodyData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + if (err.status != null) { + this.status = err.status; + } + if (err.info != null) { + this.info = err.info; + } + if (err.error != null) { + this.error = err.error; + } + if (err.details != null) { + this.details = err.details; + } + + this.name = "GlacierHealthCheckResponseBody"; + } +} + +/** @internal */ +export const Info$inboundSchema: z.ZodType = collectExtraKeys$( + z + .object({ + status: z.string().optional(), + }) + .catchall(z.string()), + "additionalProperties" +); + +/** @internal */ +export type Info$Outbound = { + status?: string | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const Info$outboundSchema: z.ZodType = z + .object({ + status: z.string().optional(), + additionalProperties: z.record(z.string()), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Info$ { + /** @deprecated use `Info$inboundSchema` instead. */ + export const inboundSchema = Info$inboundSchema; + /** @deprecated use `Info$outboundSchema` instead. */ + export const outboundSchema = Info$outboundSchema; + /** @deprecated use `Info$Outbound` instead. */ + export type Outbound = Info$Outbound; +} + +/** @internal */ +export const ErrorT$inboundSchema: z.ZodType = collectExtraKeys$( + z + .object({ + status: z.string().optional(), + }) + .catchall(z.string()), + "additionalProperties" +); + +/** @internal */ +export type ErrorT$Outbound = { + status?: string | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const ErrorT$outboundSchema: z.ZodType = z + .object({ + status: z.string().optional(), + additionalProperties: z.record(z.string()), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ErrorT$ { + /** @deprecated use `ErrorT$inboundSchema` instead. */ + export const inboundSchema = ErrorT$inboundSchema; + /** @deprecated use `ErrorT$outboundSchema` instead. */ + export const outboundSchema = ErrorT$outboundSchema; + /** @deprecated use `ErrorT$Outbound` instead. */ + export type Outbound = ErrorT$Outbound; +} + +/** @internal */ +export const Details$inboundSchema: z.ZodType = collectExtraKeys$( + z + .object({ + status: z.string().optional(), + }) + .catchall(z.string()), + "additionalProperties" +); + +/** @internal */ +export type Details$Outbound = { + status?: string | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const Details$outboundSchema: z.ZodType = z + .object({ + status: z.string().optional(), + additionalProperties: z.record(z.string()), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Details$ { + /** @deprecated use `Details$inboundSchema` instead. */ + export const inboundSchema = Details$inboundSchema; + /** @deprecated use `Details$outboundSchema` instead. */ + export const outboundSchema = Details$outboundSchema; + /** @deprecated use `Details$Outbound` instead. */ + export type Outbound = Details$Outbound; +} + +/** @internal */ +export const GlacierHealthCheckResponseBody$inboundSchema: z.ZodType< + GlacierHealthCheckResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + status: z.string().optional(), + info: z.nullable(z.record(z.lazy(() => Info$inboundSchema))).optional(), + error: z.nullable(z.record(z.lazy(() => ErrorT$inboundSchema))).optional(), + details: z.record(z.lazy(() => Details$inboundSchema)).optional(), + }) + .transform((v) => { + return new GlacierHealthCheckResponseBody(v); + }); + +/** @internal */ +export type GlacierHealthCheckResponseBody$Outbound = { + status?: string | undefined; + info?: { [k: string]: Info$Outbound } | null | undefined; + error?: { [k: string]: ErrorT$Outbound } | null | undefined; + details?: { [k: string]: Details$Outbound } | undefined; +}; + +/** @internal */ +export const GlacierHealthCheckResponseBody$outboundSchema: z.ZodType< + GlacierHealthCheckResponseBody$Outbound, + z.ZodTypeDef, + GlacierHealthCheckResponseBody +> = z + .instanceof(GlacierHealthCheckResponseBody) + .transform((v) => v.data$) + .pipe( + z.object({ + status: z.string().optional(), + info: z.nullable(z.record(z.lazy(() => Info$outboundSchema))).optional(), + error: z.nullable(z.record(z.lazy(() => ErrorT$outboundSchema))).optional(), + details: z.record(z.lazy(() => Details$outboundSchema)).optional(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GlacierHealthCheckResponseBody$ { + /** @deprecated use `GlacierHealthCheckResponseBody$inboundSchema` instead. */ + export const inboundSchema = GlacierHealthCheckResponseBody$inboundSchema; + /** @deprecated use `GlacierHealthCheckResponseBody$outboundSchema` instead. */ + export const outboundSchema = GlacierHealthCheckResponseBody$outboundSchema; + /** @deprecated use `GlacierHealthCheckResponseBody$Outbound` instead. */ + export type Outbound = GlacierHealthCheckResponseBody$Outbound; +} diff --git a/src/models/errors/httpclienterrors.ts b/src/models/errors/httpclienterrors.ts new file mode 100644 index 0000000..cdb2995 --- /dev/null +++ b/src/models/errors/httpclienterrors.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * Base class for all HTTP errors. + */ +export class HTTPClientError extends Error { + /** The underlying cause of the error. */ + override readonly cause: unknown; + override name = "HTTPClientError"; + constructor(message: string, opts?: { cause?: unknown }) { + let msg = message; + if (opts?.cause) { + msg += `: ${opts.cause}`; + } + + super(msg, opts); + // In older runtimes, the cause field would not have been assigned through + // the super() call. + if (typeof this.cause === "undefined") { + this.cause = opts?.cause; + } + } +} + +/** + * An error to capture unrecognised or unexpected errors when making HTTP calls. + */ +export class UnexpectedClientError extends HTTPClientError { + override name = "UnexpectedClientError"; +} + +/** + * An error that is raised when any inputs used to create a request are invalid. + */ +export class InvalidRequestError extends HTTPClientError { + override name = "InvalidRequestError"; +} + +/** + * An error that is raised when a HTTP request was aborted by the client error. + */ +export class RequestAbortedError extends HTTPClientError { + override readonly name = "RequestAbortedError"; +} + +/** + * An error that is raised when a HTTP request timed out due to an AbortSignal + * signal timeout. + */ +export class RequestTimeoutError extends HTTPClientError { + override readonly name = "RequestTimeoutError"; +} + +/** + * An error that is raised when a HTTP client is unable to make a request to + * a server. + */ +export class ConnectionError extends HTTPClientError { + override readonly name = "ConnectionError"; +} diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts new file mode 100644 index 0000000..ceda99f --- /dev/null +++ b/src/models/errors/index.ts @@ -0,0 +1,16 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export * from "./badgateway.js"; +export * from "./badrequest.js"; +export * from "./forbidden.js"; +export * from "./glacierhealthcheck.js"; +export * from "./httpclienterrors.js"; +export * from "./internalservererror.js"; +export * from "./notfound.js"; +export * from "./sdkerror.js"; +export * from "./sdkvalidationerror.js"; +export * from "./serviceunavailable.js"; +export * from "./toomanyrequests.js"; +export * from "./unauthorized.js"; diff --git a/src/models/errors/internalservererror.ts b/src/models/errors/internalservererror.ts new file mode 100644 index 0000000..2f2beab --- /dev/null +++ b/src/models/errors/internalservererror.ts @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type InternalServerErrorMessage = string | Array; + +/** + * The error is a generic server side error that is + * + * @remarks + * returned for any uncaught and unexpected issues on the server side. + * This should be very rare, and you may reach out to us if the problem + * persists for a longer duration. + */ +export type InternalServerErrorData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * The error is a generic server side error that is + * + * @remarks + * returned for any uncaught and unexpected issues on the server side. + * This should be very rare, and you may reach out to us if the problem + * persists for a longer duration. + */ +export class InternalServerError extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: InternalServerErrorData; + + constructor(err: InternalServerErrorData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "InternalServerError"; + } +} + +/** @internal */ +export const InternalServerErrorMessage$inboundSchema: z.ZodType< + InternalServerErrorMessage, + z.ZodTypeDef, + unknown +> = z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type InternalServerErrorMessage$Outbound = string | Array; + +/** @internal */ +export const InternalServerErrorMessage$outboundSchema: z.ZodType< + InternalServerErrorMessage$Outbound, + z.ZodTypeDef, + InternalServerErrorMessage +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InternalServerErrorMessage$ { + /** @deprecated use `InternalServerErrorMessage$inboundSchema` instead. */ + export const inboundSchema = InternalServerErrorMessage$inboundSchema; + /** @deprecated use `InternalServerErrorMessage$outboundSchema` instead. */ + export const outboundSchema = InternalServerErrorMessage$outboundSchema; + /** @deprecated use `InternalServerErrorMessage$Outbound` instead. */ + export type Outbound = InternalServerErrorMessage$Outbound; +} + +/** @internal */ +export const InternalServerError$inboundSchema: z.ZodType< + InternalServerError, + z.ZodTypeDef, + unknown +> = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new InternalServerError(v); + }); + +/** @internal */ +export type InternalServerError$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const InternalServerError$outboundSchema: z.ZodType< + InternalServerError$Outbound, + z.ZodTypeDef, + InternalServerError +> = z + .instanceof(InternalServerError) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InternalServerError$ { + /** @deprecated use `InternalServerError$inboundSchema` instead. */ + export const inboundSchema = InternalServerError$inboundSchema; + /** @deprecated use `InternalServerError$outboundSchema` instead. */ + export const outboundSchema = InternalServerError$outboundSchema; + /** @deprecated use `InternalServerError$Outbound` instead. */ + export type Outbound = InternalServerError$Outbound; +} diff --git a/src/models/errors/notfound.ts b/src/models/errors/notfound.ts new file mode 100644 index 0000000..2e1a892 --- /dev/null +++ b/src/models/errors/notfound.ts @@ -0,0 +1,137 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type NotFoundMessage = string | Array; + +/** + * The error is mostly returned when the client requests + * + * @remarks + * with either mistyped URL, or the passed resource is moved or deleted, + * or the resource doesn't exist. + */ +export type NotFoundData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * The error is mostly returned when the client requests + * + * @remarks + * with either mistyped URL, or the passed resource is moved or deleted, + * or the resource doesn't exist. + */ +export class NotFound extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: NotFoundData; + + constructor(err: NotFoundData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "NotFound"; + } +} + +/** @internal */ +export const NotFoundMessage$inboundSchema: z.ZodType = + z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type NotFoundMessage$Outbound = string | Array; + +/** @internal */ +export const NotFoundMessage$outboundSchema: z.ZodType< + NotFoundMessage$Outbound, + z.ZodTypeDef, + NotFoundMessage +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotFoundMessage$ { + /** @deprecated use `NotFoundMessage$inboundSchema` instead. */ + export const inboundSchema = NotFoundMessage$inboundSchema; + /** @deprecated use `NotFoundMessage$outboundSchema` instead. */ + export const outboundSchema = NotFoundMessage$outboundSchema; + /** @deprecated use `NotFoundMessage$Outbound` instead. */ + export type Outbound = NotFoundMessage$Outbound; +} + +/** @internal */ +export const NotFound$inboundSchema: z.ZodType = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new NotFound(v); + }); + +/** @internal */ +export type NotFound$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const NotFound$outboundSchema: z.ZodType = z + .instanceof(NotFound) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotFound$ { + /** @deprecated use `NotFound$inboundSchema` instead. */ + export const inboundSchema = NotFound$inboundSchema; + /** @deprecated use `NotFound$outboundSchema` instead. */ + export const outboundSchema = NotFound$outboundSchema; + /** @deprecated use `NotFound$Outbound` instead. */ + export type Outbound = NotFound$Outbound; +} diff --git a/src/models/errors/sdkerror.ts b/src/models/errors/sdkerror.ts new file mode 100644 index 0000000..80e3aa4 --- /dev/null +++ b/src/models/errors/sdkerror.ts @@ -0,0 +1,25 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export class SDKError extends Error { + public readonly statusCode: number; + public readonly contentType: string; + + constructor( + message: string, + public readonly rawResponse: Response, + public readonly body: string = "" + ) { + const statusCode = rawResponse.status; + const contentType = rawResponse.headers.get("content-type") || ""; + const bodyString = body.length > 0 ? `\n${body}` : ""; + + super(`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`); + + this.statusCode = statusCode; + this.contentType = contentType; + + this.name = "SDKError"; + } +} diff --git a/src/models/errors/sdkvalidationerror.ts b/src/models/errors/sdkvalidationerror.ts new file mode 100644 index 0000000..16929b9 --- /dev/null +++ b/src/models/errors/sdkvalidationerror.ts @@ -0,0 +1,97 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export class SDKValidationError extends Error { + /** + * The raw value that failed validation. + */ + public readonly rawValue: unknown; + + /** + * The raw message that failed validation. + */ + public readonly rawMessage: unknown; + + constructor(message: string, cause: unknown, rawValue: unknown) { + super(`${message}: ${cause}`); + this.name = "SDKValidationError"; + this.cause = cause; + this.rawValue = rawValue; + this.rawMessage = message; + } + + /** + * Return a pretty-formatted error message if the underlying validation error + * is a ZodError or some other recognized error type, otherwise return the + * default error message. + */ + public pretty(): string { + if (this.cause instanceof z.ZodError) { + return `${this.rawMessage}\n${formatZodError(this.cause)}`; + } else { + return this.toString(); + } + } +} + +export function formatZodError(err: z.ZodError, level = 0): string { + let pre = " ".repeat(level); + pre = level > 0 ? `│${pre}` : pre; + pre += " ".repeat(level); + + let message = ""; + const append = (str: string) => (message += `\n${pre}${str}`); + + const len = err.issues.length; + const headline = len === 1 ? `${len} issue found` : `${len} issues found`; + + if (len) { + append(`┌ ${headline}:`); + } + + for (const issue of err.issues) { + let path = issue.path.join("."); + path = path ? `.${path}` : ""; + append(`│ • [${path}]: ${issue.message} (${issue.code})`); + switch (issue.code) { + case "invalid_literal": + case "invalid_type": { + append(`│ Want: ${issue.expected}`); + append(`│ Got: ${issue.received}`); + break; + } + case "unrecognized_keys": { + append(`│ Keys: ${issue.keys.join(", ")}`); + break; + } + case "invalid_enum_value": { + append(`│ Allowed: ${issue.options.join(", ")}`); + append(`│ Got: ${issue.received}`); + break; + } + case "invalid_union_discriminator": { + append(`│ Allowed: ${issue.options.join(", ")}`); + break; + } + case "invalid_union": { + const len = issue.unionErrors.length; + append( + `│ ✖︎ Attemped to deserialize into one of ${len} union members:`, + ); + issue.unionErrors.forEach((err, i) => { + append(`│ ✖︎ Member ${i + 1} of ${len}`); + append(`${formatZodError(err, level + 1)}`); + }); + } + } + } + + if (err.issues.length) { + append(`└─*`); + } + + return message.slice(1); +} diff --git a/src/models/errors/serviceunavailable.ts b/src/models/errors/serviceunavailable.ts new file mode 100644 index 0000000..757f395 --- /dev/null +++ b/src/models/errors/serviceunavailable.ts @@ -0,0 +1,148 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type ServiceUnavailableMessage = string | Array; + +/** + * The error is returned for certain routes on a particular + * + * @remarks + * Subnet. This indicates an internal problem with our Subnet node, and may + * not necessarily mean the Subnet is down or affected. + */ +export type ServiceUnavailableData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * The error is returned for certain routes on a particular + * + * @remarks + * Subnet. This indicates an internal problem with our Subnet node, and may + * not necessarily mean the Subnet is down or affected. + */ +export class ServiceUnavailable extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: ServiceUnavailableData; + + constructor(err: ServiceUnavailableData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "ServiceUnavailable"; + } +} + +/** @internal */ +export const ServiceUnavailableMessage$inboundSchema: z.ZodType< + ServiceUnavailableMessage, + z.ZodTypeDef, + unknown +> = z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type ServiceUnavailableMessage$Outbound = string | Array; + +/** @internal */ +export const ServiceUnavailableMessage$outboundSchema: z.ZodType< + ServiceUnavailableMessage$Outbound, + z.ZodTypeDef, + ServiceUnavailableMessage +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ServiceUnavailableMessage$ { + /** @deprecated use `ServiceUnavailableMessage$inboundSchema` instead. */ + export const inboundSchema = ServiceUnavailableMessage$inboundSchema; + /** @deprecated use `ServiceUnavailableMessage$outboundSchema` instead. */ + export const outboundSchema = ServiceUnavailableMessage$outboundSchema; + /** @deprecated use `ServiceUnavailableMessage$Outbound` instead. */ + export type Outbound = ServiceUnavailableMessage$Outbound; +} + +/** @internal */ +export const ServiceUnavailable$inboundSchema: z.ZodType< + ServiceUnavailable, + z.ZodTypeDef, + unknown +> = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new ServiceUnavailable(v); + }); + +/** @internal */ +export type ServiceUnavailable$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const ServiceUnavailable$outboundSchema: z.ZodType< + ServiceUnavailable$Outbound, + z.ZodTypeDef, + ServiceUnavailable +> = z + .instanceof(ServiceUnavailable) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ServiceUnavailable$ { + /** @deprecated use `ServiceUnavailable$inboundSchema` instead. */ + export const inboundSchema = ServiceUnavailable$inboundSchema; + /** @deprecated use `ServiceUnavailable$outboundSchema` instead. */ + export const outboundSchema = ServiceUnavailable$outboundSchema; + /** @deprecated use `ServiceUnavailable$Outbound` instead. */ + export type Outbound = ServiceUnavailable$Outbound; +} diff --git a/src/models/errors/toomanyrequests.ts b/src/models/errors/toomanyrequests.ts new file mode 100644 index 0000000..411617b --- /dev/null +++ b/src/models/errors/toomanyrequests.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type TooManyRequestsMessage = string | Array; + +/** + * This error is returned when the client has sent too many, + * + * @remarks + * and has hit the rate limit. + */ +export type TooManyRequestsData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * This error is returned when the client has sent too many, + * + * @remarks + * and has hit the rate limit. + */ +export class TooManyRequests extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: TooManyRequestsData; + + constructor(err: TooManyRequestsData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "TooManyRequests"; + } +} + +/** @internal */ +export const TooManyRequestsMessage$inboundSchema: z.ZodType< + TooManyRequestsMessage, + z.ZodTypeDef, + unknown +> = z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type TooManyRequestsMessage$Outbound = string | Array; + +/** @internal */ +export const TooManyRequestsMessage$outboundSchema: z.ZodType< + TooManyRequestsMessage$Outbound, + z.ZodTypeDef, + TooManyRequestsMessage +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TooManyRequestsMessage$ { + /** @deprecated use `TooManyRequestsMessage$inboundSchema` instead. */ + export const inboundSchema = TooManyRequestsMessage$inboundSchema; + /** @deprecated use `TooManyRequestsMessage$outboundSchema` instead. */ + export const outboundSchema = TooManyRequestsMessage$outboundSchema; + /** @deprecated use `TooManyRequestsMessage$Outbound` instead. */ + export type Outbound = TooManyRequestsMessage$Outbound; +} + +/** @internal */ +export const TooManyRequests$inboundSchema: z.ZodType = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new TooManyRequests(v); + }); + +/** @internal */ +export type TooManyRequests$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const TooManyRequests$outboundSchema: z.ZodType< + TooManyRequests$Outbound, + z.ZodTypeDef, + TooManyRequests +> = z + .instanceof(TooManyRequests) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TooManyRequests$ { + /** @deprecated use `TooManyRequests$inboundSchema` instead. */ + export const inboundSchema = TooManyRequests$inboundSchema; + /** @deprecated use `TooManyRequests$outboundSchema` instead. */ + export const outboundSchema = TooManyRequests$outboundSchema; + /** @deprecated use `TooManyRequests$Outbound` instead. */ + export type Outbound = TooManyRequests$Outbound; +} diff --git a/src/models/errors/unauthorized.ts b/src/models/errors/unauthorized.ts new file mode 100644 index 0000000..a23a373 --- /dev/null +++ b/src/models/errors/unauthorized.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The error message describing the reason for the exception + */ +export type UnauthorizedMessage = string | Array; + +/** + * When a client attempts to access resources that require + * + * @remarks + * authorization credentials but the client lacks proper authentication + * in the request, the server responds with 401. + */ +export type UnauthorizedData = { + /** + * The error message describing the reason for the exception + */ + message: string | Array; + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; +}; + +/** + * When a client attempts to access resources that require + * + * @remarks + * authorization credentials but the client lacks proper authentication + * in the request, the server responds with 401. + */ +export class Unauthorized extends Error { + /** + * The HTTP status code of the response + */ + statusCode: number; + /** + * The type of error + */ + error: string; + + /** The original data that was passed to this error instance. */ + data$: UnauthorizedData; + + constructor(err: UnauthorizedData) { + const message = + "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + this.statusCode = err.statusCode; + this.error = err.error; + + this.name = "Unauthorized"; + } +} + +/** @internal */ +export const UnauthorizedMessage$inboundSchema: z.ZodType< + UnauthorizedMessage, + z.ZodTypeDef, + unknown +> = z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type UnauthorizedMessage$Outbound = string | Array; + +/** @internal */ +export const UnauthorizedMessage$outboundSchema: z.ZodType< + UnauthorizedMessage$Outbound, + z.ZodTypeDef, + UnauthorizedMessage +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UnauthorizedMessage$ { + /** @deprecated use `UnauthorizedMessage$inboundSchema` instead. */ + export const inboundSchema = UnauthorizedMessage$inboundSchema; + /** @deprecated use `UnauthorizedMessage$outboundSchema` instead. */ + export const outboundSchema = UnauthorizedMessage$outboundSchema; + /** @deprecated use `UnauthorizedMessage$Outbound` instead. */ + export type Outbound = UnauthorizedMessage$Outbound; +} + +/** @internal */ +export const Unauthorized$inboundSchema: z.ZodType = z + .object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + .transform((v) => { + return new Unauthorized(v); + }); + +/** @internal */ +export type Unauthorized$Outbound = { + message: string | Array; + statusCode: number; + error: string; +}; + +/** @internal */ +export const Unauthorized$outboundSchema: z.ZodType< + Unauthorized$Outbound, + z.ZodTypeDef, + Unauthorized +> = z + .instanceof(Unauthorized) + .transform((v) => v.data$) + .pipe( + z.object({ + message: z.union([z.string(), z.array(z.string())]), + statusCode: z.number(), + error: z.string(), + }) + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Unauthorized$ { + /** @deprecated use `Unauthorized$inboundSchema` instead. */ + export const inboundSchema = Unauthorized$inboundSchema; + /** @deprecated use `Unauthorized$outboundSchema` instead. */ + export const outboundSchema = Unauthorized$outboundSchema; + /** @deprecated use `Unauthorized$Outbound` instead. */ + export type Outbound = Unauthorized$Outbound; +} diff --git a/src/models/operations/addaddressestowebhook.ts b/src/models/operations/addaddressestowebhook.ts new file mode 100644 index 0000000..105bc41 --- /dev/null +++ b/src/models/operations/addaddressestowebhook.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type AddAddressesToWebhookRequest = { + /** + * The webhook identifier. + */ + id: string; + addressesChangeRequest: components.AddressesChangeRequest; +}; + +/** @internal */ +export const AddAddressesToWebhookRequest$inboundSchema: z.ZodType< + AddAddressesToWebhookRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.string(), + AddressesChangeRequest: components.AddressesChangeRequest$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + AddressesChangeRequest: "addressesChangeRequest", + }); + }); + +/** @internal */ +export type AddAddressesToWebhookRequest$Outbound = { + id: string; + AddressesChangeRequest: components.AddressesChangeRequest$Outbound; +}; + +/** @internal */ +export const AddAddressesToWebhookRequest$outboundSchema: z.ZodType< + AddAddressesToWebhookRequest$Outbound, + z.ZodTypeDef, + AddAddressesToWebhookRequest +> = z + .object({ + id: z.string(), + addressesChangeRequest: components.AddressesChangeRequest$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + addressesChangeRequest: "AddressesChangeRequest", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddAddressesToWebhookRequest$ { + /** @deprecated use `AddAddressesToWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = AddAddressesToWebhookRequest$inboundSchema; + /** @deprecated use `AddAddressesToWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = AddAddressesToWebhookRequest$outboundSchema; + /** @deprecated use `AddAddressesToWebhookRequest$Outbound` instead. */ + export type Outbound = AddAddressesToWebhookRequest$Outbound; +} diff --git a/src/models/operations/deactivatewebhook.ts b/src/models/operations/deactivatewebhook.ts new file mode 100644 index 0000000..18e36e1 --- /dev/null +++ b/src/models/operations/deactivatewebhook.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type DeactivateWebhookRequest = { + /** + * The webhook identifier. + */ + id: string; +}; + +/** @internal */ +export const DeactivateWebhookRequest$inboundSchema: z.ZodType< + DeactivateWebhookRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type DeactivateWebhookRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const DeactivateWebhookRequest$outboundSchema: z.ZodType< + DeactivateWebhookRequest$Outbound, + z.ZodTypeDef, + DeactivateWebhookRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeactivateWebhookRequest$ { + /** @deprecated use `DeactivateWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = DeactivateWebhookRequest$inboundSchema; + /** @deprecated use `DeactivateWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = DeactivateWebhookRequest$outboundSchema; + /** @deprecated use `DeactivateWebhookRequest$Outbound` instead. */ + export type Outbound = DeactivateWebhookRequest$Outbound; +} diff --git a/src/models/operations/getaddressesfromwebhook.ts b/src/models/operations/getaddressesfromwebhook.ts new file mode 100644 index 0000000..3532ecf --- /dev/null +++ b/src/models/operations/getaddressesfromwebhook.ts @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetAddressesFromWebhookRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * The webhook identifier. + */ + id: string; +}; + +export type GetAddressesFromWebhookResponse = { + result: components.ListWebhookAddressesResponse; +}; + +/** @internal */ +export const GetAddressesFromWebhookRequest$inboundSchema: z.ZodType< + GetAddressesFromWebhookRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + id: z.string(), +}); + +/** @internal */ +export type GetAddressesFromWebhookRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + id: string; +}; + +/** @internal */ +export const GetAddressesFromWebhookRequest$outboundSchema: z.ZodType< + GetAddressesFromWebhookRequest$Outbound, + z.ZodTypeDef, + GetAddressesFromWebhookRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetAddressesFromWebhookRequest$ { + /** @deprecated use `GetAddressesFromWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = GetAddressesFromWebhookRequest$inboundSchema; + /** @deprecated use `GetAddressesFromWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = GetAddressesFromWebhookRequest$outboundSchema; + /** @deprecated use `GetAddressesFromWebhookRequest$Outbound` instead. */ + export type Outbound = GetAddressesFromWebhookRequest$Outbound; +} + +/** @internal */ +export const GetAddressesFromWebhookResponse$inboundSchema: z.ZodType< + GetAddressesFromWebhookResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListWebhookAddressesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type GetAddressesFromWebhookResponse$Outbound = { + Result: components.ListWebhookAddressesResponse$Outbound; +}; + +/** @internal */ +export const GetAddressesFromWebhookResponse$outboundSchema: z.ZodType< + GetAddressesFromWebhookResponse$Outbound, + z.ZodTypeDef, + GetAddressesFromWebhookResponse +> = z + .object({ + result: components.ListWebhookAddressesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetAddressesFromWebhookResponse$ { + /** @deprecated use `GetAddressesFromWebhookResponse$inboundSchema` instead. */ + export const inboundSchema = GetAddressesFromWebhookResponse$inboundSchema; + /** @deprecated use `GetAddressesFromWebhookResponse$outboundSchema` instead. */ + export const outboundSchema = GetAddressesFromWebhookResponse$outboundSchema; + /** @deprecated use `GetAddressesFromWebhookResponse$Outbound` instead. */ + export type Outbound = GetAddressesFromWebhookResponse$Outbound; +} diff --git a/src/models/operations/getapilogs.ts b/src/models/operations/getapilogs.ts new file mode 100644 index 0000000..6abb3f3 --- /dev/null +++ b/src/models/operations/getapilogs.ts @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +/** + * Filter data by request type. + */ +export const QueryParamRequestType = { + GlacierAPIRequest: "Glacier API Request", + GlacierRPCRequest: "Glacier RPC Request", +} as const; +/** + * Filter data by request type. + */ +export type QueryParamRequestType = ClosedEnum; + +export type GetApiLogsRequest = { + /** + * Organization ID to fetch usage metrics for + */ + orgId?: string | undefined; + /** + * Query param for retrieving items after a specific timestamp. + */ + startTimestamp?: number | undefined; + /** + * Query param for retrieving items before a specific timestamp. + */ + endTimestamp?: number | undefined; + /** + * Filter data by request path. + */ + requestPath?: string | undefined; + /** + * Filter data by request type. + */ + requestType?: QueryParamRequestType | undefined; + /** + * Filter data by response status code. + */ + responseStatusCode?: string | undefined; + /** + * Filter data by chain ID. + */ + chainId?: string | undefined; + /** + * Filter data by API key ID. + */ + apiKeyId?: string | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. + */ + pageSize?: number | undefined; +}; + +export type GetApiLogsResponse = { + result: components.LogsResponseDTO; +}; + +/** @internal */ +export const QueryParamRequestType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamRequestType); + +/** @internal */ +export const QueryParamRequestType$outboundSchema: z.ZodNativeEnum = + QueryParamRequestType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryParamRequestType$ { + /** @deprecated use `QueryParamRequestType$inboundSchema` instead. */ + export const inboundSchema = QueryParamRequestType$inboundSchema; + /** @deprecated use `QueryParamRequestType$outboundSchema` instead. */ + export const outboundSchema = QueryParamRequestType$outboundSchema; +} + +/** @internal */ +export const GetApiLogsRequest$inboundSchema: z.ZodType = + z.object({ + orgId: z.string().optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + requestPath: z.string().optional(), + requestType: QueryParamRequestType$inboundSchema.optional(), + responseStatusCode: z.string().optional(), + chainId: z.string().optional(), + apiKeyId: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + }); + +/** @internal */ +export type GetApiLogsRequest$Outbound = { + orgId?: string | undefined; + startTimestamp?: number | undefined; + endTimestamp?: number | undefined; + requestPath?: string | undefined; + requestType?: string | undefined; + responseStatusCode?: string | undefined; + chainId?: string | undefined; + apiKeyId?: string | undefined; + pageToken?: string | undefined; + pageSize: number; +}; + +/** @internal */ +export const GetApiLogsRequest$outboundSchema: z.ZodType< + GetApiLogsRequest$Outbound, + z.ZodTypeDef, + GetApiLogsRequest +> = z.object({ + orgId: z.string().optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + requestPath: z.string().optional(), + requestType: QueryParamRequestType$outboundSchema.optional(), + responseStatusCode: z.string().optional(), + chainId: z.string().optional(), + apiKeyId: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetApiLogsRequest$ { + /** @deprecated use `GetApiLogsRequest$inboundSchema` instead. */ + export const inboundSchema = GetApiLogsRequest$inboundSchema; + /** @deprecated use `GetApiLogsRequest$outboundSchema` instead. */ + export const outboundSchema = GetApiLogsRequest$outboundSchema; + /** @deprecated use `GetApiLogsRequest$Outbound` instead. */ + export type Outbound = GetApiLogsRequest$Outbound; +} + +/** @internal */ +export const GetApiLogsResponse$inboundSchema: z.ZodType< + GetApiLogsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.LogsResponseDTO$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type GetApiLogsResponse$Outbound = { + Result: components.LogsResponseDTO$Outbound; +}; + +/** @internal */ +export const GetApiLogsResponse$outboundSchema: z.ZodType< + GetApiLogsResponse$Outbound, + z.ZodTypeDef, + GetApiLogsResponse +> = z + .object({ + result: components.LogsResponseDTO$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetApiLogsResponse$ { + /** @deprecated use `GetApiLogsResponse$inboundSchema` instead. */ + export const inboundSchema = GetApiLogsResponse$inboundSchema; + /** @deprecated use `GetApiLogsResponse$outboundSchema` instead. */ + export const outboundSchema = GetApiLogsResponse$outboundSchema; + /** @deprecated use `GetApiLogsResponse$Outbound` instead. */ + export type Outbound = GetApiLogsResponse$Outbound; +} diff --git a/src/models/operations/getapiusagemetrics.ts b/src/models/operations/getapiusagemetrics.ts new file mode 100644 index 0000000..3244133 --- /dev/null +++ b/src/models/operations/getapiusagemetrics.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClosedEnum } from "../../types/enums.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +/** + * Filter data by request type. + */ +export const RequestType = { + GlacierAPIRequest: "Glacier API Request", + GlacierRPCRequest: "Glacier RPC Request", +} as const; +/** + * Filter data by request type. + */ +export type RequestType = ClosedEnum; + +export type GetApiUsageMetricsRequest = { + /** + * Organization ID to fetch usage metrics for + */ + orgId?: string | undefined; + /** + * Query param for retrieving items after a specific timestamp. + */ + startTimestamp?: number | undefined; + /** + * Query param for retrieving items before a specific timestamp. + */ + endTimestamp?: number | undefined; + /** + * Time interval granularity for data aggregation + */ + timeInterval?: components.TimeIntervalGranularityExtended | undefined; + /** + * Query param for the criterion used for grouping metrics + */ + groupBy?: components.UsageMetricsGroupByEnum | undefined; + /** + * Filter data by request path. + */ + requestPath?: string | undefined; + /** + * Filter data by request type. + */ + requestType?: RequestType | undefined; + /** + * Filter data by response status code. + */ + responseStatusCode?: string | undefined; + /** + * Filter data by chain ID. + */ + chainId?: string | undefined; + /** + * Filter data by API key ID. + */ + apiKeyId?: string | undefined; +}; + +/** @internal */ +export const RequestType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(RequestType); + +/** @internal */ +export const RequestType$outboundSchema: z.ZodNativeEnum = + RequestType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RequestType$ { + /** @deprecated use `RequestType$inboundSchema` instead. */ + export const inboundSchema = RequestType$inboundSchema; + /** @deprecated use `RequestType$outboundSchema` instead. */ + export const outboundSchema = RequestType$outboundSchema; +} + +/** @internal */ +export const GetApiUsageMetricsRequest$inboundSchema: z.ZodType< + GetApiUsageMetricsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + orgId: z.string().optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + timeInterval: components.TimeIntervalGranularityExtended$inboundSchema.optional(), + groupBy: components.UsageMetricsGroupByEnum$inboundSchema.optional(), + requestPath: z.string().optional(), + requestType: RequestType$inboundSchema.optional(), + responseStatusCode: z.string().optional(), + chainId: z.string().optional(), + apiKeyId: z.string().optional(), +}); + +/** @internal */ +export type GetApiUsageMetricsRequest$Outbound = { + orgId?: string | undefined; + startTimestamp?: number | undefined; + endTimestamp?: number | undefined; + timeInterval?: string | undefined; + groupBy?: string | undefined; + requestPath?: string | undefined; + requestType?: string | undefined; + responseStatusCode?: string | undefined; + chainId?: string | undefined; + apiKeyId?: string | undefined; +}; + +/** @internal */ +export const GetApiUsageMetricsRequest$outboundSchema: z.ZodType< + GetApiUsageMetricsRequest$Outbound, + z.ZodTypeDef, + GetApiUsageMetricsRequest +> = z.object({ + orgId: z.string().optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + timeInterval: components.TimeIntervalGranularityExtended$outboundSchema.optional(), + groupBy: components.UsageMetricsGroupByEnum$outboundSchema.optional(), + requestPath: z.string().optional(), + requestType: RequestType$outboundSchema.optional(), + responseStatusCode: z.string().optional(), + chainId: z.string().optional(), + apiKeyId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetApiUsageMetricsRequest$ { + /** @deprecated use `GetApiUsageMetricsRequest$inboundSchema` instead. */ + export const inboundSchema = GetApiUsageMetricsRequest$inboundSchema; + /** @deprecated use `GetApiUsageMetricsRequest$outboundSchema` instead. */ + export const outboundSchema = GetApiUsageMetricsRequest$outboundSchema; + /** @deprecated use `GetApiUsageMetricsRequest$Outbound` instead. */ + export type Outbound = GetApiUsageMetricsRequest$Outbound; +} diff --git a/src/models/operations/getassetdetails.ts b/src/models/operations/getassetdetails.ts new file mode 100644 index 0000000..359390a --- /dev/null +++ b/src/models/operations/getassetdetails.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetAssetDetailsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetAssetDetailsRequest = { + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.XChainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * Asset ID for any asset on X-Chain + */ + assetId: string; +}; + +/** @internal */ +export const GetAssetDetailsGlobals$inboundSchema: z.ZodType< + GetAssetDetailsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetAssetDetailsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetAssetDetailsGlobals$outboundSchema: z.ZodType< + GetAssetDetailsGlobals$Outbound, + z.ZodTypeDef, + GetAssetDetailsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetAssetDetailsGlobals$ { + /** @deprecated use `GetAssetDetailsGlobals$inboundSchema` instead. */ + export const inboundSchema = GetAssetDetailsGlobals$inboundSchema; + /** @deprecated use `GetAssetDetailsGlobals$outboundSchema` instead. */ + export const outboundSchema = GetAssetDetailsGlobals$outboundSchema; + /** @deprecated use `GetAssetDetailsGlobals$Outbound` instead. */ + export type Outbound = GetAssetDetailsGlobals$Outbound; +} + +/** @internal */ +export const GetAssetDetailsRequest$inboundSchema: z.ZodType< + GetAssetDetailsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + blockchainId: components.XChainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + assetId: z.string(), +}); + +/** @internal */ +export type GetAssetDetailsRequest$Outbound = { + blockchainId: string; + network?: string | undefined; + assetId: string; +}; + +/** @internal */ +export const GetAssetDetailsRequest$outboundSchema: z.ZodType< + GetAssetDetailsRequest$Outbound, + z.ZodTypeDef, + GetAssetDetailsRequest +> = z.object({ + blockchainId: components.XChainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + assetId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetAssetDetailsRequest$ { + /** @deprecated use `GetAssetDetailsRequest$inboundSchema` instead. */ + export const inboundSchema = GetAssetDetailsRequest$inboundSchema; + /** @deprecated use `GetAssetDetailsRequest$outboundSchema` instead. */ + export const outboundSchema = GetAssetDetailsRequest$outboundSchema; + /** @deprecated use `GetAssetDetailsRequest$Outbound` instead. */ + export type Outbound = GetAssetDetailsRequest$Outbound; +} diff --git a/src/models/operations/getbalancesbyaddresses.ts b/src/models/operations/getbalancesbyaddresses.ts new file mode 100644 index 0000000..3d5c1ba --- /dev/null +++ b/src/models/operations/getbalancesbyaddresses.ts @@ -0,0 +1,162 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetBalancesByAddressesGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetBalancesByAddressesRequest = { + /** + * An epoch timestamp in seconds. Balance will be calculated at this timestamp. + */ + blockTimestamp?: number | undefined; + /** + * A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". + */ + addresses?: string | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.BlockchainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +/** + * Successful response + */ +export type GetBalancesByAddressesResponseBody = + | components.ListPChainBalancesResponse + | components.ListXChainBalancesResponse + | components.ListCChainAtomicBalancesResponse; + +/** @internal */ +export const GetBalancesByAddressesGlobals$inboundSchema: z.ZodType< + GetBalancesByAddressesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetBalancesByAddressesGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetBalancesByAddressesGlobals$outboundSchema: z.ZodType< + GetBalancesByAddressesGlobals$Outbound, + z.ZodTypeDef, + GetBalancesByAddressesGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBalancesByAddressesGlobals$ { + /** @deprecated use `GetBalancesByAddressesGlobals$inboundSchema` instead. */ + export const inboundSchema = GetBalancesByAddressesGlobals$inboundSchema; + /** @deprecated use `GetBalancesByAddressesGlobals$outboundSchema` instead. */ + export const outboundSchema = GetBalancesByAddressesGlobals$outboundSchema; + /** @deprecated use `GetBalancesByAddressesGlobals$Outbound` instead. */ + export type Outbound = GetBalancesByAddressesGlobals$Outbound; +} + +/** @internal */ +export const GetBalancesByAddressesRequest$inboundSchema: z.ZodType< + GetBalancesByAddressesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + blockTimestamp: z.number().int().optional(), + addresses: z.string().optional(), + blockchainId: components.BlockchainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetBalancesByAddressesRequest$Outbound = { + blockTimestamp?: number | undefined; + addresses?: string | undefined; + blockchainId: string; + network?: string | undefined; +}; + +/** @internal */ +export const GetBalancesByAddressesRequest$outboundSchema: z.ZodType< + GetBalancesByAddressesRequest$Outbound, + z.ZodTypeDef, + GetBalancesByAddressesRequest +> = z.object({ + blockTimestamp: z.number().int().optional(), + addresses: z.string().optional(), + blockchainId: components.BlockchainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBalancesByAddressesRequest$ { + /** @deprecated use `GetBalancesByAddressesRequest$inboundSchema` instead. */ + export const inboundSchema = GetBalancesByAddressesRequest$inboundSchema; + /** @deprecated use `GetBalancesByAddressesRequest$outboundSchema` instead. */ + export const outboundSchema = GetBalancesByAddressesRequest$outboundSchema; + /** @deprecated use `GetBalancesByAddressesRequest$Outbound` instead. */ + export type Outbound = GetBalancesByAddressesRequest$Outbound; +} + +/** @internal */ +export const GetBalancesByAddressesResponseBody$inboundSchema: z.ZodType< + GetBalancesByAddressesResponseBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.ListPChainBalancesResponse$inboundSchema, + components.ListXChainBalancesResponse$inboundSchema, + components.ListCChainAtomicBalancesResponse$inboundSchema, +]); + +/** @internal */ +export type GetBalancesByAddressesResponseBody$Outbound = + | components.ListPChainBalancesResponse$Outbound + | components.ListXChainBalancesResponse$Outbound + | components.ListCChainAtomicBalancesResponse$Outbound; + +/** @internal */ +export const GetBalancesByAddressesResponseBody$outboundSchema: z.ZodType< + GetBalancesByAddressesResponseBody$Outbound, + z.ZodTypeDef, + GetBalancesByAddressesResponseBody +> = z.union([ + components.ListPChainBalancesResponse$outboundSchema, + components.ListXChainBalancesResponse$outboundSchema, + components.ListCChainAtomicBalancesResponse$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBalancesByAddressesResponseBody$ { + /** @deprecated use `GetBalancesByAddressesResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetBalancesByAddressesResponseBody$inboundSchema; + /** @deprecated use `GetBalancesByAddressesResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetBalancesByAddressesResponseBody$outboundSchema; + /** @deprecated use `GetBalancesByAddressesResponseBody$Outbound` instead. */ + export type Outbound = GetBalancesByAddressesResponseBody$Outbound; +} diff --git a/src/models/operations/getblock.ts b/src/models/operations/getblock.ts new file mode 100644 index 0000000..4add039 --- /dev/null +++ b/src/models/operations/getblock.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetBlockGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetBlockRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A block identifier which is either a block number or the block hash. + */ + blockId: string; +}; + +/** @internal */ +export const GetBlockGlobals$inboundSchema: z.ZodType = + z.object({ + chainId: z.string().optional(), + }); + +/** @internal */ +export type GetBlockGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetBlockGlobals$outboundSchema: z.ZodType< + GetBlockGlobals$Outbound, + z.ZodTypeDef, + GetBlockGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBlockGlobals$ { + /** @deprecated use `GetBlockGlobals$inboundSchema` instead. */ + export const inboundSchema = GetBlockGlobals$inboundSchema; + /** @deprecated use `GetBlockGlobals$outboundSchema` instead. */ + export const outboundSchema = GetBlockGlobals$outboundSchema; + /** @deprecated use `GetBlockGlobals$Outbound` instead. */ + export type Outbound = GetBlockGlobals$Outbound; +} + +/** @internal */ +export const GetBlockRequest$inboundSchema: z.ZodType = + z.object({ + chainId: z.string().optional(), + blockId: z.string(), + }); + +/** @internal */ +export type GetBlockRequest$Outbound = { + chainId?: string | undefined; + blockId: string; +}; + +/** @internal */ +export const GetBlockRequest$outboundSchema: z.ZodType< + GetBlockRequest$Outbound, + z.ZodTypeDef, + GetBlockRequest +> = z.object({ + chainId: z.string().optional(), + blockId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBlockRequest$ { + /** @deprecated use `GetBlockRequest$inboundSchema` instead. */ + export const inboundSchema = GetBlockRequest$inboundSchema; + /** @deprecated use `GetBlockRequest$outboundSchema` instead. */ + export const outboundSchema = GetBlockRequest$outboundSchema; + /** @deprecated use `GetBlockRequest$Outbound` instead. */ + export type Outbound = GetBlockRequest$Outbound; +} diff --git a/src/models/operations/getblockbyid.ts b/src/models/operations/getblockbyid.ts new file mode 100644 index 0000000..51353a3 --- /dev/null +++ b/src/models/operations/getblockbyid.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetBlockByIdGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetBlockByIdRequest = { + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.BlockchainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * A block identifier which is either a block number or the block hash. + */ + blockId: string; +}; + +/** @internal */ +export const GetBlockByIdGlobals$inboundSchema: z.ZodType< + GetBlockByIdGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetBlockByIdGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetBlockByIdGlobals$outboundSchema: z.ZodType< + GetBlockByIdGlobals$Outbound, + z.ZodTypeDef, + GetBlockByIdGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBlockByIdGlobals$ { + /** @deprecated use `GetBlockByIdGlobals$inboundSchema` instead. */ + export const inboundSchema = GetBlockByIdGlobals$inboundSchema; + /** @deprecated use `GetBlockByIdGlobals$outboundSchema` instead. */ + export const outboundSchema = GetBlockByIdGlobals$outboundSchema; + /** @deprecated use `GetBlockByIdGlobals$Outbound` instead. */ + export type Outbound = GetBlockByIdGlobals$Outbound; +} + +/** @internal */ +export const GetBlockByIdRequest$inboundSchema: z.ZodType< + GetBlockByIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + blockchainId: components.BlockchainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + blockId: z.string(), +}); + +/** @internal */ +export type GetBlockByIdRequest$Outbound = { + blockchainId: string; + network?: string | undefined; + blockId: string; +}; + +/** @internal */ +export const GetBlockByIdRequest$outboundSchema: z.ZodType< + GetBlockByIdRequest$Outbound, + z.ZodTypeDef, + GetBlockByIdRequest +> = z.object({ + blockchainId: components.BlockchainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + blockId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBlockByIdRequest$ { + /** @deprecated use `GetBlockByIdRequest$inboundSchema` instead. */ + export const inboundSchema = GetBlockByIdRequest$inboundSchema; + /** @deprecated use `GetBlockByIdRequest$outboundSchema` instead. */ + export const outboundSchema = GetBlockByIdRequest$outboundSchema; + /** @deprecated use `GetBlockByIdRequest$Outbound` instead. */ + export type Outbound = GetBlockByIdRequest$Outbound; +} diff --git a/src/models/operations/getchainidsforaddresses.ts b/src/models/operations/getchainidsforaddresses.ts new file mode 100644 index 0000000..a7121fa --- /dev/null +++ b/src/models/operations/getchainidsforaddresses.ts @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetChainIdsForAddressesGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetChainIdsForAddressesRequest = { + /** + * A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". + */ + addresses: string; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +/** @internal */ +export const GetChainIdsForAddressesGlobals$inboundSchema: z.ZodType< + GetChainIdsForAddressesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetChainIdsForAddressesGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetChainIdsForAddressesGlobals$outboundSchema: z.ZodType< + GetChainIdsForAddressesGlobals$Outbound, + z.ZodTypeDef, + GetChainIdsForAddressesGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetChainIdsForAddressesGlobals$ { + /** @deprecated use `GetChainIdsForAddressesGlobals$inboundSchema` instead. */ + export const inboundSchema = GetChainIdsForAddressesGlobals$inboundSchema; + /** @deprecated use `GetChainIdsForAddressesGlobals$outboundSchema` instead. */ + export const outboundSchema = GetChainIdsForAddressesGlobals$outboundSchema; + /** @deprecated use `GetChainIdsForAddressesGlobals$Outbound` instead. */ + export type Outbound = GetChainIdsForAddressesGlobals$Outbound; +} + +/** @internal */ +export const GetChainIdsForAddressesRequest$inboundSchema: z.ZodType< + GetChainIdsForAddressesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.string(), + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetChainIdsForAddressesRequest$Outbound = { + addresses: string; + network?: string | undefined; +}; + +/** @internal */ +export const GetChainIdsForAddressesRequest$outboundSchema: z.ZodType< + GetChainIdsForAddressesRequest$Outbound, + z.ZodTypeDef, + GetChainIdsForAddressesRequest +> = z.object({ + addresses: z.string(), + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetChainIdsForAddressesRequest$ { + /** @deprecated use `GetChainIdsForAddressesRequest$inboundSchema` instead. */ + export const inboundSchema = GetChainIdsForAddressesRequest$inboundSchema; + /** @deprecated use `GetChainIdsForAddressesRequest$outboundSchema` instead. */ + export const outboundSchema = GetChainIdsForAddressesRequest$outboundSchema; + /** @deprecated use `GetChainIdsForAddressesRequest$Outbound` instead. */ + export type Outbound = GetChainIdsForAddressesRequest$Outbound; +} diff --git a/src/models/operations/getchaininfo.ts b/src/models/operations/getchaininfo.ts new file mode 100644 index 0000000..cbaac5e --- /dev/null +++ b/src/models/operations/getchaininfo.ts @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetChainInfoGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetChainInfoRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; +}; + +/** @internal */ +export const GetChainInfoGlobals$inboundSchema: z.ZodType< + GetChainInfoGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetChainInfoGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetChainInfoGlobals$outboundSchema: z.ZodType< + GetChainInfoGlobals$Outbound, + z.ZodTypeDef, + GetChainInfoGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetChainInfoGlobals$ { + /** @deprecated use `GetChainInfoGlobals$inboundSchema` instead. */ + export const inboundSchema = GetChainInfoGlobals$inboundSchema; + /** @deprecated use `GetChainInfoGlobals$outboundSchema` instead. */ + export const outboundSchema = GetChainInfoGlobals$outboundSchema; + /** @deprecated use `GetChainInfoGlobals$Outbound` instead. */ + export type Outbound = GetChainInfoGlobals$Outbound; +} + +/** @internal */ +export const GetChainInfoRequest$inboundSchema: z.ZodType< + GetChainInfoRequest, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetChainInfoRequest$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetChainInfoRequest$outboundSchema: z.ZodType< + GetChainInfoRequest$Outbound, + z.ZodTypeDef, + GetChainInfoRequest +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetChainInfoRequest$ { + /** @deprecated use `GetChainInfoRequest$inboundSchema` instead. */ + export const inboundSchema = GetChainInfoRequest$inboundSchema; + /** @deprecated use `GetChainInfoRequest$outboundSchema` instead. */ + export const outboundSchema = GetChainInfoRequest$outboundSchema; + /** @deprecated use `GetChainInfoRequest$Outbound` instead. */ + export type Outbound = GetChainInfoRequest$Outbound; +} diff --git a/src/models/operations/getcontractmetadata.ts b/src/models/operations/getcontractmetadata.ts new file mode 100644 index 0000000..41c5894 --- /dev/null +++ b/src/models/operations/getcontractmetadata.ts @@ -0,0 +1,168 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetContractMetadataGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetContractMetadataRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * Contract address on the relevant chain. + */ + address: string; +}; + +/** + * Successful response + */ +export type GetContractMetadataResponseBody = + | (components.UnknownContract & { ercType: "UNKNOWN" }) + | (components.Erc721Contract & { ercType: "ERC-721" }) + | (components.Erc1155Contract & { ercType: "ERC-1155" }) + | (components.Erc20Contract & { ercType: "ERC-20" }); + +/** @internal */ +export const GetContractMetadataGlobals$inboundSchema: z.ZodType< + GetContractMetadataGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetContractMetadataGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetContractMetadataGlobals$outboundSchema: z.ZodType< + GetContractMetadataGlobals$Outbound, + z.ZodTypeDef, + GetContractMetadataGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetContractMetadataGlobals$ { + /** @deprecated use `GetContractMetadataGlobals$inboundSchema` instead. */ + export const inboundSchema = GetContractMetadataGlobals$inboundSchema; + /** @deprecated use `GetContractMetadataGlobals$outboundSchema` instead. */ + export const outboundSchema = GetContractMetadataGlobals$outboundSchema; + /** @deprecated use `GetContractMetadataGlobals$Outbound` instead. */ + export type Outbound = GetContractMetadataGlobals$Outbound; +} + +/** @internal */ +export const GetContractMetadataRequest$inboundSchema: z.ZodType< + GetContractMetadataRequest, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type GetContractMetadataRequest$Outbound = { + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const GetContractMetadataRequest$outboundSchema: z.ZodType< + GetContractMetadataRequest$Outbound, + z.ZodTypeDef, + GetContractMetadataRequest +> = z.object({ + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetContractMetadataRequest$ { + /** @deprecated use `GetContractMetadataRequest$inboundSchema` instead. */ + export const inboundSchema = GetContractMetadataRequest$inboundSchema; + /** @deprecated use `GetContractMetadataRequest$outboundSchema` instead. */ + export const outboundSchema = GetContractMetadataRequest$outboundSchema; + /** @deprecated use `GetContractMetadataRequest$Outbound` instead. */ + export type Outbound = GetContractMetadataRequest$Outbound; +} + +/** @internal */ +export const GetContractMetadataResponseBody$inboundSchema: z.ZodType< + GetContractMetadataResponseBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.UnknownContract$inboundSchema.and( + z.object({ ercType: z.literal("UNKNOWN") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc721Contract$inboundSchema.and( + z.object({ ercType: z.literal("ERC-721") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc1155Contract$inboundSchema.and( + z.object({ ercType: z.literal("ERC-1155") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc20Contract$inboundSchema.and( + z.object({ ercType: z.literal("ERC-20") }).transform((v) => ({ ercType: v.ercType })) + ), +]); + +/** @internal */ +export type GetContractMetadataResponseBody$Outbound = + | (components.UnknownContract$Outbound & { ercType: "UNKNOWN" }) + | (components.Erc721Contract$Outbound & { ercType: "ERC-721" }) + | (components.Erc1155Contract$Outbound & { ercType: "ERC-1155" }) + | (components.Erc20Contract$Outbound & { ercType: "ERC-20" }); + +/** @internal */ +export const GetContractMetadataResponseBody$outboundSchema: z.ZodType< + GetContractMetadataResponseBody$Outbound, + z.ZodTypeDef, + GetContractMetadataResponseBody +> = z.union([ + components.UnknownContract$outboundSchema.and( + z.object({ ercType: z.literal("UNKNOWN") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc721Contract$outboundSchema.and( + z.object({ ercType: z.literal("ERC-721") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc1155Contract$outboundSchema.and( + z.object({ ercType: z.literal("ERC-1155") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc20Contract$outboundSchema.and( + z.object({ ercType: z.literal("ERC-20") }).transform((v) => ({ ercType: v.ercType })) + ), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetContractMetadataResponseBody$ { + /** @deprecated use `GetContractMetadataResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetContractMetadataResponseBody$inboundSchema; + /** @deprecated use `GetContractMetadataResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetContractMetadataResponseBody$outboundSchema; + /** @deprecated use `GetContractMetadataResponseBody$Outbound` instead. */ + export type Outbound = GetContractMetadataResponseBody$Outbound; +} diff --git a/src/models/operations/getdeploymenttransaction.ts b/src/models/operations/getdeploymenttransaction.ts new file mode 100644 index 0000000..d2d707c --- /dev/null +++ b/src/models/operations/getdeploymenttransaction.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetDeploymentTransactionGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetDeploymentTransactionRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * Contract address on the relevant chain. + */ + address: string; + /** + * The currency that return values should use. Defaults to USD. + */ + currency?: components.CurrencyCode | undefined; +}; + +/** @internal */ +export const GetDeploymentTransactionGlobals$inboundSchema: z.ZodType< + GetDeploymentTransactionGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetDeploymentTransactionGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetDeploymentTransactionGlobals$outboundSchema: z.ZodType< + GetDeploymentTransactionGlobals$Outbound, + z.ZodTypeDef, + GetDeploymentTransactionGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetDeploymentTransactionGlobals$ { + /** @deprecated use `GetDeploymentTransactionGlobals$inboundSchema` instead. */ + export const inboundSchema = GetDeploymentTransactionGlobals$inboundSchema; + /** @deprecated use `GetDeploymentTransactionGlobals$outboundSchema` instead. */ + export const outboundSchema = GetDeploymentTransactionGlobals$outboundSchema; + /** @deprecated use `GetDeploymentTransactionGlobals$Outbound` instead. */ + export type Outbound = GetDeploymentTransactionGlobals$Outbound; +} + +/** @internal */ +export const GetDeploymentTransactionRequest$inboundSchema: z.ZodType< + GetDeploymentTransactionRequest, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), + address: z.string(), + currency: components.CurrencyCode$inboundSchema.optional(), +}); + +/** @internal */ +export type GetDeploymentTransactionRequest$Outbound = { + chainId?: string | undefined; + address: string; + currency?: string | undefined; +}; + +/** @internal */ +export const GetDeploymentTransactionRequest$outboundSchema: z.ZodType< + GetDeploymentTransactionRequest$Outbound, + z.ZodTypeDef, + GetDeploymentTransactionRequest +> = z.object({ + chainId: z.string().optional(), + address: z.string(), + currency: components.CurrencyCode$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetDeploymentTransactionRequest$ { + /** @deprecated use `GetDeploymentTransactionRequest$inboundSchema` instead. */ + export const inboundSchema = GetDeploymentTransactionRequest$inboundSchema; + /** @deprecated use `GetDeploymentTransactionRequest$outboundSchema` instead. */ + export const outboundSchema = GetDeploymentTransactionRequest$outboundSchema; + /** @deprecated use `GetDeploymentTransactionRequest$Outbound` instead. */ + export type Outbound = GetDeploymentTransactionRequest$Outbound; +} diff --git a/src/models/operations/getlatestblocks.ts b/src/models/operations/getlatestblocks.ts new file mode 100644 index 0000000..353ce7e --- /dev/null +++ b/src/models/operations/getlatestblocks.ts @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetLatestBlocksGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetLatestBlocksRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; +}; + +export type GetLatestBlocksResponse = { + result: components.ListEvmBlocksResponse; +}; + +/** @internal */ +export const GetLatestBlocksGlobals$inboundSchema: z.ZodType< + GetLatestBlocksGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetLatestBlocksGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetLatestBlocksGlobals$outboundSchema: z.ZodType< + GetLatestBlocksGlobals$Outbound, + z.ZodTypeDef, + GetLatestBlocksGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLatestBlocksGlobals$ { + /** @deprecated use `GetLatestBlocksGlobals$inboundSchema` instead. */ + export const inboundSchema = GetLatestBlocksGlobals$inboundSchema; + /** @deprecated use `GetLatestBlocksGlobals$outboundSchema` instead. */ + export const outboundSchema = GetLatestBlocksGlobals$outboundSchema; + /** @deprecated use `GetLatestBlocksGlobals$Outbound` instead. */ + export type Outbound = GetLatestBlocksGlobals$Outbound; +} + +/** @internal */ +export const GetLatestBlocksRequest$inboundSchema: z.ZodType< + GetLatestBlocksRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetLatestBlocksRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; +}; + +/** @internal */ +export const GetLatestBlocksRequest$outboundSchema: z.ZodType< + GetLatestBlocksRequest$Outbound, + z.ZodTypeDef, + GetLatestBlocksRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLatestBlocksRequest$ { + /** @deprecated use `GetLatestBlocksRequest$inboundSchema` instead. */ + export const inboundSchema = GetLatestBlocksRequest$inboundSchema; + /** @deprecated use `GetLatestBlocksRequest$outboundSchema` instead. */ + export const outboundSchema = GetLatestBlocksRequest$outboundSchema; + /** @deprecated use `GetLatestBlocksRequest$Outbound` instead. */ + export type Outbound = GetLatestBlocksRequest$Outbound; +} + +/** @internal */ +export const GetLatestBlocksResponse$inboundSchema: z.ZodType< + GetLatestBlocksResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListEvmBlocksResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type GetLatestBlocksResponse$Outbound = { + Result: components.ListEvmBlocksResponse$Outbound; +}; + +/** @internal */ +export const GetLatestBlocksResponse$outboundSchema: z.ZodType< + GetLatestBlocksResponse$Outbound, + z.ZodTypeDef, + GetLatestBlocksResponse +> = z + .object({ + result: components.ListEvmBlocksResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLatestBlocksResponse$ { + /** @deprecated use `GetLatestBlocksResponse$inboundSchema` instead. */ + export const inboundSchema = GetLatestBlocksResponse$inboundSchema; + /** @deprecated use `GetLatestBlocksResponse$outboundSchema` instead. */ + export const outboundSchema = GetLatestBlocksResponse$outboundSchema; + /** @deprecated use `GetLatestBlocksResponse$Outbound` instead. */ + export type Outbound = GetLatestBlocksResponse$Outbound; +} diff --git a/src/models/operations/getnativebalance.ts b/src/models/operations/getnativebalance.ts new file mode 100644 index 0000000..ba862bb --- /dev/null +++ b/src/models/operations/getnativebalance.ts @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetNativeBalanceGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetNativeBalanceRequest = { + /** + * The block number, if not defined the block number will be the latest block. + */ + blockNumber?: string | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; + /** + * The currency that return values should use. Defaults to USD. + */ + currency?: components.CurrencyCode | undefined; +}; + +/** @internal */ +export const GetNativeBalanceGlobals$inboundSchema: z.ZodType< + GetNativeBalanceGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetNativeBalanceGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetNativeBalanceGlobals$outboundSchema: z.ZodType< + GetNativeBalanceGlobals$Outbound, + z.ZodTypeDef, + GetNativeBalanceGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetNativeBalanceGlobals$ { + /** @deprecated use `GetNativeBalanceGlobals$inboundSchema` instead. */ + export const inboundSchema = GetNativeBalanceGlobals$inboundSchema; + /** @deprecated use `GetNativeBalanceGlobals$outboundSchema` instead. */ + export const outboundSchema = GetNativeBalanceGlobals$outboundSchema; + /** @deprecated use `GetNativeBalanceGlobals$Outbound` instead. */ + export type Outbound = GetNativeBalanceGlobals$Outbound; +} + +/** @internal */ +export const GetNativeBalanceRequest$inboundSchema: z.ZodType< + GetNativeBalanceRequest, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string().optional(), + chainId: z.string().optional(), + address: z.string(), + currency: components.CurrencyCode$inboundSchema.optional(), +}); + +/** @internal */ +export type GetNativeBalanceRequest$Outbound = { + blockNumber?: string | undefined; + chainId?: string | undefined; + address: string; + currency?: string | undefined; +}; + +/** @internal */ +export const GetNativeBalanceRequest$outboundSchema: z.ZodType< + GetNativeBalanceRequest$Outbound, + z.ZodTypeDef, + GetNativeBalanceRequest +> = z.object({ + blockNumber: z.string().optional(), + chainId: z.string().optional(), + address: z.string(), + currency: components.CurrencyCode$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetNativeBalanceRequest$ { + /** @deprecated use `GetNativeBalanceRequest$inboundSchema` instead. */ + export const inboundSchema = GetNativeBalanceRequest$inboundSchema; + /** @deprecated use `GetNativeBalanceRequest$outboundSchema` instead. */ + export const outboundSchema = GetNativeBalanceRequest$outboundSchema; + /** @deprecated use `GetNativeBalanceRequest$Outbound` instead. */ + export type Outbound = GetNativeBalanceRequest$Outbound; +} diff --git a/src/models/operations/getnetworkdetails.ts b/src/models/operations/getnetworkdetails.ts new file mode 100644 index 0000000..d65e226 --- /dev/null +++ b/src/models/operations/getnetworkdetails.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetNetworkDetailsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetNetworkDetailsRequest = { + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +/** @internal */ +export const GetNetworkDetailsGlobals$inboundSchema: z.ZodType< + GetNetworkDetailsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetNetworkDetailsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetNetworkDetailsGlobals$outboundSchema: z.ZodType< + GetNetworkDetailsGlobals$Outbound, + z.ZodTypeDef, + GetNetworkDetailsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetNetworkDetailsGlobals$ { + /** @deprecated use `GetNetworkDetailsGlobals$inboundSchema` instead. */ + export const inboundSchema = GetNetworkDetailsGlobals$inboundSchema; + /** @deprecated use `GetNetworkDetailsGlobals$outboundSchema` instead. */ + export const outboundSchema = GetNetworkDetailsGlobals$outboundSchema; + /** @deprecated use `GetNetworkDetailsGlobals$Outbound` instead. */ + export type Outbound = GetNetworkDetailsGlobals$Outbound; +} + +/** @internal */ +export const GetNetworkDetailsRequest$inboundSchema: z.ZodType< + GetNetworkDetailsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetNetworkDetailsRequest$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetNetworkDetailsRequest$outboundSchema: z.ZodType< + GetNetworkDetailsRequest$Outbound, + z.ZodTypeDef, + GetNetworkDetailsRequest +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetNetworkDetailsRequest$ { + /** @deprecated use `GetNetworkDetailsRequest$inboundSchema` instead. */ + export const inboundSchema = GetNetworkDetailsRequest$inboundSchema; + /** @deprecated use `GetNetworkDetailsRequest$outboundSchema` instead. */ + export const outboundSchema = GetNetworkDetailsRequest$outboundSchema; + /** @deprecated use `GetNetworkDetailsRequest$Outbound` instead. */ + export type Outbound = GetNetworkDetailsRequest$Outbound; +} diff --git a/src/models/operations/getoperationresult.ts b/src/models/operations/getoperationresult.ts new file mode 100644 index 0000000..3bcb71f --- /dev/null +++ b/src/models/operations/getoperationresult.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetOperationResultRequest = { + /** + * UUID of given operation + */ + operationId: string; +}; + +/** @internal */ +export const GetOperationResultRequest$inboundSchema: z.ZodType< + GetOperationResultRequest, + z.ZodTypeDef, + unknown +> = z.object({ + operationId: z.string(), +}); + +/** @internal */ +export type GetOperationResultRequest$Outbound = { + operationId: string; +}; + +/** @internal */ +export const GetOperationResultRequest$outboundSchema: z.ZodType< + GetOperationResultRequest$Outbound, + z.ZodTypeDef, + GetOperationResultRequest +> = z.object({ + operationId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetOperationResultRequest$ { + /** @deprecated use `GetOperationResultRequest$inboundSchema` instead. */ + export const inboundSchema = GetOperationResultRequest$inboundSchema; + /** @deprecated use `GetOperationResultRequest$outboundSchema` instead. */ + export const outboundSchema = GetOperationResultRequest$outboundSchema; + /** @deprecated use `GetOperationResultRequest$Outbound` instead. */ + export type Outbound = GetOperationResultRequest$Outbound; +} diff --git a/src/models/operations/getsinglevalidatordetails.ts b/src/models/operations/getsinglevalidatordetails.ts new file mode 100644 index 0000000..1cf03f2 --- /dev/null +++ b/src/models/operations/getsinglevalidatordetails.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetSingleValidatorDetailsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetSingleValidatorDetailsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * A primary network (P or X chain) nodeId. + */ + nodeId: string; + /** + * Validation status of the node. + */ + validationStatus?: components.ValidationStatusType | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +export type GetSingleValidatorDetailsResponse = { + result: components.ListValidatorDetailsResponse; +}; + +/** @internal */ +export const GetSingleValidatorDetailsGlobals$inboundSchema: z.ZodType< + GetSingleValidatorDetailsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetSingleValidatorDetailsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetSingleValidatorDetailsGlobals$outboundSchema: z.ZodType< + GetSingleValidatorDetailsGlobals$Outbound, + z.ZodTypeDef, + GetSingleValidatorDetailsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSingleValidatorDetailsGlobals$ { + /** @deprecated use `GetSingleValidatorDetailsGlobals$inboundSchema` instead. */ + export const inboundSchema = GetSingleValidatorDetailsGlobals$inboundSchema; + /** @deprecated use `GetSingleValidatorDetailsGlobals$outboundSchema` instead. */ + export const outboundSchema = GetSingleValidatorDetailsGlobals$outboundSchema; + /** @deprecated use `GetSingleValidatorDetailsGlobals$Outbound` instead. */ + export type Outbound = GetSingleValidatorDetailsGlobals$Outbound; +} + +/** @internal */ +export const GetSingleValidatorDetailsRequest$inboundSchema: z.ZodType< + GetSingleValidatorDetailsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$inboundSchema.optional(), + nodeId: z.string(), + validationStatus: components.ValidationStatusType$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type GetSingleValidatorDetailsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + network?: string | undefined; + nodeId: string; + validationStatus?: string | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const GetSingleValidatorDetailsRequest$outboundSchema: z.ZodType< + GetSingleValidatorDetailsRequest$Outbound, + z.ZodTypeDef, + GetSingleValidatorDetailsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$outboundSchema.optional(), + nodeId: z.string(), + validationStatus: components.ValidationStatusType$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSingleValidatorDetailsRequest$ { + /** @deprecated use `GetSingleValidatorDetailsRequest$inboundSchema` instead. */ + export const inboundSchema = GetSingleValidatorDetailsRequest$inboundSchema; + /** @deprecated use `GetSingleValidatorDetailsRequest$outboundSchema` instead. */ + export const outboundSchema = GetSingleValidatorDetailsRequest$outboundSchema; + /** @deprecated use `GetSingleValidatorDetailsRequest$Outbound` instead. */ + export type Outbound = GetSingleValidatorDetailsRequest$Outbound; +} + +/** @internal */ +export const GetSingleValidatorDetailsResponse$inboundSchema: z.ZodType< + GetSingleValidatorDetailsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListValidatorDetailsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type GetSingleValidatorDetailsResponse$Outbound = { + Result: components.ListValidatorDetailsResponse$Outbound; +}; + +/** @internal */ +export const GetSingleValidatorDetailsResponse$outboundSchema: z.ZodType< + GetSingleValidatorDetailsResponse$Outbound, + z.ZodTypeDef, + GetSingleValidatorDetailsResponse +> = z + .object({ + result: components.ListValidatorDetailsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSingleValidatorDetailsResponse$ { + /** @deprecated use `GetSingleValidatorDetailsResponse$inboundSchema` instead. */ + export const inboundSchema = GetSingleValidatorDetailsResponse$inboundSchema; + /** @deprecated use `GetSingleValidatorDetailsResponse$outboundSchema` instead. */ + export const outboundSchema = GetSingleValidatorDetailsResponse$outboundSchema; + /** @deprecated use `GetSingleValidatorDetailsResponse$Outbound` instead. */ + export type Outbound = GetSingleValidatorDetailsResponse$Outbound; +} diff --git a/src/models/operations/getsubnetbyid.ts b/src/models/operations/getsubnetbyid.ts new file mode 100644 index 0000000..dfd4d9f --- /dev/null +++ b/src/models/operations/getsubnetbyid.ts @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetSubnetByIdGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetSubnetByIdRequest = { + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * Subnet ID to fetch details for + */ + subnetId: string; +}; + +/** @internal */ +export const GetSubnetByIdGlobals$inboundSchema: z.ZodType< + GetSubnetByIdGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetSubnetByIdGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetSubnetByIdGlobals$outboundSchema: z.ZodType< + GetSubnetByIdGlobals$Outbound, + z.ZodTypeDef, + GetSubnetByIdGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSubnetByIdGlobals$ { + /** @deprecated use `GetSubnetByIdGlobals$inboundSchema` instead. */ + export const inboundSchema = GetSubnetByIdGlobals$inboundSchema; + /** @deprecated use `GetSubnetByIdGlobals$outboundSchema` instead. */ + export const outboundSchema = GetSubnetByIdGlobals$outboundSchema; + /** @deprecated use `GetSubnetByIdGlobals$Outbound` instead. */ + export type Outbound = GetSubnetByIdGlobals$Outbound; +} + +/** @internal */ +export const GetSubnetByIdRequest$inboundSchema: z.ZodType< + GetSubnetByIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), + subnetId: z.string(), +}); + +/** @internal */ +export type GetSubnetByIdRequest$Outbound = { + network?: string | undefined; + subnetId: string; +}; + +/** @internal */ +export const GetSubnetByIdRequest$outboundSchema: z.ZodType< + GetSubnetByIdRequest$Outbound, + z.ZodTypeDef, + GetSubnetByIdRequest +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), + subnetId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSubnetByIdRequest$ { + /** @deprecated use `GetSubnetByIdRequest$inboundSchema` instead. */ + export const inboundSchema = GetSubnetByIdRequest$inboundSchema; + /** @deprecated use `GetSubnetByIdRequest$outboundSchema` instead. */ + export const outboundSchema = GetSubnetByIdRequest$outboundSchema; + /** @deprecated use `GetSubnetByIdRequest$Outbound` instead. */ + export type Outbound = GetSubnetByIdRequest$Outbound; +} diff --git a/src/models/operations/getteleportermessage.ts b/src/models/operations/getteleportermessage.ts new file mode 100644 index 0000000..b77dcf5 --- /dev/null +++ b/src/models/operations/getteleportermessage.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetTeleporterMessageRequest = { + /** + * The message ID of the teleporter message. + */ + messageId: string; +}; + +/** + * Successful response + */ +export type GetTeleporterMessageResponseBody = + | (components.PendingTeleporterMessage & { status: "pending" }) + | (components.DeliveredSourceNotIndexedTeleporterMessage & { + status: "delivered_source_not_indexed"; + }) + | (components.DeliveredTeleporterMessage & { status: "delivered" }); + +/** @internal */ +export const GetTeleporterMessageRequest$inboundSchema: z.ZodType< + GetTeleporterMessageRequest, + z.ZodTypeDef, + unknown +> = z.object({ + messageId: z.string(), +}); + +/** @internal */ +export type GetTeleporterMessageRequest$Outbound = { + messageId: string; +}; + +/** @internal */ +export const GetTeleporterMessageRequest$outboundSchema: z.ZodType< + GetTeleporterMessageRequest$Outbound, + z.ZodTypeDef, + GetTeleporterMessageRequest +> = z.object({ + messageId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTeleporterMessageRequest$ { + /** @deprecated use `GetTeleporterMessageRequest$inboundSchema` instead. */ + export const inboundSchema = GetTeleporterMessageRequest$inboundSchema; + /** @deprecated use `GetTeleporterMessageRequest$outboundSchema` instead. */ + export const outboundSchema = GetTeleporterMessageRequest$outboundSchema; + /** @deprecated use `GetTeleporterMessageRequest$Outbound` instead. */ + export type Outbound = GetTeleporterMessageRequest$Outbound; +} + +/** @internal */ +export const GetTeleporterMessageResponseBody$inboundSchema: z.ZodType< + GetTeleporterMessageResponseBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.PendingTeleporterMessage$inboundSchema.and( + z.object({ status: z.literal("pending") }).transform((v) => ({ status: v.status })) + ), + components.DeliveredSourceNotIndexedTeleporterMessage$inboundSchema.and( + z + .object({ status: z.literal("delivered_source_not_indexed") }) + .transform((v) => ({ status: v.status })) + ), + components.DeliveredTeleporterMessage$inboundSchema.and( + z.object({ status: z.literal("delivered") }).transform((v) => ({ status: v.status })) + ), +]); + +/** @internal */ +export type GetTeleporterMessageResponseBody$Outbound = + | (components.PendingTeleporterMessage$Outbound & { status: "pending" }) + | (components.DeliveredSourceNotIndexedTeleporterMessage$Outbound & { + status: "delivered_source_not_indexed"; + }) + | (components.DeliveredTeleporterMessage$Outbound & { status: "delivered" }); + +/** @internal */ +export const GetTeleporterMessageResponseBody$outboundSchema: z.ZodType< + GetTeleporterMessageResponseBody$Outbound, + z.ZodTypeDef, + GetTeleporterMessageResponseBody +> = z.union([ + components.PendingTeleporterMessage$outboundSchema.and( + z.object({ status: z.literal("pending") }).transform((v) => ({ status: v.status })) + ), + components.DeliveredSourceNotIndexedTeleporterMessage$outboundSchema.and( + z + .object({ status: z.literal("delivered_source_not_indexed") }) + .transform((v) => ({ status: v.status })) + ), + components.DeliveredTeleporterMessage$outboundSchema.and( + z.object({ status: z.literal("delivered") }).transform((v) => ({ status: v.status })) + ), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTeleporterMessageResponseBody$ { + /** @deprecated use `GetTeleporterMessageResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTeleporterMessageResponseBody$inboundSchema; + /** @deprecated use `GetTeleporterMessageResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTeleporterMessageResponseBody$outboundSchema; + /** @deprecated use `GetTeleporterMessageResponseBody$Outbound` instead. */ + export type Outbound = GetTeleporterMessageResponseBody$Outbound; +} diff --git a/src/models/operations/gettokendetails.ts b/src/models/operations/gettokendetails.ts new file mode 100644 index 0000000..22b2917 --- /dev/null +++ b/src/models/operations/gettokendetails.ts @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetTokenDetailsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetTokenDetailsRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * Contract address on the relevant chain. + */ + address: string; + /** + * TokenId on the contract + */ + tokenId: string; +}; + +/** + * Successful response + */ +export type GetTokenDetailsResponseBody = + | (components.Erc1155Token & { ercType: "ERC-1155" }) + | (components.Erc721Token & { ercType: "ERC-721" }); + +/** @internal */ +export const GetTokenDetailsGlobals$inboundSchema: z.ZodType< + GetTokenDetailsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetTokenDetailsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetTokenDetailsGlobals$outboundSchema: z.ZodType< + GetTokenDetailsGlobals$Outbound, + z.ZodTypeDef, + GetTokenDetailsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTokenDetailsGlobals$ { + /** @deprecated use `GetTokenDetailsGlobals$inboundSchema` instead. */ + export const inboundSchema = GetTokenDetailsGlobals$inboundSchema; + /** @deprecated use `GetTokenDetailsGlobals$outboundSchema` instead. */ + export const outboundSchema = GetTokenDetailsGlobals$outboundSchema; + /** @deprecated use `GetTokenDetailsGlobals$Outbound` instead. */ + export type Outbound = GetTokenDetailsGlobals$Outbound; +} + +/** @internal */ +export const GetTokenDetailsRequest$inboundSchema: z.ZodType< + GetTokenDetailsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), + address: z.string(), + tokenId: z.string(), +}); + +/** @internal */ +export type GetTokenDetailsRequest$Outbound = { + chainId?: string | undefined; + address: string; + tokenId: string; +}; + +/** @internal */ +export const GetTokenDetailsRequest$outboundSchema: z.ZodType< + GetTokenDetailsRequest$Outbound, + z.ZodTypeDef, + GetTokenDetailsRequest +> = z.object({ + chainId: z.string().optional(), + address: z.string(), + tokenId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTokenDetailsRequest$ { + /** @deprecated use `GetTokenDetailsRequest$inboundSchema` instead. */ + export const inboundSchema = GetTokenDetailsRequest$inboundSchema; + /** @deprecated use `GetTokenDetailsRequest$outboundSchema` instead. */ + export const outboundSchema = GetTokenDetailsRequest$outboundSchema; + /** @deprecated use `GetTokenDetailsRequest$Outbound` instead. */ + export type Outbound = GetTokenDetailsRequest$Outbound; +} + +/** @internal */ +export const GetTokenDetailsResponseBody$inboundSchema: z.ZodType< + GetTokenDetailsResponseBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.Erc1155Token$inboundSchema.and( + z.object({ ercType: z.literal("ERC-1155") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc721Token$inboundSchema.and( + z.object({ ercType: z.literal("ERC-721") }).transform((v) => ({ ercType: v.ercType })) + ), +]); + +/** @internal */ +export type GetTokenDetailsResponseBody$Outbound = + | (components.Erc1155Token$Outbound & { ercType: "ERC-1155" }) + | (components.Erc721Token$Outbound & { ercType: "ERC-721" }); + +/** @internal */ +export const GetTokenDetailsResponseBody$outboundSchema: z.ZodType< + GetTokenDetailsResponseBody$Outbound, + z.ZodTypeDef, + GetTokenDetailsResponseBody +> = z.union([ + components.Erc1155Token$outboundSchema.and( + z.object({ ercType: z.literal("ERC-1155") }).transform((v) => ({ ercType: v.ercType })) + ), + components.Erc721Token$outboundSchema.and( + z.object({ ercType: z.literal("ERC-721") }).transform((v) => ({ ercType: v.ercType })) + ), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTokenDetailsResponseBody$ { + /** @deprecated use `GetTokenDetailsResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTokenDetailsResponseBody$inboundSchema; + /** @deprecated use `GetTokenDetailsResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTokenDetailsResponseBody$outboundSchema; + /** @deprecated use `GetTokenDetailsResponseBody$Outbound` instead. */ + export type Outbound = GetTokenDetailsResponseBody$Outbound; +} diff --git a/src/models/operations/gettransaction.ts b/src/models/operations/gettransaction.ts new file mode 100644 index 0000000..e52db64 --- /dev/null +++ b/src/models/operations/gettransaction.ts @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetTransactionGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetTransactionRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A transaction hash. + */ + txHash: string; +}; + +/** @internal */ +export const GetTransactionGlobals$inboundSchema: z.ZodType< + GetTransactionGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetTransactionGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetTransactionGlobals$outboundSchema: z.ZodType< + GetTransactionGlobals$Outbound, + z.ZodTypeDef, + GetTransactionGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTransactionGlobals$ { + /** @deprecated use `GetTransactionGlobals$inboundSchema` instead. */ + export const inboundSchema = GetTransactionGlobals$inboundSchema; + /** @deprecated use `GetTransactionGlobals$outboundSchema` instead. */ + export const outboundSchema = GetTransactionGlobals$outboundSchema; + /** @deprecated use `GetTransactionGlobals$Outbound` instead. */ + export type Outbound = GetTransactionGlobals$Outbound; +} + +/** @internal */ +export const GetTransactionRequest$inboundSchema: z.ZodType< + GetTransactionRequest, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), + txHash: z.string(), +}); + +/** @internal */ +export type GetTransactionRequest$Outbound = { + chainId?: string | undefined; + txHash: string; +}; + +/** @internal */ +export const GetTransactionRequest$outboundSchema: z.ZodType< + GetTransactionRequest$Outbound, + z.ZodTypeDef, + GetTransactionRequest +> = z.object({ + chainId: z.string().optional(), + txHash: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTransactionRequest$ { + /** @deprecated use `GetTransactionRequest$inboundSchema` instead. */ + export const inboundSchema = GetTransactionRequest$inboundSchema; + /** @deprecated use `GetTransactionRequest$outboundSchema` instead. */ + export const outboundSchema = GetTransactionRequest$outboundSchema; + /** @deprecated use `GetTransactionRequest$Outbound` instead. */ + export type Outbound = GetTransactionRequest$Outbound; +} diff --git a/src/models/operations/gettransactionsforblock.ts b/src/models/operations/gettransactionsforblock.ts new file mode 100644 index 0000000..bbb60b3 --- /dev/null +++ b/src/models/operations/gettransactionsforblock.ts @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetTransactionsForBlockGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type GetTransactionsForBlockRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A block identifier which is either a block number or the block hash. + */ + blockId: string; +}; + +/** @internal */ +export const GetTransactionsForBlockGlobals$inboundSchema: z.ZodType< + GetTransactionsForBlockGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type GetTransactionsForBlockGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const GetTransactionsForBlockGlobals$outboundSchema: z.ZodType< + GetTransactionsForBlockGlobals$Outbound, + z.ZodTypeDef, + GetTransactionsForBlockGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTransactionsForBlockGlobals$ { + /** @deprecated use `GetTransactionsForBlockGlobals$inboundSchema` instead. */ + export const inboundSchema = GetTransactionsForBlockGlobals$inboundSchema; + /** @deprecated use `GetTransactionsForBlockGlobals$outboundSchema` instead. */ + export const outboundSchema = GetTransactionsForBlockGlobals$outboundSchema; + /** @deprecated use `GetTransactionsForBlockGlobals$Outbound` instead. */ + export type Outbound = GetTransactionsForBlockGlobals$Outbound; +} + +/** @internal */ +export const GetTransactionsForBlockRequest$inboundSchema: z.ZodType< + GetTransactionsForBlockRequest, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), + blockId: z.string(), +}); + +/** @internal */ +export type GetTransactionsForBlockRequest$Outbound = { + chainId?: string | undefined; + blockId: string; +}; + +/** @internal */ +export const GetTransactionsForBlockRequest$outboundSchema: z.ZodType< + GetTransactionsForBlockRequest$Outbound, + z.ZodTypeDef, + GetTransactionsForBlockRequest +> = z.object({ + chainId: z.string().optional(), + blockId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTransactionsForBlockRequest$ { + /** @deprecated use `GetTransactionsForBlockRequest$inboundSchema` instead. */ + export const inboundSchema = GetTransactionsForBlockRequest$inboundSchema; + /** @deprecated use `GetTransactionsForBlockRequest$outboundSchema` instead. */ + export const outboundSchema = GetTransactionsForBlockRequest$outboundSchema; + /** @deprecated use `GetTransactionsForBlockRequest$Outbound` instead. */ + export type Outbound = GetTransactionsForBlockRequest$Outbound; +} diff --git a/src/models/operations/gettxbyhash.ts b/src/models/operations/gettxbyhash.ts new file mode 100644 index 0000000..23aa8be --- /dev/null +++ b/src/models/operations/gettxbyhash.ts @@ -0,0 +1,163 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetTxByHashGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetTxByHashRequest = { + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.BlockchainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * A primary network (P or X chain) transaction hash. + */ + txHash: string; +}; + +/** + * Successful response + */ +export type GetTxByHashResponseBody = + | components.CChainExportTransaction + | components.CChainImportTransaction + | components.XChainNonLinearTransaction + | components.XChainLinearTransaction + | components.PChainTransaction; + +/** @internal */ +export const GetTxByHashGlobals$inboundSchema: z.ZodType< + GetTxByHashGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetTxByHashGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetTxByHashGlobals$outboundSchema: z.ZodType< + GetTxByHashGlobals$Outbound, + z.ZodTypeDef, + GetTxByHashGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTxByHashGlobals$ { + /** @deprecated use `GetTxByHashGlobals$inboundSchema` instead. */ + export const inboundSchema = GetTxByHashGlobals$inboundSchema; + /** @deprecated use `GetTxByHashGlobals$outboundSchema` instead. */ + export const outboundSchema = GetTxByHashGlobals$outboundSchema; + /** @deprecated use `GetTxByHashGlobals$Outbound` instead. */ + export type Outbound = GetTxByHashGlobals$Outbound; +} + +/** @internal */ +export const GetTxByHashRequest$inboundSchema: z.ZodType< + GetTxByHashRequest, + z.ZodTypeDef, + unknown +> = z.object({ + blockchainId: components.BlockchainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + txHash: z.string(), +}); + +/** @internal */ +export type GetTxByHashRequest$Outbound = { + blockchainId: string; + network?: string | undefined; + txHash: string; +}; + +/** @internal */ +export const GetTxByHashRequest$outboundSchema: z.ZodType< + GetTxByHashRequest$Outbound, + z.ZodTypeDef, + GetTxByHashRequest +> = z.object({ + blockchainId: components.BlockchainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + txHash: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTxByHashRequest$ { + /** @deprecated use `GetTxByHashRequest$inboundSchema` instead. */ + export const inboundSchema = GetTxByHashRequest$inboundSchema; + /** @deprecated use `GetTxByHashRequest$outboundSchema` instead. */ + export const outboundSchema = GetTxByHashRequest$outboundSchema; + /** @deprecated use `GetTxByHashRequest$Outbound` instead. */ + export type Outbound = GetTxByHashRequest$Outbound; +} + +/** @internal */ +export const GetTxByHashResponseBody$inboundSchema: z.ZodType< + GetTxByHashResponseBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.CChainExportTransaction$inboundSchema, + components.CChainImportTransaction$inboundSchema, + components.XChainNonLinearTransaction$inboundSchema, + components.XChainLinearTransaction$inboundSchema, + components.PChainTransaction$inboundSchema, +]); + +/** @internal */ +export type GetTxByHashResponseBody$Outbound = + | components.CChainExportTransaction$Outbound + | components.CChainImportTransaction$Outbound + | components.XChainNonLinearTransaction$Outbound + | components.XChainLinearTransaction$Outbound + | components.PChainTransaction$Outbound; + +/** @internal */ +export const GetTxByHashResponseBody$outboundSchema: z.ZodType< + GetTxByHashResponseBody$Outbound, + z.ZodTypeDef, + GetTxByHashResponseBody +> = z.union([ + components.CChainExportTransaction$outboundSchema, + components.CChainImportTransaction$outboundSchema, + components.XChainNonLinearTransaction$outboundSchema, + components.XChainLinearTransaction$outboundSchema, + components.PChainTransaction$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTxByHashResponseBody$ { + /** @deprecated use `GetTxByHashResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTxByHashResponseBody$inboundSchema; + /** @deprecated use `GetTxByHashResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTxByHashResponseBody$outboundSchema; + /** @deprecated use `GetTxByHashResponseBody$Outbound` instead. */ + export type Outbound = GetTxByHashResponseBody$Outbound; +} diff --git a/src/models/operations/getutxosbyaddresses.ts b/src/models/operations/getutxosbyaddresses.ts new file mode 100644 index 0000000..7481752 --- /dev/null +++ b/src/models/operations/getutxosbyaddresses.ts @@ -0,0 +1,245 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetUtxosByAddressesGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetUtxosByAddressesRequest = { + /** + * A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". + */ + addresses?: string | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.BlockchainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * Asset ID for any asset (only applicable X-Chain) + */ + assetId?: string | undefined; + /** + * Boolean filter to include spent UTXOs. + */ + includeSpent?: boolean | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +/** + * Successful response + */ +export type GetUtxosByAddressesResponseBody = + | components.ListPChainUtxosResponse + | components.ListUtxosResponse; + +export type GetUtxosByAddressesResponse = { + result: components.ListPChainUtxosResponse | components.ListUtxosResponse; +}; + +/** @internal */ +export const GetUtxosByAddressesGlobals$inboundSchema: z.ZodType< + GetUtxosByAddressesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetUtxosByAddressesGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetUtxosByAddressesGlobals$outboundSchema: z.ZodType< + GetUtxosByAddressesGlobals$Outbound, + z.ZodTypeDef, + GetUtxosByAddressesGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUtxosByAddressesGlobals$ { + /** @deprecated use `GetUtxosByAddressesGlobals$inboundSchema` instead. */ + export const inboundSchema = GetUtxosByAddressesGlobals$inboundSchema; + /** @deprecated use `GetUtxosByAddressesGlobals$outboundSchema` instead. */ + export const outboundSchema = GetUtxosByAddressesGlobals$outboundSchema; + /** @deprecated use `GetUtxosByAddressesGlobals$Outbound` instead. */ + export type Outbound = GetUtxosByAddressesGlobals$Outbound; +} + +/** @internal */ +export const GetUtxosByAddressesRequest$inboundSchema: z.ZodType< + GetUtxosByAddressesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + assetId: z.string().optional(), + includeSpent: z.boolean().optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type GetUtxosByAddressesRequest$Outbound = { + addresses?: string | undefined; + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; + assetId?: string | undefined; + includeSpent?: boolean | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const GetUtxosByAddressesRequest$outboundSchema: z.ZodType< + GetUtxosByAddressesRequest$Outbound, + z.ZodTypeDef, + GetUtxosByAddressesRequest +> = z.object({ + addresses: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + assetId: z.string().optional(), + includeSpent: z.boolean().optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUtxosByAddressesRequest$ { + /** @deprecated use `GetUtxosByAddressesRequest$inboundSchema` instead. */ + export const inboundSchema = GetUtxosByAddressesRequest$inboundSchema; + /** @deprecated use `GetUtxosByAddressesRequest$outboundSchema` instead. */ + export const outboundSchema = GetUtxosByAddressesRequest$outboundSchema; + /** @deprecated use `GetUtxosByAddressesRequest$Outbound` instead. */ + export type Outbound = GetUtxosByAddressesRequest$Outbound; +} + +/** @internal */ +export const GetUtxosByAddressesResponseBody$inboundSchema: z.ZodType< + GetUtxosByAddressesResponseBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.ListPChainUtxosResponse$inboundSchema, + components.ListUtxosResponse$inboundSchema, +]); + +/** @internal */ +export type GetUtxosByAddressesResponseBody$Outbound = + | components.ListPChainUtxosResponse$Outbound + | components.ListUtxosResponse$Outbound; + +/** @internal */ +export const GetUtxosByAddressesResponseBody$outboundSchema: z.ZodType< + GetUtxosByAddressesResponseBody$Outbound, + z.ZodTypeDef, + GetUtxosByAddressesResponseBody +> = z.union([ + components.ListPChainUtxosResponse$outboundSchema, + components.ListUtxosResponse$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUtxosByAddressesResponseBody$ { + /** @deprecated use `GetUtxosByAddressesResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetUtxosByAddressesResponseBody$inboundSchema; + /** @deprecated use `GetUtxosByAddressesResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetUtxosByAddressesResponseBody$outboundSchema; + /** @deprecated use `GetUtxosByAddressesResponseBody$Outbound` instead. */ + export type Outbound = GetUtxosByAddressesResponseBody$Outbound; +} + +/** @internal */ +export const GetUtxosByAddressesResponse$inboundSchema: z.ZodType< + GetUtxosByAddressesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: z.union([ + components.ListPChainUtxosResponse$inboundSchema, + components.ListUtxosResponse$inboundSchema, + ]), + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type GetUtxosByAddressesResponse$Outbound = { + Result: components.ListPChainUtxosResponse$Outbound | components.ListUtxosResponse$Outbound; +}; + +/** @internal */ +export const GetUtxosByAddressesResponse$outboundSchema: z.ZodType< + GetUtxosByAddressesResponse$Outbound, + z.ZodTypeDef, + GetUtxosByAddressesResponse +> = z + .object({ + result: z.union([ + components.ListPChainUtxosResponse$outboundSchema, + components.ListUtxosResponse$outboundSchema, + ]), + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUtxosByAddressesResponse$ { + /** @deprecated use `GetUtxosByAddressesResponse$inboundSchema` instead. */ + export const inboundSchema = GetUtxosByAddressesResponse$inboundSchema; + /** @deprecated use `GetUtxosByAddressesResponse$outboundSchema` instead. */ + export const outboundSchema = GetUtxosByAddressesResponse$outboundSchema; + /** @deprecated use `GetUtxosByAddressesResponse$Outbound` instead. */ + export type Outbound = GetUtxosByAddressesResponse$Outbound; +} diff --git a/src/models/operations/getvertexbyhash.ts b/src/models/operations/getvertexbyhash.ts new file mode 100644 index 0000000..cccb841 --- /dev/null +++ b/src/models/operations/getvertexbyhash.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetVertexByHashGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetVertexByHashRequest = { + /** + * A vertex hash string. + */ + vertexHash: string; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.XChainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +/** @internal */ +export const GetVertexByHashGlobals$inboundSchema: z.ZodType< + GetVertexByHashGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetVertexByHashGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetVertexByHashGlobals$outboundSchema: z.ZodType< + GetVertexByHashGlobals$Outbound, + z.ZodTypeDef, + GetVertexByHashGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetVertexByHashGlobals$ { + /** @deprecated use `GetVertexByHashGlobals$inboundSchema` instead. */ + export const inboundSchema = GetVertexByHashGlobals$inboundSchema; + /** @deprecated use `GetVertexByHashGlobals$outboundSchema` instead. */ + export const outboundSchema = GetVertexByHashGlobals$outboundSchema; + /** @deprecated use `GetVertexByHashGlobals$Outbound` instead. */ + export type Outbound = GetVertexByHashGlobals$Outbound; +} + +/** @internal */ +export const GetVertexByHashRequest$inboundSchema: z.ZodType< + GetVertexByHashRequest, + z.ZodTypeDef, + unknown +> = z.object({ + vertexHash: z.string(), + blockchainId: components.XChainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetVertexByHashRequest$Outbound = { + vertexHash: string; + blockchainId: string; + network?: string | undefined; +}; + +/** @internal */ +export const GetVertexByHashRequest$outboundSchema: z.ZodType< + GetVertexByHashRequest$Outbound, + z.ZodTypeDef, + GetVertexByHashRequest +> = z.object({ + vertexHash: z.string(), + blockchainId: components.XChainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetVertexByHashRequest$ { + /** @deprecated use `GetVertexByHashRequest$inboundSchema` instead. */ + export const inboundSchema = GetVertexByHashRequest$inboundSchema; + /** @deprecated use `GetVertexByHashRequest$outboundSchema` instead. */ + export const outboundSchema = GetVertexByHashRequest$outboundSchema; + /** @deprecated use `GetVertexByHashRequest$Outbound` instead. */ + export type Outbound = GetVertexByHashRequest$Outbound; +} diff --git a/src/models/operations/getvertexbyheight.ts b/src/models/operations/getvertexbyheight.ts new file mode 100644 index 0000000..2c7b708 --- /dev/null +++ b/src/models/operations/getvertexbyheight.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type GetVertexByHeightGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type GetVertexByHeightRequest = { + /** + * The height of a vertex. + */ + vertexHeight: number; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.XChainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +export type GetVertexByHeightResponse = { + result: components.ListXChainVerticesResponse; +}; + +/** @internal */ +export const GetVertexByHeightGlobals$inboundSchema: z.ZodType< + GetVertexByHeightGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type GetVertexByHeightGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const GetVertexByHeightGlobals$outboundSchema: z.ZodType< + GetVertexByHeightGlobals$Outbound, + z.ZodTypeDef, + GetVertexByHeightGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetVertexByHeightGlobals$ { + /** @deprecated use `GetVertexByHeightGlobals$inboundSchema` instead. */ + export const inboundSchema = GetVertexByHeightGlobals$inboundSchema; + /** @deprecated use `GetVertexByHeightGlobals$outboundSchema` instead. */ + export const outboundSchema = GetVertexByHeightGlobals$outboundSchema; + /** @deprecated use `GetVertexByHeightGlobals$Outbound` instead. */ + export type Outbound = GetVertexByHeightGlobals$Outbound; +} + +/** @internal */ +export const GetVertexByHeightRequest$inboundSchema: z.ZodType< + GetVertexByHeightRequest, + z.ZodTypeDef, + unknown +> = z.object({ + vertexHeight: z.number().int(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.XChainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type GetVertexByHeightRequest$Outbound = { + vertexHeight: number; + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const GetVertexByHeightRequest$outboundSchema: z.ZodType< + GetVertexByHeightRequest$Outbound, + z.ZodTypeDef, + GetVertexByHeightRequest +> = z.object({ + vertexHeight: z.number().int(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.XChainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetVertexByHeightRequest$ { + /** @deprecated use `GetVertexByHeightRequest$inboundSchema` instead. */ + export const inboundSchema = GetVertexByHeightRequest$inboundSchema; + /** @deprecated use `GetVertexByHeightRequest$outboundSchema` instead. */ + export const outboundSchema = GetVertexByHeightRequest$outboundSchema; + /** @deprecated use `GetVertexByHeightRequest$Outbound` instead. */ + export type Outbound = GetVertexByHeightRequest$Outbound; +} + +/** @internal */ +export const GetVertexByHeightResponse$inboundSchema: z.ZodType< + GetVertexByHeightResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListXChainVerticesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type GetVertexByHeightResponse$Outbound = { + Result: components.ListXChainVerticesResponse$Outbound; +}; + +/** @internal */ +export const GetVertexByHeightResponse$outboundSchema: z.ZodType< + GetVertexByHeightResponse$Outbound, + z.ZodTypeDef, + GetVertexByHeightResponse +> = z + .object({ + result: components.ListXChainVerticesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetVertexByHeightResponse$ { + /** @deprecated use `GetVertexByHeightResponse$inboundSchema` instead. */ + export const inboundSchema = GetVertexByHeightResponse$inboundSchema; + /** @deprecated use `GetVertexByHeightResponse$outboundSchema` instead. */ + export const outboundSchema = GetVertexByHeightResponse$outboundSchema; + /** @deprecated use `GetVertexByHeightResponse$Outbound` instead. */ + export type Outbound = GetVertexByHeightResponse$Outbound; +} diff --git a/src/models/operations/getwebhook.ts b/src/models/operations/getwebhook.ts new file mode 100644 index 0000000..7c7833c --- /dev/null +++ b/src/models/operations/getwebhook.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetWebhookRequest = { + /** + * The webhook identifier. + */ + id: string; +}; + +/** @internal */ +export const GetWebhookRequest$inboundSchema: z.ZodType = + z.object({ + id: z.string(), + }); + +/** @internal */ +export type GetWebhookRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const GetWebhookRequest$outboundSchema: z.ZodType< + GetWebhookRequest$Outbound, + z.ZodTypeDef, + GetWebhookRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWebhookRequest$ { + /** @deprecated use `GetWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = GetWebhookRequest$inboundSchema; + /** @deprecated use `GetWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = GetWebhookRequest$outboundSchema; + /** @deprecated use `GetWebhookRequest$Outbound` instead. */ + export type Outbound = GetWebhookRequest$Outbound; +} diff --git a/src/models/operations/glacierhealthcheck.ts b/src/models/operations/glacierhealthcheck.ts new file mode 100644 index 0000000..f55113a --- /dev/null +++ b/src/models/operations/glacierhealthcheck.ts @@ -0,0 +1,209 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import { collectExtraKeys as collectExtraKeys$ } from "../../lib/schemas.js"; +import * as z from "zod"; + +export type Info = { + status?: string | undefined; + additionalProperties: { [k: string]: string }; +}; + +export type ErrorT = { + status?: string | undefined; + additionalProperties: { [k: string]: string }; +}; + +export type Details = { + status?: string | undefined; + additionalProperties: { [k: string]: string }; +}; + +/** + * The Health Check is successful + */ +export type GlacierHealthCheckResponseBody = { + status?: string | undefined; + info?: { [k: string]: Info } | null | undefined; + error?: { [k: string]: ErrorT } | null | undefined; + details?: { [k: string]: Details } | undefined; +}; + +/** @internal */ +export const Info$inboundSchema: z.ZodType = collectExtraKeys$( + z + .object({ + status: z.string().optional(), + }) + .catchall(z.string()), + "additionalProperties" +); + +/** @internal */ +export type Info$Outbound = { + status?: string | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const Info$outboundSchema: z.ZodType = z + .object({ + status: z.string().optional(), + additionalProperties: z.record(z.string()), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Info$ { + /** @deprecated use `Info$inboundSchema` instead. */ + export const inboundSchema = Info$inboundSchema; + /** @deprecated use `Info$outboundSchema` instead. */ + export const outboundSchema = Info$outboundSchema; + /** @deprecated use `Info$Outbound` instead. */ + export type Outbound = Info$Outbound; +} + +/** @internal */ +export const ErrorT$inboundSchema: z.ZodType = collectExtraKeys$( + z + .object({ + status: z.string().optional(), + }) + .catchall(z.string()), + "additionalProperties" +); + +/** @internal */ +export type ErrorT$Outbound = { + status?: string | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const ErrorT$outboundSchema: z.ZodType = z + .object({ + status: z.string().optional(), + additionalProperties: z.record(z.string()), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ErrorT$ { + /** @deprecated use `ErrorT$inboundSchema` instead. */ + export const inboundSchema = ErrorT$inboundSchema; + /** @deprecated use `ErrorT$outboundSchema` instead. */ + export const outboundSchema = ErrorT$outboundSchema; + /** @deprecated use `ErrorT$Outbound` instead. */ + export type Outbound = ErrorT$Outbound; +} + +/** @internal */ +export const Details$inboundSchema: z.ZodType = collectExtraKeys$( + z + .object({ + status: z.string().optional(), + }) + .catchall(z.string()), + "additionalProperties" +); + +/** @internal */ +export type Details$Outbound = { + status?: string | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const Details$outboundSchema: z.ZodType = z + .object({ + status: z.string().optional(), + additionalProperties: z.record(z.string()), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Details$ { + /** @deprecated use `Details$inboundSchema` instead. */ + export const inboundSchema = Details$inboundSchema; + /** @deprecated use `Details$outboundSchema` instead. */ + export const outboundSchema = Details$outboundSchema; + /** @deprecated use `Details$Outbound` instead. */ + export type Outbound = Details$Outbound; +} + +/** @internal */ +export const GlacierHealthCheckResponseBody$inboundSchema: z.ZodType< + GlacierHealthCheckResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + status: z.string().optional(), + info: z.nullable(z.record(z.lazy(() => Info$inboundSchema))).optional(), + error: z.nullable(z.record(z.lazy(() => ErrorT$inboundSchema))).optional(), + details: z.record(z.lazy(() => Details$inboundSchema)).optional(), +}); + +/** @internal */ +export type GlacierHealthCheckResponseBody$Outbound = { + status?: string | undefined; + info?: { [k: string]: Info$Outbound } | null | undefined; + error?: { [k: string]: ErrorT$Outbound } | null | undefined; + details?: { [k: string]: Details$Outbound } | undefined; +}; + +/** @internal */ +export const GlacierHealthCheckResponseBody$outboundSchema: z.ZodType< + GlacierHealthCheckResponseBody$Outbound, + z.ZodTypeDef, + GlacierHealthCheckResponseBody +> = z.object({ + status: z.string().optional(), + info: z.nullable(z.record(z.lazy(() => Info$outboundSchema))).optional(), + error: z.nullable(z.record(z.lazy(() => ErrorT$outboundSchema))).optional(), + details: z.record(z.lazy(() => Details$outboundSchema)).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GlacierHealthCheckResponseBody$ { + /** @deprecated use `GlacierHealthCheckResponseBody$inboundSchema` instead. */ + export const inboundSchema = GlacierHealthCheckResponseBody$inboundSchema; + /** @deprecated use `GlacierHealthCheckResponseBody$outboundSchema` instead. */ + export const outboundSchema = GlacierHealthCheckResponseBody$outboundSchema; + /** @deprecated use `GlacierHealthCheckResponseBody$Outbound` instead. */ + export type Outbound = GlacierHealthCheckResponseBody$Outbound; +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts new file mode 100644 index 0000000..e32c259 --- /dev/null +++ b/src/models/operations/index.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export * from "./addaddressestowebhook.js"; +export * from "./deactivatewebhook.js"; +export * from "./getaddressesfromwebhook.js"; +export * from "./getapilogs.js"; +export * from "./getapiusagemetrics.js"; +export * from "./getassetdetails.js"; +export * from "./getbalancesbyaddresses.js"; +export * from "./getblock.js"; +export * from "./getblockbyid.js"; +export * from "./getchainidsforaddresses.js"; +export * from "./getchaininfo.js"; +export * from "./getcontractmetadata.js"; +export * from "./getdeploymenttransaction.js"; +export * from "./getlatestblocks.js"; +export * from "./getnativebalance.js"; +export * from "./getnetworkdetails.js"; +export * from "./getoperationresult.js"; +export * from "./getsinglevalidatordetails.js"; +export * from "./getsubnetbyid.js"; +export * from "./getteleportermessage.js"; +export * from "./gettokendetails.js"; +export * from "./gettransaction.js"; +export * from "./gettransactionsforblock.js"; +export * from "./gettxbyhash.js"; +export * from "./getutxosbyaddresses.js"; +export * from "./getvertexbyhash.js"; +export * from "./getvertexbyheight.js"; +export * from "./getwebhook.js"; +export * from "./glacierhealthcheck.js"; +export * from "./listactiveprimarynetworkstakingtransactions.js"; +export * from "./listassettransactions.js"; +export * from "./listblockchains.js"; +export * from "./listcollectiblebalances.js"; +export * from "./listcontractdeployments.js"; +export * from "./listdelegators.js"; +export * from "./listerc1155balances.js"; +export * from "./listerc1155transactions.js"; +export * from "./listerc20balances.js"; +export * from "./listerc20transactions.js"; +export * from "./listerc721balances.js"; +export * from "./listerc721transactions.js"; +export * from "./listhistoricalprimarynetworkrewards.js"; +export * from "./listinternaltransactions.js"; +export * from "./listlatestprimarynetworkblocks.js"; +export * from "./listlatestprimarynetworktransactions.js"; +export * from "./listlatesttransactions.js"; +export * from "./listlatestxchainvertices.js"; +export * from "./listnativetransactions.js"; +export * from "./listpendingprimarynetworkrewards.js"; +export * from "./listprimarynetworkblocksbynodeid.js"; +export * from "./listsubnets.js"; +export * from "./listteleportermessages.js"; +export * from "./listtokens.js"; +export * from "./listtransactions.js"; +export * from "./listtransfers.js"; +export * from "./listvalidators.js"; +export * from "./listwebhooks.js"; +export * from "./posttransactionexportjob.js"; +export * from "./reindexnft.js"; +export * from "./removeaddressesfromwebhook.js"; +export * from "./supportedchains.js"; +export * from "./updatewebhook.js"; diff --git a/src/models/operations/listactiveprimarynetworkstakingtransactions.ts b/src/models/operations/listactiveprimarynetworkstakingtransactions.ts new file mode 100644 index 0000000..609aa7e --- /dev/null +++ b/src/models/operations/listactiveprimarynetworkstakingtransactions.ts @@ -0,0 +1,202 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListActivePrimaryNetworkStakingTransactionsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListActivePrimaryNetworkStakingTransactionsRequest = { + /** + * A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". + */ + addresses?: string | undefined; + /** + * Query param for filtering items based on transaction types. + */ + txTypes?: Array | undefined; + /** + * Query param for retrieving items after a specific timestamp. + */ + startTimestamp?: number | undefined; + /** + * Query param for retrieving items before a specific timestamp. + */ + endTimestamp?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.PChainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +export type ListActivePrimaryNetworkStakingTransactionsResponse = { + result: components.ListPChainTransactionsResponse; +}; + +/** @internal */ +export const ListActivePrimaryNetworkStakingTransactionsGlobals$inboundSchema: z.ZodType< + ListActivePrimaryNetworkStakingTransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListActivePrimaryNetworkStakingTransactionsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListActivePrimaryNetworkStakingTransactionsGlobals$outboundSchema: z.ZodType< + ListActivePrimaryNetworkStakingTransactionsGlobals$Outbound, + z.ZodTypeDef, + ListActivePrimaryNetworkStakingTransactionsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListActivePrimaryNetworkStakingTransactionsGlobals$ { + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListActivePrimaryNetworkStakingTransactionsGlobals$inboundSchema; + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListActivePrimaryNetworkStakingTransactionsGlobals$outboundSchema; + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsGlobals$Outbound` instead. */ + export type Outbound = ListActivePrimaryNetworkStakingTransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListActivePrimaryNetworkStakingTransactionsRequest$inboundSchema: z.ZodType< + ListActivePrimaryNetworkStakingTransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.string().optional(), + txTypes: z.array(components.PrimaryNetworkTxType$inboundSchema).optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.PChainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type ListActivePrimaryNetworkStakingTransactionsRequest$Outbound = { + addresses?: string | undefined; + txTypes?: Array | undefined; + startTimestamp?: number | undefined; + endTimestamp?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const ListActivePrimaryNetworkStakingTransactionsRequest$outboundSchema: z.ZodType< + ListActivePrimaryNetworkStakingTransactionsRequest$Outbound, + z.ZodTypeDef, + ListActivePrimaryNetworkStakingTransactionsRequest +> = z.object({ + addresses: z.string().optional(), + txTypes: z.array(components.PrimaryNetworkTxType$outboundSchema).optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.PChainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListActivePrimaryNetworkStakingTransactionsRequest$ { + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListActivePrimaryNetworkStakingTransactionsRequest$inboundSchema; + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListActivePrimaryNetworkStakingTransactionsRequest$outboundSchema; + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsRequest$Outbound` instead. */ + export type Outbound = ListActivePrimaryNetworkStakingTransactionsRequest$Outbound; +} + +/** @internal */ +export const ListActivePrimaryNetworkStakingTransactionsResponse$inboundSchema: z.ZodType< + ListActivePrimaryNetworkStakingTransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListPChainTransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListActivePrimaryNetworkStakingTransactionsResponse$Outbound = { + Result: components.ListPChainTransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListActivePrimaryNetworkStakingTransactionsResponse$outboundSchema: z.ZodType< + ListActivePrimaryNetworkStakingTransactionsResponse$Outbound, + z.ZodTypeDef, + ListActivePrimaryNetworkStakingTransactionsResponse +> = z + .object({ + result: components.ListPChainTransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListActivePrimaryNetworkStakingTransactionsResponse$ { + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListActivePrimaryNetworkStakingTransactionsResponse$inboundSchema; + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = + ListActivePrimaryNetworkStakingTransactionsResponse$outboundSchema; + /** @deprecated use `ListActivePrimaryNetworkStakingTransactionsResponse$Outbound` instead. */ + export type Outbound = ListActivePrimaryNetworkStakingTransactionsResponse$Outbound; +} diff --git a/src/models/operations/listassettransactions.ts b/src/models/operations/listassettransactions.ts new file mode 100644 index 0000000..3f2c6de --- /dev/null +++ b/src/models/operations/listassettransactions.ts @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListAssetTransactionsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListAssetTransactionsRequest = { + /** + * Query param for filtering items based on transaction types. + */ + txTypes?: Array | undefined; + /** + * Query param for retrieving items after a specific timestamp. + */ + startTimestamp?: number | undefined; + /** + * Query param for retrieving items before a specific timestamp. + */ + endTimestamp?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.XChainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * Asset ID for any asset on X-Chain + */ + assetId: string; +}; + +export type ListAssetTransactionsResponse = { + result: components.ListXChainTransactionsResponse; +}; + +/** @internal */ +export const ListAssetTransactionsGlobals$inboundSchema: z.ZodType< + ListAssetTransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListAssetTransactionsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListAssetTransactionsGlobals$outboundSchema: z.ZodType< + ListAssetTransactionsGlobals$Outbound, + z.ZodTypeDef, + ListAssetTransactionsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListAssetTransactionsGlobals$ { + /** @deprecated use `ListAssetTransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListAssetTransactionsGlobals$inboundSchema; + /** @deprecated use `ListAssetTransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListAssetTransactionsGlobals$outboundSchema; + /** @deprecated use `ListAssetTransactionsGlobals$Outbound` instead. */ + export type Outbound = ListAssetTransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListAssetTransactionsRequest$inboundSchema: z.ZodType< + ListAssetTransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + txTypes: z.array(components.PrimaryNetworkTxType$inboundSchema).optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.XChainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + assetId: z.string(), +}); + +/** @internal */ +export type ListAssetTransactionsRequest$Outbound = { + txTypes?: Array | undefined; + startTimestamp?: number | undefined; + endTimestamp?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; + assetId: string; +}; + +/** @internal */ +export const ListAssetTransactionsRequest$outboundSchema: z.ZodType< + ListAssetTransactionsRequest$Outbound, + z.ZodTypeDef, + ListAssetTransactionsRequest +> = z.object({ + txTypes: z.array(components.PrimaryNetworkTxType$outboundSchema).optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.XChainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + assetId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListAssetTransactionsRequest$ { + /** @deprecated use `ListAssetTransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListAssetTransactionsRequest$inboundSchema; + /** @deprecated use `ListAssetTransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListAssetTransactionsRequest$outboundSchema; + /** @deprecated use `ListAssetTransactionsRequest$Outbound` instead. */ + export type Outbound = ListAssetTransactionsRequest$Outbound; +} + +/** @internal */ +export const ListAssetTransactionsResponse$inboundSchema: z.ZodType< + ListAssetTransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListXChainTransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListAssetTransactionsResponse$Outbound = { + Result: components.ListXChainTransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListAssetTransactionsResponse$outboundSchema: z.ZodType< + ListAssetTransactionsResponse$Outbound, + z.ZodTypeDef, + ListAssetTransactionsResponse +> = z + .object({ + result: components.ListXChainTransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListAssetTransactionsResponse$ { + /** @deprecated use `ListAssetTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListAssetTransactionsResponse$inboundSchema; + /** @deprecated use `ListAssetTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListAssetTransactionsResponse$outboundSchema; + /** @deprecated use `ListAssetTransactionsResponse$Outbound` instead. */ + export type Outbound = ListAssetTransactionsResponse$Outbound; +} diff --git a/src/models/operations/listblockchains.ts b/src/models/operations/listblockchains.ts new file mode 100644 index 0000000..a38c3e3 --- /dev/null +++ b/src/models/operations/listblockchains.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListBlockchainsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListBlockchainsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +export type ListBlockchainsResponse = { + result: components.ListBlockchainsResponse; +}; + +/** @internal */ +export const ListBlockchainsGlobals$inboundSchema: z.ZodType< + ListBlockchainsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListBlockchainsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListBlockchainsGlobals$outboundSchema: z.ZodType< + ListBlockchainsGlobals$Outbound, + z.ZodTypeDef, + ListBlockchainsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListBlockchainsGlobals$ { + /** @deprecated use `ListBlockchainsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListBlockchainsGlobals$inboundSchema; + /** @deprecated use `ListBlockchainsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListBlockchainsGlobals$outboundSchema; + /** @deprecated use `ListBlockchainsGlobals$Outbound` instead. */ + export type Outbound = ListBlockchainsGlobals$Outbound; +} + +/** @internal */ +export const ListBlockchainsRequest$inboundSchema: z.ZodType< + ListBlockchainsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type ListBlockchainsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + network?: string | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const ListBlockchainsRequest$outboundSchema: z.ZodType< + ListBlockchainsRequest$Outbound, + z.ZodTypeDef, + ListBlockchainsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListBlockchainsRequest$ { + /** @deprecated use `ListBlockchainsRequest$inboundSchema` instead. */ + export const inboundSchema = ListBlockchainsRequest$inboundSchema; + /** @deprecated use `ListBlockchainsRequest$outboundSchema` instead. */ + export const outboundSchema = ListBlockchainsRequest$outboundSchema; + /** @deprecated use `ListBlockchainsRequest$Outbound` instead. */ + export type Outbound = ListBlockchainsRequest$Outbound; +} + +/** @internal */ +export const ListBlockchainsResponse$inboundSchema: z.ZodType< + ListBlockchainsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListBlockchainsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListBlockchainsResponse$Outbound = { + Result: components.ListBlockchainsResponse$Outbound; +}; + +/** @internal */ +export const ListBlockchainsResponse$outboundSchema: z.ZodType< + ListBlockchainsResponse$Outbound, + z.ZodTypeDef, + ListBlockchainsResponse +> = z + .object({ + result: components.ListBlockchainsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListBlockchainsResponse$ { + /** @deprecated use `ListBlockchainsResponse$inboundSchema` instead. */ + export const inboundSchema = ListBlockchainsResponse$inboundSchema; + /** @deprecated use `ListBlockchainsResponse$outboundSchema` instead. */ + export const outboundSchema = ListBlockchainsResponse$outboundSchema; + /** @deprecated use `ListBlockchainsResponse$Outbound` instead. */ + export type Outbound = ListBlockchainsResponse$Outbound; +} diff --git a/src/models/operations/listcollectiblebalances.ts b/src/models/operations/listcollectiblebalances.ts new file mode 100644 index 0000000..caf774b --- /dev/null +++ b/src/models/operations/listcollectiblebalances.ts @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListCollectibleBalancesGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListCollectibleBalancesRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; + /** + * A contract addresses to filter by. + */ + contractAddress?: string | undefined; +}; + +export type ListCollectibleBalancesResponse = { + result: components.ListCollectibleBalancesResponse; +}; + +/** @internal */ +export const ListCollectibleBalancesGlobals$inboundSchema: z.ZodType< + ListCollectibleBalancesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListCollectibleBalancesGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListCollectibleBalancesGlobals$outboundSchema: z.ZodType< + ListCollectibleBalancesGlobals$Outbound, + z.ZodTypeDef, + ListCollectibleBalancesGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCollectibleBalancesGlobals$ { + /** @deprecated use `ListCollectibleBalancesGlobals$inboundSchema` instead. */ + export const inboundSchema = ListCollectibleBalancesGlobals$inboundSchema; + /** @deprecated use `ListCollectibleBalancesGlobals$outboundSchema` instead. */ + export const outboundSchema = ListCollectibleBalancesGlobals$outboundSchema; + /** @deprecated use `ListCollectibleBalancesGlobals$Outbound` instead. */ + export type Outbound = ListCollectibleBalancesGlobals$Outbound; +} + +/** @internal */ +export const ListCollectibleBalancesRequest$inboundSchema: z.ZodType< + ListCollectibleBalancesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), + contractAddress: z.string().optional(), +}); + +/** @internal */ +export type ListCollectibleBalancesRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; + contractAddress?: string | undefined; +}; + +/** @internal */ +export const ListCollectibleBalancesRequest$outboundSchema: z.ZodType< + ListCollectibleBalancesRequest$Outbound, + z.ZodTypeDef, + ListCollectibleBalancesRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), + contractAddress: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCollectibleBalancesRequest$ { + /** @deprecated use `ListCollectibleBalancesRequest$inboundSchema` instead. */ + export const inboundSchema = ListCollectibleBalancesRequest$inboundSchema; + /** @deprecated use `ListCollectibleBalancesRequest$outboundSchema` instead. */ + export const outboundSchema = ListCollectibleBalancesRequest$outboundSchema; + /** @deprecated use `ListCollectibleBalancesRequest$Outbound` instead. */ + export type Outbound = ListCollectibleBalancesRequest$Outbound; +} + +/** @internal */ +export const ListCollectibleBalancesResponse$inboundSchema: z.ZodType< + ListCollectibleBalancesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListCollectibleBalancesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListCollectibleBalancesResponse$Outbound = { + Result: components.ListCollectibleBalancesResponse$Outbound; +}; + +/** @internal */ +export const ListCollectibleBalancesResponse$outboundSchema: z.ZodType< + ListCollectibleBalancesResponse$Outbound, + z.ZodTypeDef, + ListCollectibleBalancesResponse +> = z + .object({ + result: components.ListCollectibleBalancesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCollectibleBalancesResponse$ { + /** @deprecated use `ListCollectibleBalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListCollectibleBalancesResponse$inboundSchema; + /** @deprecated use `ListCollectibleBalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListCollectibleBalancesResponse$outboundSchema; + /** @deprecated use `ListCollectibleBalancesResponse$Outbound` instead. */ + export type Outbound = ListCollectibleBalancesResponse$Outbound; +} diff --git a/src/models/operations/listcontractdeployments.ts b/src/models/operations/listcontractdeployments.ts new file mode 100644 index 0000000..91e0b23 --- /dev/null +++ b/src/models/operations/listcontractdeployments.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListContractDeploymentsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListContractDeploymentsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; +}; + +export type ListContractDeploymentsResponse = { + result: components.ListContractsResponse; +}; + +/** @internal */ +export const ListContractDeploymentsGlobals$inboundSchema: z.ZodType< + ListContractDeploymentsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListContractDeploymentsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListContractDeploymentsGlobals$outboundSchema: z.ZodType< + ListContractDeploymentsGlobals$Outbound, + z.ZodTypeDef, + ListContractDeploymentsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListContractDeploymentsGlobals$ { + /** @deprecated use `ListContractDeploymentsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListContractDeploymentsGlobals$inboundSchema; + /** @deprecated use `ListContractDeploymentsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListContractDeploymentsGlobals$outboundSchema; + /** @deprecated use `ListContractDeploymentsGlobals$Outbound` instead. */ + export type Outbound = ListContractDeploymentsGlobals$Outbound; +} + +/** @internal */ +export const ListContractDeploymentsRequest$inboundSchema: z.ZodType< + ListContractDeploymentsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type ListContractDeploymentsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListContractDeploymentsRequest$outboundSchema: z.ZodType< + ListContractDeploymentsRequest$Outbound, + z.ZodTypeDef, + ListContractDeploymentsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListContractDeploymentsRequest$ { + /** @deprecated use `ListContractDeploymentsRequest$inboundSchema` instead. */ + export const inboundSchema = ListContractDeploymentsRequest$inboundSchema; + /** @deprecated use `ListContractDeploymentsRequest$outboundSchema` instead. */ + export const outboundSchema = ListContractDeploymentsRequest$outboundSchema; + /** @deprecated use `ListContractDeploymentsRequest$Outbound` instead. */ + export type Outbound = ListContractDeploymentsRequest$Outbound; +} + +/** @internal */ +export const ListContractDeploymentsResponse$inboundSchema: z.ZodType< + ListContractDeploymentsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListContractsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListContractDeploymentsResponse$Outbound = { + Result: components.ListContractsResponse$Outbound; +}; + +/** @internal */ +export const ListContractDeploymentsResponse$outboundSchema: z.ZodType< + ListContractDeploymentsResponse$Outbound, + z.ZodTypeDef, + ListContractDeploymentsResponse +> = z + .object({ + result: components.ListContractsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListContractDeploymentsResponse$ { + /** @deprecated use `ListContractDeploymentsResponse$inboundSchema` instead. */ + export const inboundSchema = ListContractDeploymentsResponse$inboundSchema; + /** @deprecated use `ListContractDeploymentsResponse$outboundSchema` instead. */ + export const outboundSchema = ListContractDeploymentsResponse$outboundSchema; + /** @deprecated use `ListContractDeploymentsResponse$Outbound` instead. */ + export type Outbound = ListContractDeploymentsResponse$Outbound; +} diff --git a/src/models/operations/listdelegators.ts b/src/models/operations/listdelegators.ts new file mode 100644 index 0000000..9716d1c --- /dev/null +++ b/src/models/operations/listdelegators.ts @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListDelegatorsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListDelegatorsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A comma separated list of reward addresses to filter by. + */ + rewardAddresses?: string | undefined; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; + /** + * Delegation status of the node. + */ + delegationStatus?: components.DelegationStatusType | undefined; + /** + * A comma separated list of node ids to filter by. + */ + nodeIds?: string | undefined; +}; + +export type ListDelegatorsResponse = { + result: components.ListDelegatorDetailsResponse; +}; + +/** @internal */ +export const ListDelegatorsGlobals$inboundSchema: z.ZodType< + ListDelegatorsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListDelegatorsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListDelegatorsGlobals$outboundSchema: z.ZodType< + ListDelegatorsGlobals$Outbound, + z.ZodTypeDef, + ListDelegatorsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListDelegatorsGlobals$ { + /** @deprecated use `ListDelegatorsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListDelegatorsGlobals$inboundSchema; + /** @deprecated use `ListDelegatorsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListDelegatorsGlobals$outboundSchema; + /** @deprecated use `ListDelegatorsGlobals$Outbound` instead. */ + export type Outbound = ListDelegatorsGlobals$Outbound; +} + +/** @internal */ +export const ListDelegatorsRequest$inboundSchema: z.ZodType< + ListDelegatorsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + rewardAddresses: z.string().optional(), + network: components.GlobalParamNetwork$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), + delegationStatus: components.DelegationStatusType$inboundSchema.optional(), + nodeIds: z.string().optional(), +}); + +/** @internal */ +export type ListDelegatorsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + rewardAddresses?: string | undefined; + network?: string | undefined; + sortOrder?: string | undefined; + delegationStatus?: string | undefined; + nodeIds?: string | undefined; +}; + +/** @internal */ +export const ListDelegatorsRequest$outboundSchema: z.ZodType< + ListDelegatorsRequest$Outbound, + z.ZodTypeDef, + ListDelegatorsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + rewardAddresses: z.string().optional(), + network: components.GlobalParamNetwork$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), + delegationStatus: components.DelegationStatusType$outboundSchema.optional(), + nodeIds: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListDelegatorsRequest$ { + /** @deprecated use `ListDelegatorsRequest$inboundSchema` instead. */ + export const inboundSchema = ListDelegatorsRequest$inboundSchema; + /** @deprecated use `ListDelegatorsRequest$outboundSchema` instead. */ + export const outboundSchema = ListDelegatorsRequest$outboundSchema; + /** @deprecated use `ListDelegatorsRequest$Outbound` instead. */ + export type Outbound = ListDelegatorsRequest$Outbound; +} + +/** @internal */ +export const ListDelegatorsResponse$inboundSchema: z.ZodType< + ListDelegatorsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListDelegatorDetailsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListDelegatorsResponse$Outbound = { + Result: components.ListDelegatorDetailsResponse$Outbound; +}; + +/** @internal */ +export const ListDelegatorsResponse$outboundSchema: z.ZodType< + ListDelegatorsResponse$Outbound, + z.ZodTypeDef, + ListDelegatorsResponse +> = z + .object({ + result: components.ListDelegatorDetailsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListDelegatorsResponse$ { + /** @deprecated use `ListDelegatorsResponse$inboundSchema` instead. */ + export const inboundSchema = ListDelegatorsResponse$inboundSchema; + /** @deprecated use `ListDelegatorsResponse$outboundSchema` instead. */ + export const outboundSchema = ListDelegatorsResponse$outboundSchema; + /** @deprecated use `ListDelegatorsResponse$Outbound` instead. */ + export type Outbound = ListDelegatorsResponse$Outbound; +} diff --git a/src/models/operations/listerc1155balances.ts b/src/models/operations/listerc1155balances.ts new file mode 100644 index 0000000..53f4777 --- /dev/null +++ b/src/models/operations/listerc1155balances.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListErc1155BalancesGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListErc1155BalancesRequest = { + /** + * The block number, if not defined the block number will be the latest block. + */ + blockNumber?: string | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; + /** + * A contract addresses to filter by. + */ + contractAddress?: string | undefined; +}; + +export type ListErc1155BalancesResponse = { + result: components.ListErc1155BalancesResponse; +}; + +/** @internal */ +export const ListErc1155BalancesGlobals$inboundSchema: z.ZodType< + ListErc1155BalancesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListErc1155BalancesGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListErc1155BalancesGlobals$outboundSchema: z.ZodType< + ListErc1155BalancesGlobals$Outbound, + z.ZodTypeDef, + ListErc1155BalancesGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155BalancesGlobals$ { + /** @deprecated use `ListErc1155BalancesGlobals$inboundSchema` instead. */ + export const inboundSchema = ListErc1155BalancesGlobals$inboundSchema; + /** @deprecated use `ListErc1155BalancesGlobals$outboundSchema` instead. */ + export const outboundSchema = ListErc1155BalancesGlobals$outboundSchema; + /** @deprecated use `ListErc1155BalancesGlobals$Outbound` instead. */ + export type Outbound = ListErc1155BalancesGlobals$Outbound; +} + +/** @internal */ +export const ListErc1155BalancesRequest$inboundSchema: z.ZodType< + ListErc1155BalancesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), + contractAddress: z.string().optional(), +}); + +/** @internal */ +export type ListErc1155BalancesRequest$Outbound = { + blockNumber?: string | undefined; + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; + contractAddress?: string | undefined; +}; + +/** @internal */ +export const ListErc1155BalancesRequest$outboundSchema: z.ZodType< + ListErc1155BalancesRequest$Outbound, + z.ZodTypeDef, + ListErc1155BalancesRequest +> = z.object({ + blockNumber: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), + contractAddress: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155BalancesRequest$ { + /** @deprecated use `ListErc1155BalancesRequest$inboundSchema` instead. */ + export const inboundSchema = ListErc1155BalancesRequest$inboundSchema; + /** @deprecated use `ListErc1155BalancesRequest$outboundSchema` instead. */ + export const outboundSchema = ListErc1155BalancesRequest$outboundSchema; + /** @deprecated use `ListErc1155BalancesRequest$Outbound` instead. */ + export type Outbound = ListErc1155BalancesRequest$Outbound; +} + +/** @internal */ +export const ListErc1155BalancesResponse$inboundSchema: z.ZodType< + ListErc1155BalancesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListErc1155BalancesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListErc1155BalancesResponse$Outbound = { + Result: components.ListErc1155BalancesResponse$Outbound; +}; + +/** @internal */ +export const ListErc1155BalancesResponse$outboundSchema: z.ZodType< + ListErc1155BalancesResponse$Outbound, + z.ZodTypeDef, + ListErc1155BalancesResponse +> = z + .object({ + result: components.ListErc1155BalancesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155BalancesResponse$ { + /** @deprecated use `ListErc1155BalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc1155BalancesResponse$inboundSchema; + /** @deprecated use `ListErc1155BalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc1155BalancesResponse$outboundSchema; + /** @deprecated use `ListErc1155BalancesResponse$Outbound` instead. */ + export type Outbound = ListErc1155BalancesResponse$Outbound; +} diff --git a/src/models/operations/listerc1155transactions.ts b/src/models/operations/listerc1155transactions.ts new file mode 100644 index 0000000..9e2a47e --- /dev/null +++ b/src/models/operations/listerc1155transactions.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListErc1155TransactionsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListErc1155TransactionsRequest = { + /** + * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. + */ + startBlock?: number | undefined; + /** + * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. + */ + endBlock?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; +}; + +export type ListErc1155TransactionsResponse = { + result: components.ListErc1155TransactionsResponse; +}; + +/** @internal */ +export const ListErc1155TransactionsGlobals$inboundSchema: z.ZodType< + ListErc1155TransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListErc1155TransactionsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListErc1155TransactionsGlobals$outboundSchema: z.ZodType< + ListErc1155TransactionsGlobals$Outbound, + z.ZodTypeDef, + ListErc1155TransactionsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155TransactionsGlobals$ { + /** @deprecated use `ListErc1155TransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListErc1155TransactionsGlobals$inboundSchema; + /** @deprecated use `ListErc1155TransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListErc1155TransactionsGlobals$outboundSchema; + /** @deprecated use `ListErc1155TransactionsGlobals$Outbound` instead. */ + export type Outbound = ListErc1155TransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListErc1155TransactionsRequest$inboundSchema: z.ZodType< + ListErc1155TransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type ListErc1155TransactionsRequest$Outbound = { + startBlock?: number | undefined; + endBlock?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListErc1155TransactionsRequest$outboundSchema: z.ZodType< + ListErc1155TransactionsRequest$Outbound, + z.ZodTypeDef, + ListErc1155TransactionsRequest +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155TransactionsRequest$ { + /** @deprecated use `ListErc1155TransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListErc1155TransactionsRequest$inboundSchema; + /** @deprecated use `ListErc1155TransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListErc1155TransactionsRequest$outboundSchema; + /** @deprecated use `ListErc1155TransactionsRequest$Outbound` instead. */ + export type Outbound = ListErc1155TransactionsRequest$Outbound; +} + +/** @internal */ +export const ListErc1155TransactionsResponse$inboundSchema: z.ZodType< + ListErc1155TransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListErc1155TransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListErc1155TransactionsResponse$Outbound = { + Result: components.ListErc1155TransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListErc1155TransactionsResponse$outboundSchema: z.ZodType< + ListErc1155TransactionsResponse$Outbound, + z.ZodTypeDef, + ListErc1155TransactionsResponse +> = z + .object({ + result: components.ListErc1155TransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc1155TransactionsResponse$ { + /** @deprecated use `ListErc1155TransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc1155TransactionsResponse$inboundSchema; + /** @deprecated use `ListErc1155TransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc1155TransactionsResponse$outboundSchema; + /** @deprecated use `ListErc1155TransactionsResponse$Outbound` instead. */ + export type Outbound = ListErc1155TransactionsResponse$Outbound; +} diff --git a/src/models/operations/listerc20balances.ts b/src/models/operations/listerc20balances.ts new file mode 100644 index 0000000..3fc93a8 --- /dev/null +++ b/src/models/operations/listerc20balances.ts @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListErc20BalancesGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListErc20BalancesRequest = { + /** + * The block number, if not defined the block number will be the latest block. + */ + blockNumber?: string | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * whether to filter out spam tokens from the response. Default is true. + */ + filterSpamTokens?: boolean | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; + /** + * A comma separated list of contract addresses to filter by. + */ + contractAddresses?: string | undefined; + /** + * The currency that return values should use. Defaults to USD. + */ + currency?: components.CurrencyCode | undefined; +}; + +export type ListErc20BalancesResponse = { + result: components.ListErc20BalancesResponse; +}; + +/** @internal */ +export const ListErc20BalancesGlobals$inboundSchema: z.ZodType< + ListErc20BalancesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListErc20BalancesGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListErc20BalancesGlobals$outboundSchema: z.ZodType< + ListErc20BalancesGlobals$Outbound, + z.ZodTypeDef, + ListErc20BalancesGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20BalancesGlobals$ { + /** @deprecated use `ListErc20BalancesGlobals$inboundSchema` instead. */ + export const inboundSchema = ListErc20BalancesGlobals$inboundSchema; + /** @deprecated use `ListErc20BalancesGlobals$outboundSchema` instead. */ + export const outboundSchema = ListErc20BalancesGlobals$outboundSchema; + /** @deprecated use `ListErc20BalancesGlobals$Outbound` instead. */ + export type Outbound = ListErc20BalancesGlobals$Outbound; +} + +/** @internal */ +export const ListErc20BalancesRequest$inboundSchema: z.ZodType< + ListErc20BalancesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + blockNumber: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + filterSpamTokens: z.boolean().default(true), + chainId: z.string().optional(), + address: z.string(), + contractAddresses: z.string().optional(), + currency: components.CurrencyCode$inboundSchema.optional(), +}); + +/** @internal */ +export type ListErc20BalancesRequest$Outbound = { + blockNumber?: string | undefined; + pageToken?: string | undefined; + pageSize: number; + filterSpamTokens: boolean; + chainId?: string | undefined; + address: string; + contractAddresses?: string | undefined; + currency?: string | undefined; +}; + +/** @internal */ +export const ListErc20BalancesRequest$outboundSchema: z.ZodType< + ListErc20BalancesRequest$Outbound, + z.ZodTypeDef, + ListErc20BalancesRequest +> = z.object({ + blockNumber: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + filterSpamTokens: z.boolean().default(true), + chainId: z.string().optional(), + address: z.string(), + contractAddresses: z.string().optional(), + currency: components.CurrencyCode$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20BalancesRequest$ { + /** @deprecated use `ListErc20BalancesRequest$inboundSchema` instead. */ + export const inboundSchema = ListErc20BalancesRequest$inboundSchema; + /** @deprecated use `ListErc20BalancesRequest$outboundSchema` instead. */ + export const outboundSchema = ListErc20BalancesRequest$outboundSchema; + /** @deprecated use `ListErc20BalancesRequest$Outbound` instead. */ + export type Outbound = ListErc20BalancesRequest$Outbound; +} + +/** @internal */ +export const ListErc20BalancesResponse$inboundSchema: z.ZodType< + ListErc20BalancesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListErc20BalancesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListErc20BalancesResponse$Outbound = { + Result: components.ListErc20BalancesResponse$Outbound; +}; + +/** @internal */ +export const ListErc20BalancesResponse$outboundSchema: z.ZodType< + ListErc20BalancesResponse$Outbound, + z.ZodTypeDef, + ListErc20BalancesResponse +> = z + .object({ + result: components.ListErc20BalancesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20BalancesResponse$ { + /** @deprecated use `ListErc20BalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc20BalancesResponse$inboundSchema; + /** @deprecated use `ListErc20BalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc20BalancesResponse$outboundSchema; + /** @deprecated use `ListErc20BalancesResponse$Outbound` instead. */ + export type Outbound = ListErc20BalancesResponse$Outbound; +} diff --git a/src/models/operations/listerc20transactions.ts b/src/models/operations/listerc20transactions.ts new file mode 100644 index 0000000..1cf4cde --- /dev/null +++ b/src/models/operations/listerc20transactions.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListErc20TransactionsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListErc20TransactionsRequest = { + /** + * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. + */ + startBlock?: number | undefined; + /** + * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. + */ + endBlock?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; +}; + +export type ListErc20TransactionsResponse = { + result: components.ListErc20TransactionsResponse; +}; + +/** @internal */ +export const ListErc20TransactionsGlobals$inboundSchema: z.ZodType< + ListErc20TransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListErc20TransactionsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListErc20TransactionsGlobals$outboundSchema: z.ZodType< + ListErc20TransactionsGlobals$Outbound, + z.ZodTypeDef, + ListErc20TransactionsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20TransactionsGlobals$ { + /** @deprecated use `ListErc20TransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListErc20TransactionsGlobals$inboundSchema; + /** @deprecated use `ListErc20TransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListErc20TransactionsGlobals$outboundSchema; + /** @deprecated use `ListErc20TransactionsGlobals$Outbound` instead. */ + export type Outbound = ListErc20TransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListErc20TransactionsRequest$inboundSchema: z.ZodType< + ListErc20TransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type ListErc20TransactionsRequest$Outbound = { + startBlock?: number | undefined; + endBlock?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListErc20TransactionsRequest$outboundSchema: z.ZodType< + ListErc20TransactionsRequest$Outbound, + z.ZodTypeDef, + ListErc20TransactionsRequest +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20TransactionsRequest$ { + /** @deprecated use `ListErc20TransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListErc20TransactionsRequest$inboundSchema; + /** @deprecated use `ListErc20TransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListErc20TransactionsRequest$outboundSchema; + /** @deprecated use `ListErc20TransactionsRequest$Outbound` instead. */ + export type Outbound = ListErc20TransactionsRequest$Outbound; +} + +/** @internal */ +export const ListErc20TransactionsResponse$inboundSchema: z.ZodType< + ListErc20TransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListErc20TransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListErc20TransactionsResponse$Outbound = { + Result: components.ListErc20TransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListErc20TransactionsResponse$outboundSchema: z.ZodType< + ListErc20TransactionsResponse$Outbound, + z.ZodTypeDef, + ListErc20TransactionsResponse +> = z + .object({ + result: components.ListErc20TransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc20TransactionsResponse$ { + /** @deprecated use `ListErc20TransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc20TransactionsResponse$inboundSchema; + /** @deprecated use `ListErc20TransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc20TransactionsResponse$outboundSchema; + /** @deprecated use `ListErc20TransactionsResponse$Outbound` instead. */ + export type Outbound = ListErc20TransactionsResponse$Outbound; +} diff --git a/src/models/operations/listerc721balances.ts b/src/models/operations/listerc721balances.ts new file mode 100644 index 0000000..c29b1b0 --- /dev/null +++ b/src/models/operations/listerc721balances.ts @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListErc721BalancesGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListErc721BalancesRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; + /** + * A contract addresses to filter by. + */ + contractAddress?: string | undefined; +}; + +export type ListErc721BalancesResponse = { + result: components.ListErc721BalancesResponse; +}; + +/** @internal */ +export const ListErc721BalancesGlobals$inboundSchema: z.ZodType< + ListErc721BalancesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListErc721BalancesGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListErc721BalancesGlobals$outboundSchema: z.ZodType< + ListErc721BalancesGlobals$Outbound, + z.ZodTypeDef, + ListErc721BalancesGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721BalancesGlobals$ { + /** @deprecated use `ListErc721BalancesGlobals$inboundSchema` instead. */ + export const inboundSchema = ListErc721BalancesGlobals$inboundSchema; + /** @deprecated use `ListErc721BalancesGlobals$outboundSchema` instead. */ + export const outboundSchema = ListErc721BalancesGlobals$outboundSchema; + /** @deprecated use `ListErc721BalancesGlobals$Outbound` instead. */ + export type Outbound = ListErc721BalancesGlobals$Outbound; +} + +/** @internal */ +export const ListErc721BalancesRequest$inboundSchema: z.ZodType< + ListErc721BalancesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), + contractAddress: z.string().optional(), +}); + +/** @internal */ +export type ListErc721BalancesRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; + contractAddress?: string | undefined; +}; + +/** @internal */ +export const ListErc721BalancesRequest$outboundSchema: z.ZodType< + ListErc721BalancesRequest$Outbound, + z.ZodTypeDef, + ListErc721BalancesRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), + contractAddress: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721BalancesRequest$ { + /** @deprecated use `ListErc721BalancesRequest$inboundSchema` instead. */ + export const inboundSchema = ListErc721BalancesRequest$inboundSchema; + /** @deprecated use `ListErc721BalancesRequest$outboundSchema` instead. */ + export const outboundSchema = ListErc721BalancesRequest$outboundSchema; + /** @deprecated use `ListErc721BalancesRequest$Outbound` instead. */ + export type Outbound = ListErc721BalancesRequest$Outbound; +} + +/** @internal */ +export const ListErc721BalancesResponse$inboundSchema: z.ZodType< + ListErc721BalancesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListErc721BalancesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListErc721BalancesResponse$Outbound = { + Result: components.ListErc721BalancesResponse$Outbound; +}; + +/** @internal */ +export const ListErc721BalancesResponse$outboundSchema: z.ZodType< + ListErc721BalancesResponse$Outbound, + z.ZodTypeDef, + ListErc721BalancesResponse +> = z + .object({ + result: components.ListErc721BalancesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721BalancesResponse$ { + /** @deprecated use `ListErc721BalancesResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc721BalancesResponse$inboundSchema; + /** @deprecated use `ListErc721BalancesResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc721BalancesResponse$outboundSchema; + /** @deprecated use `ListErc721BalancesResponse$Outbound` instead. */ + export type Outbound = ListErc721BalancesResponse$Outbound; +} diff --git a/src/models/operations/listerc721transactions.ts b/src/models/operations/listerc721transactions.ts new file mode 100644 index 0000000..7e88995 --- /dev/null +++ b/src/models/operations/listerc721transactions.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListErc721TransactionsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListErc721TransactionsRequest = { + /** + * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. + */ + startBlock?: number | undefined; + /** + * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. + */ + endBlock?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; +}; + +export type ListErc721TransactionsResponse = { + result: components.ListErc721TransactionsResponse; +}; + +/** @internal */ +export const ListErc721TransactionsGlobals$inboundSchema: z.ZodType< + ListErc721TransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListErc721TransactionsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListErc721TransactionsGlobals$outboundSchema: z.ZodType< + ListErc721TransactionsGlobals$Outbound, + z.ZodTypeDef, + ListErc721TransactionsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721TransactionsGlobals$ { + /** @deprecated use `ListErc721TransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListErc721TransactionsGlobals$inboundSchema; + /** @deprecated use `ListErc721TransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListErc721TransactionsGlobals$outboundSchema; + /** @deprecated use `ListErc721TransactionsGlobals$Outbound` instead. */ + export type Outbound = ListErc721TransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListErc721TransactionsRequest$inboundSchema: z.ZodType< + ListErc721TransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type ListErc721TransactionsRequest$Outbound = { + startBlock?: number | undefined; + endBlock?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListErc721TransactionsRequest$outboundSchema: z.ZodType< + ListErc721TransactionsRequest$Outbound, + z.ZodTypeDef, + ListErc721TransactionsRequest +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721TransactionsRequest$ { + /** @deprecated use `ListErc721TransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListErc721TransactionsRequest$inboundSchema; + /** @deprecated use `ListErc721TransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListErc721TransactionsRequest$outboundSchema; + /** @deprecated use `ListErc721TransactionsRequest$Outbound` instead. */ + export type Outbound = ListErc721TransactionsRequest$Outbound; +} + +/** @internal */ +export const ListErc721TransactionsResponse$inboundSchema: z.ZodType< + ListErc721TransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListErc721TransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListErc721TransactionsResponse$Outbound = { + Result: components.ListErc721TransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListErc721TransactionsResponse$outboundSchema: z.ZodType< + ListErc721TransactionsResponse$Outbound, + z.ZodTypeDef, + ListErc721TransactionsResponse +> = z + .object({ + result: components.ListErc721TransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListErc721TransactionsResponse$ { + /** @deprecated use `ListErc721TransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListErc721TransactionsResponse$inboundSchema; + /** @deprecated use `ListErc721TransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListErc721TransactionsResponse$outboundSchema; + /** @deprecated use `ListErc721TransactionsResponse$Outbound` instead. */ + export type Outbound = ListErc721TransactionsResponse$Outbound; +} diff --git a/src/models/operations/listhistoricalprimarynetworkrewards.ts b/src/models/operations/listhistoricalprimarynetworkrewards.ts new file mode 100644 index 0000000..96f95e0 --- /dev/null +++ b/src/models/operations/listhistoricalprimarynetworkrewards.ts @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListHistoricalPrimaryNetworkRewardsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListHistoricalPrimaryNetworkRewardsRequest = { + /** + * A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". Optional, but at least one of addresses or nodeIds is required. + */ + addresses?: string | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * A comma separated list of node ids to filter by. Optional, but at least one of addresses or nodeIds is required. + */ + nodeIds?: string | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; + /** + * The currency that return values should use. Defaults to USD. + */ + currency?: components.CurrencyCode | undefined; +}; + +export type ListHistoricalPrimaryNetworkRewardsResponse = { + result: components.ListHistoricalRewardsResponse; +}; + +/** @internal */ +export const ListHistoricalPrimaryNetworkRewardsGlobals$inboundSchema: z.ZodType< + ListHistoricalPrimaryNetworkRewardsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListHistoricalPrimaryNetworkRewardsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListHistoricalPrimaryNetworkRewardsGlobals$outboundSchema: z.ZodType< + ListHistoricalPrimaryNetworkRewardsGlobals$Outbound, + z.ZodTypeDef, + ListHistoricalPrimaryNetworkRewardsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListHistoricalPrimaryNetworkRewardsGlobals$ { + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListHistoricalPrimaryNetworkRewardsGlobals$inboundSchema; + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListHistoricalPrimaryNetworkRewardsGlobals$outboundSchema; + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsGlobals$Outbound` instead. */ + export type Outbound = ListHistoricalPrimaryNetworkRewardsGlobals$Outbound; +} + +/** @internal */ +export const ListHistoricalPrimaryNetworkRewardsRequest$inboundSchema: z.ZodType< + ListHistoricalPrimaryNetworkRewardsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$inboundSchema.optional(), + nodeIds: z.string().optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), + currency: components.CurrencyCode$inboundSchema.optional(), +}); + +/** @internal */ +export type ListHistoricalPrimaryNetworkRewardsRequest$Outbound = { + addresses?: string | undefined; + pageToken?: string | undefined; + pageSize: number; + network?: string | undefined; + nodeIds?: string | undefined; + sortOrder?: string | undefined; + currency?: string | undefined; +}; + +/** @internal */ +export const ListHistoricalPrimaryNetworkRewardsRequest$outboundSchema: z.ZodType< + ListHistoricalPrimaryNetworkRewardsRequest$Outbound, + z.ZodTypeDef, + ListHistoricalPrimaryNetworkRewardsRequest +> = z.object({ + addresses: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$outboundSchema.optional(), + nodeIds: z.string().optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), + currency: components.CurrencyCode$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListHistoricalPrimaryNetworkRewardsRequest$ { + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsRequest$inboundSchema` instead. */ + export const inboundSchema = ListHistoricalPrimaryNetworkRewardsRequest$inboundSchema; + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsRequest$outboundSchema` instead. */ + export const outboundSchema = ListHistoricalPrimaryNetworkRewardsRequest$outboundSchema; + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsRequest$Outbound` instead. */ + export type Outbound = ListHistoricalPrimaryNetworkRewardsRequest$Outbound; +} + +/** @internal */ +export const ListHistoricalPrimaryNetworkRewardsResponse$inboundSchema: z.ZodType< + ListHistoricalPrimaryNetworkRewardsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListHistoricalRewardsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListHistoricalPrimaryNetworkRewardsResponse$Outbound = { + Result: components.ListHistoricalRewardsResponse$Outbound; +}; + +/** @internal */ +export const ListHistoricalPrimaryNetworkRewardsResponse$outboundSchema: z.ZodType< + ListHistoricalPrimaryNetworkRewardsResponse$Outbound, + z.ZodTypeDef, + ListHistoricalPrimaryNetworkRewardsResponse +> = z + .object({ + result: components.ListHistoricalRewardsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListHistoricalPrimaryNetworkRewardsResponse$ { + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsResponse$inboundSchema` instead. */ + export const inboundSchema = ListHistoricalPrimaryNetworkRewardsResponse$inboundSchema; + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsResponse$outboundSchema` instead. */ + export const outboundSchema = ListHistoricalPrimaryNetworkRewardsResponse$outboundSchema; + /** @deprecated use `ListHistoricalPrimaryNetworkRewardsResponse$Outbound` instead. */ + export type Outbound = ListHistoricalPrimaryNetworkRewardsResponse$Outbound; +} diff --git a/src/models/operations/listinternaltransactions.ts b/src/models/operations/listinternaltransactions.ts new file mode 100644 index 0000000..96d4417 --- /dev/null +++ b/src/models/operations/listinternaltransactions.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListInternalTransactionsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListInternalTransactionsRequest = { + /** + * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. + */ + startBlock?: number | undefined; + /** + * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. + */ + endBlock?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; +}; + +export type ListInternalTransactionsResponse = { + result: components.ListInternalTransactionsResponse; +}; + +/** @internal */ +export const ListInternalTransactionsGlobals$inboundSchema: z.ZodType< + ListInternalTransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListInternalTransactionsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListInternalTransactionsGlobals$outboundSchema: z.ZodType< + ListInternalTransactionsGlobals$Outbound, + z.ZodTypeDef, + ListInternalTransactionsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListInternalTransactionsGlobals$ { + /** @deprecated use `ListInternalTransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListInternalTransactionsGlobals$inboundSchema; + /** @deprecated use `ListInternalTransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListInternalTransactionsGlobals$outboundSchema; + /** @deprecated use `ListInternalTransactionsGlobals$Outbound` instead. */ + export type Outbound = ListInternalTransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListInternalTransactionsRequest$inboundSchema: z.ZodType< + ListInternalTransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type ListInternalTransactionsRequest$Outbound = { + startBlock?: number | undefined; + endBlock?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListInternalTransactionsRequest$outboundSchema: z.ZodType< + ListInternalTransactionsRequest$Outbound, + z.ZodTypeDef, + ListInternalTransactionsRequest +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListInternalTransactionsRequest$ { + /** @deprecated use `ListInternalTransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListInternalTransactionsRequest$inboundSchema; + /** @deprecated use `ListInternalTransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListInternalTransactionsRequest$outboundSchema; + /** @deprecated use `ListInternalTransactionsRequest$Outbound` instead. */ + export type Outbound = ListInternalTransactionsRequest$Outbound; +} + +/** @internal */ +export const ListInternalTransactionsResponse$inboundSchema: z.ZodType< + ListInternalTransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListInternalTransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListInternalTransactionsResponse$Outbound = { + Result: components.ListInternalTransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListInternalTransactionsResponse$outboundSchema: z.ZodType< + ListInternalTransactionsResponse$Outbound, + z.ZodTypeDef, + ListInternalTransactionsResponse +> = z + .object({ + result: components.ListInternalTransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListInternalTransactionsResponse$ { + /** @deprecated use `ListInternalTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListInternalTransactionsResponse$inboundSchema; + /** @deprecated use `ListInternalTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListInternalTransactionsResponse$outboundSchema; + /** @deprecated use `ListInternalTransactionsResponse$Outbound` instead. */ + export type Outbound = ListInternalTransactionsResponse$Outbound; +} diff --git a/src/models/operations/listlatestprimarynetworkblocks.ts b/src/models/operations/listlatestprimarynetworkblocks.ts new file mode 100644 index 0000000..6e0bc6b --- /dev/null +++ b/src/models/operations/listlatestprimarynetworkblocks.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListLatestPrimaryNetworkBlocksGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListLatestPrimaryNetworkBlocksRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.BlockchainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListLatestPrimaryNetworkBlocksResponse = { + result: components.ListPrimaryNetworkBlocksResponse; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkBlocksGlobals$inboundSchema: z.ZodType< + ListLatestPrimaryNetworkBlocksGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListLatestPrimaryNetworkBlocksGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkBlocksGlobals$outboundSchema: z.ZodType< + ListLatestPrimaryNetworkBlocksGlobals$Outbound, + z.ZodTypeDef, + ListLatestPrimaryNetworkBlocksGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestPrimaryNetworkBlocksGlobals$ { + /** @deprecated use `ListLatestPrimaryNetworkBlocksGlobals$inboundSchema` instead. */ + export const inboundSchema = ListLatestPrimaryNetworkBlocksGlobals$inboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkBlocksGlobals$outboundSchema` instead. */ + export const outboundSchema = ListLatestPrimaryNetworkBlocksGlobals$outboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkBlocksGlobals$Outbound` instead. */ + export type Outbound = ListLatestPrimaryNetworkBlocksGlobals$Outbound; +} + +/** @internal */ +export const ListLatestPrimaryNetworkBlocksRequest$inboundSchema: z.ZodType< + ListLatestPrimaryNetworkBlocksRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListLatestPrimaryNetworkBlocksRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkBlocksRequest$outboundSchema: z.ZodType< + ListLatestPrimaryNetworkBlocksRequest$Outbound, + z.ZodTypeDef, + ListLatestPrimaryNetworkBlocksRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestPrimaryNetworkBlocksRequest$ { + /** @deprecated use `ListLatestPrimaryNetworkBlocksRequest$inboundSchema` instead. */ + export const inboundSchema = ListLatestPrimaryNetworkBlocksRequest$inboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkBlocksRequest$outboundSchema` instead. */ + export const outboundSchema = ListLatestPrimaryNetworkBlocksRequest$outboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkBlocksRequest$Outbound` instead. */ + export type Outbound = ListLatestPrimaryNetworkBlocksRequest$Outbound; +} + +/** @internal */ +export const ListLatestPrimaryNetworkBlocksResponse$inboundSchema: z.ZodType< + ListLatestPrimaryNetworkBlocksResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListPrimaryNetworkBlocksResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListLatestPrimaryNetworkBlocksResponse$Outbound = { + Result: components.ListPrimaryNetworkBlocksResponse$Outbound; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkBlocksResponse$outboundSchema: z.ZodType< + ListLatestPrimaryNetworkBlocksResponse$Outbound, + z.ZodTypeDef, + ListLatestPrimaryNetworkBlocksResponse +> = z + .object({ + result: components.ListPrimaryNetworkBlocksResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestPrimaryNetworkBlocksResponse$ { + /** @deprecated use `ListLatestPrimaryNetworkBlocksResponse$inboundSchema` instead. */ + export const inboundSchema = ListLatestPrimaryNetworkBlocksResponse$inboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkBlocksResponse$outboundSchema` instead. */ + export const outboundSchema = ListLatestPrimaryNetworkBlocksResponse$outboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkBlocksResponse$Outbound` instead. */ + export type Outbound = ListLatestPrimaryNetworkBlocksResponse$Outbound; +} diff --git a/src/models/operations/listlatestprimarynetworktransactions.ts b/src/models/operations/listlatestprimarynetworktransactions.ts new file mode 100644 index 0000000..d18e4a9 --- /dev/null +++ b/src/models/operations/listlatestprimarynetworktransactions.ts @@ -0,0 +1,264 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListLatestPrimaryNetworkTransactionsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListLatestPrimaryNetworkTransactionsRequest = { + /** + * A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". Also accepts EVM formatted addresses starting with "0x" for C-Chain-related atomic transaction lookups. + */ + addresses: string; + /** + * Query param for filtering items based on transaction types. + */ + txTypes?: Array | undefined; + /** + * Query param for retrieving items after a specific timestamp. + */ + startTimestamp?: number | undefined; + /** + * Query param for retrieving items before a specific timestamp. + */ + endTimestamp?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.BlockchainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +/** + * Successful response + */ +export type ListLatestPrimaryNetworkTransactionsResponseBody = + | components.ListPChainTransactionsResponse + | components.ListXChainTransactionsResponse + | components.ListCChainAtomicTransactionsResponse; + +export type ListLatestPrimaryNetworkTransactionsResponse = { + result: + | components.ListPChainTransactionsResponse + | components.ListXChainTransactionsResponse + | components.ListCChainAtomicTransactionsResponse; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsGlobals$inboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListLatestPrimaryNetworkTransactionsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsGlobals$outboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsGlobals$Outbound, + z.ZodTypeDef, + ListLatestPrimaryNetworkTransactionsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestPrimaryNetworkTransactionsGlobals$ { + /** @deprecated use `ListLatestPrimaryNetworkTransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListLatestPrimaryNetworkTransactionsGlobals$inboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListLatestPrimaryNetworkTransactionsGlobals$outboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsGlobals$Outbound` instead. */ + export type Outbound = ListLatestPrimaryNetworkTransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsRequest$inboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.string(), + txTypes: z.array(components.PrimaryNetworkTxType$inboundSchema).optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type ListLatestPrimaryNetworkTransactionsRequest$Outbound = { + addresses: string; + txTypes?: Array | undefined; + startTimestamp?: number | undefined; + endTimestamp?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsRequest$outboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsRequest$Outbound, + z.ZodTypeDef, + ListLatestPrimaryNetworkTransactionsRequest +> = z.object({ + addresses: z.string(), + txTypes: z.array(components.PrimaryNetworkTxType$outboundSchema).optional(), + startTimestamp: z.number().int().optional(), + endTimestamp: z.number().int().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestPrimaryNetworkTransactionsRequest$ { + /** @deprecated use `ListLatestPrimaryNetworkTransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListLatestPrimaryNetworkTransactionsRequest$inboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListLatestPrimaryNetworkTransactionsRequest$outboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsRequest$Outbound` instead. */ + export type Outbound = ListLatestPrimaryNetworkTransactionsRequest$Outbound; +} + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsResponseBody$inboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsResponseBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.ListPChainTransactionsResponse$inboundSchema, + components.ListXChainTransactionsResponse$inboundSchema, + components.ListCChainAtomicTransactionsResponse$inboundSchema, +]); + +/** @internal */ +export type ListLatestPrimaryNetworkTransactionsResponseBody$Outbound = + | components.ListPChainTransactionsResponse$Outbound + | components.ListXChainTransactionsResponse$Outbound + | components.ListCChainAtomicTransactionsResponse$Outbound; + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsResponseBody$outboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsResponseBody$Outbound, + z.ZodTypeDef, + ListLatestPrimaryNetworkTransactionsResponseBody +> = z.union([ + components.ListPChainTransactionsResponse$outboundSchema, + components.ListXChainTransactionsResponse$outboundSchema, + components.ListCChainAtomicTransactionsResponse$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestPrimaryNetworkTransactionsResponseBody$ { + /** @deprecated use `ListLatestPrimaryNetworkTransactionsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListLatestPrimaryNetworkTransactionsResponseBody$inboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListLatestPrimaryNetworkTransactionsResponseBody$outboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsResponseBody$Outbound` instead. */ + export type Outbound = ListLatestPrimaryNetworkTransactionsResponseBody$Outbound; +} + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsResponse$inboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: z.union([ + components.ListPChainTransactionsResponse$inboundSchema, + components.ListXChainTransactionsResponse$inboundSchema, + components.ListCChainAtomicTransactionsResponse$inboundSchema, + ]), + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListLatestPrimaryNetworkTransactionsResponse$Outbound = { + Result: + | components.ListPChainTransactionsResponse$Outbound + | components.ListXChainTransactionsResponse$Outbound + | components.ListCChainAtomicTransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListLatestPrimaryNetworkTransactionsResponse$outboundSchema: z.ZodType< + ListLatestPrimaryNetworkTransactionsResponse$Outbound, + z.ZodTypeDef, + ListLatestPrimaryNetworkTransactionsResponse +> = z + .object({ + result: z.union([ + components.ListPChainTransactionsResponse$outboundSchema, + components.ListXChainTransactionsResponse$outboundSchema, + components.ListCChainAtomicTransactionsResponse$outboundSchema, + ]), + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestPrimaryNetworkTransactionsResponse$ { + /** @deprecated use `ListLatestPrimaryNetworkTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListLatestPrimaryNetworkTransactionsResponse$inboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListLatestPrimaryNetworkTransactionsResponse$outboundSchema; + /** @deprecated use `ListLatestPrimaryNetworkTransactionsResponse$Outbound` instead. */ + export type Outbound = ListLatestPrimaryNetworkTransactionsResponse$Outbound; +} diff --git a/src/models/operations/listlatesttransactions.ts b/src/models/operations/listlatesttransactions.ts new file mode 100644 index 0000000..f0387c1 --- /dev/null +++ b/src/models/operations/listlatesttransactions.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListLatestTransactionsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListLatestTransactionsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A status filter for listed transactions. + */ + status?: components.TransactionStatus | undefined; +}; + +export type ListLatestTransactionsResponse = { + result: components.ListNativeTransactionsResponse; +}; + +/** @internal */ +export const ListLatestTransactionsGlobals$inboundSchema: z.ZodType< + ListLatestTransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListLatestTransactionsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListLatestTransactionsGlobals$outboundSchema: z.ZodType< + ListLatestTransactionsGlobals$Outbound, + z.ZodTypeDef, + ListLatestTransactionsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTransactionsGlobals$ { + /** @deprecated use `ListLatestTransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListLatestTransactionsGlobals$inboundSchema; + /** @deprecated use `ListLatestTransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListLatestTransactionsGlobals$outboundSchema; + /** @deprecated use `ListLatestTransactionsGlobals$Outbound` instead. */ + export type Outbound = ListLatestTransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListLatestTransactionsRequest$inboundSchema: z.ZodType< + ListLatestTransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + status: components.TransactionStatus$inboundSchema.optional(), +}); + +/** @internal */ +export type ListLatestTransactionsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + status?: string | undefined; +}; + +/** @internal */ +export const ListLatestTransactionsRequest$outboundSchema: z.ZodType< + ListLatestTransactionsRequest$Outbound, + z.ZodTypeDef, + ListLatestTransactionsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + status: components.TransactionStatus$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTransactionsRequest$ { + /** @deprecated use `ListLatestTransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListLatestTransactionsRequest$inboundSchema; + /** @deprecated use `ListLatestTransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListLatestTransactionsRequest$outboundSchema; + /** @deprecated use `ListLatestTransactionsRequest$Outbound` instead. */ + export type Outbound = ListLatestTransactionsRequest$Outbound; +} + +/** @internal */ +export const ListLatestTransactionsResponse$inboundSchema: z.ZodType< + ListLatestTransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListNativeTransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListLatestTransactionsResponse$Outbound = { + Result: components.ListNativeTransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListLatestTransactionsResponse$outboundSchema: z.ZodType< + ListLatestTransactionsResponse$Outbound, + z.ZodTypeDef, + ListLatestTransactionsResponse +> = z + .object({ + result: components.ListNativeTransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTransactionsResponse$ { + /** @deprecated use `ListLatestTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListLatestTransactionsResponse$inboundSchema; + /** @deprecated use `ListLatestTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListLatestTransactionsResponse$outboundSchema; + /** @deprecated use `ListLatestTransactionsResponse$Outbound` instead. */ + export type Outbound = ListLatestTransactionsResponse$Outbound; +} diff --git a/src/models/operations/listlatestxchainvertices.ts b/src/models/operations/listlatestxchainvertices.ts new file mode 100644 index 0000000..a32865f --- /dev/null +++ b/src/models/operations/listlatestxchainvertices.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListLatestXChainVerticesGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListLatestXChainVerticesRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.XChainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListLatestXChainVerticesResponse = { + result: components.ListXChainVerticesResponse; +}; + +/** @internal */ +export const ListLatestXChainVerticesGlobals$inboundSchema: z.ZodType< + ListLatestXChainVerticesGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListLatestXChainVerticesGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListLatestXChainVerticesGlobals$outboundSchema: z.ZodType< + ListLatestXChainVerticesGlobals$Outbound, + z.ZodTypeDef, + ListLatestXChainVerticesGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestXChainVerticesGlobals$ { + /** @deprecated use `ListLatestXChainVerticesGlobals$inboundSchema` instead. */ + export const inboundSchema = ListLatestXChainVerticesGlobals$inboundSchema; + /** @deprecated use `ListLatestXChainVerticesGlobals$outboundSchema` instead. */ + export const outboundSchema = ListLatestXChainVerticesGlobals$outboundSchema; + /** @deprecated use `ListLatestXChainVerticesGlobals$Outbound` instead. */ + export type Outbound = ListLatestXChainVerticesGlobals$Outbound; +} + +/** @internal */ +export const ListLatestXChainVerticesRequest$inboundSchema: z.ZodType< + ListLatestXChainVerticesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.XChainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListLatestXChainVerticesRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; +}; + +/** @internal */ +export const ListLatestXChainVerticesRequest$outboundSchema: z.ZodType< + ListLatestXChainVerticesRequest$Outbound, + z.ZodTypeDef, + ListLatestXChainVerticesRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.XChainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestXChainVerticesRequest$ { + /** @deprecated use `ListLatestXChainVerticesRequest$inboundSchema` instead. */ + export const inboundSchema = ListLatestXChainVerticesRequest$inboundSchema; + /** @deprecated use `ListLatestXChainVerticesRequest$outboundSchema` instead. */ + export const outboundSchema = ListLatestXChainVerticesRequest$outboundSchema; + /** @deprecated use `ListLatestXChainVerticesRequest$Outbound` instead. */ + export type Outbound = ListLatestXChainVerticesRequest$Outbound; +} + +/** @internal */ +export const ListLatestXChainVerticesResponse$inboundSchema: z.ZodType< + ListLatestXChainVerticesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListXChainVerticesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListLatestXChainVerticesResponse$Outbound = { + Result: components.ListXChainVerticesResponse$Outbound; +}; + +/** @internal */ +export const ListLatestXChainVerticesResponse$outboundSchema: z.ZodType< + ListLatestXChainVerticesResponse$Outbound, + z.ZodTypeDef, + ListLatestXChainVerticesResponse +> = z + .object({ + result: components.ListXChainVerticesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestXChainVerticesResponse$ { + /** @deprecated use `ListLatestXChainVerticesResponse$inboundSchema` instead. */ + export const inboundSchema = ListLatestXChainVerticesResponse$inboundSchema; + /** @deprecated use `ListLatestXChainVerticesResponse$outboundSchema` instead. */ + export const outboundSchema = ListLatestXChainVerticesResponse$outboundSchema; + /** @deprecated use `ListLatestXChainVerticesResponse$Outbound` instead. */ + export type Outbound = ListLatestXChainVerticesResponse$Outbound; +} diff --git a/src/models/operations/listnativetransactions.ts b/src/models/operations/listnativetransactions.ts new file mode 100644 index 0000000..9fc4d5a --- /dev/null +++ b/src/models/operations/listnativetransactions.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListNativeTransactionsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListNativeTransactionsRequest = { + /** + * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. + */ + startBlock?: number | undefined; + /** + * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. + */ + endBlock?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; +}; + +export type ListNativeTransactionsResponse = { + result: components.ListNativeTransactionsResponse; +}; + +/** @internal */ +export const ListNativeTransactionsGlobals$inboundSchema: z.ZodType< + ListNativeTransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListNativeTransactionsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListNativeTransactionsGlobals$outboundSchema: z.ZodType< + ListNativeTransactionsGlobals$Outbound, + z.ZodTypeDef, + ListNativeTransactionsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListNativeTransactionsGlobals$ { + /** @deprecated use `ListNativeTransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListNativeTransactionsGlobals$inboundSchema; + /** @deprecated use `ListNativeTransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListNativeTransactionsGlobals$outboundSchema; + /** @deprecated use `ListNativeTransactionsGlobals$Outbound` instead. */ + export type Outbound = ListNativeTransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListNativeTransactionsRequest$inboundSchema: z.ZodType< + ListNativeTransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type ListNativeTransactionsRequest$Outbound = { + startBlock?: number | undefined; + endBlock?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListNativeTransactionsRequest$outboundSchema: z.ZodType< + ListNativeTransactionsRequest$Outbound, + z.ZodTypeDef, + ListNativeTransactionsRequest +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListNativeTransactionsRequest$ { + /** @deprecated use `ListNativeTransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListNativeTransactionsRequest$inboundSchema; + /** @deprecated use `ListNativeTransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListNativeTransactionsRequest$outboundSchema; + /** @deprecated use `ListNativeTransactionsRequest$Outbound` instead. */ + export type Outbound = ListNativeTransactionsRequest$Outbound; +} + +/** @internal */ +export const ListNativeTransactionsResponse$inboundSchema: z.ZodType< + ListNativeTransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListNativeTransactionsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListNativeTransactionsResponse$Outbound = { + Result: components.ListNativeTransactionsResponse$Outbound; +}; + +/** @internal */ +export const ListNativeTransactionsResponse$outboundSchema: z.ZodType< + ListNativeTransactionsResponse$Outbound, + z.ZodTypeDef, + ListNativeTransactionsResponse +> = z + .object({ + result: components.ListNativeTransactionsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListNativeTransactionsResponse$ { + /** @deprecated use `ListNativeTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListNativeTransactionsResponse$inboundSchema; + /** @deprecated use `ListNativeTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListNativeTransactionsResponse$outboundSchema; + /** @deprecated use `ListNativeTransactionsResponse$Outbound` instead. */ + export type Outbound = ListNativeTransactionsResponse$Outbound; +} diff --git a/src/models/operations/listpendingprimarynetworkrewards.ts b/src/models/operations/listpendingprimarynetworkrewards.ts new file mode 100644 index 0000000..0a8a06a --- /dev/null +++ b/src/models/operations/listpendingprimarynetworkrewards.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListPendingPrimaryNetworkRewardsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListPendingPrimaryNetworkRewardsRequest = { + /** + * A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". One of addresses or nodeIds is required. + */ + addresses?: string | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * A comma separated list of node ids to filter by. One of addresses or nodeIds is required. + */ + nodeIds?: string | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +export type ListPendingPrimaryNetworkRewardsResponse = { + result: components.ListPendingRewardsResponse; +}; + +/** @internal */ +export const ListPendingPrimaryNetworkRewardsGlobals$inboundSchema: z.ZodType< + ListPendingPrimaryNetworkRewardsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListPendingPrimaryNetworkRewardsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListPendingPrimaryNetworkRewardsGlobals$outboundSchema: z.ZodType< + ListPendingPrimaryNetworkRewardsGlobals$Outbound, + z.ZodTypeDef, + ListPendingPrimaryNetworkRewardsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPendingPrimaryNetworkRewardsGlobals$ { + /** @deprecated use `ListPendingPrimaryNetworkRewardsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListPendingPrimaryNetworkRewardsGlobals$inboundSchema; + /** @deprecated use `ListPendingPrimaryNetworkRewardsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListPendingPrimaryNetworkRewardsGlobals$outboundSchema; + /** @deprecated use `ListPendingPrimaryNetworkRewardsGlobals$Outbound` instead. */ + export type Outbound = ListPendingPrimaryNetworkRewardsGlobals$Outbound; +} + +/** @internal */ +export const ListPendingPrimaryNetworkRewardsRequest$inboundSchema: z.ZodType< + ListPendingPrimaryNetworkRewardsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + addresses: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$inboundSchema.optional(), + nodeIds: z.string().optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type ListPendingPrimaryNetworkRewardsRequest$Outbound = { + addresses?: string | undefined; + pageToken?: string | undefined; + pageSize: number; + network?: string | undefined; + nodeIds?: string | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const ListPendingPrimaryNetworkRewardsRequest$outboundSchema: z.ZodType< + ListPendingPrimaryNetworkRewardsRequest$Outbound, + z.ZodTypeDef, + ListPendingPrimaryNetworkRewardsRequest +> = z.object({ + addresses: z.string().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$outboundSchema.optional(), + nodeIds: z.string().optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPendingPrimaryNetworkRewardsRequest$ { + /** @deprecated use `ListPendingPrimaryNetworkRewardsRequest$inboundSchema` instead. */ + export const inboundSchema = ListPendingPrimaryNetworkRewardsRequest$inboundSchema; + /** @deprecated use `ListPendingPrimaryNetworkRewardsRequest$outboundSchema` instead. */ + export const outboundSchema = ListPendingPrimaryNetworkRewardsRequest$outboundSchema; + /** @deprecated use `ListPendingPrimaryNetworkRewardsRequest$Outbound` instead. */ + export type Outbound = ListPendingPrimaryNetworkRewardsRequest$Outbound; +} + +/** @internal */ +export const ListPendingPrimaryNetworkRewardsResponse$inboundSchema: z.ZodType< + ListPendingPrimaryNetworkRewardsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListPendingRewardsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListPendingPrimaryNetworkRewardsResponse$Outbound = { + Result: components.ListPendingRewardsResponse$Outbound; +}; + +/** @internal */ +export const ListPendingPrimaryNetworkRewardsResponse$outboundSchema: z.ZodType< + ListPendingPrimaryNetworkRewardsResponse$Outbound, + z.ZodTypeDef, + ListPendingPrimaryNetworkRewardsResponse +> = z + .object({ + result: components.ListPendingRewardsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPendingPrimaryNetworkRewardsResponse$ { + /** @deprecated use `ListPendingPrimaryNetworkRewardsResponse$inboundSchema` instead. */ + export const inboundSchema = ListPendingPrimaryNetworkRewardsResponse$inboundSchema; + /** @deprecated use `ListPendingPrimaryNetworkRewardsResponse$outboundSchema` instead. */ + export const outboundSchema = ListPendingPrimaryNetworkRewardsResponse$outboundSchema; + /** @deprecated use `ListPendingPrimaryNetworkRewardsResponse$Outbound` instead. */ + export type Outbound = ListPendingPrimaryNetworkRewardsResponse$Outbound; +} diff --git a/src/models/operations/listprimarynetworkblocksbynodeid.ts b/src/models/operations/listprimarynetworkblocksbynodeid.ts new file mode 100644 index 0000000..f7bbf1e --- /dev/null +++ b/src/models/operations/listprimarynetworkblocksbynodeid.ts @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListPrimaryNetworkBlocksByNodeIdGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListPrimaryNetworkBlocksByNodeIdRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A primary network blockchain id or alias. + */ + blockchainId: components.BlockchainId; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * A primary network (P or X chain) nodeId. + */ + nodeId: string; +}; + +export type ListPrimaryNetworkBlocksByNodeIdResponse = { + result: components.ListPrimaryNetworkBlocksResponse; +}; + +/** @internal */ +export const ListPrimaryNetworkBlocksByNodeIdGlobals$inboundSchema: z.ZodType< + ListPrimaryNetworkBlocksByNodeIdGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListPrimaryNetworkBlocksByNodeIdGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListPrimaryNetworkBlocksByNodeIdGlobals$outboundSchema: z.ZodType< + ListPrimaryNetworkBlocksByNodeIdGlobals$Outbound, + z.ZodTypeDef, + ListPrimaryNetworkBlocksByNodeIdGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPrimaryNetworkBlocksByNodeIdGlobals$ { + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdGlobals$inboundSchema` instead. */ + export const inboundSchema = ListPrimaryNetworkBlocksByNodeIdGlobals$inboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdGlobals$outboundSchema` instead. */ + export const outboundSchema = ListPrimaryNetworkBlocksByNodeIdGlobals$outboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdGlobals$Outbound` instead. */ + export type Outbound = ListPrimaryNetworkBlocksByNodeIdGlobals$Outbound; +} + +/** @internal */ +export const ListPrimaryNetworkBlocksByNodeIdRequest$inboundSchema: z.ZodType< + ListPrimaryNetworkBlocksByNodeIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$inboundSchema, + network: components.GlobalParamNetwork$inboundSchema.optional(), + nodeId: z.string(), +}); + +/** @internal */ +export type ListPrimaryNetworkBlocksByNodeIdRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + blockchainId: string; + network?: string | undefined; + nodeId: string; +}; + +/** @internal */ +export const ListPrimaryNetworkBlocksByNodeIdRequest$outboundSchema: z.ZodType< + ListPrimaryNetworkBlocksByNodeIdRequest$Outbound, + z.ZodTypeDef, + ListPrimaryNetworkBlocksByNodeIdRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + blockchainId: components.BlockchainId$outboundSchema, + network: components.GlobalParamNetwork$outboundSchema.optional(), + nodeId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPrimaryNetworkBlocksByNodeIdRequest$ { + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdRequest$inboundSchema` instead. */ + export const inboundSchema = ListPrimaryNetworkBlocksByNodeIdRequest$inboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdRequest$outboundSchema` instead. */ + export const outboundSchema = ListPrimaryNetworkBlocksByNodeIdRequest$outboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdRequest$Outbound` instead. */ + export type Outbound = ListPrimaryNetworkBlocksByNodeIdRequest$Outbound; +} + +/** @internal */ +export const ListPrimaryNetworkBlocksByNodeIdResponse$inboundSchema: z.ZodType< + ListPrimaryNetworkBlocksByNodeIdResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListPrimaryNetworkBlocksResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListPrimaryNetworkBlocksByNodeIdResponse$Outbound = { + Result: components.ListPrimaryNetworkBlocksResponse$Outbound; +}; + +/** @internal */ +export const ListPrimaryNetworkBlocksByNodeIdResponse$outboundSchema: z.ZodType< + ListPrimaryNetworkBlocksByNodeIdResponse$Outbound, + z.ZodTypeDef, + ListPrimaryNetworkBlocksByNodeIdResponse +> = z + .object({ + result: components.ListPrimaryNetworkBlocksResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPrimaryNetworkBlocksByNodeIdResponse$ { + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdResponse$inboundSchema` instead. */ + export const inboundSchema = ListPrimaryNetworkBlocksByNodeIdResponse$inboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdResponse$outboundSchema` instead. */ + export const outboundSchema = ListPrimaryNetworkBlocksByNodeIdResponse$outboundSchema; + /** @deprecated use `ListPrimaryNetworkBlocksByNodeIdResponse$Outbound` instead. */ + export type Outbound = ListPrimaryNetworkBlocksByNodeIdResponse$Outbound; +} diff --git a/src/models/operations/listsubnets.ts b/src/models/operations/listsubnets.ts new file mode 100644 index 0000000..dd20016 --- /dev/null +++ b/src/models/operations/listsubnets.ts @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListSubnetsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListSubnetsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +export type ListSubnetsResponse = { + result: components.ListSubnetsResponse; +}; + +/** @internal */ +export const ListSubnetsGlobals$inboundSchema: z.ZodType< + ListSubnetsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListSubnetsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListSubnetsGlobals$outboundSchema: z.ZodType< + ListSubnetsGlobals$Outbound, + z.ZodTypeDef, + ListSubnetsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListSubnetsGlobals$ { + /** @deprecated use `ListSubnetsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListSubnetsGlobals$inboundSchema; + /** @deprecated use `ListSubnetsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListSubnetsGlobals$outboundSchema; + /** @deprecated use `ListSubnetsGlobals$Outbound` instead. */ + export type Outbound = ListSubnetsGlobals$Outbound; +} + +/** @internal */ +export const ListSubnetsRequest$inboundSchema: z.ZodType< + ListSubnetsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type ListSubnetsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + network?: string | undefined; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const ListSubnetsRequest$outboundSchema: z.ZodType< + ListSubnetsRequest$Outbound, + z.ZodTypeDef, + ListSubnetsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListSubnetsRequest$ { + /** @deprecated use `ListSubnetsRequest$inboundSchema` instead. */ + export const inboundSchema = ListSubnetsRequest$inboundSchema; + /** @deprecated use `ListSubnetsRequest$outboundSchema` instead. */ + export const outboundSchema = ListSubnetsRequest$outboundSchema; + /** @deprecated use `ListSubnetsRequest$Outbound` instead. */ + export type Outbound = ListSubnetsRequest$Outbound; +} + +/** @internal */ +export const ListSubnetsResponse$inboundSchema: z.ZodType< + ListSubnetsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListSubnetsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListSubnetsResponse$Outbound = { + Result: components.ListSubnetsResponse$Outbound; +}; + +/** @internal */ +export const ListSubnetsResponse$outboundSchema: z.ZodType< + ListSubnetsResponse$Outbound, + z.ZodTypeDef, + ListSubnetsResponse +> = z + .object({ + result: components.ListSubnetsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListSubnetsResponse$ { + /** @deprecated use `ListSubnetsResponse$inboundSchema` instead. */ + export const inboundSchema = ListSubnetsResponse$inboundSchema; + /** @deprecated use `ListSubnetsResponse$outboundSchema` instead. */ + export const outboundSchema = ListSubnetsResponse$outboundSchema; + /** @deprecated use `ListSubnetsResponse$Outbound` instead. */ + export type Outbound = ListSubnetsResponse$Outbound; +} diff --git a/src/models/operations/listteleportermessages.ts b/src/models/operations/listteleportermessages.ts new file mode 100644 index 0000000..5d5c7ac --- /dev/null +++ b/src/models/operations/listteleportermessages.ts @@ -0,0 +1,151 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListTeleporterMessagesRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * The base58 encoded blockchain ID or evm chain ID of the source chain that the teleporter message was sent from. + */ + sourceBlockchainId?: string | undefined; + /** + * The base58 encoded blockchain ID or evm chain ID of the destination chain that the teleporter message was sent to. + */ + destinationBlockchainId?: string | undefined; + /** + * The base58 encoded blockchain ID of either source or destination chain that one teleporter message interacts with. + */ + blockchainId?: string | undefined; + /** + * The address of the recipient of the teleporter message. + */ + to?: string | undefined; + /** + * The address of the sender of the teleporter message. + */ + from?: string | undefined; + /** + * mainnet or testnet. + */ + network?: components.NetworkType | undefined; +}; + +export type ListTeleporterMessagesResponse = { + result: components.ListTeleporterMessagesResponse; +}; + +/** @internal */ +export const ListTeleporterMessagesRequest$inboundSchema: z.ZodType< + ListTeleporterMessagesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + sourceBlockchainId: z.string().optional(), + destinationBlockchainId: z.string().optional(), + blockchainId: z.string().optional(), + to: z.string().optional(), + from: z.string().optional(), + network: components.NetworkType$inboundSchema.optional(), +}); + +/** @internal */ +export type ListTeleporterMessagesRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + sourceBlockchainId?: string | undefined; + destinationBlockchainId?: string | undefined; + blockchainId?: string | undefined; + to?: string | undefined; + from?: string | undefined; + network?: string | undefined; +}; + +/** @internal */ +export const ListTeleporterMessagesRequest$outboundSchema: z.ZodType< + ListTeleporterMessagesRequest$Outbound, + z.ZodTypeDef, + ListTeleporterMessagesRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + sourceBlockchainId: z.string().optional(), + destinationBlockchainId: z.string().optional(), + blockchainId: z.string().optional(), + to: z.string().optional(), + from: z.string().optional(), + network: components.NetworkType$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTeleporterMessagesRequest$ { + /** @deprecated use `ListTeleporterMessagesRequest$inboundSchema` instead. */ + export const inboundSchema = ListTeleporterMessagesRequest$inboundSchema; + /** @deprecated use `ListTeleporterMessagesRequest$outboundSchema` instead. */ + export const outboundSchema = ListTeleporterMessagesRequest$outboundSchema; + /** @deprecated use `ListTeleporterMessagesRequest$Outbound` instead. */ + export type Outbound = ListTeleporterMessagesRequest$Outbound; +} + +/** @internal */ +export const ListTeleporterMessagesResponse$inboundSchema: z.ZodType< + ListTeleporterMessagesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListTeleporterMessagesResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListTeleporterMessagesResponse$Outbound = { + Result: components.ListTeleporterMessagesResponse$Outbound; +}; + +/** @internal */ +export const ListTeleporterMessagesResponse$outboundSchema: z.ZodType< + ListTeleporterMessagesResponse$Outbound, + z.ZodTypeDef, + ListTeleporterMessagesResponse +> = z + .object({ + result: components.ListTeleporterMessagesResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTeleporterMessagesResponse$ { + /** @deprecated use `ListTeleporterMessagesResponse$inboundSchema` instead. */ + export const inboundSchema = ListTeleporterMessagesResponse$inboundSchema; + /** @deprecated use `ListTeleporterMessagesResponse$outboundSchema` instead. */ + export const outboundSchema = ListTeleporterMessagesResponse$outboundSchema; + /** @deprecated use `ListTeleporterMessagesResponse$Outbound` instead. */ + export type Outbound = ListTeleporterMessagesResponse$Outbound; +} diff --git a/src/models/operations/listtokens.ts b/src/models/operations/listtokens.ts new file mode 100644 index 0000000..6832a89 --- /dev/null +++ b/src/models/operations/listtokens.ts @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListTokensGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListTokensRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * Contract address on the relevant chain. + */ + address: string; +}; + +export type ListTokensResponse = { + result: components.ListNftTokens; +}; + +/** @internal */ +export const ListTokensGlobals$inboundSchema: z.ZodType = + z.object({ + chainId: z.string().optional(), + }); + +/** @internal */ +export type ListTokensGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListTokensGlobals$outboundSchema: z.ZodType< + ListTokensGlobals$Outbound, + z.ZodTypeDef, + ListTokensGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTokensGlobals$ { + /** @deprecated use `ListTokensGlobals$inboundSchema` instead. */ + export const inboundSchema = ListTokensGlobals$inboundSchema; + /** @deprecated use `ListTokensGlobals$outboundSchema` instead. */ + export const outboundSchema = ListTokensGlobals$outboundSchema; + /** @deprecated use `ListTokensGlobals$Outbound` instead. */ + export type Outbound = ListTokensGlobals$Outbound; +} + +/** @internal */ +export const ListTokensRequest$inboundSchema: z.ZodType = + z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), + }); + +/** @internal */ +export type ListTokensRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListTokensRequest$outboundSchema: z.ZodType< + ListTokensRequest$Outbound, + z.ZodTypeDef, + ListTokensRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTokensRequest$ { + /** @deprecated use `ListTokensRequest$inboundSchema` instead. */ + export const inboundSchema = ListTokensRequest$inboundSchema; + /** @deprecated use `ListTokensRequest$outboundSchema` instead. */ + export const outboundSchema = ListTokensRequest$outboundSchema; + /** @deprecated use `ListTokensRequest$Outbound` instead. */ + export type Outbound = ListTokensRequest$Outbound; +} + +/** @internal */ +export const ListTokensResponse$inboundSchema: z.ZodType< + ListTokensResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListNftTokens$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListTokensResponse$Outbound = { + Result: components.ListNftTokens$Outbound; +}; + +/** @internal */ +export const ListTokensResponse$outboundSchema: z.ZodType< + ListTokensResponse$Outbound, + z.ZodTypeDef, + ListTokensResponse +> = z + .object({ + result: components.ListNftTokens$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTokensResponse$ { + /** @deprecated use `ListTokensResponse$inboundSchema` instead. */ + export const inboundSchema = ListTokensResponse$inboundSchema; + /** @deprecated use `ListTokensResponse$outboundSchema` instead. */ + export const outboundSchema = ListTokensResponse$outboundSchema; + /** @deprecated use `ListTokensResponse$Outbound` instead. */ + export type Outbound = ListTokensResponse$Outbound; +} diff --git a/src/models/operations/listtransactions.ts b/src/models/operations/listtransactions.ts new file mode 100644 index 0000000..00d5d79 --- /dev/null +++ b/src/models/operations/listtransactions.ts @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListTransactionsGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListTransactionsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. + */ + startBlock?: number | undefined; + /** + * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. + */ + endBlock?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; +}; + +export type ListTransactionsResponse = { + result: components.ListTransactionDetailsResponse; +}; + +/** @internal */ +export const ListTransactionsGlobals$inboundSchema: z.ZodType< + ListTransactionsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListTransactionsGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListTransactionsGlobals$outboundSchema: z.ZodType< + ListTransactionsGlobals$Outbound, + z.ZodTypeDef, + ListTransactionsGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransactionsGlobals$ { + /** @deprecated use `ListTransactionsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListTransactionsGlobals$inboundSchema; + /** @deprecated use `ListTransactionsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListTransactionsGlobals$outboundSchema; + /** @deprecated use `ListTransactionsGlobals$Outbound` instead. */ + export type Outbound = ListTransactionsGlobals$Outbound; +} + +/** @internal */ +export const ListTransactionsRequest$inboundSchema: z.ZodType< + ListTransactionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + startBlock: z.number().optional(), + endBlock: z.number().optional(), + chainId: z.string().optional(), + address: z.string(), + sortOrder: components.SortOrder$inboundSchema.optional(), +}); + +/** @internal */ +export type ListTransactionsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + startBlock?: number | undefined; + endBlock?: number | undefined; + chainId?: string | undefined; + address: string; + sortOrder?: string | undefined; +}; + +/** @internal */ +export const ListTransactionsRequest$outboundSchema: z.ZodType< + ListTransactionsRequest$Outbound, + z.ZodTypeDef, + ListTransactionsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + startBlock: z.number().optional(), + endBlock: z.number().optional(), + chainId: z.string().optional(), + address: z.string(), + sortOrder: components.SortOrder$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransactionsRequest$ { + /** @deprecated use `ListTransactionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListTransactionsRequest$inboundSchema; + /** @deprecated use `ListTransactionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListTransactionsRequest$outboundSchema; + /** @deprecated use `ListTransactionsRequest$Outbound` instead. */ + export type Outbound = ListTransactionsRequest$Outbound; +} + +/** @internal */ +export const ListTransactionsResponse$inboundSchema: z.ZodType< + ListTransactionsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListTransactionDetailsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListTransactionsResponse$Outbound = { + Result: components.ListTransactionDetailsResponse$Outbound; +}; + +/** @internal */ +export const ListTransactionsResponse$outboundSchema: z.ZodType< + ListTransactionsResponse$Outbound, + z.ZodTypeDef, + ListTransactionsResponse +> = z + .object({ + result: components.ListTransactionDetailsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransactionsResponse$ { + /** @deprecated use `ListTransactionsResponse$inboundSchema` instead. */ + export const inboundSchema = ListTransactionsResponse$inboundSchema; + /** @deprecated use `ListTransactionsResponse$outboundSchema` instead. */ + export const outboundSchema = ListTransactionsResponse$outboundSchema; + /** @deprecated use `ListTransactionsResponse$Outbound` instead. */ + export type Outbound = ListTransactionsResponse$Outbound; +} diff --git a/src/models/operations/listtransfers.ts b/src/models/operations/listtransfers.ts new file mode 100644 index 0000000..f46ada9 --- /dev/null +++ b/src/models/operations/listtransfers.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListTransfersGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ListTransfersRequest = { + /** + * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block. + */ + startBlock?: number | undefined; + /** + * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block. + */ + endBlock?: number | undefined; + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * A wallet address. + */ + address: string; +}; + +export type ListTransfersResponse = { + result: components.ListTransfersResponse; +}; + +/** @internal */ +export const ListTransfersGlobals$inboundSchema: z.ZodType< + ListTransfersGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + chainId: z.string().optional(), +}); + +/** @internal */ +export type ListTransfersGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ListTransfersGlobals$outboundSchema: z.ZodType< + ListTransfersGlobals$Outbound, + z.ZodTypeDef, + ListTransfersGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransfersGlobals$ { + /** @deprecated use `ListTransfersGlobals$inboundSchema` instead. */ + export const inboundSchema = ListTransfersGlobals$inboundSchema; + /** @deprecated use `ListTransfersGlobals$outboundSchema` instead. */ + export const outboundSchema = ListTransfersGlobals$outboundSchema; + /** @deprecated use `ListTransfersGlobals$Outbound` instead. */ + export type Outbound = ListTransfersGlobals$Outbound; +} + +/** @internal */ +export const ListTransfersRequest$inboundSchema: z.ZodType< + ListTransfersRequest, + z.ZodTypeDef, + unknown +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** @internal */ +export type ListTransfersRequest$Outbound = { + startBlock?: number | undefined; + endBlock?: number | undefined; + pageToken?: string | undefined; + pageSize: number; + chainId?: string | undefined; + address: string; +}; + +/** @internal */ +export const ListTransfersRequest$outboundSchema: z.ZodType< + ListTransfersRequest$Outbound, + z.ZodTypeDef, + ListTransfersRequest +> = z.object({ + startBlock: z.number().optional(), + endBlock: z.number().optional(), + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + chainId: z.string().optional(), + address: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransfersRequest$ { + /** @deprecated use `ListTransfersRequest$inboundSchema` instead. */ + export const inboundSchema = ListTransfersRequest$inboundSchema; + /** @deprecated use `ListTransfersRequest$outboundSchema` instead. */ + export const outboundSchema = ListTransfersRequest$outboundSchema; + /** @deprecated use `ListTransfersRequest$Outbound` instead. */ + export type Outbound = ListTransfersRequest$Outbound; +} + +/** @internal */ +export const ListTransfersResponse$inboundSchema: z.ZodType< + ListTransfersResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListTransfersResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListTransfersResponse$Outbound = { + Result: components.ListTransfersResponse$Outbound; +}; + +/** @internal */ +export const ListTransfersResponse$outboundSchema: z.ZodType< + ListTransfersResponse$Outbound, + z.ZodTypeDef, + ListTransfersResponse +> = z + .object({ + result: components.ListTransfersResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTransfersResponse$ { + /** @deprecated use `ListTransfersResponse$inboundSchema` instead. */ + export const inboundSchema = ListTransfersResponse$inboundSchema; + /** @deprecated use `ListTransfersResponse$outboundSchema` instead. */ + export const outboundSchema = ListTransfersResponse$outboundSchema; + /** @deprecated use `ListTransfersResponse$Outbound` instead. */ + export type Outbound = ListTransfersResponse$Outbound; +} diff --git a/src/models/operations/listvalidators.ts b/src/models/operations/listvalidators.ts new file mode 100644 index 0000000..2251e00 --- /dev/null +++ b/src/models/operations/listvalidators.ts @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListValidatorsGlobals = { + /** + * A supported network type mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; +}; + +export type ListValidatorsRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * Either mainnet or a testnet. + */ + network?: components.GlobalParamNetwork | undefined; + /** + * A comma separated list of node ids to filter by. + */ + nodeIds?: string | undefined; + /** + * Which property to sort by, in conjunction with sortOrder. + * + * @remarks + * + * Note: Delegation fee is only available for mainnet validators. Set `subnetId` to `11111111111111111111111111111111LpoYY` to use this option. + */ + sortBy?: components.SortByOption | undefined; + /** + * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided. + */ + sortOrder?: components.SortOrder | undefined; + /** + * Validation status of the node. + */ + validationStatus?: components.ValidationStatusType | undefined; + /** + * The minimum delegation capacity, in nAVAX, used to filter the set of nodes being returned. Accepts values between 0 and 720,000,000,000,000,000 + */ + minDelegationCapacity?: string | undefined; + /** + * The maximum delegation capacity, in nAVAX, used to filter the set of nodes being returned. Accepts values between 0 and 720,000,000,000,000,000. + */ + maxDelegationCapacity?: string | undefined; + /** + * The minimum validation time remaining, in seconds, used to filter the set of nodes being returned. + */ + minTimeRemaining?: number | undefined; + /** + * The maximum validation time remaining, in seconds, used to filter the set of nodes being returned. + */ + maxTimeRemaining?: number | undefined; + /** + * The minimum fee percentage, used to filter the set of nodes being returned. If this field is populated no subnet validations will be returned, as their fee percentage is null, since subnet delegations are not supported. Default is 2.0, as per the Avalanche spec. + */ + minFeePercentage?: number | undefined; + /** + * The maximum fee percentage, used to filter the set of nodes being returned. If this field is populated no subnet validations will be returned, as their fee percentage is null, since subnet delegations are not supported. Default is 100.0. + */ + maxFeePercentage?: number | undefined; + /** + * The minimum node uptime performance percentage, which represents node health, used to filter the set of nodes being returned Default is 90. + */ + minUptimePerformance?: number | undefined; + /** + * The maximum node uptime performance percentage, which represents node health, used to filter the set of nodes being returned. Default is 100. + */ + maxUptimePerformance?: number | undefined; + /** + * The subnet ID to filter by. If not provided, then all subnets will be returned. + */ + subnetId?: any | undefined; +}; + +export type ListValidatorsResponse = { + result: components.ListValidatorDetailsResponse; +}; + +/** @internal */ +export const ListValidatorsGlobals$inboundSchema: z.ZodType< + ListValidatorsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.GlobalParamNetwork$inboundSchema.optional(), +}); + +/** @internal */ +export type ListValidatorsGlobals$Outbound = { + network?: string | undefined; +}; + +/** @internal */ +export const ListValidatorsGlobals$outboundSchema: z.ZodType< + ListValidatorsGlobals$Outbound, + z.ZodTypeDef, + ListValidatorsGlobals +> = z.object({ + network: components.GlobalParamNetwork$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListValidatorsGlobals$ { + /** @deprecated use `ListValidatorsGlobals$inboundSchema` instead. */ + export const inboundSchema = ListValidatorsGlobals$inboundSchema; + /** @deprecated use `ListValidatorsGlobals$outboundSchema` instead. */ + export const outboundSchema = ListValidatorsGlobals$outboundSchema; + /** @deprecated use `ListValidatorsGlobals$Outbound` instead. */ + export type Outbound = ListValidatorsGlobals$Outbound; +} + +/** @internal */ +export const ListValidatorsRequest$inboundSchema: z.ZodType< + ListValidatorsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$inboundSchema.optional(), + nodeIds: z.string().optional(), + sortBy: components.SortByOption$inboundSchema.optional(), + sortOrder: components.SortOrder$inboundSchema.optional(), + validationStatus: components.ValidationStatusType$inboundSchema.optional(), + minDelegationCapacity: z.string().optional(), + maxDelegationCapacity: z.string().optional(), + minTimeRemaining: z.number().optional(), + maxTimeRemaining: z.number().optional(), + minFeePercentage: z.number().optional(), + maxFeePercentage: z.number().optional(), + minUptimePerformance: z.number().optional(), + maxUptimePerformance: z.number().optional(), + subnetId: z.any().optional(), +}); + +/** @internal */ +export type ListValidatorsRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + network?: string | undefined; + nodeIds?: string | undefined; + sortBy?: string | undefined; + sortOrder?: string | undefined; + validationStatus?: string | undefined; + minDelegationCapacity?: string | undefined; + maxDelegationCapacity?: string | undefined; + minTimeRemaining?: number | undefined; + maxTimeRemaining?: number | undefined; + minFeePercentage?: number | undefined; + maxFeePercentage?: number | undefined; + minUptimePerformance?: number | undefined; + maxUptimePerformance?: number | undefined; + subnetId?: any | undefined; +}; + +/** @internal */ +export const ListValidatorsRequest$outboundSchema: z.ZodType< + ListValidatorsRequest$Outbound, + z.ZodTypeDef, + ListValidatorsRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + network: components.GlobalParamNetwork$outboundSchema.optional(), + nodeIds: z.string().optional(), + sortBy: components.SortByOption$outboundSchema.optional(), + sortOrder: components.SortOrder$outboundSchema.optional(), + validationStatus: components.ValidationStatusType$outboundSchema.optional(), + minDelegationCapacity: z.string().optional(), + maxDelegationCapacity: z.string().optional(), + minTimeRemaining: z.number().optional(), + maxTimeRemaining: z.number().optional(), + minFeePercentage: z.number().optional(), + maxFeePercentage: z.number().optional(), + minUptimePerformance: z.number().optional(), + maxUptimePerformance: z.number().optional(), + subnetId: z.any().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListValidatorsRequest$ { + /** @deprecated use `ListValidatorsRequest$inboundSchema` instead. */ + export const inboundSchema = ListValidatorsRequest$inboundSchema; + /** @deprecated use `ListValidatorsRequest$outboundSchema` instead. */ + export const outboundSchema = ListValidatorsRequest$outboundSchema; + /** @deprecated use `ListValidatorsRequest$Outbound` instead. */ + export type Outbound = ListValidatorsRequest$Outbound; +} + +/** @internal */ +export const ListValidatorsResponse$inboundSchema: z.ZodType< + ListValidatorsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListValidatorDetailsResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListValidatorsResponse$Outbound = { + Result: components.ListValidatorDetailsResponse$Outbound; +}; + +/** @internal */ +export const ListValidatorsResponse$outboundSchema: z.ZodType< + ListValidatorsResponse$Outbound, + z.ZodTypeDef, + ListValidatorsResponse +> = z + .object({ + result: components.ListValidatorDetailsResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListValidatorsResponse$ { + /** @deprecated use `ListValidatorsResponse$inboundSchema` instead. */ + export const inboundSchema = ListValidatorsResponse$inboundSchema; + /** @deprecated use `ListValidatorsResponse$outboundSchema` instead. */ + export const outboundSchema = ListValidatorsResponse$outboundSchema; + /** @deprecated use `ListValidatorsResponse$Outbound` instead. */ + export type Outbound = ListValidatorsResponse$Outbound; +} diff --git a/src/models/operations/listwebhooks.ts b/src/models/operations/listwebhooks.ts new file mode 100644 index 0000000..aded0fd --- /dev/null +++ b/src/models/operations/listwebhooks.ts @@ -0,0 +1,116 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type ListWebhooksRequest = { + /** + * A page token, received from a previous list call. Provide this to retrieve the subsequent page. + */ + pageToken?: string | undefined; + /** + * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100. + */ + pageSize?: number | undefined; + /** + * Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned. + */ + status?: components.WebhookStatus | undefined; +}; + +export type ListWebhooksResponse = { + result: components.ListWebhooksResponse; +}; + +/** @internal */ +export const ListWebhooksRequest$inboundSchema: z.ZodType< + ListWebhooksRequest, + z.ZodTypeDef, + unknown +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + status: components.WebhookStatus$inboundSchema.optional(), +}); + +/** @internal */ +export type ListWebhooksRequest$Outbound = { + pageToken?: string | undefined; + pageSize: number; + status?: string | undefined; +}; + +/** @internal */ +export const ListWebhooksRequest$outboundSchema: z.ZodType< + ListWebhooksRequest$Outbound, + z.ZodTypeDef, + ListWebhooksRequest +> = z.object({ + pageToken: z.string().optional(), + pageSize: z.number().int().default(10), + status: components.WebhookStatus$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListWebhooksRequest$ { + /** @deprecated use `ListWebhooksRequest$inboundSchema` instead. */ + export const inboundSchema = ListWebhooksRequest$inboundSchema; + /** @deprecated use `ListWebhooksRequest$outboundSchema` instead. */ + export const outboundSchema = ListWebhooksRequest$outboundSchema; + /** @deprecated use `ListWebhooksRequest$Outbound` instead. */ + export type Outbound = ListWebhooksRequest$Outbound; +} + +/** @internal */ +export const ListWebhooksResponse$inboundSchema: z.ZodType< + ListWebhooksResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: components.ListWebhooksResponse$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + Result: "result", + }); + }); + +/** @internal */ +export type ListWebhooksResponse$Outbound = { + Result: components.ListWebhooksResponse$Outbound; +}; + +/** @internal */ +export const ListWebhooksResponse$outboundSchema: z.ZodType< + ListWebhooksResponse$Outbound, + z.ZodTypeDef, + ListWebhooksResponse +> = z + .object({ + result: components.ListWebhooksResponse$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + result: "Result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListWebhooksResponse$ { + /** @deprecated use `ListWebhooksResponse$inboundSchema` instead. */ + export const inboundSchema = ListWebhooksResponse$inboundSchema; + /** @deprecated use `ListWebhooksResponse$outboundSchema` instead. */ + export const outboundSchema = ListWebhooksResponse$outboundSchema; + /** @deprecated use `ListWebhooksResponse$Outbound` instead. */ + export type Outbound = ListWebhooksResponse$Outbound; +} diff --git a/src/models/operations/posttransactionexportjob.ts b/src/models/operations/posttransactionexportjob.ts new file mode 100644 index 0000000..3b7813d --- /dev/null +++ b/src/models/operations/posttransactionexportjob.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type PostTransactionExportJobRequestBody = + | components.CreateEvmTransactionExportRequest + | components.CreatePrimaryNetworkTransactionExportRequest; + +/** @internal */ +export const PostTransactionExportJobRequestBody$inboundSchema: z.ZodType< + PostTransactionExportJobRequestBody, + z.ZodTypeDef, + unknown +> = z.union([ + components.CreateEvmTransactionExportRequest$inboundSchema, + components.CreatePrimaryNetworkTransactionExportRequest$inboundSchema, +]); + +/** @internal */ +export type PostTransactionExportJobRequestBody$Outbound = + | components.CreateEvmTransactionExportRequest$Outbound + | components.CreatePrimaryNetworkTransactionExportRequest$Outbound; + +/** @internal */ +export const PostTransactionExportJobRequestBody$outboundSchema: z.ZodType< + PostTransactionExportJobRequestBody$Outbound, + z.ZodTypeDef, + PostTransactionExportJobRequestBody +> = z.union([ + components.CreateEvmTransactionExportRequest$outboundSchema, + components.CreatePrimaryNetworkTransactionExportRequest$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostTransactionExportJobRequestBody$ { + /** @deprecated use `PostTransactionExportJobRequestBody$inboundSchema` instead. */ + export const inboundSchema = PostTransactionExportJobRequestBody$inboundSchema; + /** @deprecated use `PostTransactionExportJobRequestBody$outboundSchema` instead. */ + export const outboundSchema = PostTransactionExportJobRequestBody$outboundSchema; + /** @deprecated use `PostTransactionExportJobRequestBody$Outbound` instead. */ + export type Outbound = PostTransactionExportJobRequestBody$Outbound; +} diff --git a/src/models/operations/reindexnft.ts b/src/models/operations/reindexnft.ts new file mode 100644 index 0000000..c8a5f16 --- /dev/null +++ b/src/models/operations/reindexnft.ts @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type ReindexNftGlobals = { + /** + * A supported EVM chain id, chain alias, or blockchain id. + */ + chainId?: string | undefined; +}; + +export type ReindexNftRequest = { + /** + * A supported evm chain id, chain alias or blockchain id. Use the `/chains` endpoint to get a list of supported chain ids. + */ + chainId?: string | undefined; + /** + * Contract address on the relevant chain. + */ + address: string; + /** + * TokenId on the contract + */ + tokenId: string; +}; + +/** @internal */ +export const ReindexNftGlobals$inboundSchema: z.ZodType = + z.object({ + chainId: z.string().optional(), + }); + +/** @internal */ +export type ReindexNftGlobals$Outbound = { + chainId?: string | undefined; +}; + +/** @internal */ +export const ReindexNftGlobals$outboundSchema: z.ZodType< + ReindexNftGlobals$Outbound, + z.ZodTypeDef, + ReindexNftGlobals +> = z.object({ + chainId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ReindexNftGlobals$ { + /** @deprecated use `ReindexNftGlobals$inboundSchema` instead. */ + export const inboundSchema = ReindexNftGlobals$inboundSchema; + /** @deprecated use `ReindexNftGlobals$outboundSchema` instead. */ + export const outboundSchema = ReindexNftGlobals$outboundSchema; + /** @deprecated use `ReindexNftGlobals$Outbound` instead. */ + export type Outbound = ReindexNftGlobals$Outbound; +} + +/** @internal */ +export const ReindexNftRequest$inboundSchema: z.ZodType = + z.object({ + chainId: z.string().optional(), + address: z.string(), + tokenId: z.string(), + }); + +/** @internal */ +export type ReindexNftRequest$Outbound = { + chainId?: string | undefined; + address: string; + tokenId: string; +}; + +/** @internal */ +export const ReindexNftRequest$outboundSchema: z.ZodType< + ReindexNftRequest$Outbound, + z.ZodTypeDef, + ReindexNftRequest +> = z.object({ + chainId: z.string().optional(), + address: z.string(), + tokenId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ReindexNftRequest$ { + /** @deprecated use `ReindexNftRequest$inboundSchema` instead. */ + export const inboundSchema = ReindexNftRequest$inboundSchema; + /** @deprecated use `ReindexNftRequest$outboundSchema` instead. */ + export const outboundSchema = ReindexNftRequest$outboundSchema; + /** @deprecated use `ReindexNftRequest$Outbound` instead. */ + export type Outbound = ReindexNftRequest$Outbound; +} diff --git a/src/models/operations/removeaddressesfromwebhook.ts b/src/models/operations/removeaddressesfromwebhook.ts new file mode 100644 index 0000000..d3f8b56 --- /dev/null +++ b/src/models/operations/removeaddressesfromwebhook.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type RemoveAddressesFromWebhookRequest = { + /** + * The webhook identifier. + */ + id: string; + addressesChangeRequest: components.AddressesChangeRequest; +}; + +/** @internal */ +export const RemoveAddressesFromWebhookRequest$inboundSchema: z.ZodType< + RemoveAddressesFromWebhookRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.string(), + AddressesChangeRequest: components.AddressesChangeRequest$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + AddressesChangeRequest: "addressesChangeRequest", + }); + }); + +/** @internal */ +export type RemoveAddressesFromWebhookRequest$Outbound = { + id: string; + AddressesChangeRequest: components.AddressesChangeRequest$Outbound; +}; + +/** @internal */ +export const RemoveAddressesFromWebhookRequest$outboundSchema: z.ZodType< + RemoveAddressesFromWebhookRequest$Outbound, + z.ZodTypeDef, + RemoveAddressesFromWebhookRequest +> = z + .object({ + id: z.string(), + addressesChangeRequest: components.AddressesChangeRequest$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + addressesChangeRequest: "AddressesChangeRequest", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoveAddressesFromWebhookRequest$ { + /** @deprecated use `RemoveAddressesFromWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = RemoveAddressesFromWebhookRequest$inboundSchema; + /** @deprecated use `RemoveAddressesFromWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = RemoveAddressesFromWebhookRequest$outboundSchema; + /** @deprecated use `RemoveAddressesFromWebhookRequest$Outbound` instead. */ + export type Outbound = RemoveAddressesFromWebhookRequest$Outbound; +} diff --git a/src/models/operations/supportedchains.ts b/src/models/operations/supportedchains.ts new file mode 100644 index 0000000..202d9d4 --- /dev/null +++ b/src/models/operations/supportedchains.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type SupportedChainsRequest = { + /** + * mainnet or testnet. + */ + network?: components.NetworkType | undefined; + /** + * Filter by feature. + */ + feature?: components.GlacierApiFeature | undefined; +}; + +/** @internal */ +export const SupportedChainsRequest$inboundSchema: z.ZodType< + SupportedChainsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + network: components.NetworkType$inboundSchema.optional(), + feature: components.GlacierApiFeature$inboundSchema.optional(), +}); + +/** @internal */ +export type SupportedChainsRequest$Outbound = { + network?: string | undefined; + feature?: string | undefined; +}; + +/** @internal */ +export const SupportedChainsRequest$outboundSchema: z.ZodType< + SupportedChainsRequest$Outbound, + z.ZodTypeDef, + SupportedChainsRequest +> = z.object({ + network: components.NetworkType$outboundSchema.optional(), + feature: components.GlacierApiFeature$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SupportedChainsRequest$ { + /** @deprecated use `SupportedChainsRequest$inboundSchema` instead. */ + export const inboundSchema = SupportedChainsRequest$inboundSchema; + /** @deprecated use `SupportedChainsRequest$outboundSchema` instead. */ + export const outboundSchema = SupportedChainsRequest$outboundSchema; + /** @deprecated use `SupportedChainsRequest$Outbound` instead. */ + export type Outbound = SupportedChainsRequest$Outbound; +} diff --git a/src/models/operations/updatewebhook.ts b/src/models/operations/updatewebhook.ts new file mode 100644 index 0000000..16e01b7 --- /dev/null +++ b/src/models/operations/updatewebhook.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; +import * as z from "zod"; + +export type UpdateWebhookRequest = { + /** + * The webhook identifier. + */ + id: string; + updateWebhookRequest: components.UpdateWebhookRequest; +}; + +/** @internal */ +export const UpdateWebhookRequest$inboundSchema: z.ZodType< + UpdateWebhookRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.string(), + UpdateWebhookRequest: components.UpdateWebhookRequest$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateWebhookRequest: "updateWebhookRequest", + }); + }); + +/** @internal */ +export type UpdateWebhookRequest$Outbound = { + id: string; + UpdateWebhookRequest: components.UpdateWebhookRequest$Outbound; +}; + +/** @internal */ +export const UpdateWebhookRequest$outboundSchema: z.ZodType< + UpdateWebhookRequest$Outbound, + z.ZodTypeDef, + UpdateWebhookRequest +> = z + .object({ + id: z.string(), + updateWebhookRequest: components.UpdateWebhookRequest$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateWebhookRequest: "UpdateWebhookRequest", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWebhookRequest$ { + /** @deprecated use `UpdateWebhookRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateWebhookRequest$inboundSchema; + /** @deprecated use `UpdateWebhookRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateWebhookRequest$outboundSchema; + /** @deprecated use `UpdateWebhookRequest$Outbound` instead. */ + export type Outbound = UpdateWebhookRequest$Outbound; +} diff --git a/src/sdk/avacloudsdkbalances.ts b/src/sdk/avacloudsdkbalances.ts new file mode 100644 index 0000000..074924b --- /dev/null +++ b/src/sdk/avacloudsdkbalances.ts @@ -0,0 +1,97 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierEvmBalancesGetNativeBalance } from "../funcs/glacierEvmBalancesGetNativeBalance.js"; +import { glacierEvmBalancesListCollectibleBalances } from "../funcs/glacierEvmBalancesListCollectibleBalances.js"; +import { glacierEvmBalancesListErc1155Balances } from "../funcs/glacierEvmBalancesListErc1155Balances.js"; +import { glacierEvmBalancesListErc20Balances } from "../funcs/glacierEvmBalancesListErc20Balances.js"; +import { glacierEvmBalancesListErc721Balances } from "../funcs/glacierEvmBalancesListErc721Balances.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class AvaCloudSDKBalances extends ClientSDK { + /** + * Get native token balance + * + * @remarks + * Gets native token balance of a wallet address. + * + * Balance at a given block can be retrieved with the `blockNumber` parameter. + */ + async getNativeBalance( + request: operations.GetNativeBalanceRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmBalancesGetNativeBalance(this, request, options)); + } + + /** + * List ERC-20 balances + * + * @remarks + * Lists ERC-20 token balances of a wallet address. + * + * Balance at a given block can be retrieved with the `blockNumber` parameter. + * + * Balance for specific contracts can be retrieved with the `contractAddresses` parameter. + */ + async listErc20Balances( + request: operations.ListErc20BalancesRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierEvmBalancesListErc20Balances(this, request, options)); + } + + /** + * List ERC-721 balances + * + * @remarks + * Lists ERC-721 token balances of a wallet address. + * + * Balance for a specific contract can be retrieved with the `contractAddress` parameter. + */ + async listErc721Balances( + request: operations.ListErc721BalancesRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierEvmBalancesListErc721Balances(this, request, options)); + } + + /** + * List ERC-1155 balances + * + * @remarks + * Lists ERC-1155 token balances of a wallet address. + * + * Balance at a given block can be retrieved with the `blockNumber` parameter. + * + * Balance for a specific contract can be retrieved with the `contractAddress` parameter. + */ + async listErc1155Balances( + request: operations.ListErc1155BalancesRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierEvmBalancesListErc1155Balances(this, request, options)); + } + + /** + * List collectible (ERC-721/ERC-1155) balances + * + * @remarks + * Lists ERC-721 and ERC-1155 token balances of a wallet address. + * + * Balance for a specific contract can be retrieved with the `contractAddress` parameter. + */ + async listCollectibleBalances( + request: operations.ListCollectibleBalancesRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmBalancesListCollectibleBalances(this, request, options) + ); + } +} diff --git a/src/sdk/avacloudsdkblocks.ts b/src/sdk/avacloudsdkblocks.ts new file mode 100644 index 0000000..ba215e7 --- /dev/null +++ b/src/sdk/avacloudsdkblocks.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierEvmBlocksGetBlock } from "../funcs/glacierEvmBlocksGetBlock.js"; +import { glacierEvmBlocksGetLatestBlocks } from "../funcs/glacierEvmBlocksGetLatestBlocks.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class AvaCloudSDKBlocks extends ClientSDK { + /** + * List latest blocks + * + * @remarks + * Lists the latest indexed blocks on the EVM-compatible chain sorted in descending order by block timestamp. + */ + async getLatestBlocks( + request: operations.GetLatestBlocksRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierEvmBlocksGetLatestBlocks(this, request, options)); + } + + /** + * Get block + * + * @remarks + * Gets the details of an individual block on the EVM-compatible chain. + */ + async getBlock( + request: operations.GetBlockRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmBlocksGetBlock(this, request, options)); + } +} diff --git a/src/sdk/avacloudsdktransactions.ts b/src/sdk/avacloudsdktransactions.ts new file mode 100644 index 0000000..0a3c5b0 --- /dev/null +++ b/src/sdk/avacloudsdktransactions.ts @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierEvmTransactionsGetDeploymentTransaction } from "../funcs/glacierEvmTransactionsGetDeploymentTransaction.js"; +import { glacierEvmTransactionsGetTransaction } from "../funcs/glacierEvmTransactionsGetTransaction.js"; +import { glacierEvmTransactionsGetTransactionsForBlock } from "../funcs/glacierEvmTransactionsGetTransactionsForBlock.js"; +import { glacierEvmTransactionsListContractDeployments } from "../funcs/glacierEvmTransactionsListContractDeployments.js"; +import { glacierEvmTransactionsListErc1155Transactions } from "../funcs/glacierEvmTransactionsListErc1155Transactions.js"; +import { glacierEvmTransactionsListErc20Transactions } from "../funcs/glacierEvmTransactionsListErc20Transactions.js"; +import { glacierEvmTransactionsListErc721Transactions } from "../funcs/glacierEvmTransactionsListErc721Transactions.js"; +import { glacierEvmTransactionsListInternalTransactions } from "../funcs/glacierEvmTransactionsListInternalTransactions.js"; +import { glacierEvmTransactionsListLatestTransactions } from "../funcs/glacierEvmTransactionsListLatestTransactions.js"; +import { glacierEvmTransactionsListNativeTransactions } from "../funcs/glacierEvmTransactionsListNativeTransactions.js"; +import { glacierEvmTransactionsListTransactions } from "../funcs/glacierEvmTransactionsListTransactions.js"; +import { glacierEvmTransactionsListTransfers } from "../funcs/glacierEvmTransactionsListTransfers.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class AvaCloudSDKTransactions extends ClientSDK { + /** + * Get deployment transaction + * + * @remarks + * If the address is a smart contract, returns the transaction in which it was deployed. + */ + async getDeploymentTransaction( + request: operations.GetDeploymentTransactionRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmTransactionsGetDeploymentTransaction(this, request, options)); + } + + /** + * List deployed contracts + * + * @remarks + * Lists all contracts deployed by the given address. + */ + async listContractDeployments( + request: operations.ListContractDeploymentsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmTransactionsListContractDeployments(this, request, options) + ); + } + + /** + * List ERC transfers + * + * @remarks + * Lists ERC transfers for an ERC-20, ERC-721, or ERC-1155 contract address. + */ + async listTransfers( + request: operations.ListTransfersRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierEvmTransactionsListTransfers(this, request, options)); + } + + /** + * List transactions + * + * @remarks + * Returns a list of transactions where the given wallet address had an on-chain interaction for the given chain. The ERC-20 transfers, ERC-721 transfers, ERC-1155, and internal transactions returned are only those where the input address had an interaction. Specifically, those lists only inlcude entries where the input address was the sender (`from` field) or the receiver (`to` field) for the sub-transaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the `/chains/:chainId/transactions/:txHash` endpoint. + * + * Filterable by block ranges. + */ + async listTransactions( + request: operations.ListTransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierEvmTransactionsListTransactions(this, request, options)); + } + + /** + * List native transactions + * + * @remarks + * Lists native transactions for an address. Filterable by block range. + */ + async listNativeTransactions( + request: operations.ListNativeTransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmTransactionsListNativeTransactions(this, request, options) + ); + } + + /** + * List ERC-20 transfers + * + * @remarks + * Lists ERC-20 transfers for an address. Filterable by block range. + */ + async listErc20Transactions( + request: operations.ListErc20TransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmTransactionsListErc20Transactions(this, request, options) + ); + } + + /** + * List ERC-721 transfers + * + * @remarks + * Lists ERC-721 transfers for an address. Filterable by block range. + */ + async listErc721Transactions( + request: operations.ListErc721TransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmTransactionsListErc721Transactions(this, request, options) + ); + } + + /** + * List ERC-1155 transfers + * + * @remarks + * Lists ERC-1155 transfers for an address. Filterable by block range. + */ + async listErc1155Transactions( + request: operations.ListErc1155TransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmTransactionsListErc1155Transactions(this, request, options) + ); + } + + /** + * List internal transactions + * + * @remarks + * Returns a list of internal transactions for an address and chain. Filterable by block range. + * + * Note that the internal transactions list only contains `CALL` or `CALLCODE` transactions with a non-zero value and `CREATE`/`CREATE2` transactions. To get a complete list of internal transactions use the `debug_` prefixed RPC methods on an archive node. + */ + async listInternalTransactions( + request: operations.ListInternalTransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmTransactionsListInternalTransactions(this, request, options) + ); + } + + /** + * Get transaction + * + * @remarks + * Gets the details of a single transaction. + */ + async getTransaction( + request: operations.GetTransactionRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmTransactionsGetTransaction(this, request, options)); + } + + /** + * List transactions for a block + * + * @remarks + * Lists the transactions that occured in a given block. + */ + async getTransactionsForBlock( + request: operations.GetTransactionsForBlockRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmTransactionsGetTransactionsForBlock(this, request, options)); + } + + /** + * List latest transactions + * + * @remarks + * Lists the latest transactions. Filterable by status. + */ + async listLatestTransactions( + request: operations.ListLatestTransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierEvmTransactionsListLatestTransactions(this, request, options) + ); + } +} diff --git a/src/sdk/balances.ts b/src/sdk/balances.ts new file mode 100644 index 0000000..8b6b7db --- /dev/null +++ b/src/sdk/balances.ts @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierPrimaryNetworkBalancesGetBalancesByAddresses } from "../funcs/glacierPrimaryNetworkBalancesGetBalancesByAddresses.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Balances extends ClientSDK { + /** + * Get balances + * + * @remarks + * Gets primary network balances for one of the Primary Network chains for the supplied addresses. + * + * C-Chain balances returned are only the shared atomic memory balance. For EVM balance, use the `/v1/chains/:chainId/addresses/:addressId/balances:getNative` endpoint. + */ + async getBalancesByAddresses( + request: operations.GetBalancesByAddressesRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync( + glacierPrimaryNetworkBalancesGetBalancesByAddresses(this, request, options) + ); + } +} diff --git a/src/sdk/blocks.ts b/src/sdk/blocks.ts new file mode 100644 index 0000000..f948c2d --- /dev/null +++ b/src/sdk/blocks.ts @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierPrimaryNetworkBlocksGetBlockById } from "../funcs/glacierPrimaryNetworkBlocksGetBlockById.js"; +import { glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks } from "../funcs/glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks.js"; +import { glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId } from "../funcs/glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Blocks extends ClientSDK { + /** + * Get block + * + * @remarks + * Gets a block by block height or block hash on one of the Primary Network chains. + */ + async getBlockById( + request: operations.GetBlockByIdRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierPrimaryNetworkBlocksGetBlockById(this, request, options)); + } + + /** + * List blocks proposed by node + * + * @remarks + * Lists the latest blocks proposed by a given NodeID on one of the Primary Network chains. + */ + async listPrimaryNetworkBlocksByNodeId( + request: operations.ListPrimaryNetworkBlocksByNodeIdRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkBlocksListPrimaryNetworkBlocksByNodeId(this, request, options) + ); + } + + /** + * List latest blocks + * + * @remarks + * Lists latest blocks on one of the Primary Network chains. + */ + async listLatestPrimaryNetworkBlocks( + request: operations.ListLatestPrimaryNetworkBlocksRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkBlocksListLatestPrimaryNetworkBlocks(this, request, options) + ); + } +} diff --git a/src/sdk/chains.ts b/src/sdk/chains.ts new file mode 100644 index 0000000..30b9cd5 --- /dev/null +++ b/src/sdk/chains.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierEvmChainsGetChainInfo } from "../funcs/glacierEvmChainsGetChainInfo.js"; +import { glacierEvmChainsSupportedChains } from "../funcs/glacierEvmChainsSupportedChains.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Chains extends ClientSDK { + /** + * List chains + * + * @remarks + * Lists the supported EVM-compatible chains. Filterable by network. + */ + async supportedChains( + request: operations.SupportedChainsRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmChainsSupportedChains(this, request, options)); + } + + /** + * Get chain information + * + * @remarks + * Gets chain information for the EVM-compatible chain if supported by the api. + */ + async getChainInfo( + request: operations.GetChainInfoRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmChainsGetChainInfo(this, request, options)); + } +} diff --git a/src/sdk/contracts.ts b/src/sdk/contracts.ts new file mode 100644 index 0000000..1c8a080 --- /dev/null +++ b/src/sdk/contracts.ts @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierEvmContractsGetContractMetadata } from "../funcs/glacierEvmContractsGetContractMetadata.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Contracts extends ClientSDK { + /** + * Get contract metadata + * + * @remarks + * Gets metadata about the contract at the given address. + */ + async getContractMetadata( + request: operations.GetContractMetadataRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierEvmContractsGetContractMetadata(this, request, options)); + } +} diff --git a/src/sdk/evm.ts b/src/sdk/evm.ts new file mode 100644 index 0000000..b438d3b --- /dev/null +++ b/src/sdk/evm.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "../lib/sdks.js"; +import { AvaCloudSDKBalances } from "./avacloudsdkbalances.js"; +import { AvaCloudSDKBlocks } from "./avacloudsdkblocks.js"; +import { AvaCloudSDKTransactions } from "./avacloudsdktransactions.js"; +import { Chains } from "./chains.js"; +import { Contracts } from "./contracts.js"; + +export class Evm extends ClientSDK { + private _balances?: AvaCloudSDKBalances; + get balances(): AvaCloudSDKBalances { + return (this._balances ??= new AvaCloudSDKBalances(this.options$)); + } + + private _blocks?: AvaCloudSDKBlocks; + get blocks(): AvaCloudSDKBlocks { + return (this._blocks ??= new AvaCloudSDKBlocks(this.options$)); + } + + private _transactions?: AvaCloudSDKTransactions; + get transactions(): AvaCloudSDKTransactions { + return (this._transactions ??= new AvaCloudSDKTransactions(this.options$)); + } + + private _contracts?: Contracts; + get contracts(): Contracts { + return (this._contracts ??= new Contracts(this.options$)); + } + + private _chains?: Chains; + get chains(): Chains { + return (this._chains ??= new Chains(this.options$)); + } +} diff --git a/src/sdk/glacier.ts b/src/sdk/glacier.ts new file mode 100644 index 0000000..0ec75dc --- /dev/null +++ b/src/sdk/glacier.ts @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "../lib/sdks.js"; +import { Evm } from "./evm.js"; +import { HealthCheck } from "./healthcheck.js"; +import { Nfts } from "./nfts.js"; +import { Operations } from "./operations.js"; +import { PrimaryNetwork } from "./primarynetwork.js"; +import { Teleporter } from "./teleporter.js"; +import { UsageMetrics } from "./usagemetrics.js"; +import { Webhooks } from "./webhooks.js"; + +export class Glacier extends ClientSDK { + private _healthCheck?: HealthCheck; + get healthCheck(): HealthCheck { + return (this._healthCheck ??= new HealthCheck(this.options$)); + } + + private _nfts?: Nfts; + get nfts(): Nfts { + return (this._nfts ??= new Nfts(this.options$)); + } + + private _operations?: Operations; + get operations(): Operations { + return (this._operations ??= new Operations(this.options$)); + } + + private _primaryNetwork?: PrimaryNetwork; + get primaryNetwork(): PrimaryNetwork { + return (this._primaryNetwork ??= new PrimaryNetwork(this.options$)); + } + + private _usageMetrics?: UsageMetrics; + get usageMetrics(): UsageMetrics { + return (this._usageMetrics ??= new UsageMetrics(this.options$)); + } + + private _webhooks?: Webhooks; + get webhooks(): Webhooks { + return (this._webhooks ??= new Webhooks(this.options$)); + } + + private _teleporter?: Teleporter; + get teleporter(): Teleporter { + return (this._teleporter ??= new Teleporter(this.options$)); + } + + private _evm?: Evm; + get evm(): Evm { + return (this._evm ??= new Evm(this.options$)); + } +} diff --git a/src/sdk/healthcheck.ts b/src/sdk/healthcheck.ts new file mode 100644 index 0000000..f17574b --- /dev/null +++ b/src/sdk/healthcheck.ts @@ -0,0 +1,19 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierHealthCheckGlacierHealthCheck } from "../funcs/glacierHealthCheckGlacierHealthCheck.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class HealthCheck extends ClientSDK { + /** + * Get the health of the service + */ + async glacierHealthCheck( + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierHealthCheckGlacierHealthCheck(this, options)); + } +} diff --git a/src/sdk/index.ts b/src/sdk/index.ts new file mode 100644 index 0000000..ecac226 --- /dev/null +++ b/src/sdk/index.ts @@ -0,0 +1,5 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export * from "./sdk.js"; diff --git a/src/sdk/nfts.ts b/src/sdk/nfts.ts new file mode 100644 index 0000000..b36d735 --- /dev/null +++ b/src/sdk/nfts.ts @@ -0,0 +1,52 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierNftsGetTokenDetails } from "../funcs/glacierNftsGetTokenDetails.js"; +import { glacierNftsListTokens } from "../funcs/glacierNftsListTokens.js"; +import { glacierNftsReindexNft } from "../funcs/glacierNftsReindexNft.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Nfts extends ClientSDK { + /** + * Reindex NFT metadata + * + * @remarks + * Triggers reindexing of token metadata for an NFT token. Reindexing can only be called once per hour for each NFT token. + */ + async reindexNft( + request: operations.ReindexNftRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierNftsReindexNft(this, request, options)); + } + + /** + * List tokens + * + * @remarks + * Lists tokens for an NFT contract. + */ + async listTokens( + request: operations.ListTokensRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierNftsListTokens(this, request, options)); + } + + /** + * Get token details + * + * @remarks + * Gets token details for a specific token of an NFT contract. + */ + async getTokenDetails( + request: operations.GetTokenDetailsRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierNftsGetTokenDetails(this, request, options)); + } +} diff --git a/src/sdk/operations.ts b/src/sdk/operations.ts new file mode 100644 index 0000000..1cdd904 --- /dev/null +++ b/src/sdk/operations.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierOperationsGetOperationResult } from "../funcs/glacierOperationsGetOperationResult.js"; +import { glacierOperationsPostTransactionExportJob } from "../funcs/glacierOperationsPostTransactionExportJob.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Operations extends ClientSDK { + /** + * Get operation + * + * @remarks + * Gets operation details for the given operation id. + */ + async getOperationResult( + request: operations.GetOperationResultRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierOperationsGetOperationResult(this, request, options)); + } + + /** + * Create transaction export operation + * + * @remarks + * Trigger a transaction export operation with given parameters. + * + * The transaction export operation runs asynchronously in the background. The status of the job can be retrieved from the `/v1/operations/:operationId` endpoint using the `operationId` returned from this endpoint. + */ + async postTransactionExportJob( + request: operations.PostTransactionExportJobRequestBody, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierOperationsPostTransactionExportJob(this, request, options)); + } +} diff --git a/src/sdk/primarynetwork.ts b/src/sdk/primarynetwork.ts new file mode 100644 index 0000000..f1bad97 --- /dev/null +++ b/src/sdk/primarynetwork.ts @@ -0,0 +1,175 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierPrimaryNetworkGetAssetDetails } from "../funcs/glacierPrimaryNetworkGetAssetDetails.js"; +import { glacierPrimaryNetworkGetChainIdsForAddresses } from "../funcs/glacierPrimaryNetworkGetChainIdsForAddresses.js"; +import { glacierPrimaryNetworkGetNetworkDetails } from "../funcs/glacierPrimaryNetworkGetNetworkDetails.js"; +import { glacierPrimaryNetworkGetSingleValidatorDetails } from "../funcs/glacierPrimaryNetworkGetSingleValidatorDetails.js"; +import { glacierPrimaryNetworkGetSubnetById } from "../funcs/glacierPrimaryNetworkGetSubnetById.js"; +import { glacierPrimaryNetworkListBlockchains } from "../funcs/glacierPrimaryNetworkListBlockchains.js"; +import { glacierPrimaryNetworkListDelegators } from "../funcs/glacierPrimaryNetworkListDelegators.js"; +import { glacierPrimaryNetworkListSubnets } from "../funcs/glacierPrimaryNetworkListSubnets.js"; +import { glacierPrimaryNetworkListValidators } from "../funcs/glacierPrimaryNetworkListValidators.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; +import { Balances } from "./balances.js"; +import { Blocks } from "./blocks.js"; +import { Rewards } from "./rewards.js"; +import { Transactions } from "./transactions.js"; +import { Utxos } from "./utxos.js"; +import { Vertices } from "./vertices.js"; + +export class PrimaryNetwork extends ClientSDK { + private _transactions?: Transactions; + get transactions(): Transactions { + return (this._transactions ??= new Transactions(this.options$)); + } + + private _rewards?: Rewards; + get rewards(): Rewards { + return (this._rewards ??= new Rewards(this.options$)); + } + + private _utxos?: Utxos; + get utxos(): Utxos { + return (this._utxos ??= new Utxos(this.options$)); + } + + private _balances?: Balances; + get balances(): Balances { + return (this._balances ??= new Balances(this.options$)); + } + + private _blocks?: Blocks; + get blocks(): Blocks { + return (this._blocks ??= new Blocks(this.options$)); + } + + private _vertices?: Vertices; + get vertices(): Vertices { + return (this._vertices ??= new Vertices(this.options$)); + } + + /** + * Get asset details + * + * @remarks + * Gets asset details corresponding to the given asset id on the X-Chain. + */ + async getAssetDetails( + request: operations.GetAssetDetailsRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierPrimaryNetworkGetAssetDetails(this, request, options)); + } + + /** + * Get chain interactions for addresses + * + * @remarks + * Returns Primary Network chains that each address has touched in the form of an address mapped array. If an address has had any on-chain interaction for a chain, that chain's chain id will be returned. + */ + async getChainIdsForAddresses( + request: operations.GetChainIdsForAddressesRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierPrimaryNetworkGetChainIdsForAddresses(this, request, options)); + } + + /** + * Get network details + * + * @remarks + * Gets network details such as validator and delegator stats. + */ + async getNetworkDetails( + request: operations.GetNetworkDetailsRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierPrimaryNetworkGetNetworkDetails(this, request, options)); + } + + /** + * List blockchains + * + * @remarks + * Lists all blockchains registered on the network. + */ + async listBlockchains( + request: operations.ListBlockchainsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierPrimaryNetworkListBlockchains(this, request, options)); + } + + /** + * List subnets + * + * @remarks + * Lists all subnets registered on the network. + */ + async listSubnets( + request: operations.ListSubnetsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierPrimaryNetworkListSubnets(this, request, options)); + } + + /** + * Get Subnet details by ID + * + * @remarks + * Get details of the Subnet registered on the network. + */ + async getSubnetById( + request: operations.GetSubnetByIdRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierPrimaryNetworkGetSubnetById(this, request, options)); + } + + /** + * List validators + * + * @remarks + * Lists details for validators. By default, returns details for all validators. Filterable by validator node ids and minimum delegation capacity. + */ + async listValidators( + request: operations.ListValidatorsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierPrimaryNetworkListValidators(this, request, options)); + } + + /** + * Get single validator details + * + * @remarks + * List validator details for a single validator. Filterable by validation status. + */ + async getSingleValidatorDetails( + request: operations.GetSingleValidatorDetailsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkGetSingleValidatorDetails(this, request, options) + ); + } + + /** + * List delegators + * + * @remarks + * Lists details for delegators. + */ + async listDelegators( + request: operations.ListDelegatorsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierPrimaryNetworkListDelegators(this, request, options)); + } +} diff --git a/src/sdk/rewards.ts b/src/sdk/rewards.ts new file mode 100644 index 0000000..8395d4e --- /dev/null +++ b/src/sdk/rewards.ts @@ -0,0 +1,41 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards } from "../funcs/glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.js"; +import { glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards } from "../funcs/glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Rewards extends ClientSDK { + /** + * List pending rewards + * + * @remarks + * Lists pending rewards on the Primary Network for the supplied addresses. + */ + async listPendingPrimaryNetworkRewards( + request: operations.ListPendingPrimaryNetworkRewardsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkRewardsListPendingPrimaryNetworkRewards(this, request, options) + ); + } + + /** + * List historical rewards + * + * @remarks + * Lists historical rewards on the Primary Network for the supplied addresses. + */ + async listHistoricalPrimaryNetworkRewards( + request: operations.ListHistoricalPrimaryNetworkRewardsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards(this, request, options) + ); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts new file mode 100644 index 0000000..fbde010 --- /dev/null +++ b/src/sdk/sdk.ts @@ -0,0 +1,13 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "../lib/sdks.js"; +import { Glacier } from "./glacier.js"; + +export class AvaCloudSDK extends ClientSDK { + private _glacier?: Glacier; + get glacier(): Glacier { + return (this._glacier ??= new Glacier(this.options$)); + } +} diff --git a/src/sdk/teleporter.ts b/src/sdk/teleporter.ts new file mode 100644 index 0000000..9429bd6 --- /dev/null +++ b/src/sdk/teleporter.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierTeleporterGetTeleporterMessage } from "../funcs/glacierTeleporterGetTeleporterMessage.js"; +import { glacierTeleporterListTeleporterMessages } from "../funcs/glacierTeleporterListTeleporterMessages.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Teleporter extends ClientSDK { + /** + * Get a teleporter message + * + * @remarks + * Gets a teleporter message by message ID. + */ + async getTeleporterMessage( + request: operations.GetTeleporterMessageRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierTeleporterGetTeleporterMessage(this, request, options)); + } + + /** + * List teleporter messages + * + * @remarks + * Lists teleporter messages. Ordered by timestamp in descending order. + */ + async listTeleporterMessages( + request: operations.ListTeleporterMessagesRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierTeleporterListTeleporterMessages(this, request, options) + ); + } +} diff --git a/src/sdk/transactions.ts b/src/sdk/transactions.ts new file mode 100644 index 0000000..c97f432 --- /dev/null +++ b/src/sdk/transactions.ts @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierPrimaryNetworkTransactionsGetTxByHash } from "../funcs/glacierPrimaryNetworkTransactionsGetTxByHash.js"; +import { glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions } from "../funcs/glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions.js"; +import { glacierPrimaryNetworkTransactionsListAssetTransactions } from "../funcs/glacierPrimaryNetworkTransactionsListAssetTransactions.js"; +import { glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions } from "../funcs/glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Transactions extends ClientSDK { + /** + * Get transaction + * + * @remarks + * Gets the details of a single transaction on one of the Primary Network chains. + */ + async getTxByHash( + request: operations.GetTxByHashRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierPrimaryNetworkTransactionsGetTxByHash(this, request, options)); + } + + /** + * List latest transactions + * + * @remarks + * Lists the latest transactions on one of the Primary Network chains. + * + * Transactions are filterable by addresses, txTypes, and timestamps. When querying for latest transactions without an address parameter, filtering by txTypes and timestamps is not supported. An address filter must be provided to utilize txTypes and timestamp filters. + * + * Given that each transaction may return a large number of UTXO objects, bounded only by the maximum transaction size, the query may return less transactions than the provided page size. The result will contain less results than the page size if the number of utxos contained in the resulting transactions reach a performance threshold. + */ + async listLatestPrimaryNetworkTransactions( + request: operations.ListLatestPrimaryNetworkTransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkTransactionsListLatestPrimaryNetworkTransactions( + this, + request, + options + ) + ); + } + + /** + * List staking transactions + * + * @remarks + * Lists active staking transactions on the P-Chain for the supplied addresses. + */ + async listActivePrimaryNetworkStakingTransactions( + request: operations.ListActivePrimaryNetworkStakingTransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkTransactionsListActivePrimaryNetworkStakingTransactions( + this, + request, + options + ) + ); + } + + /** + * List asset transactions + * + * @remarks + * Lists asset transactions corresponding to the given asset id on the X-Chain. + */ + async listAssetTransactions( + request: operations.ListAssetTransactionsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkTransactionsListAssetTransactions(this, request, options) + ); + } +} diff --git a/src/sdk/usagemetrics.ts b/src/sdk/usagemetrics.ts new file mode 100644 index 0000000..6fa9f33 --- /dev/null +++ b/src/sdk/usagemetrics.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierUsageMetricsGetApiLogs } from "../funcs/glacierUsageMetricsGetApiLogs.js"; +import { glacierUsageMetricsGetApiUsageMetrics } from "../funcs/glacierUsageMetricsGetApiUsageMetrics.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class UsageMetrics extends ClientSDK { + /** + * Get usage metrics for the Glacier API + * + * @remarks + * Gets metrics for Glacier API usage over a specified time interval aggregated at the specified time-duration granularity. + */ + async getApiUsageMetrics( + request: operations.GetApiUsageMetricsRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierUsageMetricsGetApiUsageMetrics(this, request, options)); + } + + /** + * Get logs for requests made by client + * + * @remarks + * Gets logs for requests made by client over a specified time interval for a specific organization. + */ + async getApiLogs( + request: operations.GetApiLogsRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierUsageMetricsGetApiLogs(this, request, options)); + } +} diff --git a/src/sdk/utxos.ts b/src/sdk/utxos.ts new file mode 100644 index 0000000..2146396 --- /dev/null +++ b/src/sdk/utxos.ts @@ -0,0 +1,25 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierPrimaryNetworkUtxosGetUtxosByAddresses } from "../funcs/glacierPrimaryNetworkUtxosGetUtxosByAddresses.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Utxos extends ClientSDK { + /** + * List UTXOs + * + * @remarks + * Lists UTXOs on one of the Primary Network chains for the supplied addresses. + */ + async getUtxosByAddresses( + request: operations.GetUtxosByAddressesRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkUtxosGetUtxosByAddresses(this, request, options) + ); + } +} diff --git a/src/sdk/vertices.ts b/src/sdk/vertices.ts new file mode 100644 index 0000000..807749c --- /dev/null +++ b/src/sdk/vertices.ts @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierPrimaryNetworkVerticesGetVertexByHash } from "../funcs/glacierPrimaryNetworkVerticesGetVertexByHash.js"; +import { glacierPrimaryNetworkVerticesGetVertexByHeight } from "../funcs/glacierPrimaryNetworkVerticesGetVertexByHeight.js"; +import { glacierPrimaryNetworkVerticesListLatestXChainVertices } from "../funcs/glacierPrimaryNetworkVerticesListLatestXChainVertices.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Vertices extends ClientSDK { + /** + * List vertices + * + * @remarks + * Lists latest vertices on the X-Chain. + */ + async listLatestXChainVertices( + request: operations.ListLatestXChainVerticesRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkVerticesListLatestXChainVertices(this, request, options) + ); + } + + /** + * Get vertex + * + * @remarks + * Gets a single vertex on the X-Chain. + */ + async getVertexByHash( + request: operations.GetVertexByHashRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierPrimaryNetworkVerticesGetVertexByHash(this, request, options)); + } + + /** + * List vertices by height + * + * @remarks + * Lists vertices at the given vertex height on the X-Chain. + */ + async getVertexByHeight( + request: operations.GetVertexByHeightRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator( + glacierPrimaryNetworkVerticesGetVertexByHeight(this, request, options) + ); + } +} diff --git a/src/sdk/webhooks.ts b/src/sdk/webhooks.ts new file mode 100644 index 0000000..fea58c6 --- /dev/null +++ b/src/sdk/webhooks.ts @@ -0,0 +1,147 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { glacierWebhooksAddAddressesToWebhook } from "../funcs/glacierWebhooksAddAddressesToWebhook.js"; +import { glacierWebhooksCreateWebhook } from "../funcs/glacierWebhooksCreateWebhook.js"; +import { glacierWebhooksDeactivateWebhook } from "../funcs/glacierWebhooksDeactivateWebhook.js"; +import { glacierWebhooksGenerateSharedSecret } from "../funcs/glacierWebhooksGenerateSharedSecret.js"; +import { glacierWebhooksGetAddressesFromWebhook } from "../funcs/glacierWebhooksGetAddressesFromWebhook.js"; +import { glacierWebhooksGetSharedSecret } from "../funcs/glacierWebhooksGetSharedSecret.js"; +import { glacierWebhooksGetWebhook } from "../funcs/glacierWebhooksGetWebhook.js"; +import { glacierWebhooksListWebhooks } from "../funcs/glacierWebhooksListWebhooks.js"; +import { glacierWebhooksRemoveAddressesFromWebhook } from "../funcs/glacierWebhooksRemoveAddressesFromWebhook.js"; +import { glacierWebhooksUpdateWebhook } from "../funcs/glacierWebhooksUpdateWebhook.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; + +export class Webhooks extends ClientSDK { + /** + * List webhooks + * + * @remarks + * Lists webhooks for the user. + */ + async listWebhooks( + request: operations.ListWebhooksRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierWebhooksListWebhooks(this, request, options)); + } + + /** + * Create a webhook + * + * @remarks + * Create a new webhook. + */ + async createWebhook( + request: components.CreateWebhookRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierWebhooksCreateWebhook(this, request, options)); + } + + /** + * Get a webhook by ID + * + * @remarks + * Retrieves a webhook by ID. + */ + async getWebhook( + request: operations.GetWebhookRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierWebhooksGetWebhook(this, request, options)); + } + + /** + * Deactivate a webhook + * + * @remarks + * Deactivates a webhook by ID. + */ + async deactivateWebhook( + request: operations.DeactivateWebhookRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierWebhooksDeactivateWebhook(this, request, options)); + } + + /** + * Update a webhook + * + * @remarks + * Updates an existing webhook. + */ + async updateWebhook( + request: operations.UpdateWebhookRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierWebhooksUpdateWebhook(this, request, options)); + } + + /** + * Generate a shared secret + * + * @remarks + * Generates a new shared secret. + */ + async generateSharedSecret( + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierWebhooksGenerateSharedSecret(this, options)); + } + + /** + * Get a shared secret + * + * @remarks + * Get a previously generated shared secret. + */ + async getSharedSecret(options?: RequestOptions): Promise { + return unwrapAsync(glacierWebhooksGetSharedSecret(this, options)); + } + + /** + * List adresses by webhook + * + * @remarks + * List adresses by webhook. + */ + async getAddressesFromWebhook( + request: operations.GetAddressesFromWebhookRequest, + options?: RequestOptions + ): Promise> { + return unwrapResultIterator(glacierWebhooksGetAddressesFromWebhook(this, request, options)); + } + + /** + * Remove addresses from webhook + * + * @remarks + * Remove addresses from webhook. + */ + async removeAddressesFromWebhook( + request: operations.RemoveAddressesFromWebhookRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierWebhooksRemoveAddressesFromWebhook(this, request, options)); + } + + /** + * Add addresses to webhook + * + * @remarks + * Add addresses to webhook. + */ + async addAddressesToWebhook( + request: operations.AddAddressesToWebhookRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(glacierWebhooksAddAddressesToWebhook(this, request, options)); + } +} diff --git a/src/types/blobs.ts b/src/types/blobs.ts new file mode 100644 index 0000000..4ce8460 --- /dev/null +++ b/src/types/blobs.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export const blobLikeSchema: z.ZodType = + z.custom(isBlobLike, { + message: "expected a Blob, File or Blob-like object", + fatal: true, + }); + +export function isBlobLike(val: unknown): val is Blob { + if (val instanceof Blob) { + return true; + } + + if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { + return false; + } + + const name = val[Symbol.toStringTag]; + if (typeof name !== "string") { + return false; + } + if (name !== "Blob" && name !== "File") { + return false; + } + + return "stream" in val && typeof val.stream === "function"; +} diff --git a/src/types/constdatetime.ts b/src/types/constdatetime.ts new file mode 100644 index 0000000..c0a4409 --- /dev/null +++ b/src/types/constdatetime.ts @@ -0,0 +1,15 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export function constDateTime( + val: string, +): z.ZodType { + return z.custom((v) => { + return ( + typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() + ); + }, `Value must be equivelant to ${val}`); +} diff --git a/src/types/enums.ts b/src/types/enums.ts new file mode 100644 index 0000000..6fb6d91 --- /dev/null +++ b/src/types/enums.ts @@ -0,0 +1,16 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +declare const __brand: unique symbol; +export type Unrecognized = T & { [__brand]: "unrecognized" }; + +export function catchUnrecognizedEnum(value: T): Unrecognized { + return value as Unrecognized; +} + +type Prettify = { [K in keyof T]: T[K] } & {}; +export type ClosedEnum = T[keyof T]; +export type OpenEnum = + | Prettify + | Unrecognized; diff --git a/src/types/fp.ts b/src/types/fp.ts new file mode 100644 index 0000000..ccbe51e --- /dev/null +++ b/src/types/fp.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * A monad that captures the result of a function call or an error if it was not + * successful. Railway programming, enabled by this type, can be a nicer + * alternative to traditional exception throwing because it allows functions to + * declare all _known_ errors with static types and then check for them + * exhaustively in application code. Thrown exception have a type of `unknown` + * and break out of regular control flow of programs making them harder to + * inspect and more verbose work with due to try-catch blocks. + */ +export type Result = + | { ok: true; value: T; error?: never } + | { ok: false; value?: never; error: E }; + +export function OK(value: V): Result { + return { ok: true, value }; +} + +export function ERR(error: E): Result { + return { ok: false, error }; +} + +/** + * unwrap is a convenience function for extracting a value from a result or + * throwing if there was an error. + */ +export function unwrap(r: Result): T { + if (!r.ok) { + throw r.error; + } + return r.value; +} + +/** + * unwrapAsync is a convenience function for resolving a value from a Promise + * of a result or rejecting if an error occurred. + */ +export async function unwrapAsync( + pr: Promise>, +): Promise { + const r = await pr; + if (!r.ok) { + throw r.error; + } + + return r.value; +} diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..dbaa5e6 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,11 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export { RFCDate } from "./rfcdate.js"; +export { blobLikeSchema, isBlobLike } from "./blobs.js"; +export type { Paginator, PageIterator } from "./operations.js"; +export { createPageIterator } from "./operations.js"; +export { catchUnrecognizedEnum } from "./enums.js"; +export type { OpenEnum, ClosedEnum, Unrecognized } from "./enums.js"; +export type { Result } from "./fp.js"; diff --git a/src/types/operations.ts b/src/types/operations.ts new file mode 100644 index 0000000..0952f6f --- /dev/null +++ b/src/types/operations.ts @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Result } from "./fp.js"; + +export type Paginator = () => Promise }> | null; + +export type PageIterator = V & { + next: Paginator; + [Symbol.asyncIterator]: () => AsyncIterableIterator; +}; + +export function createPageIterator( + page: V & { next: Paginator }, + halt: (v: V) => boolean, +): { + [Symbol.asyncIterator]: () => AsyncIterableIterator; +} { + return { + [Symbol.asyncIterator]: async function* paginator() { + yield page; + if (halt(page)) { + return; + } + + let p: typeof page | null = page; + for (p = await p.next(); p != null; p = await p.next()) { + yield p; + if (halt(p)) { + return; + } + } + }, + }; +} + +/** + * This utility create a special iterator that yields a single value and + * terminates. It is useful in paginated SDK functions that have early return + * paths when things go wrong. + */ +export function haltIterator(v: V): PageIterator { + return { + ...v, + next: () => null, + [Symbol.asyncIterator]: async function* paginator() { + yield v; + }, + }; +} + +/** + * Converts an async iterator of `Result` into an async iterator of `V`. + * When error results occur, the underlying error value is thrown. + */ +export async function unwrapResultIterator( + iteratorPromise: Promise>>, +): Promise> { + const resultIter = await iteratorPromise; + + if (!resultIter.ok) { + throw resultIter.error; + } + + return { + ...resultIter.value, + next: unwrapPaginator(resultIter.next), + [Symbol.asyncIterator]: async function* paginator() { + for await (const page of resultIter) { + if (!page.ok) { + throw page.error; + } + yield page.value; + } + }, + }; +} + +function unwrapPaginator( + paginator: Paginator>, +): Paginator { + return () => { + const nextResult = paginator(); + if (nextResult == null) { + return null; + } + return nextResult.then((res) => { + if (!res.ok) { + throw res.error; + } + const out = { + ...res.value, + next: unwrapPaginator(res.next), + }; + return out; + }); + }; +} diff --git a/src/types/rfcdate.ts b/src/types/rfcdate.ts new file mode 100644 index 0000000..c79b3f5 --- /dev/null +++ b/src/types/rfcdate.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +const dateRE = /^\d{4}-\d{2}-\d{2}$/; + +export class RFCDate { + private serialized: string; + + /** + * Creates a new RFCDate instance using today's date. + */ + static today(): RFCDate { + return new RFCDate(new Date()); + } + + /** + * Creates a new RFCDate instance using the provided input. + * If a string is used then in must be in the format YYYY-MM-DD. + * + * @param date A Date object or a date string in YYYY-MM-DD format + * @example + * new RFCDate("2022-01-01") + * @example + * new RFCDate(new Date()) + */ + constructor(date: Date | string) { + if (typeof date === "string" && !dateRE.test(date)) { + throw new RangeError( + "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, + ); + } + + const value = new Date(date); + if (isNaN(+value)) { + throw new RangeError("RFCDate: invalid date provided: " + date); + } + + this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); + if (!dateRE.test(this.serialized)) { + throw new TypeError( + `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, + ); + } + } + + toJSON(): string { + return this.toString(); + } + + toString(): string { + return this.serialized; + } +} diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..6d6d825 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1 @@ +export * from './isvalidsignature'; \ No newline at end of file diff --git a/src/utils/isvalidsignature.ts b/src/utils/isvalidsignature.ts new file mode 100644 index 0000000..288e0e9 --- /dev/null +++ b/src/utils/isvalidsignature.ts @@ -0,0 +1,11 @@ +import crypto from 'crypto'; +import { canonicalize } from 'json-canonicalize'; + +export function isValidSignature(signingSecret: any, signature: any, payload: any) { + const canonicalizedPayload = canonicalize(payload); + const hmac = crypto.createHmac('sha256', Buffer.from(signingSecret, 'hex')); + const digest = hmac.update(canonicalizedPayload).digest('base64'); + console.log("signature: ", signature); + console.log("digest", digest); + return signature === digest; +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..7a86d2d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "incremental": true, + "tsBuildInfoFile": ".tsbuildinfo", + "target": "ES2018", + "lib": ["ES2022", "DOM", "DOM.Iterable"], + + "module": "Node16", + "moduleResolution": "Node16", + + "allowJs": true, + + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": ".", + + + // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json + "strict": true, + "allowUnusedLabels": false, + "allowUnreachableCode": false, + "exactOptionalPropertyTypes": true, + "useUnknownInCatchVariables": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "isolatedModules": true, + "checkJs": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src"], + "exclude": ["node_modules"] +} diff --git a/utils/index.d.ts b/utils/index.d.ts new file mode 100644 index 0000000..8613ad9 --- /dev/null +++ b/utils/index.d.ts @@ -0,0 +1,2 @@ +export * from './isvalidsignature'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/utils/index.d.ts.map b/utils/index.d.ts.map new file mode 100644 index 0000000..850e2cb --- /dev/null +++ b/utils/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"} \ No newline at end of file diff --git a/utils/index.js b/utils/index.js new file mode 100644 index 0000000..e628400 --- /dev/null +++ b/utils/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./isvalidsignature"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/utils/index.js.map b/utils/index.js.map new file mode 100644 index 0000000..68850ab --- /dev/null +++ b/utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"} \ No newline at end of file diff --git a/utils/isvalidsignature.d.ts b/utils/isvalidsignature.d.ts new file mode 100644 index 0000000..73ce4c1 --- /dev/null +++ b/utils/isvalidsignature.d.ts @@ -0,0 +1,2 @@ +export declare function isValidSignature(signingSecret: any, signature: any, payload: any): boolean; +//# sourceMappingURL=isvalidsignature.d.ts.map \ No newline at end of file diff --git a/utils/isvalidsignature.d.ts.map b/utils/isvalidsignature.d.ts.map new file mode 100644 index 0000000..430880c --- /dev/null +++ b/utils/isvalidsignature.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isvalidsignature.d.ts","sourceRoot":"","sources":["../src/utils/isvalidsignature.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,WAOhF"} \ No newline at end of file diff --git a/utils/isvalidsignature.js b/utils/isvalidsignature.js new file mode 100644 index 0000000..f5dc65b --- /dev/null +++ b/utils/isvalidsignature.js @@ -0,0 +1,17 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isValidSignature = isValidSignature; +const crypto_1 = __importDefault(require("crypto")); +const json_canonicalize_1 = require("json-canonicalize"); +function isValidSignature(signingSecret, signature, payload) { + const canonicalizedPayload = (0, json_canonicalize_1.canonicalize)(payload); + const hmac = crypto_1.default.createHmac('sha256', Buffer.from(signingSecret, 'hex')); + const digest = hmac.update(canonicalizedPayload).digest('base64'); + console.log("signature: ", signature); + console.log("digest", digest); + return signature === digest; +} +//# sourceMappingURL=isvalidsignature.js.map \ No newline at end of file diff --git a/utils/isvalidsignature.js.map b/utils/isvalidsignature.js.map new file mode 100644 index 0000000..d57d44f --- /dev/null +++ b/utils/isvalidsignature.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isvalidsignature.js","sourceRoot":"","sources":["../src/utils/isvalidsignature.ts"],"names":[],"mappings":";;;;;AAGA,4CAOC;AAVD,oDAA4B;AAC5B,yDAAiD;AAEjD,SAAgB,gBAAgB,CAAC,aAAkB,EAAE,SAAc,EAAE,OAAY;IAC7E,MAAM,oBAAoB,GAAG,IAAA,gCAAY,EAAC,OAAO,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,gBAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,SAAS,KAAK,MAAM,CAAC;AAChC,CAAC"} \ No newline at end of file