@distilled.cloud/coinbase 0.30.3 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +8 -0
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +17 -2
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +8 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -6
- package/lib/index.js.map +1 -1
- package/lib/protocol.d.ts +24 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/{client.js → protocol.js} +107 -46
- package/lib/protocol.js.map +1 -0
- package/lib/retry.d.ts +4 -4
- package/lib/retry.js +4 -4
- package/lib/services/cdp.d.ts +5054 -0
- package/lib/services/cdp.d.ts.map +1 -0
- package/lib/services/cdp.js +4331 -0
- package/lib/services/cdp.js.map +1 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +3 -0
- package/lib/services/index.js.map +1 -0
- package/lib/traits.d.ts +8 -2
- package/lib/traits.d.ts.map +1 -1
- package/lib/traits.js +8 -2
- package/lib/traits.js.map +1 -1
- package/package.json +29 -42
- package/src/credentials.ts +8 -0
- package/src/errors.ts +92 -2
- package/src/index.ts +12 -6
- package/src/{client.ts → protocol.ts} +163 -52
- package/src/retry.ts +4 -4
- package/src/services/cdp.ts +11912 -0
- package/src/services/index.ts +2 -0
- package/src/traits.ts +42 -2
- package/README.md +0 -78
- package/lib/category.d.ts +0 -5
- package/lib/category.d.ts.map +0 -1
- package/lib/category.js +0 -5
- package/lib/category.js.map +0 -1
- package/lib/client.d.ts +0 -13
- package/lib/client.d.ts.map +0 -1
- package/lib/client.js.map +0 -1
- package/lib/operations/addEndUserEvmAccount.d.ts +0 -30
- package/lib/operations/addEndUserEvmAccount.d.ts.map +0 -1
- package/lib/operations/addEndUserEvmAccount.js +0 -36
- package/lib/operations/addEndUserEvmAccount.js.map +0 -1
- package/lib/operations/addEndUserEvmSmartAccount.d.ts +0 -32
- package/lib/operations/addEndUserEvmSmartAccount.d.ts.map +0 -1
- package/lib/operations/addEndUserEvmSmartAccount.js +0 -41
- package/lib/operations/addEndUserEvmSmartAccount.js.map +0 -1
- package/lib/operations/addEndUserSolanaAccount.d.ts +0 -30
- package/lib/operations/addEndUserSolanaAccount.d.ts.map +0 -1
- package/lib/operations/addEndUserSolanaAccount.js +0 -36
- package/lib/operations/addEndUserSolanaAccount.js.map +0 -1
- package/lib/operations/createDelegationForEndUserAccount.d.ts +0 -34
- package/lib/operations/createDelegationForEndUserAccount.d.ts.map +0 -1
- package/lib/operations/createDelegationForEndUserAccount.js +0 -44
- package/lib/operations/createDelegationForEndUserAccount.js.map +0 -1
- package/lib/operations/createDepositDestination.d.ts +0 -34
- package/lib/operations/createDepositDestination.d.ts.map +0 -1
- package/lib/operations/createDepositDestination.js +0 -50
- package/lib/operations/createDepositDestination.js.map +0 -1
- package/lib/operations/createEndUser.d.ts +0 -115
- package/lib/operations/createEndUser.d.ts.map +0 -1
- package/lib/operations/createEndUser.js +0 -133
- package/lib/operations/createEndUser.js.map +0 -1
- package/lib/operations/createEvmAccount.d.ts +0 -30
- package/lib/operations/createEvmAccount.d.ts.map +0 -1
- package/lib/operations/createEvmAccount.js +0 -34
- package/lib/operations/createEvmAccount.js.map +0 -1
- package/lib/operations/createEvmEip7702Delegation.d.ts +0 -34
- package/lib/operations/createEvmEip7702Delegation.d.ts.map +0 -1
- package/lib/operations/createEvmEip7702Delegation.js +0 -51
- package/lib/operations/createEvmEip7702Delegation.js.map +0 -1
- package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.d.ts +0 -42
- package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.js +0 -60
- package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.js.map +0 -1
- package/lib/operations/createEvmSmartAccount.d.ts +0 -27
- package/lib/operations/createEvmSmartAccount.d.ts.map +0 -1
- package/lib/operations/createEvmSmartAccount.js +0 -33
- package/lib/operations/createEvmSmartAccount.js.map +0 -1
- package/lib/operations/createEvmSwapQuote.d.ts +0 -80
- package/lib/operations/createEvmSwapQuote.d.ts.map +0 -1
- package/lib/operations/createEvmSwapQuote.js +0 -95
- package/lib/operations/createEvmSwapQuote.js.map +0 -1
- package/lib/operations/createFoundationAccount.d.ts +0 -26
- package/lib/operations/createFoundationAccount.d.ts.map +0 -1
- package/lib/operations/createFoundationAccount.js +0 -32
- package/lib/operations/createFoundationAccount.js.map +0 -1
- package/lib/operations/createOnrampOrder.d.ts +0 -60
- package/lib/operations/createOnrampOrder.d.ts.map +0 -1
- package/lib/operations/createOnrampOrder.js +0 -79
- package/lib/operations/createOnrampOrder.js.map +0 -1
- package/lib/operations/createOnrampSession.d.ts +0 -55
- package/lib/operations/createOnrampSession.d.ts.map +0 -1
- package/lib/operations/createOnrampSession.js +0 -68
- package/lib/operations/createOnrampSession.js.map +0 -1
- package/lib/operations/createPolicy.d.ts +0 -28
- package/lib/operations/createPolicy.d.ts.map +0 -1
- package/lib/operations/createPolicy.js +0 -32
- package/lib/operations/createPolicy.js.map +0 -1
- package/lib/operations/createSolanaAccount.d.ts +0 -30
- package/lib/operations/createSolanaAccount.d.ts.map +0 -1
- package/lib/operations/createSolanaAccount.js +0 -36
- package/lib/operations/createSolanaAccount.js.map +0 -1
- package/lib/operations/createSpendPermission.d.ts +0 -56
- package/lib/operations/createSpendPermission.d.ts.map +0 -1
- package/lib/operations/createSpendPermission.js +0 -92
- package/lib/operations/createSpendPermission.js.map +0 -1
- package/lib/operations/createTransfer.d.ts +0 -178
- package/lib/operations/createTransfer.d.ts.map +0 -1
- package/lib/operations/createTransfer.js +0 -244
- package/lib/operations/createTransfer.js.map +0 -1
- package/lib/operations/createWebhookSubscription.d.ts +0 -54
- package/lib/operations/createWebhookSubscription.d.ts.map +0 -1
- package/lib/operations/createWebhookSubscription.js +0 -109
- package/lib/operations/createWebhookSubscription.js.map +0 -1
- package/lib/operations/deletePolicy.d.ts +0 -20
- package/lib/operations/deletePolicy.d.ts.map +0 -1
- package/lib/operations/deletePolicy.js +0 -25
- package/lib/operations/deletePolicy.js.map +0 -1
- package/lib/operations/deleteWebhookSubscription.d.ts +0 -21
- package/lib/operations/deleteWebhookSubscription.d.ts.map +0 -1
- package/lib/operations/deleteWebhookSubscription.js +0 -30
- package/lib/operations/deleteWebhookSubscription.js.map +0 -1
- package/lib/operations/executeFundTransfer.d.ts +0 -103
- package/lib/operations/executeFundTransfer.d.ts.map +0 -1
- package/lib/operations/executeFundTransfer.js +0 -152
- package/lib/operations/executeFundTransfer.js.map +0 -1
- package/lib/operations/exportEvmAccount.d.ts +0 -27
- package/lib/operations/exportEvmAccount.d.ts.map +0 -1
- package/lib/operations/exportEvmAccount.js +0 -31
- package/lib/operations/exportEvmAccount.js.map +0 -1
- package/lib/operations/exportEvmAccountByName.d.ts +0 -27
- package/lib/operations/exportEvmAccountByName.d.ts.map +0 -1
- package/lib/operations/exportEvmAccountByName.js +0 -33
- package/lib/operations/exportEvmAccountByName.js.map +0 -1
- package/lib/operations/exportSolanaAccount.d.ts +0 -27
- package/lib/operations/exportSolanaAccount.d.ts.map +0 -1
- package/lib/operations/exportSolanaAccount.js +0 -33
- package/lib/operations/exportSolanaAccount.js.map +0 -1
- package/lib/operations/exportSolanaAccountByName.d.ts +0 -27
- package/lib/operations/exportSolanaAccountByName.d.ts.map +0 -1
- package/lib/operations/exportSolanaAccountByName.js +0 -36
- package/lib/operations/exportSolanaAccountByName.js.map +0 -1
- package/lib/operations/getBalanceByAsset.d.ts +0 -29
- package/lib/operations/getBalanceByAsset.d.ts.map +0 -1
- package/lib/operations/getBalanceByAsset.js +0 -34
- package/lib/operations/getBalanceByAsset.js.map +0 -1
- package/lib/operations/getDelegationForEndUser.d.ts +0 -20
- package/lib/operations/getDelegationForEndUser.d.ts.map +0 -1
- package/lib/operations/getDelegationForEndUser.js +0 -29
- package/lib/operations/getDelegationForEndUser.js.map +0 -1
- package/lib/operations/getDelegationForEndUserAccount.d.ts +0 -23
- package/lib/operations/getDelegationForEndUserAccount.d.ts.map +0 -1
- package/lib/operations/getDelegationForEndUserAccount.js +0 -33
- package/lib/operations/getDelegationForEndUserAccount.js.map +0 -1
- package/lib/operations/getDepositDestinationById.d.ts +0 -32
- package/lib/operations/getDepositDestinationById.d.ts.map +0 -1
- package/lib/operations/getDepositDestinationById.js +0 -52
- package/lib/operations/getDepositDestinationById.js.map +0 -1
- package/lib/operations/getEndUser.d.ts +0 -73
- package/lib/operations/getEndUser.d.ts.map +0 -1
- package/lib/operations/getEndUser.js +0 -84
- package/lib/operations/getEndUser.js.map +0 -1
- package/lib/operations/getEvmAccount.d.ts +0 -22
- package/lib/operations/getEvmAccount.d.ts.map +0 -1
- package/lib/operations/getEvmAccount.js +0 -26
- package/lib/operations/getEvmAccount.js.map +0 -1
- package/lib/operations/getEvmAccountByName.d.ts +0 -22
- package/lib/operations/getEvmAccountByName.d.ts.map +0 -1
- package/lib/operations/getEvmAccountByName.js +0 -28
- package/lib/operations/getEvmAccountByName.js.map +0 -1
- package/lib/operations/getEvmEip7702DelegationOperationById.d.ts +0 -22
- package/lib/operations/getEvmEip7702DelegationOperationById.d.ts.map +0 -1
- package/lib/operations/getEvmEip7702DelegationOperationById.js +0 -46
- package/lib/operations/getEvmEip7702DelegationOperationById.js.map +0 -1
- package/lib/operations/getEvmSmartAccount.d.ts +0 -23
- package/lib/operations/getEvmSmartAccount.d.ts.map +0 -1
- package/lib/operations/getEvmSmartAccount.js +0 -29
- package/lib/operations/getEvmSmartAccount.js.map +0 -1
- package/lib/operations/getEvmSmartAccountByName.d.ts +0 -23
- package/lib/operations/getEvmSmartAccountByName.d.ts.map +0 -1
- package/lib/operations/getEvmSmartAccountByName.js +0 -29
- package/lib/operations/getEvmSmartAccountByName.js.map +0 -1
- package/lib/operations/getEvmSwapPrice.d.ts +0 -55
- package/lib/operations/getEvmSwapPrice.d.ts.map +0 -1
- package/lib/operations/getEvmSwapPrice.js +0 -62
- package/lib/operations/getEvmSwapPrice.js.map +0 -1
- package/lib/operations/getFoundationAccountById.d.ts +0 -23
- package/lib/operations/getFoundationAccountById.d.ts.map +0 -1
- package/lib/operations/getFoundationAccountById.js +0 -29
- package/lib/operations/getFoundationAccountById.js.map +0 -1
- package/lib/operations/getOnrampOrderById.d.ts +0 -39
- package/lib/operations/getOnrampOrderById.d.ts.map +0 -1
- package/lib/operations/getOnrampOrderById.js +0 -54
- package/lib/operations/getOnrampOrderById.js.map +0 -1
- package/lib/operations/getOnrampUserLimits.d.ts +0 -24
- package/lib/operations/getOnrampUserLimits.d.ts.map +0 -1
- package/lib/operations/getOnrampUserLimits.js +0 -36
- package/lib/operations/getOnrampUserLimits.js.map +0 -1
- package/lib/operations/getPaymentMethod.d.ts +0 -53
- package/lib/operations/getPaymentMethod.d.ts.map +0 -1
- package/lib/operations/getPaymentMethod.js +0 -61
- package/lib/operations/getPaymentMethod.js.map +0 -1
- package/lib/operations/getPolicyById.d.ts +0 -23
- package/lib/operations/getPolicyById.d.ts.map +0 -1
- package/lib/operations/getPolicyById.js +0 -27
- package/lib/operations/getPolicyById.js.map +0 -1
- package/lib/operations/getSQLGrammar.d.ts +0 -16
- package/lib/operations/getSQLGrammar.d.ts.map +0 -1
- package/lib/operations/getSQLGrammar.js +0 -20
- package/lib/operations/getSQLGrammar.js.map +0 -1
- package/lib/operations/getSQLSchema.d.ts +0 -31
- package/lib/operations/getSQLSchema.d.ts.map +0 -1
- package/lib/operations/getSQLSchema.js +0 -35
- package/lib/operations/getSQLSchema.js.map +0 -1
- package/lib/operations/getSolanaAccount.d.ts +0 -22
- package/lib/operations/getSolanaAccount.d.ts.map +0 -1
- package/lib/operations/getSolanaAccount.js +0 -26
- package/lib/operations/getSolanaAccount.js.map +0 -1
- package/lib/operations/getSolanaAccountByName.d.ts +0 -22
- package/lib/operations/getSolanaAccountByName.d.ts.map +0 -1
- package/lib/operations/getSolanaAccountByName.js +0 -28
- package/lib/operations/getSolanaAccountByName.js.map +0 -1
- package/lib/operations/getTransferById.d.ts +0 -99
- package/lib/operations/getTransferById.d.ts.map +0 -1
- package/lib/operations/getTransferById.js +0 -146
- package/lib/operations/getTransferById.js.map +0 -1
- package/lib/operations/getUserOperation.d.ts +0 -40
- package/lib/operations/getUserOperation.d.ts.map +0 -1
- package/lib/operations/getUserOperation.js +0 -65
- package/lib/operations/getUserOperation.js.map +0 -1
- package/lib/operations/getWebhookSubscription.d.ts +0 -39
- package/lib/operations/getWebhookSubscription.d.ts.map +0 -1
- package/lib/operations/getWebhookSubscription.js +0 -73
- package/lib/operations/getWebhookSubscription.js.map +0 -1
- package/lib/operations/importEndUser.d.ts +0 -110
- package/lib/operations/importEndUser.d.ts.map +0 -1
- package/lib/operations/importEndUser.js +0 -128
- package/lib/operations/importEndUser.js.map +0 -1
- package/lib/operations/importEvmAccount.d.ts +0 -31
- package/lib/operations/importEvmAccount.d.ts.map +0 -1
- package/lib/operations/importEvmAccount.js +0 -35
- package/lib/operations/importEvmAccount.js.map +0 -1
- package/lib/operations/importSolanaAccount.d.ts +0 -30
- package/lib/operations/importSolanaAccount.d.ts.map +0 -1
- package/lib/operations/importSolanaAccount.js +0 -36
- package/lib/operations/importSolanaAccount.js.map +0 -1
- package/lib/operations/index.d.ts +0 -116
- package/lib/operations/index.d.ts.map +0 -1
- package/lib/operations/index.js +0 -116
- package/lib/operations/index.js.map +0 -1
- package/lib/operations/initiateOnrampVerification.d.ts +0 -24
- package/lib/operations/initiateOnrampVerification.d.ts.map +0 -1
- package/lib/operations/initiateOnrampVerification.js +0 -30
- package/lib/operations/initiateOnrampVerification.js.map +0 -1
- package/lib/operations/listBalances.d.ts +0 -34
- package/lib/operations/listBalances.d.ts.map +0 -1
- package/lib/operations/listBalances.js +0 -38
- package/lib/operations/listBalances.js.map +0 -1
- package/lib/operations/listDataTokenBalances.d.ts +0 -37
- package/lib/operations/listDataTokenBalances.d.ts.map +0 -1
- package/lib/operations/listDataTokenBalances.js +0 -46
- package/lib/operations/listDataTokenBalances.js.map +0 -1
- package/lib/operations/listDepositDestinations.d.ts +0 -45
- package/lib/operations/listDepositDestinations.d.ts.map +0 -1
- package/lib/operations/listDepositDestinations.js +0 -62
- package/lib/operations/listDepositDestinations.js.map +0 -1
- package/lib/operations/listEndUsers.d.ts +0 -80
- package/lib/operations/listEndUsers.d.ts.map +0 -1
- package/lib/operations/listEndUsers.js +0 -103
- package/lib/operations/listEndUsers.js.map +0 -1
- package/lib/operations/listEvmAccounts.d.ts +0 -28
- package/lib/operations/listEvmAccounts.d.ts.map +0 -1
- package/lib/operations/listEvmAccounts.js +0 -32
- package/lib/operations/listEvmAccounts.js.map +0 -1
- package/lib/operations/listEvmSmartAccounts.d.ts +0 -29
- package/lib/operations/listEvmSmartAccounts.d.ts.map +0 -1
- package/lib/operations/listEvmSmartAccounts.js +0 -35
- package/lib/operations/listEvmSmartAccounts.js.map +0 -1
- package/lib/operations/listEvmTokenBalances.d.ts +0 -37
- package/lib/operations/listEvmTokenBalances.d.ts.map +0 -1
- package/lib/operations/listEvmTokenBalances.js +0 -46
- package/lib/operations/listEvmTokenBalances.js.map +0 -1
- package/lib/operations/listFoundationAccounts.d.ts +0 -30
- package/lib/operations/listFoundationAccounts.d.ts.map +0 -1
- package/lib/operations/listFoundationAccounts.js +0 -36
- package/lib/operations/listFoundationAccounts.js.map +0 -1
- package/lib/operations/listPaymentMethods.d.ts +0 -63
- package/lib/operations/listPaymentMethods.d.ts.map +0 -1
- package/lib/operations/listPaymentMethods.js +0 -73
- package/lib/operations/listPaymentMethods.js.map +0 -1
- package/lib/operations/listPolicies.d.ts +0 -31
- package/lib/operations/listPolicies.d.ts.map +0 -1
- package/lib/operations/listPolicies.js +0 -35
- package/lib/operations/listPolicies.js.map +0 -1
- package/lib/operations/listSolanaAccounts.d.ts +0 -29
- package/lib/operations/listSolanaAccounts.d.ts.map +0 -1
- package/lib/operations/listSolanaAccounts.js +0 -35
- package/lib/operations/listSolanaAccounts.js.map +0 -1
- package/lib/operations/listSolanaTokenBalances.d.ts +0 -36
- package/lib/operations/listSolanaTokenBalances.d.ts.map +0 -1
- package/lib/operations/listSolanaTokenBalances.js +0 -45
- package/lib/operations/listSolanaTokenBalances.js.map +0 -1
- package/lib/operations/listSpendPermissions.d.ts +0 -40
- package/lib/operations/listSpendPermissions.d.ts.map +0 -1
- package/lib/operations/listSpendPermissions.js +0 -58
- package/lib/operations/listSpendPermissions.js.map +0 -1
- package/lib/operations/listTokensForAccount.d.ts +0 -23
- package/lib/operations/listTokensForAccount.d.ts.map +0 -1
- package/lib/operations/listTokensForAccount.js +0 -32
- package/lib/operations/listTokensForAccount.js.map +0 -1
- package/lib/operations/listTransfers.d.ts +0 -153
- package/lib/operations/listTransfers.d.ts.map +0 -1
- package/lib/operations/listTransfers.js +0 -205
- package/lib/operations/listTransfers.js.map +0 -1
- package/lib/operations/listWebhookSubscriptionEvents.d.ts +0 -52
- package/lib/operations/listWebhookSubscriptionEvents.d.ts.map +0 -1
- package/lib/operations/listWebhookSubscriptionEvents.js +0 -68
- package/lib/operations/listWebhookSubscriptionEvents.js.map +0 -1
- package/lib/operations/listWebhookSubscriptions.d.ts +0 -44
- package/lib/operations/listWebhookSubscriptions.d.ts.map +0 -1
- package/lib/operations/listWebhookSubscriptions.js +0 -75
- package/lib/operations/listWebhookSubscriptions.js.map +0 -1
- package/lib/operations/listX402DiscoveryMerchant.d.ts +0 -69
- package/lib/operations/listX402DiscoveryMerchant.d.ts.map +0 -1
- package/lib/operations/listX402DiscoveryMerchant.js +0 -92
- package/lib/operations/listX402DiscoveryMerchant.js.map +0 -1
- package/lib/operations/listX402DiscoveryResources.d.ts +0 -67
- package/lib/operations/listX402DiscoveryResources.d.ts.map +0 -1
- package/lib/operations/listX402DiscoveryResources.js +0 -90
- package/lib/operations/listX402DiscoveryResources.js.map +0 -1
- package/lib/operations/lookupEndUser.d.ts +0 -93
- package/lib/operations/lookupEndUser.d.ts.map +0 -1
- package/lib/operations/lookupEndUser.js +0 -116
- package/lib/operations/lookupEndUser.js.map +0 -1
- package/lib/operations/postX402DiscoveryMcp.d.ts +0 -26
- package/lib/operations/postX402DiscoveryMcp.d.ts.map +0 -1
- package/lib/operations/postX402DiscoveryMcp.js +0 -32
- package/lib/operations/postX402DiscoveryMcp.js.map +0 -1
- package/lib/operations/prepareAndSendUserOperation.d.ts +0 -55
- package/lib/operations/prepareAndSendUserOperation.d.ts.map +0 -1
- package/lib/operations/prepareAndSendUserOperation.js +0 -93
- package/lib/operations/prepareAndSendUserOperation.js.map +0 -1
- package/lib/operations/prepareUserOperation.d.ts +0 -48
- package/lib/operations/prepareUserOperation.d.ts.map +0 -1
- package/lib/operations/prepareUserOperation.js +0 -86
- package/lib/operations/prepareUserOperation.js.map +0 -1
- package/lib/operations/requestEvmFaucet.d.ts +0 -22
- package/lib/operations/requestEvmFaucet.d.ts.map +0 -1
- package/lib/operations/requestEvmFaucet.js +0 -30
- package/lib/operations/requestEvmFaucet.js.map +0 -1
- package/lib/operations/requestLimitsUpgrade.d.ts +0 -29
- package/lib/operations/requestLimitsUpgrade.d.ts.map +0 -1
- package/lib/operations/requestLimitsUpgrade.js +0 -35
- package/lib/operations/requestLimitsUpgrade.js.map +0 -1
- package/lib/operations/requestSolanaFaucet.d.ts +0 -21
- package/lib/operations/requestSolanaFaucet.d.ts.map +0 -1
- package/lib/operations/requestSolanaFaucet.js +0 -27
- package/lib/operations/requestSolanaFaucet.js.map +0 -1
- package/lib/operations/revokeDelegationForEndUser.d.ts +0 -31
- package/lib/operations/revokeDelegationForEndUser.d.ts.map +0 -1
- package/lib/operations/revokeDelegationForEndUser.js +0 -40
- package/lib/operations/revokeDelegationForEndUser.js.map +0 -1
- package/lib/operations/revokeDelegationForEndUserAccount.d.ts +0 -34
- package/lib/operations/revokeDelegationForEndUserAccount.d.ts.map +0 -1
- package/lib/operations/revokeDelegationForEndUserAccount.js +0 -44
- package/lib/operations/revokeDelegationForEndUserAccount.js.map +0 -1
- package/lib/operations/revokeSpendPermission.d.ts +0 -49
- package/lib/operations/revokeSpendPermission.d.ts.map +0 -1
- package/lib/operations/revokeSpendPermission.js +0 -85
- package/lib/operations/revokeSpendPermission.js.map +0 -1
- package/lib/operations/runSQLQuery.d.ts +0 -57
- package/lib/operations/runSQLQuery.d.ts.map +0 -1
- package/lib/operations/runSQLQuery.js +0 -82
- package/lib/operations/runSQLQuery.js.map +0 -1
- package/lib/operations/searchX402Resources.d.ts +0 -83
- package/lib/operations/searchX402Resources.d.ts.map +0 -1
- package/lib/operations/searchX402Resources.js +0 -106
- package/lib/operations/searchX402Resources.js.map +0 -1
- package/lib/operations/sendEvmAssetWithEndUserAccount.d.ts +0 -45
- package/lib/operations/sendEvmAssetWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/sendEvmAssetWithEndUserAccount.js +0 -67
- package/lib/operations/sendEvmAssetWithEndUserAccount.js.map +0 -1
- package/lib/operations/sendEvmTransaction.d.ts +0 -44
- package/lib/operations/sendEvmTransaction.d.ts.map +0 -1
- package/lib/operations/sendEvmTransaction.js +0 -65
- package/lib/operations/sendEvmTransaction.js.map +0 -1
- package/lib/operations/sendEvmTransactionWithEndUserAccount.d.ts +0 -52
- package/lib/operations/sendEvmTransactionWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/sendEvmTransactionWithEndUserAccount.js +0 -74
- package/lib/operations/sendEvmTransactionWithEndUserAccount.js.map +0 -1
- package/lib/operations/sendSolanaAssetWithEndUserAccount.d.ts +0 -44
- package/lib/operations/sendSolanaAssetWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/sendSolanaAssetWithEndUserAccount.js +0 -54
- package/lib/operations/sendSolanaAssetWithEndUserAccount.js.map +0 -1
- package/lib/operations/sendSolanaTransaction.d.ts +0 -39
- package/lib/operations/sendSolanaTransaction.d.ts.map +0 -1
- package/lib/operations/sendSolanaTransaction.js +0 -45
- package/lib/operations/sendSolanaTransaction.js.map +0 -1
- package/lib/operations/sendSolanaTransactionWithEndUserAccount.d.ts +0 -50
- package/lib/operations/sendSolanaTransactionWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/sendSolanaTransactionWithEndUserAccount.js +0 -60
- package/lib/operations/sendSolanaTransactionWithEndUserAccount.js.map +0 -1
- package/lib/operations/sendUserOperation.d.ts +0 -44
- package/lib/operations/sendUserOperation.d.ts.map +0 -1
- package/lib/operations/sendUserOperation.js +0 -70
- package/lib/operations/sendUserOperation.js.map +0 -1
- package/lib/operations/sendUserOperationWithEndUserAccount.d.ts +0 -66
- package/lib/operations/sendUserOperationWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/sendUserOperationWithEndUserAccount.js +0 -105
- package/lib/operations/sendUserOperationWithEndUserAccount.js.map +0 -1
- package/lib/operations/settleX402Payment.d.ts +0 -245
- package/lib/operations/settleX402Payment.d.ts.map +0 -1
- package/lib/operations/settleX402Payment.js +0 -355
- package/lib/operations/settleX402Payment.js.map +0 -1
- package/lib/operations/signEvmHash.d.ts +0 -27
- package/lib/operations/signEvmHash.d.ts.map +0 -1
- package/lib/operations/signEvmHash.js +0 -31
- package/lib/operations/signEvmHash.js.map +0 -1
- package/lib/operations/signEvmMessage.d.ts +0 -28
- package/lib/operations/signEvmMessage.d.ts.map +0 -1
- package/lib/operations/signEvmMessage.js +0 -32
- package/lib/operations/signEvmMessage.js.map +0 -1
- package/lib/operations/signEvmMessageWithEndUserAccount.d.ts +0 -36
- package/lib/operations/signEvmMessageWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/signEvmMessageWithEndUserAccount.js +0 -46
- package/lib/operations/signEvmMessageWithEndUserAccount.js.map +0 -1
- package/lib/operations/signEvmTransaction.d.ts +0 -29
- package/lib/operations/signEvmTransaction.d.ts.map +0 -1
- package/lib/operations/signEvmTransaction.js +0 -38
- package/lib/operations/signEvmTransaction.js.map +0 -1
- package/lib/operations/signEvmTransactionWithEndUserAccount.d.ts +0 -37
- package/lib/operations/signEvmTransactionWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/signEvmTransactionWithEndUserAccount.js +0 -47
- package/lib/operations/signEvmTransactionWithEndUserAccount.js.map +0 -1
- package/lib/operations/signEvmTypedData.d.ts +0 -36
- package/lib/operations/signEvmTypedData.d.ts.map +0 -1
- package/lib/operations/signEvmTypedData.js +0 -43
- package/lib/operations/signEvmTypedData.js.map +0 -1
- package/lib/operations/signEvmTypedDataWithEndUserAccount.d.ts +0 -46
- package/lib/operations/signEvmTypedDataWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/signEvmTypedDataWithEndUserAccount.js +0 -56
- package/lib/operations/signEvmTypedDataWithEndUserAccount.js.map +0 -1
- package/lib/operations/signSolanaMessage.d.ts +0 -28
- package/lib/operations/signSolanaMessage.d.ts.map +0 -1
- package/lib/operations/signSolanaMessage.js +0 -36
- package/lib/operations/signSolanaMessage.js.map +0 -1
- package/lib/operations/signSolanaMessageWithEndUserAccount.d.ts +0 -36
- package/lib/operations/signSolanaMessageWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/signSolanaMessageWithEndUserAccount.js +0 -46
- package/lib/operations/signSolanaMessageWithEndUserAccount.js.map +0 -1
- package/lib/operations/signSolanaTransaction.d.ts +0 -33
- package/lib/operations/signSolanaTransaction.d.ts.map +0 -1
- package/lib/operations/signSolanaTransaction.js +0 -42
- package/lib/operations/signSolanaTransaction.js.map +0 -1
- package/lib/operations/signSolanaTransactionWithEndUserAccount.d.ts +0 -41
- package/lib/operations/signSolanaTransactionWithEndUserAccount.d.ts.map +0 -1
- package/lib/operations/signSolanaTransactionWithEndUserAccount.js +0 -51
- package/lib/operations/signSolanaTransactionWithEndUserAccount.js.map +0 -1
- package/lib/operations/submitDepositTravelRule.d.ts +0 -52
- package/lib/operations/submitDepositTravelRule.d.ts.map +0 -1
- package/lib/operations/submitDepositTravelRule.js +0 -58
- package/lib/operations/submitDepositTravelRule.js.map +0 -1
- package/lib/operations/submitOnrampVerification.d.ts +0 -26
- package/lib/operations/submitOnrampVerification.d.ts.map +0 -1
- package/lib/operations/submitOnrampVerification.js +0 -35
- package/lib/operations/submitOnrampVerification.js.map +0 -1
- package/lib/operations/supportedX402PaymentKinds.d.ts +0 -22
- package/lib/operations/supportedX402PaymentKinds.d.ts.map +0 -1
- package/lib/operations/supportedX402PaymentKinds.js +0 -40
- package/lib/operations/supportedX402PaymentKinds.js.map +0 -1
- package/lib/operations/updateEvmAccount.d.ts +0 -28
- package/lib/operations/updateEvmAccount.d.ts.map +0 -1
- package/lib/operations/updateEvmAccount.js +0 -32
- package/lib/operations/updateEvmAccount.js.map +0 -1
- package/lib/operations/updateEvmSmartAccount.d.ts +0 -24
- package/lib/operations/updateEvmSmartAccount.d.ts.map +0 -1
- package/lib/operations/updateEvmSmartAccount.js +0 -30
- package/lib/operations/updateEvmSmartAccount.js.map +0 -1
- package/lib/operations/updatePolicy.d.ts +0 -29
- package/lib/operations/updatePolicy.d.ts.map +0 -1
- package/lib/operations/updatePolicy.js +0 -33
- package/lib/operations/updatePolicy.js.map +0 -1
- package/lib/operations/updateSolanaAccount.d.ts +0 -28
- package/lib/operations/updateSolanaAccount.d.ts.map +0 -1
- package/lib/operations/updateSolanaAccount.js +0 -34
- package/lib/operations/updateSolanaAccount.js.map +0 -1
- package/lib/operations/updateWebhookSubscription.d.ts +0 -49
- package/lib/operations/updateWebhookSubscription.d.ts.map +0 -1
- package/lib/operations/updateWebhookSubscription.js +0 -107
- package/lib/operations/updateWebhookSubscription.js.map +0 -1
- package/lib/operations/validateEndUserAccessToken.d.ts +0 -72
- package/lib/operations/validateEndUserAccessToken.d.ts.map +0 -1
- package/lib/operations/validateEndUserAccessToken.js +0 -86
- package/lib/operations/validateEndUserAccessToken.js.map +0 -1
- package/lib/operations/validateX402Resource.d.ts +0 -64
- package/lib/operations/validateX402Resource.d.ts.map +0 -1
- package/lib/operations/validateX402Resource.js +0 -92
- package/lib/operations/validateX402Resource.js.map +0 -1
- package/lib/operations/verifyX402Payment.d.ts +0 -242
- package/lib/operations/verifyX402Payment.d.ts.map +0 -1
- package/lib/operations/verifyX402Payment.js +0 -333
- package/lib/operations/verifyX402Payment.js.map +0 -1
- package/lib/sensitive.d.ts +0 -5
- package/lib/sensitive.d.ts.map +0 -1
- package/lib/sensitive.js +0 -5
- package/lib/sensitive.js.map +0 -1
- package/src/category.ts +0 -4
- package/src/operations/addEndUserEvmAccount.ts +0 -48
- package/src/operations/addEndUserEvmSmartAccount.ts +0 -58
- package/src/operations/addEndUserSolanaAccount.ts +0 -48
- package/src/operations/createDelegationForEndUserAccount.ts +0 -60
- package/src/operations/createDepositDestination.ts +0 -83
- package/src/operations/createEndUser.ts +0 -230
- package/src/operations/createEvmAccount.ts +0 -51
- package/src/operations/createEvmEip7702Delegation.ts +0 -72
- package/src/operations/createEvmEip7702DelegationWithEndUserAccount.ts +0 -84
- package/src/operations/createEvmSmartAccount.ts +0 -51
- package/src/operations/createEvmSwapQuote.ts +0 -167
- package/src/operations/createFoundationAccount.ts +0 -49
- package/src/operations/createOnrampOrder.ts +0 -142
- package/src/operations/createOnrampSession.ts +0 -117
- package/src/operations/createPolicy.ts +0 -51
- package/src/operations/createSolanaAccount.ts +0 -53
- package/src/operations/createSpendPermission.ts +0 -163
- package/src/operations/createTransfer.ts +0 -461
- package/src/operations/createWebhookSubscription.ts +0 -189
- package/src/operations/deletePolicy.ts +0 -35
- package/src/operations/deleteWebhookSubscription.ts +0 -40
- package/src/operations/executeFundTransfer.ts +0 -282
- package/src/operations/exportEvmAccount.ts +0 -44
- package/src/operations/exportEvmAccountByName.ts +0 -46
- package/src/operations/exportSolanaAccount.ts +0 -46
- package/src/operations/exportSolanaAccountByName.ts +0 -49
- package/src/operations/getBalanceByAsset.ts +0 -56
- package/src/operations/getDelegationForEndUser.ts +0 -42
- package/src/operations/getDelegationForEndUserAccount.ts +0 -47
- package/src/operations/getDepositDestinationById.ts +0 -87
- package/src/operations/getEndUser.ts +0 -148
- package/src/operations/getEvmAccount.ts +0 -42
- package/src/operations/getEvmAccountByName.ts +0 -44
- package/src/operations/getEvmEip7702DelegationOperationById.ts +0 -69
- package/src/operations/getEvmSmartAccount.ts +0 -46
- package/src/operations/getEvmSmartAccountByName.ts +0 -46
- package/src/operations/getEvmSwapPrice.ts +0 -112
- package/src/operations/getFoundationAccountById.ts +0 -46
- package/src/operations/getOnrampOrderById.ts +0 -94
- package/src/operations/getOnrampUserLimits.ts +0 -57
- package/src/operations/getPaymentMethod.ts +0 -106
- package/src/operations/getPolicyById.ts +0 -44
- package/src/operations/getSQLGrammar.ts +0 -28
- package/src/operations/getSQLSchema.ts +0 -68
- package/src/operations/getSolanaAccount.ts +0 -42
- package/src/operations/getSolanaAccountByName.ts +0 -44
- package/src/operations/getTransferById.ts +0 -274
- package/src/operations/getUserOperation.ts +0 -119
- package/src/operations/getWebhookSubscription.ts +0 -122
- package/src/operations/importEndUser.ts +0 -218
- package/src/operations/importEvmAccount.ts +0 -53
- package/src/operations/importSolanaAccount.ts +0 -53
- package/src/operations/index.ts +0 -115
- package/src/operations/initiateOnrampVerification.ts +0 -44
- package/src/operations/listBalances.ts +0 -66
- package/src/operations/listDataTokenBalances.ts +0 -72
- package/src/operations/listDepositDestinations.ts +0 -107
- package/src/operations/listEndUsers.ts +0 -174
- package/src/operations/listEvmAccounts.ts +0 -54
- package/src/operations/listEvmSmartAccounts.ts +0 -58
- package/src/operations/listEvmTokenBalances.ts +0 -72
- package/src/operations/listFoundationAccounts.ts +0 -60
- package/src/operations/listPaymentMethods.ts +0 -130
- package/src/operations/listPolicies.ts +0 -59
- package/src/operations/listSolanaAccounts.ts +0 -57
- package/src/operations/listSolanaTokenBalances.ts +0 -66
- package/src/operations/listSpendPermissions.ts +0 -100
- package/src/operations/listTokensForAccount.ts +0 -47
- package/src/operations/listTransfers.ts +0 -355
- package/src/operations/listWebhookSubscriptionEvents.ts +0 -101
- package/src/operations/listWebhookSubscriptions.ts +0 -130
- package/src/operations/listX402DiscoveryMerchant.ts +0 -172
- package/src/operations/listX402DiscoveryResources.ts +0 -169
- package/src/operations/lookupEndUser.ts +0 -188
- package/src/operations/postX402DiscoveryMcp.ts +0 -54
- package/src/operations/prepareAndSendUserOperation.ts +0 -169
- package/src/operations/prepareUserOperation.ts +0 -163
- package/src/operations/requestEvmFaucet.ts +0 -44
- package/src/operations/requestLimitsUpgrade.ts +0 -54
- package/src/operations/requestSolanaFaucet.ts +0 -40
- package/src/operations/revokeDelegationForEndUser.ts +0 -52
- package/src/operations/revokeDelegationForEndUserAccount.ts +0 -57
- package/src/operations/revokeSpendPermission.ts +0 -149
- package/src/operations/runSQLQuery.ts +0 -141
- package/src/operations/searchX402Resources.ts +0 -194
- package/src/operations/sendEvmAssetWithEndUserAccount.ts +0 -103
- package/src/operations/sendEvmTransaction.ts +0 -90
- package/src/operations/sendEvmTransactionWithEndUserAccount.ts +0 -102
- package/src/operations/sendSolanaAssetWithEndUserAccount.ts +0 -75
- package/src/operations/sendSolanaTransaction.ts +0 -59
- package/src/operations/sendSolanaTransactionWithEndUserAccount.ts +0 -78
- package/src/operations/sendUserOperation.ts +0 -125
- package/src/operations/sendUserOperationWithEndUserAccount.ts +0 -186
- package/src/operations/settleX402Payment.ts +0 -819
- package/src/operations/signEvmHash.ts +0 -44
- package/src/operations/signEvmMessage.ts +0 -45
- package/src/operations/signEvmMessageWithEndUserAccount.ts +0 -62
- package/src/operations/signEvmTransaction.ts +0 -51
- package/src/operations/signEvmTransactionWithEndUserAccount.ts +0 -63
- package/src/operations/signEvmTypedData.ts +0 -65
- package/src/operations/signEvmTypedDataWithEndUserAccount.ts +0 -83
- package/src/operations/signSolanaMessage.ts +0 -49
- package/src/operations/signSolanaMessageWithEndUserAccount.ts +0 -62
- package/src/operations/signSolanaTransaction.ts +0 -55
- package/src/operations/signSolanaTransactionWithEndUserAccount.ts +0 -67
- package/src/operations/submitDepositTravelRule.ts +0 -101
- package/src/operations/submitOnrampVerification.ts +0 -49
- package/src/operations/supportedX402PaymentKinds.ts +0 -71
- package/src/operations/updateEvmAccount.ts +0 -50
- package/src/operations/updateEvmSmartAccount.ts +0 -48
- package/src/operations/updatePolicy.ts +0 -52
- package/src/operations/updateSolanaAccount.ts +0 -52
- package/src/operations/updateWebhookSubscription.ts +0 -188
- package/src/operations/validateEndUserAccessToken.ts +0 -150
- package/src/operations/validateX402Resource.ts +0 -170
- package/src/operations/verifyX402Payment.ts +0 -775
- package/src/sensitive.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/coinbase",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/alchemy-run/distilled",
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"sideEffects": false,
|
|
12
|
-
"module": "src/index.ts",
|
|
13
12
|
"files": [
|
|
14
13
|
"lib",
|
|
15
14
|
"src"
|
|
@@ -18,73 +17,61 @@
|
|
|
18
17
|
".": {
|
|
19
18
|
"types": "./lib/index.d.ts",
|
|
20
19
|
"bun": "./src/index.ts",
|
|
20
|
+
"worker": "./src/index.ts",
|
|
21
21
|
"default": "./lib/index.js"
|
|
22
22
|
},
|
|
23
|
-
"./Category": {
|
|
24
|
-
"types": "./lib/category.d.ts",
|
|
25
|
-
"bun": "./src/category.ts",
|
|
26
|
-
"default": "./lib/category.js"
|
|
27
|
-
},
|
|
28
|
-
"./Client": {
|
|
29
|
-
"types": "./lib/client.d.ts",
|
|
30
|
-
"bun": "./src/client.ts",
|
|
31
|
-
"default": "./lib/client.js"
|
|
32
|
-
},
|
|
33
23
|
"./Credentials": {
|
|
34
24
|
"types": "./lib/credentials.d.ts",
|
|
35
25
|
"bun": "./src/credentials.ts",
|
|
26
|
+
"worker": "./src/credentials.ts",
|
|
36
27
|
"default": "./lib/credentials.js"
|
|
37
28
|
},
|
|
38
29
|
"./Errors": {
|
|
39
30
|
"types": "./lib/errors.d.ts",
|
|
40
31
|
"bun": "./src/errors.ts",
|
|
32
|
+
"worker": "./src/errors.ts",
|
|
41
33
|
"default": "./lib/errors.js"
|
|
42
34
|
},
|
|
43
|
-
"./
|
|
44
|
-
"types": "./lib/
|
|
45
|
-
"bun": "./src/
|
|
46
|
-
"
|
|
35
|
+
"./Traits": {
|
|
36
|
+
"types": "./lib/traits.d.ts",
|
|
37
|
+
"bun": "./src/traits.ts",
|
|
38
|
+
"worker": "./src/traits.ts",
|
|
39
|
+
"default": "./lib/traits.js"
|
|
40
|
+
},
|
|
41
|
+
"./Protocol": {
|
|
42
|
+
"types": "./lib/protocol.d.ts",
|
|
43
|
+
"bun": "./src/protocol.ts",
|
|
44
|
+
"worker": "./src/protocol.ts",
|
|
45
|
+
"default": "./lib/protocol.js"
|
|
47
46
|
},
|
|
48
47
|
"./Retry": {
|
|
49
48
|
"types": "./lib/retry.d.ts",
|
|
50
49
|
"bun": "./src/retry.ts",
|
|
50
|
+
"worker": "./src/retry.ts",
|
|
51
51
|
"default": "./lib/retry.js"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
54
|
-
"types": "./lib/
|
|
55
|
-
"bun": "./src/
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"./Traits": {
|
|
59
|
-
"types": "./lib/traits.d.ts",
|
|
60
|
-
"bun": "./src/traits.ts",
|
|
61
|
-
"default": "./lib/traits.js"
|
|
53
|
+
"./*": {
|
|
54
|
+
"types": "./lib/services/*.d.ts",
|
|
55
|
+
"bun": "./src/services/*.ts",
|
|
56
|
+
"worker": "./src/services/*.ts",
|
|
57
|
+
"default": "./lib/services/*.js"
|
|
62
58
|
}
|
|
63
59
|
},
|
|
64
60
|
"scripts": {
|
|
65
|
-
"typecheck": "tsc",
|
|
66
61
|
"build": "tsc -b",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"test": "bunx vitest run test --exclude specs --passWithNoTests",
|
|
71
|
-
"publish:npm": "bun run build && bun publish --access public",
|
|
72
|
-
"generate": "bun run scripts/generate.ts && oxlint --fix src && oxfmt --write src && oxfmt --write src",
|
|
62
|
+
"convert": "bun scripts/convert.ts",
|
|
63
|
+
"generate": "bun scripts/convert.ts && bun scripts/generate.ts",
|
|
64
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
73
65
|
"specs:fetch": "git submodule update --force --init --recursive --depth=1 specs/cdp-sdk && git -C specs/cdp-sdk checkout -- .",
|
|
74
66
|
"specs:update": "git -C specs/cdp-sdk fetch && git -C specs/cdp-sdk checkout main && git -C specs/cdp-sdk pull"
|
|
75
67
|
},
|
|
76
68
|
"dependencies": {
|
|
77
|
-
"@distilled.cloud/core": "0.
|
|
69
|
+
"@distilled.cloud/core": "1.0.0-rc.2",
|
|
70
|
+
"@effect/platform-bun": ">=4.0.0-beta.102 || >=4.0.0",
|
|
71
|
+
"effect": ">=4.0.0-beta.102 || >=4.0.0"
|
|
78
72
|
},
|
|
79
73
|
"devDependencies": {
|
|
80
|
-
"@types/bun": "
|
|
81
|
-
"@types/node": "
|
|
82
|
-
"dotenv": "^16.5.0",
|
|
83
|
-
"rolldown": "^1.2.0",
|
|
84
|
-
"vitest": "^3.2.3",
|
|
85
|
-
"yaml": "^2.8.2"
|
|
86
|
-
},
|
|
87
|
-
"peerDependencies": {
|
|
88
|
-
"effect": ">=4.0.0-beta.100 || >=4.0.0"
|
|
74
|
+
"@types/bun": "latest",
|
|
75
|
+
"@types/node": "latest"
|
|
89
76
|
}
|
|
90
77
|
}
|
package/src/credentials.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coinbase CDP credentials — hand-written.
|
|
3
|
+
*
|
|
4
|
+
* API-compatible port of the distilled repo's coinbase credentials module:
|
|
5
|
+
* the `Credentials` service holds an *effect* that resolves the current
|
|
6
|
+
* credentials on every request. The protocol layer resolves it per request
|
|
7
|
+
* and signs a fresh JWT bearer token from the API Key Secret.
|
|
8
|
+
*/
|
|
1
9
|
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
10
|
import * as EffectConfig from "effect/Config";
|
|
3
11
|
import * as Context from "effect/Context";
|
package/src/errors.ts
CHANGED
|
@@ -32,7 +32,15 @@ export {
|
|
|
32
32
|
DEFAULT_ERRORS,
|
|
33
33
|
API_ERRORS,
|
|
34
34
|
} from "@distilled.cloud/core/errors";
|
|
35
|
-
|
|
35
|
+
import type {
|
|
36
|
+
BadRequest as CoreBadRequest,
|
|
37
|
+
Conflict as CoreConflict,
|
|
38
|
+
DefaultErrors as CoreDefaultErrors,
|
|
39
|
+
Forbidden as CoreForbidden,
|
|
40
|
+
Locked as CoreLocked,
|
|
41
|
+
NotFound as CoreNotFound,
|
|
42
|
+
UnprocessableEntity as CoreUnprocessableEntity,
|
|
43
|
+
} from "@distilled.cloud/core/errors";
|
|
36
44
|
|
|
37
45
|
import {
|
|
38
46
|
BadGateway,
|
|
@@ -579,7 +587,7 @@ export const STANDARD_ERROR_TYPE_MAP: Record<
|
|
|
579
587
|
|
|
580
588
|
/**
|
|
581
589
|
* Maps Coinbase-specific `errorType` values to their corresponding error classes.
|
|
582
|
-
* Used by the
|
|
590
|
+
* Used by the protocol's matchError function for type-based error dispatching.
|
|
583
591
|
*/
|
|
584
592
|
export const ERROR_TYPE_MAP: Record<string, new (props: any) => unknown> = {
|
|
585
593
|
// Resource conflicts
|
|
@@ -692,3 +700,85 @@ export class CoinbaseParseError extends Schema.TaggedErrorClass<CoinbaseParseErr
|
|
|
692
700
|
cause: Schema.Unknown,
|
|
693
701
|
},
|
|
694
702
|
).pipe(Category.withParseError) {}
|
|
703
|
+
|
|
704
|
+
// ============================================================================
|
|
705
|
+
// Error unions (the error channel of every generated operation)
|
|
706
|
+
// ============================================================================
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* All Coinbase CDP typed errors that `errorType` dispatch can produce.
|
|
710
|
+
*/
|
|
711
|
+
export type CoinbaseTypedErrors =
|
|
712
|
+
| PaymentRequired
|
|
713
|
+
| IdempotencyError
|
|
714
|
+
| AlreadyExists
|
|
715
|
+
| FaucetLimitExceeded
|
|
716
|
+
| InvalidSqlQuery
|
|
717
|
+
| InvalidSignature
|
|
718
|
+
| MalformedTransaction
|
|
719
|
+
| SettlementFailed
|
|
720
|
+
| TimedOut
|
|
721
|
+
| ClientClosedRequest
|
|
722
|
+
| RequestCanceled
|
|
723
|
+
| PolicyViolation
|
|
724
|
+
| PolicyInUse
|
|
725
|
+
| AccountLimitExceeded
|
|
726
|
+
| InsufficientBalance
|
|
727
|
+
| AccountNotReady
|
|
728
|
+
| MfaRequired
|
|
729
|
+
| MfaAlreadyEnrolled
|
|
730
|
+
| MfaInvalidCode
|
|
731
|
+
| MfaFlowExpired
|
|
732
|
+
| MfaNotEnrolled
|
|
733
|
+
| NetworkNotTradable
|
|
734
|
+
| GuestPermissionDenied
|
|
735
|
+
| GuestRegionForbidden
|
|
736
|
+
| GuestTransactionLimit
|
|
737
|
+
| GuestTransactionCount
|
|
738
|
+
| PhoneNumberVerificationExpired
|
|
739
|
+
| DocumentVerificationFailed
|
|
740
|
+
| RecipientAllowlistViolation
|
|
741
|
+
| RecipientAllowlistPending
|
|
742
|
+
| TravelRulesRecipientViolation
|
|
743
|
+
| TravelRulesFieldMissing
|
|
744
|
+
| SourceAccountInvalid
|
|
745
|
+
| TargetAccountInvalid
|
|
746
|
+
| SourceAccountNotFound
|
|
747
|
+
| TargetAccountNotFound
|
|
748
|
+
| SourceAssetNotSupported
|
|
749
|
+
| TargetAssetNotSupported
|
|
750
|
+
| TransferAssetNotSupported
|
|
751
|
+
| AssetMismatch
|
|
752
|
+
| TargetEmailInvalid
|
|
753
|
+
| TargetOnchainAddressInvalid
|
|
754
|
+
| TransferAmountInvalid
|
|
755
|
+
| MetadataTooManyEntries
|
|
756
|
+
| MetadataKeyTooLong
|
|
757
|
+
| MetadataValueTooLong
|
|
758
|
+
| OrderQuoteExpired
|
|
759
|
+
| OrderAlreadyFilled
|
|
760
|
+
| OrderAlreadyCanceled;
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Errors any Coinbase operation may surface beyond the core HTTP defaults:
|
|
764
|
+
* the typed CDP errors plus the client-level fallback/decode errors.
|
|
765
|
+
*/
|
|
766
|
+
export type ClientErrors =
|
|
767
|
+
| CoinbaseTypedErrors
|
|
768
|
+
| UnknownCoinbaseError
|
|
769
|
+
| CoinbaseParseError;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Default Coinbase operation errors: the shared HTTP status errors from core
|
|
773
|
+
* (both the always-possible defaults and the status-mapped 4xx classes the
|
|
774
|
+
* global matcher can produce) plus the Coinbase client errors.
|
|
775
|
+
*/
|
|
776
|
+
export type DefaultErrors =
|
|
777
|
+
| CoreDefaultErrors
|
|
778
|
+
| CoreBadRequest
|
|
779
|
+
| CoreForbidden
|
|
780
|
+
| CoreNotFound
|
|
781
|
+
| CoreConflict
|
|
782
|
+
| CoreUnprocessableEntity
|
|
783
|
+
| CoreLocked
|
|
784
|
+
| ClientErrors;
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Coinbase SDK for Effect
|
|
2
|
+
* @distilled.cloud/coinbase — Coinbase CDP SDK for Effect.
|
|
3
|
+
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy model in
|
|
5
|
+
* `.generated-specs` (converted from the CDP OpenAPI spec by
|
|
6
|
+
* `scripts/convert.ts`). Everything else in this folder is hand-written.
|
|
3
7
|
*
|
|
4
8
|
* @example
|
|
5
9
|
* ```ts
|
|
@@ -7,10 +11,12 @@
|
|
|
7
11
|
* ```
|
|
8
12
|
*/
|
|
9
13
|
export * from "./credentials.ts";
|
|
10
|
-
export *
|
|
14
|
+
export * from "./errors.ts";
|
|
11
15
|
export * as T from "./traits.ts";
|
|
16
|
+
export {
|
|
17
|
+
CoinbaseProtocol,
|
|
18
|
+
type CoinbaseOpError,
|
|
19
|
+
type CoinbaseOpContext,
|
|
20
|
+
} from "./protocol.ts";
|
|
12
21
|
export * as Retry from "./retry.ts";
|
|
13
|
-
export
|
|
14
|
-
export * from "./errors.ts";
|
|
15
|
-
export * from "./operations/index.ts";
|
|
16
|
-
export { SensitiveString, SensitiveNullableString } from "./sensitive.ts";
|
|
22
|
+
export * as Services from "./services/index.ts";
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* CoinbaseProtocol — hand-written.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Speaks the Coinbase CDP JSON protocol. The generic request/response
|
|
5
|
+
* machinery (trait-driven request building, recursive wire-name mapping)
|
|
6
|
+
* lives in `@distilled.cloud/core/protocol-http`; this module supplies what
|
|
7
|
+
* is Coinbase's own:
|
|
6
8
|
*
|
|
7
9
|
* ## Authentication
|
|
8
10
|
*
|
|
9
|
-
* The Coinbase CDP API uses JWT bearer tokens
|
|
10
|
-
*
|
|
11
|
+
* The Coinbase CDP API uses per-request JWT bearer tokens. The JWT is signed
|
|
12
|
+
* with your CDP API Key Secret (ES256 or Ed25519) and includes:
|
|
11
13
|
*
|
|
12
14
|
* - `sub`: Your CDP API Key ID
|
|
13
15
|
* - `iss`: "cdp"
|
|
16
|
+
* - `aud`: ["cdp_service"]
|
|
14
17
|
* - `exp`: Current time + 120 seconds
|
|
18
|
+
* - `uri`: "METHOD host/path"
|
|
15
19
|
*
|
|
16
|
-
* Some sensitive wallet operations additionally
|
|
17
|
-
* header signed with your Wallet Secret.
|
|
20
|
+
* Some sensitive wallet operations additionally document an `X-Wallet-Auth`
|
|
21
|
+
* header signed with your Wallet Secret (`Config.walletSecret`); like the
|
|
22
|
+
* distilled v0 client, this module does not generate that header.
|
|
18
23
|
*
|
|
19
24
|
* ## Error Handling
|
|
20
25
|
*
|
|
@@ -28,28 +33,60 @@
|
|
|
28
33
|
* }
|
|
29
34
|
* ```
|
|
30
35
|
*
|
|
31
|
-
* Errors are
|
|
36
|
+
* Errors are handled globally (no per-operation error lists), dispatched
|
|
37
|
+
* first by `errorType`, then by HTTP status code.
|
|
32
38
|
*/
|
|
33
|
-
import { makeAPI } from "@distilled.cloud/core/client";
|
|
34
|
-
import { parseRetryAfterForStatus } from "@distilled.cloud/core/retry-after";
|
|
35
39
|
import * as Effect from "effect/Effect";
|
|
40
|
+
import * as Layer from "effect/Layer";
|
|
36
41
|
import * as Redacted from "effect/Redacted";
|
|
37
42
|
import * as Schema from "effect/Schema";
|
|
43
|
+
import type * as AST from "effect/SchemaAST";
|
|
38
44
|
import * as crypto from "node:crypto";
|
|
45
|
+
import type * as HttpClient from "effect/unstable/http/HttpClient";
|
|
46
|
+
import type * as HttpClientError from "effect/unstable/http/HttpClientError";
|
|
47
|
+
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
|
|
48
|
+
import type * as HttpClientResponse from "effect/unstable/http/HttpClientResponse";
|
|
49
|
+
import * as API from "@distilled.cloud/core/api";
|
|
50
|
+
import { buildRequest, mapKeys } from "@distilled.cloud/core/protocol-http";
|
|
51
|
+
import {
|
|
52
|
+
unwrapRedactedDeep,
|
|
53
|
+
wrapSensitive,
|
|
54
|
+
} from "@distilled.cloud/core/protocol-rest";
|
|
55
|
+
import {
|
|
56
|
+
type ConfigError,
|
|
57
|
+
HTTP_STATUS_MAP,
|
|
58
|
+
} from "@distilled.cloud/core/errors";
|
|
59
|
+
import { parseRetryAfterForStatus } from "@distilled.cloud/core/retry-after";
|
|
39
60
|
import type { Config } from "./credentials.ts";
|
|
40
61
|
import { Credentials } from "./credentials.ts";
|
|
41
62
|
import {
|
|
42
63
|
COINBASE_HTTP_STATUS_MAP,
|
|
43
|
-
|
|
64
|
+
type DefaultErrors,
|
|
44
65
|
ERROR_TYPE_MAP,
|
|
45
|
-
HTTP_STATUS_MAP,
|
|
46
66
|
STANDARD_ERROR_TYPE_MAP,
|
|
47
67
|
UnknownCoinbaseError,
|
|
48
68
|
} from "./errors.ts";
|
|
49
|
-
import { Retry } from "./retry.ts";
|
|
50
69
|
|
|
51
|
-
|
|
52
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Error channel shared by every generated Coinbase operation. Generated
|
|
72
|
+
* service files annotate operations with `API.OperationMethod<I, O,
|
|
73
|
+
* CoinbaseOpError, CoinbaseOpContext>` explicitly so the compiler never
|
|
74
|
+
* infers these back out of the schema generics.
|
|
75
|
+
*/
|
|
76
|
+
export type CoinbaseOpError =
|
|
77
|
+
| DefaultErrors
|
|
78
|
+
| ConfigError
|
|
79
|
+
| HttpClientError.HttpClientError;
|
|
80
|
+
|
|
81
|
+
/** Context (requirements) shared by every generated Coinbase operation. */
|
|
82
|
+
export type CoinbaseOpContext = Credentials | HttpClient.HttpClient;
|
|
83
|
+
|
|
84
|
+
// Bridge: Protocol.decode is typed as Effect<unknown> (no error channel), but
|
|
85
|
+
// Coinbase failures are real typed errors that the operation's explicit
|
|
86
|
+
// `CoinbaseOpError` annotation re-surfaces. Fail with the instance and erase
|
|
87
|
+
// the error type here.
|
|
88
|
+
const fail = (e: unknown): Effect.Effect<never> =>
|
|
89
|
+
Effect.fail(e) as Effect.Effect<never>;
|
|
53
90
|
|
|
54
91
|
// ============================================================================
|
|
55
92
|
// JWT generation for Coinbase CDP API authentication
|
|
@@ -210,7 +247,8 @@ const CoinbaseErrorResponse = Schema.Struct({
|
|
|
210
247
|
});
|
|
211
248
|
|
|
212
249
|
/**
|
|
213
|
-
* Match a Coinbase CDP API error response to the appropriate typed error
|
|
250
|
+
* Match a Coinbase CDP API error response to the appropriate typed error
|
|
251
|
+
* class. Ported from the distilled v0 client's `matchError`.
|
|
214
252
|
*
|
|
215
253
|
* Dispatches errors by:
|
|
216
254
|
* 1. The `errorType` field for Coinbase-specific errors (e.g., "already_exists", "policy_violation")
|
|
@@ -218,13 +256,16 @@ const CoinbaseErrorResponse = Schema.Struct({
|
|
|
218
256
|
* 3. Standard HTTP status codes mapped from core (400, 401, 403, 404, etc.)
|
|
219
257
|
* 4. Coinbase-specific HTTP status codes (402)
|
|
220
258
|
* 5. Falls back to UnknownCoinbaseError for unrecognized errors
|
|
259
|
+
*
|
|
260
|
+
* Error bodies carrying `isValid`/`success` keys are policy-validation
|
|
261
|
+
* results delivered with an error status — treated as success values
|
|
262
|
+
* (`Effect.succeed`) like the v0 client did.
|
|
221
263
|
*/
|
|
222
264
|
const matchError = (
|
|
223
265
|
status: number,
|
|
224
266
|
errorBody: unknown,
|
|
225
|
-
_errors?: readonly unknown[],
|
|
226
267
|
headers?: Record<string, string | undefined>,
|
|
227
|
-
): Effect.Effect<unknown
|
|
268
|
+
): Effect.Effect<unknown> => {
|
|
228
269
|
if (
|
|
229
270
|
errorBody &&
|
|
230
271
|
typeof errorBody === "object" &&
|
|
@@ -245,16 +286,16 @@ const matchError = (
|
|
|
245
286
|
// 1. Match by Coinbase-specific error type first
|
|
246
287
|
const TypedErrorClass = ERROR_TYPE_MAP[parsed.errorType];
|
|
247
288
|
if (TypedErrorClass) {
|
|
248
|
-
return
|
|
289
|
+
return fail(new TypedErrorClass(errorProps));
|
|
249
290
|
}
|
|
250
291
|
|
|
251
292
|
// 2. Match standard error types to core HTTP error classes
|
|
252
|
-
// Maps error types like "not_found", "forbidden", "unauthorized",
|
|
253
|
-
// "
|
|
254
|
-
//
|
|
293
|
+
// Maps error types like "not_found", "forbidden", "unauthorized",
|
|
294
|
+
// "invalid_request", "rate_limit_exceeded", "internal_server_error",
|
|
295
|
+
// "bad_gateway", "service_unavailable" to core HTTP error classes.
|
|
255
296
|
const StandardErrorClass = STANDARD_ERROR_TYPE_MAP[parsed.errorType];
|
|
256
297
|
if (StandardErrorClass) {
|
|
257
|
-
return
|
|
298
|
+
return fail(
|
|
258
299
|
new StandardErrorClass({
|
|
259
300
|
message: parsed.errorMessage ?? "",
|
|
260
301
|
retryAfter: parseRetryAfterForStatus(status, headers),
|
|
@@ -265,7 +306,7 @@ const matchError = (
|
|
|
265
306
|
// 3. Fall back to HTTP status code mapping from core
|
|
266
307
|
const CoreErrorClass = (HTTP_STATUS_MAP as any)[status];
|
|
267
308
|
if (CoreErrorClass) {
|
|
268
|
-
return
|
|
309
|
+
return fail(
|
|
269
310
|
new CoreErrorClass({
|
|
270
311
|
message: parsed.errorMessage ?? "",
|
|
271
312
|
retryAfter: parseRetryAfterForStatus(status, headers),
|
|
@@ -276,49 +317,119 @@ const matchError = (
|
|
|
276
317
|
// 4. Coinbase-specific HTTP status codes (402)
|
|
277
318
|
const CoinbaseErrorClass = (COINBASE_HTTP_STATUS_MAP as any)[status];
|
|
278
319
|
if (CoinbaseErrorClass) {
|
|
279
|
-
return
|
|
320
|
+
return fail(new CoinbaseErrorClass(errorProps));
|
|
280
321
|
}
|
|
281
322
|
|
|
282
323
|
// 5. Fall back to unknown error
|
|
283
|
-
return
|
|
324
|
+
return fail(
|
|
284
325
|
new UnknownCoinbaseError({
|
|
285
326
|
...errorProps,
|
|
286
327
|
body: errorBody,
|
|
287
328
|
}),
|
|
288
329
|
);
|
|
289
330
|
} catch {
|
|
290
|
-
return
|
|
331
|
+
return fail(new UnknownCoinbaseError({ body: errorBody }));
|
|
291
332
|
}
|
|
292
333
|
};
|
|
293
334
|
|
|
294
335
|
// ============================================================================
|
|
295
|
-
//
|
|
336
|
+
// Protocol
|
|
296
337
|
// ============================================================================
|
|
297
338
|
|
|
339
|
+
// The protocol layer is memoized per process by `API.make`, so the build must
|
|
340
|
+
// not capture credentials — `encode` resolves Credentials from the calling
|
|
341
|
+
// fiber's context on every request instead. Like the error channel above,
|
|
342
|
+
// the requirement is erased at this boundary (Protocol effects are typed with
|
|
343
|
+
// no requirements) and reintroduced for callers by the generated
|
|
344
|
+
// `CoinbaseOpContext` annotations.
|
|
345
|
+
const encode = ({
|
|
346
|
+
input,
|
|
347
|
+
inputAst,
|
|
348
|
+
}: {
|
|
349
|
+
readonly input: unknown;
|
|
350
|
+
readonly inputAst: AST.AST;
|
|
351
|
+
}) =>
|
|
352
|
+
Effect.gen(function* () {
|
|
353
|
+
// The Credentials service holds an effect — resolving it here (per
|
|
354
|
+
// request) picks up rotations. Its error channel is erased at this
|
|
355
|
+
// boundary; CoinbaseOpError reintroduces it for callers.
|
|
356
|
+
const resolveCredentials = yield* Credentials;
|
|
357
|
+
const creds =
|
|
358
|
+
(yield* resolveCredentials as Effect.Effect<Config>) as Config;
|
|
359
|
+
|
|
360
|
+
// Sensitive input members accept string | Redacted<string>; the wire
|
|
361
|
+
// wants the raw string.
|
|
362
|
+
const request = buildRequest({
|
|
363
|
+
input: unwrapRedactedDeep(input),
|
|
364
|
+
inputAst,
|
|
365
|
+
baseUrl: creds.apiBaseUrl,
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
// JWT `uri` claim: "METHOD host/path" — label-substituted path, no query
|
|
369
|
+
// string (matches the v0 client: baseUrl.host + baseUrl.pathname +
|
|
370
|
+
// parts.path).
|
|
371
|
+
const url = new URL(request.url);
|
|
372
|
+
const jwt = generateJwt(
|
|
373
|
+
creds.apiKeyId,
|
|
374
|
+
Redacted.value(creds.apiKeySecret),
|
|
375
|
+
request.method,
|
|
376
|
+
`${url.host}${url.pathname}`,
|
|
377
|
+
);
|
|
378
|
+
return request.pipe(
|
|
379
|
+
HttpClientRequest.setHeader("Authorization", `Bearer ${jwt}`),
|
|
380
|
+
);
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
const decode = ({
|
|
384
|
+
response,
|
|
385
|
+
outputAst,
|
|
386
|
+
}: {
|
|
387
|
+
readonly response: HttpClientResponse.HttpClientResponse;
|
|
388
|
+
readonly outputAst: AST.AST;
|
|
389
|
+
readonly errors: ReadonlyArray<unknown>;
|
|
390
|
+
}) =>
|
|
391
|
+
Effect.gen(function* () {
|
|
392
|
+
const text = (yield* response.text.pipe(Effect.orDie)) ?? "";
|
|
393
|
+
if (process.env.DISTILLED_DEBUG_HTTP) {
|
|
394
|
+
console.error(`[distilled] <- ${response.status} ${text.slice(0, 400)}`);
|
|
395
|
+
}
|
|
396
|
+
let json: unknown;
|
|
397
|
+
if (text.trim().length > 0) {
|
|
398
|
+
try {
|
|
399
|
+
json = JSON.parse(text);
|
|
400
|
+
} catch {
|
|
401
|
+
json = text;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
const status = response.status;
|
|
405
|
+
const headers = response.headers as Record<string, string | undefined>;
|
|
406
|
+
|
|
407
|
+
if (status >= 400) {
|
|
408
|
+
const result = yield* matchError(status, json, headers);
|
|
409
|
+
// isValid/success bodies are success values delivered with an error
|
|
410
|
+
// status — map them onto the output schema like a normal response.
|
|
411
|
+
return wrapSensitive(outputAst, mapKeys(outputAst, result, "decode"));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// No envelope: the response body IS the payload, mapped onto the output
|
|
415
|
+
// schema (wire names → TS names), with members marked T.SensitiveValue
|
|
416
|
+
// delivered as Redacted.
|
|
417
|
+
const body = json === undefined ? {} : json;
|
|
418
|
+
return wrapSensitive(outputAst, mapKeys(outputAst, body, "decode"));
|
|
419
|
+
});
|
|
420
|
+
|
|
298
421
|
/**
|
|
299
|
-
* Coinbase CDP
|
|
422
|
+
* Coinbase CDP protocol layer.
|
|
300
423
|
*
|
|
301
|
-
* Uses JWT bearer token authentication signed with your CDP API
|
|
424
|
+
* Uses JWT bearer token authentication signed per request with your CDP API
|
|
425
|
+
* Key Secret.
|
|
302
426
|
*/
|
|
303
|
-
export const API =
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
c.apiKeyId,
|
|
313
|
-
Redacted.value(c.apiKeySecret),
|
|
314
|
-
method,
|
|
315
|
-
uri,
|
|
316
|
-
);
|
|
317
|
-
return {
|
|
318
|
-
Authorization: `Bearer ${jwt}`,
|
|
319
|
-
};
|
|
320
|
-
},
|
|
321
|
-
matchError: matchError as any,
|
|
322
|
-
ParseError: CoinbaseParseError as any,
|
|
323
|
-
retry: Retry as any,
|
|
324
|
-
});
|
|
427
|
+
export const CoinbaseProtocol: Layer.Layer<API.Protocol> = Layer.succeed(
|
|
428
|
+
API.Protocol,
|
|
429
|
+
API.Protocol.of({
|
|
430
|
+
// Erase encode's Credentials requirement (see comment above).
|
|
431
|
+
encode: (args) =>
|
|
432
|
+
encode(args) as Effect.Effect<HttpClientRequest.HttpClientRequest>,
|
|
433
|
+
decode,
|
|
434
|
+
}),
|
|
435
|
+
);
|
package/src/retry.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Coinbase retry configuration.
|
|
3
3
|
*
|
|
4
|
-
* Defines the per-SDK `Retry` Context.Service tag that
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Defines the per-SDK `Retry` Context.Service tag that generated operations
|
|
5
|
+
* wire into `API.make({ retry: Retry.Retry })`. Callers can install a
|
|
6
|
+
* blanket retry policy at the layer level and have every Coinbase API call
|
|
7
|
+
* below it pick it up:
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|