@distilled.cloud/coinbase 0.0.0 → 0.2.5-alpha2
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/category.d.ts +5 -0
- package/lib/category.d.ts.map +1 -0
- package/lib/category.js +5 -0
- package/lib/category.js.map +1 -0
- package/lib/client.d.ts +45 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +244 -0
- package/lib/client.js.map +1 -0
- package/lib/credentials.d.ts +32 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +29 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +855 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +466 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +16 -0
- package/lib/index.js.map +1 -0
- package/lib/operations/addEndUserEvmAccount.d.ts +30 -0
- package/lib/operations/addEndUserEvmAccount.d.ts.map +1 -0
- package/lib/operations/addEndUserEvmAccount.js +38 -0
- package/lib/operations/addEndUserEvmAccount.js.map +1 -0
- package/lib/operations/addEndUserEvmSmartAccount.d.ts +32 -0
- package/lib/operations/addEndUserEvmSmartAccount.d.ts.map +1 -0
- package/lib/operations/addEndUserEvmSmartAccount.js +43 -0
- package/lib/operations/addEndUserEvmSmartAccount.js.map +1 -0
- package/lib/operations/addEndUserSolanaAccount.d.ts +30 -0
- package/lib/operations/addEndUserSolanaAccount.d.ts.map +1 -0
- package/lib/operations/addEndUserSolanaAccount.js +38 -0
- package/lib/operations/addEndUserSolanaAccount.js.map +1 -0
- package/lib/operations/createEndUser.d.ts +61 -0
- package/lib/operations/createEndUser.d.ts.map +1 -0
- package/lib/operations/createEndUser.js +67 -0
- package/lib/operations/createEndUser.js.map +1 -0
- package/lib/operations/createEvmAccount.d.ts +30 -0
- package/lib/operations/createEvmAccount.d.ts.map +1 -0
- package/lib/operations/createEvmAccount.js +36 -0
- package/lib/operations/createEvmAccount.js.map +1 -0
- package/lib/operations/createEvmEip7702Delegation.d.ts +34 -0
- package/lib/operations/createEvmEip7702Delegation.d.ts.map +1 -0
- package/lib/operations/createEvmEip7702Delegation.js +53 -0
- package/lib/operations/createEvmEip7702Delegation.js.map +1 -0
- package/lib/operations/createEvmSmartAccount.d.ts +27 -0
- package/lib/operations/createEvmSmartAccount.d.ts.map +1 -0
- package/lib/operations/createEvmSmartAccount.js +35 -0
- package/lib/operations/createEvmSmartAccount.js.map +1 -0
- package/lib/operations/createEvmSwapQuote.d.ts +26 -0
- package/lib/operations/createEvmSwapQuote.d.ts.map +1 -0
- package/lib/operations/createEvmSwapQuote.js +40 -0
- package/lib/operations/createEvmSwapQuote.js.map +1 -0
- package/lib/operations/createOnrampOrder.d.ts +58 -0
- package/lib/operations/createOnrampOrder.d.ts.map +1 -0
- package/lib/operations/createOnrampOrder.js +79 -0
- package/lib/operations/createOnrampOrder.js.map +1 -0
- package/lib/operations/createOnrampSession.d.ts +55 -0
- package/lib/operations/createOnrampSession.d.ts.map +1 -0
- package/lib/operations/createOnrampSession.js +70 -0
- package/lib/operations/createOnrampSession.js.map +1 -0
- package/lib/operations/createPolicy.d.ts +28 -0
- package/lib/operations/createPolicy.d.ts.map +1 -0
- package/lib/operations/createPolicy.js +34 -0
- package/lib/operations/createPolicy.js.map +1 -0
- package/lib/operations/createSolanaAccount.d.ts +30 -0
- package/lib/operations/createSolanaAccount.d.ts.map +1 -0
- package/lib/operations/createSolanaAccount.js +38 -0
- package/lib/operations/createSolanaAccount.js.map +1 -0
- package/lib/operations/createSpendPermission.d.ts +55 -0
- package/lib/operations/createSpendPermission.d.ts.map +1 -0
- package/lib/operations/createSpendPermission.js +93 -0
- package/lib/operations/createSpendPermission.js.map +1 -0
- package/lib/operations/createWebhookSubscription.d.ts +74 -0
- package/lib/operations/createWebhookSubscription.d.ts.map +1 -0
- package/lib/operations/createWebhookSubscription.js +82 -0
- package/lib/operations/createWebhookSubscription.js.map +1 -0
- package/lib/operations/deletePolicy.d.ts +20 -0
- package/lib/operations/deletePolicy.d.ts.map +1 -0
- package/lib/operations/deletePolicy.js +26 -0
- package/lib/operations/deletePolicy.js.map +1 -0
- package/lib/operations/deleteWebhookSubscription.d.ts +21 -0
- package/lib/operations/deleteWebhookSubscription.d.ts.map +1 -0
- package/lib/operations/deleteWebhookSubscription.js +32 -0
- package/lib/operations/deleteWebhookSubscription.js.map +1 -0
- package/lib/operations/exportEvmAccount.d.ts +27 -0
- package/lib/operations/exportEvmAccount.d.ts.map +1 -0
- package/lib/operations/exportEvmAccount.js +33 -0
- package/lib/operations/exportEvmAccount.js.map +1 -0
- package/lib/operations/exportEvmAccountByName.d.ts +27 -0
- package/lib/operations/exportEvmAccountByName.d.ts.map +1 -0
- package/lib/operations/exportEvmAccountByName.js +35 -0
- package/lib/operations/exportEvmAccountByName.js.map +1 -0
- package/lib/operations/exportSolanaAccount.d.ts +27 -0
- package/lib/operations/exportSolanaAccount.d.ts.map +1 -0
- package/lib/operations/exportSolanaAccount.js +35 -0
- package/lib/operations/exportSolanaAccount.js.map +1 -0
- package/lib/operations/exportSolanaAccountByName.d.ts +27 -0
- package/lib/operations/exportSolanaAccountByName.d.ts.map +1 -0
- package/lib/operations/exportSolanaAccountByName.js +38 -0
- package/lib/operations/exportSolanaAccountByName.js.map +1 -0
- package/lib/operations/getEndUser.d.ts +46 -0
- package/lib/operations/getEndUser.d.ts.map +1 -0
- package/lib/operations/getEndUser.js +52 -0
- package/lib/operations/getEndUser.js.map +1 -0
- package/lib/operations/getEvmAccount.d.ts +22 -0
- package/lib/operations/getEvmAccount.d.ts.map +1 -0
- package/lib/operations/getEvmAccount.js +28 -0
- package/lib/operations/getEvmAccount.js.map +1 -0
- package/lib/operations/getEvmAccountByName.d.ts +22 -0
- package/lib/operations/getEvmAccountByName.d.ts.map +1 -0
- package/lib/operations/getEvmAccountByName.js +30 -0
- package/lib/operations/getEvmAccountByName.js.map +1 -0
- package/lib/operations/getEvmEip7702DelegationOperationById.d.ts +22 -0
- package/lib/operations/getEvmEip7702DelegationOperationById.d.ts.map +1 -0
- package/lib/operations/getEvmEip7702DelegationOperationById.js +48 -0
- package/lib/operations/getEvmEip7702DelegationOperationById.js.map +1 -0
- package/lib/operations/getEvmSmartAccount.d.ts +23 -0
- package/lib/operations/getEvmSmartAccount.d.ts.map +1 -0
- package/lib/operations/getEvmSmartAccount.js +31 -0
- package/lib/operations/getEvmSmartAccount.js.map +1 -0
- package/lib/operations/getEvmSmartAccountByName.d.ts +23 -0
- package/lib/operations/getEvmSmartAccountByName.d.ts.map +1 -0
- package/lib/operations/getEvmSmartAccountByName.js +31 -0
- package/lib/operations/getEvmSmartAccountByName.js.map +1 -0
- package/lib/operations/getEvmSwapPrice.d.ts +21 -0
- package/lib/operations/getEvmSwapPrice.d.ts.map +1 -0
- package/lib/operations/getEvmSwapPrice.js +27 -0
- package/lib/operations/getEvmSwapPrice.js.map +1 -0
- package/lib/operations/getOnrampOrderById.d.ts +39 -0
- package/lib/operations/getOnrampOrderById.d.ts.map +1 -0
- package/lib/operations/getOnrampOrderById.js +56 -0
- package/lib/operations/getOnrampOrderById.js.map +1 -0
- package/lib/operations/getOnrampUserLimits.d.ts +24 -0
- package/lib/operations/getOnrampUserLimits.d.ts.map +1 -0
- package/lib/operations/getOnrampUserLimits.js +38 -0
- package/lib/operations/getOnrampUserLimits.js.map +1 -0
- package/lib/operations/getPolicyById.d.ts +23 -0
- package/lib/operations/getPolicyById.d.ts.map +1 -0
- package/lib/operations/getPolicyById.js +29 -0
- package/lib/operations/getPolicyById.js.map +1 -0
- package/lib/operations/getSQLGrammar.d.ts +14 -0
- package/lib/operations/getSQLGrammar.d.ts.map +1 -0
- package/lib/operations/getSQLGrammar.js +20 -0
- package/lib/operations/getSQLGrammar.js.map +1 -0
- package/lib/operations/getSolanaAccount.d.ts +22 -0
- package/lib/operations/getSolanaAccount.d.ts.map +1 -0
- package/lib/operations/getSolanaAccount.js +28 -0
- package/lib/operations/getSolanaAccount.js.map +1 -0
- package/lib/operations/getSolanaAccountByName.d.ts +22 -0
- package/lib/operations/getSolanaAccountByName.d.ts.map +1 -0
- package/lib/operations/getSolanaAccountByName.js +30 -0
- package/lib/operations/getSolanaAccountByName.js.map +1 -0
- package/lib/operations/getUserOperation.d.ts +39 -0
- package/lib/operations/getUserOperation.d.ts.map +1 -0
- package/lib/operations/getUserOperation.js +66 -0
- package/lib/operations/getUserOperation.js.map +1 -0
- package/lib/operations/getWebhookSubscription.d.ts +37 -0
- package/lib/operations/getWebhookSubscription.d.ts.map +1 -0
- package/lib/operations/getWebhookSubscription.js +48 -0
- package/lib/operations/getWebhookSubscription.js.map +1 -0
- package/lib/operations/importEndUser.d.ts +56 -0
- package/lib/operations/importEndUser.d.ts.map +1 -0
- package/lib/operations/importEndUser.js +62 -0
- package/lib/operations/importEndUser.js.map +1 -0
- package/lib/operations/importEvmAccount.d.ts +31 -0
- package/lib/operations/importEvmAccount.d.ts.map +1 -0
- package/lib/operations/importEvmAccount.js +37 -0
- package/lib/operations/importEvmAccount.js.map +1 -0
- package/lib/operations/importSolanaAccount.d.ts +30 -0
- package/lib/operations/importSolanaAccount.d.ts.map +1 -0
- package/lib/operations/importSolanaAccount.js +38 -0
- package/lib/operations/importSolanaAccount.js.map +1 -0
- package/lib/operations/index.d.ts +74 -0
- package/lib/operations/index.d.ts.map +1 -0
- package/lib/operations/index.js +74 -0
- package/lib/operations/index.js.map +1 -0
- package/lib/operations/listDataTokenBalances.d.ts +37 -0
- package/lib/operations/listDataTokenBalances.d.ts.map +1 -0
- package/lib/operations/listDataTokenBalances.js +48 -0
- package/lib/operations/listDataTokenBalances.js.map +1 -0
- package/lib/operations/listEndUsers.d.ts +53 -0
- package/lib/operations/listEndUsers.d.ts.map +1 -0
- package/lib/operations/listEndUsers.js +59 -0
- package/lib/operations/listEndUsers.js.map +1 -0
- package/lib/operations/listEvmAccounts.d.ts +28 -0
- package/lib/operations/listEvmAccounts.d.ts.map +1 -0
- package/lib/operations/listEvmAccounts.js +34 -0
- package/lib/operations/listEvmAccounts.js.map +1 -0
- package/lib/operations/listEvmSmartAccounts.d.ts +29 -0
- package/lib/operations/listEvmSmartAccounts.d.ts.map +1 -0
- package/lib/operations/listEvmSmartAccounts.js +37 -0
- package/lib/operations/listEvmSmartAccounts.js.map +1 -0
- package/lib/operations/listEvmTokenBalances.d.ts +37 -0
- package/lib/operations/listEvmTokenBalances.d.ts.map +1 -0
- package/lib/operations/listEvmTokenBalances.js +48 -0
- package/lib/operations/listEvmTokenBalances.js.map +1 -0
- package/lib/operations/listPolicies.d.ts +31 -0
- package/lib/operations/listPolicies.d.ts.map +1 -0
- package/lib/operations/listPolicies.js +37 -0
- package/lib/operations/listPolicies.js.map +1 -0
- package/lib/operations/listSolanaAccounts.d.ts +29 -0
- package/lib/operations/listSolanaAccounts.d.ts.map +1 -0
- package/lib/operations/listSolanaAccounts.js +37 -0
- package/lib/operations/listSolanaAccounts.js.map +1 -0
- package/lib/operations/listSolanaTokenBalances.d.ts +36 -0
- package/lib/operations/listSolanaTokenBalances.d.ts.map +1 -0
- package/lib/operations/listSolanaTokenBalances.js +47 -0
- package/lib/operations/listSolanaTokenBalances.js.map +1 -0
- package/lib/operations/listSpendPermissions.d.ts +40 -0
- package/lib/operations/listSpendPermissions.d.ts.map +1 -0
- package/lib/operations/listSpendPermissions.js +60 -0
- package/lib/operations/listSpendPermissions.js.map +1 -0
- package/lib/operations/listTokensForAccount.d.ts +23 -0
- package/lib/operations/listTokensForAccount.d.ts.map +1 -0
- package/lib/operations/listTokensForAccount.js +34 -0
- package/lib/operations/listTokensForAccount.js.map +1 -0
- package/lib/operations/listWebhookSubscriptions.d.ts +42 -0
- package/lib/operations/listWebhookSubscriptions.d.ts.map +1 -0
- package/lib/operations/listWebhookSubscriptions.js +50 -0
- package/lib/operations/listWebhookSubscriptions.js.map +1 -0
- package/lib/operations/prepareAndSendUserOperation.d.ts +53 -0
- package/lib/operations/prepareAndSendUserOperation.d.ts.map +1 -0
- package/lib/operations/prepareAndSendUserOperation.js +93 -0
- package/lib/operations/prepareAndSendUserOperation.js.map +1 -0
- package/lib/operations/prepareUserOperation.d.ts +46 -0
- package/lib/operations/prepareUserOperation.d.ts.map +1 -0
- package/lib/operations/prepareUserOperation.js +86 -0
- package/lib/operations/prepareUserOperation.js.map +1 -0
- package/lib/operations/requestEvmFaucet.d.ts +22 -0
- package/lib/operations/requestEvmFaucet.d.ts.map +1 -0
- package/lib/operations/requestEvmFaucet.js +32 -0
- package/lib/operations/requestEvmFaucet.js.map +1 -0
- package/lib/operations/requestSolanaFaucet.d.ts +21 -0
- package/lib/operations/requestSolanaFaucet.d.ts.map +1 -0
- package/lib/operations/requestSolanaFaucet.js +29 -0
- package/lib/operations/requestSolanaFaucet.js.map +1 -0
- package/lib/operations/revokeSpendPermission.d.ts +48 -0
- package/lib/operations/revokeSpendPermission.d.ts.map +1 -0
- package/lib/operations/revokeSpendPermission.js +86 -0
- package/lib/operations/revokeSpendPermission.js.map +1 -0
- package/lib/operations/runSQLQuery.d.ts +47 -0
- package/lib/operations/runSQLQuery.d.ts.map +1 -0
- package/lib/operations/runSQLQuery.js +74 -0
- package/lib/operations/runSQLQuery.js.map +1 -0
- package/lib/operations/sendEvmTransaction.d.ts +44 -0
- package/lib/operations/sendEvmTransaction.d.ts.map +1 -0
- package/lib/operations/sendEvmTransaction.js +64 -0
- package/lib/operations/sendEvmTransaction.js.map +1 -0
- package/lib/operations/sendSolanaTransaction.d.ts +38 -0
- package/lib/operations/sendSolanaTransaction.d.ts.map +1 -0
- package/lib/operations/sendSolanaTransaction.js +46 -0
- package/lib/operations/sendSolanaTransaction.js.map +1 -0
- package/lib/operations/sendUserOperation.d.ts +43 -0
- package/lib/operations/sendUserOperation.d.ts.map +1 -0
- package/lib/operations/sendUserOperation.js +71 -0
- package/lib/operations/sendUserOperation.js.map +1 -0
- package/lib/operations/settleX402Payment.d.ts +23 -0
- package/lib/operations/settleX402Payment.d.ts.map +1 -0
- package/lib/operations/settleX402Payment.js +79 -0
- package/lib/operations/settleX402Payment.js.map +1 -0
- package/lib/operations/signEvmHash.d.ts +27 -0
- package/lib/operations/signEvmHash.d.ts.map +1 -0
- package/lib/operations/signEvmHash.js +33 -0
- package/lib/operations/signEvmHash.js.map +1 -0
- package/lib/operations/signEvmMessage.d.ts +28 -0
- package/lib/operations/signEvmMessage.d.ts.map +1 -0
- package/lib/operations/signEvmMessage.js +34 -0
- package/lib/operations/signEvmMessage.js.map +1 -0
- package/lib/operations/signEvmTransaction.d.ts +29 -0
- package/lib/operations/signEvmTransaction.d.ts.map +1 -0
- package/lib/operations/signEvmTransaction.js +40 -0
- package/lib/operations/signEvmTransaction.js.map +1 -0
- package/lib/operations/signEvmTypedData.d.ts +36 -0
- package/lib/operations/signEvmTypedData.d.ts.map +1 -0
- package/lib/operations/signEvmTypedData.js +45 -0
- package/lib/operations/signEvmTypedData.js.map +1 -0
- package/lib/operations/signSolanaMessage.d.ts +28 -0
- package/lib/operations/signSolanaMessage.d.ts.map +1 -0
- package/lib/operations/signSolanaMessage.js +38 -0
- package/lib/operations/signSolanaMessage.js.map +1 -0
- package/lib/operations/signSolanaTransaction.d.ts +33 -0
- package/lib/operations/signSolanaTransaction.d.ts.map +1 -0
- package/lib/operations/signSolanaTransaction.js +44 -0
- package/lib/operations/signSolanaTransaction.js.map +1 -0
- package/lib/operations/supportedX402PaymentKinds.d.ts +21 -0
- package/lib/operations/supportedX402PaymentKinds.d.ts.map +1 -0
- package/lib/operations/supportedX402PaymentKinds.js +40 -0
- package/lib/operations/supportedX402PaymentKinds.js.map +1 -0
- package/lib/operations/updateEvmAccount.d.ts +28 -0
- package/lib/operations/updateEvmAccount.d.ts.map +1 -0
- package/lib/operations/updateEvmAccount.js +34 -0
- package/lib/operations/updateEvmAccount.js.map +1 -0
- package/lib/operations/updateEvmSmartAccount.d.ts +24 -0
- package/lib/operations/updateEvmSmartAccount.d.ts.map +1 -0
- package/lib/operations/updateEvmSmartAccount.js +32 -0
- package/lib/operations/updateEvmSmartAccount.js.map +1 -0
- package/lib/operations/updatePolicy.d.ts +29 -0
- package/lib/operations/updatePolicy.d.ts.map +1 -0
- package/lib/operations/updatePolicy.js +35 -0
- package/lib/operations/updatePolicy.js.map +1 -0
- package/lib/operations/updateSolanaAccount.d.ts +28 -0
- package/lib/operations/updateSolanaAccount.d.ts.map +1 -0
- package/lib/operations/updateSolanaAccount.js +36 -0
- package/lib/operations/updateSolanaAccount.js.map +1 -0
- package/lib/operations/updateWebhookSubscription.d.ts +47 -0
- package/lib/operations/updateWebhookSubscription.d.ts.map +1 -0
- package/lib/operations/updateWebhookSubscription.js +58 -0
- package/lib/operations/updateWebhookSubscription.js.map +1 -0
- package/lib/operations/validateEndUserAccessToken.d.ts +44 -0
- package/lib/operations/validateEndUserAccessToken.d.ts.map +1 -0
- package/lib/operations/validateEndUserAccessToken.js +52 -0
- package/lib/operations/validateEndUserAccessToken.js.map +1 -0
- package/lib/operations/verifyX402Payment.d.ts +21 -0
- package/lib/operations/verifyX402Payment.d.ts.map +1 -0
- package/lib/operations/verifyX402Payment.js +72 -0
- package/lib/operations/verifyX402Payment.js.map +1 -0
- package/lib/retry.d.ts +22 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +21 -0
- package/lib/retry.js.map +1 -0
- package/lib/sensitive.d.ts +5 -0
- package/lib/sensitive.d.ts.map +1 -0
- package/lib/sensitive.js +5 -0
- package/lib/sensitive.js.map +1 -0
- package/lib/traits.d.ts +5 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +5 -0
- package/lib/traits.js.map +1 -0
- package/package.json +82 -9
- package/src/category.ts +4 -0
- package/src/client.ts +290 -0
- package/src/credentials.ts +65 -0
- package/src/errors.ts +694 -0
- package/src/index.ts +15 -0
- package/src/operations/addEndUserEvmAccount.ts +44 -0
- package/src/operations/addEndUserEvmSmartAccount.ts +53 -0
- package/src/operations/addEndUserSolanaAccount.ts +46 -0
- package/src/operations/createEndUser.ts +87 -0
- package/src/operations/createEvmAccount.ts +42 -0
- package/src/operations/createEvmEip7702Delegation.ts +63 -0
- package/src/operations/createEvmSmartAccount.ts +42 -0
- package/src/operations/createEvmSwapQuote.ts +44 -0
- package/src/operations/createOnrampOrder.ts +89 -0
- package/src/operations/createOnrampSession.ts +80 -0
- package/src/operations/createPolicy.ts +38 -0
- package/src/operations/createSolanaAccount.ts +42 -0
- package/src/operations/createSpendPermission.ts +110 -0
- package/src/operations/createWebhookSubscription.ts +92 -0
- package/src/operations/deletePolicy.ts +32 -0
- package/src/operations/deleteWebhookSubscription.ts +42 -0
- package/src/operations/exportEvmAccount.ts +39 -0
- package/src/operations/exportEvmAccountByName.ts +45 -0
- package/src/operations/exportSolanaAccount.ts +41 -0
- package/src/operations/exportSolanaAccountByName.ts +48 -0
- package/src/operations/getEndUser.ts +68 -0
- package/src/operations/getEvmAccount.ts +32 -0
- package/src/operations/getEvmAccountByName.ts +34 -0
- package/src/operations/getEvmEip7702DelegationOperationById.ts +56 -0
- package/src/operations/getEvmSmartAccount.ts +35 -0
- package/src/operations/getEvmSmartAccountByName.ts +41 -0
- package/src/operations/getEvmSwapPrice.ts +31 -0
- package/src/operations/getOnrampOrderById.ts +62 -0
- package/src/operations/getOnrampUserLimits.ts +44 -0
- package/src/operations/getPolicyById.ts +35 -0
- package/src/operations/getSQLGrammar.ts +26 -0
- package/src/operations/getSolanaAccount.ts +34 -0
- package/src/operations/getSolanaAccountByName.ts +40 -0
- package/src/operations/getUserOperation.ts +82 -0
- package/src/operations/getWebhookSubscription.ts +60 -0
- package/src/operations/importEndUser.ts +78 -0
- package/src/operations/importEvmAccount.ts +43 -0
- package/src/operations/importSolanaAccount.ts +42 -0
- package/src/operations/index.ts +73 -0
- package/src/operations/listDataTokenBalances.ts +59 -0
- package/src/operations/listEndUsers.ts +77 -0
- package/src/operations/listEvmAccounts.ts +40 -0
- package/src/operations/listEvmSmartAccounts.ts +45 -0
- package/src/operations/listEvmTokenBalances.ts +58 -0
- package/src/operations/listPolicies.ts +43 -0
- package/src/operations/listSolanaAccounts.ts +43 -0
- package/src/operations/listSolanaTokenBalances.ts +59 -0
- package/src/operations/listSpendPermissions.ts +70 -0
- package/src/operations/listTokensForAccount.ts +42 -0
- package/src/operations/listWebhookSubscriptions.ts +62 -0
- package/src/operations/prepareAndSendUserOperation.ts +113 -0
- package/src/operations/prepareUserOperation.ts +104 -0
- package/src/operations/requestEvmFaucet.ts +38 -0
- package/src/operations/requestSolanaFaucet.ts +33 -0
- package/src/operations/revokeSpendPermission.ts +103 -0
- package/src/operations/runSQLQuery.ts +92 -0
- package/src/operations/sendEvmTransaction.ts +70 -0
- package/src/operations/sendSolanaTransaction.ts +55 -0
- package/src/operations/sendUserOperation.ts +87 -0
- package/src/operations/settleX402Payment.ts +87 -0
- package/src/operations/signEvmHash.ts +37 -0
- package/src/operations/signEvmMessage.ts +40 -0
- package/src/operations/signEvmTransaction.ts +46 -0
- package/src/operations/signEvmTypedData.ts +53 -0
- package/src/operations/signSolanaMessage.ts +46 -0
- package/src/operations/signSolanaTransaction.ts +53 -0
- package/src/operations/supportedX402PaymentKinds.ts +52 -0
- package/src/operations/updateEvmAccount.ts +40 -0
- package/src/operations/updateEvmSmartAccount.ts +39 -0
- package/src/operations/updatePolicy.ts +41 -0
- package/src/operations/updateSolanaAccount.ts +40 -0
- package/src/operations/updateWebhookSubscription.ts +70 -0
- package/src/operations/validateEndUserAccessToken.ts +74 -0
- package/src/operations/verifyX402Payment.ts +80 -0
- package/src/retry.ts +37 -0
- package/src/sensitive.ts +4 -0
- package/src/traits.ts +4 -0
- package/index.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../src/category.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gCAAgC,CAAC"}
|
package/lib/category.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../src/category.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gCAAgC,CAAC"}
|
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coinbase CDP API Client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the shared REST client from sdk-core with Coinbase CDP-specific
|
|
5
|
+
* error matching, JWT authentication, and credential handling.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* The Coinbase CDP API uses JWT bearer tokens for authentication. The JWT is
|
|
10
|
+
* signed using your CDP API Key Secret (ES256 or Ed25519) and includes:
|
|
11
|
+
*
|
|
12
|
+
* - `sub`: Your CDP API Key ID
|
|
13
|
+
* - `iss`: "cdp"
|
|
14
|
+
* - `exp`: Current time + 120 seconds
|
|
15
|
+
*
|
|
16
|
+
* Some sensitive wallet operations additionally require an `X-Wallet-Auth`
|
|
17
|
+
* header signed with your Wallet Secret.
|
|
18
|
+
*
|
|
19
|
+
* ## Error Handling
|
|
20
|
+
*
|
|
21
|
+
* Coinbase CDP errors have the shape:
|
|
22
|
+
* ```json
|
|
23
|
+
* {
|
|
24
|
+
* "errorType": "invalid_request",
|
|
25
|
+
* "errorMessage": "Invalid request.",
|
|
26
|
+
* "correlationId": "41deb8d59a9dc9a7-IAD",
|
|
27
|
+
* "errorLink": "https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request"
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Errors are dispatched first by `errorType`, then by HTTP status code.
|
|
32
|
+
*/
|
|
33
|
+
import * as Effect from "effect/Effect";
|
|
34
|
+
import * as Schema from "effect/Schema";
|
|
35
|
+
export { UnknownCoinbaseError } from "./errors.ts";
|
|
36
|
+
/**
|
|
37
|
+
* Coinbase CDP API client.
|
|
38
|
+
*
|
|
39
|
+
* Uses JWT bearer token authentication signed with your CDP API Key Secret.
|
|
40
|
+
*/
|
|
41
|
+
export declare const API: {
|
|
42
|
+
make: <I extends Schema.Top, O extends Schema.Top, const E extends readonly import("@distilled.cloud/core/client").ApiErrorClass[] = readonly []>(configFn: () => import("@distilled.cloud/core/client").OperationConfig<I, O, E>) => any;
|
|
43
|
+
makePaginated: <I extends Schema.Top, O extends Schema.Top, const E extends readonly import("@distilled.cloud/core/client").ApiErrorClass[] = readonly []>(configFn: () => import("@distilled.cloud/core/client").PaginatedOperationConfig<I, O, E>, paginateFn?: ((baseFn: (input: any) => Effect.Effect<any, any, any>, input: any, pagination: import("@distilled.cloud/core/pagination").PaginatedTrait) => import("effect/Stream").Stream<any, any, any>) | undefined) => any;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAexC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAgOnD;;;;GAIG;AACH,eAAO,MAAM,GAAG;;;CAYd,CAAC"}
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coinbase CDP API Client.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the shared REST client from sdk-core with Coinbase CDP-specific
|
|
5
|
+
* error matching, JWT authentication, and credential handling.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* The Coinbase CDP API uses JWT bearer tokens for authentication. The JWT is
|
|
10
|
+
* signed using your CDP API Key Secret (ES256 or Ed25519) and includes:
|
|
11
|
+
*
|
|
12
|
+
* - `sub`: Your CDP API Key ID
|
|
13
|
+
* - `iss`: "cdp"
|
|
14
|
+
* - `exp`: Current time + 120 seconds
|
|
15
|
+
*
|
|
16
|
+
* Some sensitive wallet operations additionally require an `X-Wallet-Auth`
|
|
17
|
+
* header signed with your Wallet Secret.
|
|
18
|
+
*
|
|
19
|
+
* ## Error Handling
|
|
20
|
+
*
|
|
21
|
+
* Coinbase CDP errors have the shape:
|
|
22
|
+
* ```json
|
|
23
|
+
* {
|
|
24
|
+
* "errorType": "invalid_request",
|
|
25
|
+
* "errorMessage": "Invalid request.",
|
|
26
|
+
* "correlationId": "41deb8d59a9dc9a7-IAD",
|
|
27
|
+
* "errorLink": "https://docs.cdp.coinbase.com/api-reference/v2/errors#invalid-request"
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Errors are dispatched first by `errorType`, then by HTTP status code.
|
|
32
|
+
*/
|
|
33
|
+
import * as Effect from "effect/Effect";
|
|
34
|
+
import * as Schema from "effect/Schema";
|
|
35
|
+
import * as crypto from "node:crypto";
|
|
36
|
+
import { makeAPI } from "@distilled.cloud/core/client";
|
|
37
|
+
import { HTTP_STATUS_MAP, COINBASE_HTTP_STATUS_MAP, ERROR_TYPE_MAP, STANDARD_ERROR_TYPE_MAP, UnknownCoinbaseError, CoinbaseParseError, } from "./errors.js";
|
|
38
|
+
import { Credentials } from "./credentials.js";
|
|
39
|
+
// Re-export for convenience
|
|
40
|
+
export { UnknownCoinbaseError } from "./errors.js";
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// JWT generation for Coinbase CDP API authentication
|
|
43
|
+
// ============================================================================
|
|
44
|
+
/**
|
|
45
|
+
* Base64url-encode a buffer.
|
|
46
|
+
*/
|
|
47
|
+
const base64url = (buf) => Buffer.from(buf)
|
|
48
|
+
.toString("base64")
|
|
49
|
+
.replace(/\+/g, "-")
|
|
50
|
+
.replace(/\//g, "_")
|
|
51
|
+
.replace(/=+$/, "");
|
|
52
|
+
/**
|
|
53
|
+
* Generate a random hex nonce.
|
|
54
|
+
*/
|
|
55
|
+
const randomNonce = () => crypto.randomBytes(16).toString("hex");
|
|
56
|
+
/**
|
|
57
|
+
* Detect key type and return the appropriate signing algorithm and key object.
|
|
58
|
+
*/
|
|
59
|
+
const resolveSigningKey = (apiKeySecret) => {
|
|
60
|
+
// Try EC (ES256) first — PEM format
|
|
61
|
+
if (apiKeySecret.includes("-----BEGIN")) {
|
|
62
|
+
return {
|
|
63
|
+
algorithm: "ES256",
|
|
64
|
+
jwsAlg: "ES256",
|
|
65
|
+
key: crypto.createPrivateKey(apiKeySecret),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
// Ed25519 — base64 encoded 64-byte key (32 seed + 32 public)
|
|
69
|
+
const keyBytes = Buffer.from(apiKeySecret, "base64");
|
|
70
|
+
if (keyBytes.length === 64) {
|
|
71
|
+
// Extract the 32-byte seed (private key)
|
|
72
|
+
const seed = keyBytes.subarray(0, 32);
|
|
73
|
+
// Import as Ed25519 private key using PKCS8 DER wrapping
|
|
74
|
+
// Ed25519 PKCS8 prefix: 302e020100300506032b657004220420
|
|
75
|
+
const pkcs8Prefix = Buffer.from("302e020100300506032b657004220420", "hex");
|
|
76
|
+
const pkcs8Der = Buffer.concat([pkcs8Prefix, seed]);
|
|
77
|
+
return {
|
|
78
|
+
algorithm: "EdDSA",
|
|
79
|
+
jwsAlg: "EdDSA",
|
|
80
|
+
key: crypto.createPrivateKey({
|
|
81
|
+
key: pkcs8Der,
|
|
82
|
+
format: "der",
|
|
83
|
+
type: "pkcs8",
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
throw new Error("Unsupported CDP API Key Secret format. Expected EC PEM or Ed25519 base64.");
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Generate a JWT bearer token for Coinbase CDP API authentication.
|
|
91
|
+
*
|
|
92
|
+
* The JWT includes:
|
|
93
|
+
* - header: { alg, kid, typ: "JWT", nonce }
|
|
94
|
+
* - payload: { sub, iss: "cdp", iat, nbf, exp }
|
|
95
|
+
*/
|
|
96
|
+
const generateJwt = (apiKeyId, apiKeySecret) => {
|
|
97
|
+
const { jwsAlg, key } = resolveSigningKey(apiKeySecret);
|
|
98
|
+
const now = Math.floor(Date.now() / 1000);
|
|
99
|
+
const header = {
|
|
100
|
+
alg: jwsAlg,
|
|
101
|
+
kid: apiKeyId,
|
|
102
|
+
typ: "JWT",
|
|
103
|
+
nonce: randomNonce(),
|
|
104
|
+
};
|
|
105
|
+
const payload = {
|
|
106
|
+
sub: apiKeyId,
|
|
107
|
+
iss: "cdp",
|
|
108
|
+
iat: now,
|
|
109
|
+
nbf: now,
|
|
110
|
+
exp: now + 120,
|
|
111
|
+
};
|
|
112
|
+
const headerB64 = base64url(Buffer.from(JSON.stringify(header)));
|
|
113
|
+
const payloadB64 = base64url(Buffer.from(JSON.stringify(payload)));
|
|
114
|
+
const signingInput = `${headerB64}.${payloadB64}`;
|
|
115
|
+
let signature;
|
|
116
|
+
if (jwsAlg === "ES256") {
|
|
117
|
+
// ES256 uses SHA-256 with ECDSA, needs IEEE P1363 format (not DER)
|
|
118
|
+
const sign = crypto.createSign("SHA256");
|
|
119
|
+
sign.update(signingInput);
|
|
120
|
+
const derSig = sign.sign(key);
|
|
121
|
+
// Convert DER signature to IEEE P1363 (raw r||s) format
|
|
122
|
+
signature = derToP1363(derSig, 32);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
// EdDSA (Ed25519) uses sign directly
|
|
126
|
+
signature = Buffer.from(crypto.sign(null, Buffer.from(signingInput), key));
|
|
127
|
+
}
|
|
128
|
+
return `${signingInput}.${base64url(signature)}`;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Convert a DER-encoded ECDSA signature to IEEE P1363 (raw r||s) format.
|
|
132
|
+
* JWS requires P1363 format for ES256.
|
|
133
|
+
*/
|
|
134
|
+
const derToP1363 = (derSig, componentLength) => {
|
|
135
|
+
// DER format: 30 <len> 02 <rLen> <r> 02 <sLen> <s>
|
|
136
|
+
let offset = 2; // skip 30 <len>
|
|
137
|
+
if (derSig[1] & 0x80)
|
|
138
|
+
offset += derSig[1] & 0x7f;
|
|
139
|
+
// Read r
|
|
140
|
+
offset++; // skip 02
|
|
141
|
+
const rLen = derSig[offset++];
|
|
142
|
+
const r = derSig.subarray(offset, offset + rLen);
|
|
143
|
+
offset += rLen;
|
|
144
|
+
// Read s
|
|
145
|
+
offset++; // skip 02
|
|
146
|
+
const sLen = derSig[offset++];
|
|
147
|
+
const s = derSig.subarray(offset, offset + sLen);
|
|
148
|
+
// Pad or trim to componentLength
|
|
149
|
+
const result = Buffer.alloc(componentLength * 2);
|
|
150
|
+
const rPadded = r.length > componentLength ? r.subarray(r.length - componentLength) : r;
|
|
151
|
+
const sPadded = s.length > componentLength ? s.subarray(s.length - componentLength) : s;
|
|
152
|
+
rPadded.copy(result, componentLength - rPadded.length);
|
|
153
|
+
sPadded.copy(result, componentLength * 2 - sPadded.length);
|
|
154
|
+
return result;
|
|
155
|
+
};
|
|
156
|
+
// ============================================================================
|
|
157
|
+
// Error response parsing
|
|
158
|
+
// ============================================================================
|
|
159
|
+
/**
|
|
160
|
+
* Coinbase CDP API Error Response Schema.
|
|
161
|
+
*
|
|
162
|
+
* All Coinbase CDP errors have the same envelope:
|
|
163
|
+
* { errorType, errorMessage, correlationId?, errorLink? }
|
|
164
|
+
*/
|
|
165
|
+
const CoinbaseErrorResponse = Schema.Struct({
|
|
166
|
+
errorType: Schema.String,
|
|
167
|
+
errorMessage: Schema.String,
|
|
168
|
+
correlationId: Schema.optional(Schema.String),
|
|
169
|
+
errorLink: Schema.optional(Schema.String),
|
|
170
|
+
});
|
|
171
|
+
/**
|
|
172
|
+
* Match a Coinbase CDP API error response to the appropriate typed error class.
|
|
173
|
+
*
|
|
174
|
+
* Dispatches errors by:
|
|
175
|
+
* 1. The `errorType` field for Coinbase-specific errors (e.g., "already_exists", "policy_violation")
|
|
176
|
+
* 2. The `errorType` field for standard errors mapped to core classes (e.g., "not_found" → NotFound)
|
|
177
|
+
* 3. Standard HTTP status codes mapped from core (400, 401, 403, 404, etc.)
|
|
178
|
+
* 4. Coinbase-specific HTTP status codes (402)
|
|
179
|
+
* 5. Falls back to UnknownCoinbaseError for unrecognized errors
|
|
180
|
+
*/
|
|
181
|
+
const matchError = (status, errorBody) => {
|
|
182
|
+
try {
|
|
183
|
+
const parsed = Schema.decodeUnknownSync(CoinbaseErrorResponse)(errorBody);
|
|
184
|
+
const errorProps = {
|
|
185
|
+
errorType: parsed.errorType,
|
|
186
|
+
errorMessage: parsed.errorMessage,
|
|
187
|
+
correlationId: parsed.correlationId,
|
|
188
|
+
errorLink: parsed.errorLink,
|
|
189
|
+
};
|
|
190
|
+
// 1. Match by Coinbase-specific error type first
|
|
191
|
+
const TypedErrorClass = ERROR_TYPE_MAP[parsed.errorType];
|
|
192
|
+
if (TypedErrorClass) {
|
|
193
|
+
return Effect.fail(new TypedErrorClass(errorProps));
|
|
194
|
+
}
|
|
195
|
+
// 2. Match standard error types to core HTTP error classes
|
|
196
|
+
// Maps error types like "not_found", "forbidden", "unauthorized", "invalid_request",
|
|
197
|
+
// "rate_limit_exceeded", "internal_server_error", "bad_gateway", "service_unavailable"
|
|
198
|
+
// to their corresponding core HTTP error classes.
|
|
199
|
+
const StandardErrorClass = STANDARD_ERROR_TYPE_MAP[parsed.errorType];
|
|
200
|
+
if (StandardErrorClass) {
|
|
201
|
+
return Effect.fail(new StandardErrorClass({ message: parsed.errorMessage ?? "" }));
|
|
202
|
+
}
|
|
203
|
+
// 3. Fall back to HTTP status code mapping from core
|
|
204
|
+
const CoreErrorClass = HTTP_STATUS_MAP[status];
|
|
205
|
+
if (CoreErrorClass) {
|
|
206
|
+
return Effect.fail(new CoreErrorClass({ message: parsed.errorMessage ?? "" }));
|
|
207
|
+
}
|
|
208
|
+
// 4. Coinbase-specific HTTP status codes (402)
|
|
209
|
+
const CoinbaseErrorClass = COINBASE_HTTP_STATUS_MAP[status];
|
|
210
|
+
if (CoinbaseErrorClass) {
|
|
211
|
+
return Effect.fail(new CoinbaseErrorClass(errorProps));
|
|
212
|
+
}
|
|
213
|
+
// 5. Fall back to unknown error
|
|
214
|
+
return Effect.fail(new UnknownCoinbaseError({
|
|
215
|
+
...errorProps,
|
|
216
|
+
body: errorBody,
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
return Effect.fail(new UnknownCoinbaseError({ body: errorBody }));
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
// ============================================================================
|
|
224
|
+
// API client factory
|
|
225
|
+
// ============================================================================
|
|
226
|
+
/**
|
|
227
|
+
* Coinbase CDP API client.
|
|
228
|
+
*
|
|
229
|
+
* Uses JWT bearer token authentication signed with your CDP API Key Secret.
|
|
230
|
+
*/
|
|
231
|
+
export const API = makeAPI({
|
|
232
|
+
credentials: Credentials,
|
|
233
|
+
getBaseUrl: (creds) => creds.apiBaseUrl,
|
|
234
|
+
getAuthHeaders: (creds) => {
|
|
235
|
+
const c = creds;
|
|
236
|
+
const jwt = generateJwt(c.apiKeyId, c.apiKeySecret);
|
|
237
|
+
return {
|
|
238
|
+
Authorization: `Bearer ${jwt}`,
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
matchError,
|
|
242
|
+
ParseError: CoinbaseParseError,
|
|
243
|
+
});
|
|
244
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,kBA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CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,oBAAoB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACpE,CAAC;AACH,CAAC,CAAC;AAEF,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC;IACzB,WAAW,EAAE,WAAkB;IAC/B,UAAU,EAAE,CAAC,KAAU,EAAE,EAAE,CAAE,KAAgB,CAAC,UAAU;IACxD,cAAc,EAAE,CAAC,KAAU,EAAE,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAe,CAAC;QAC1B,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;QACpD,OAAO;YACL,aAAa,EAAE,UAAU,GAAG,EAAE;SAC/B,CAAC;IACJ,CAAC;IACD,UAAU;IACV,UAAU,EAAE,kBAAyB;CACtC,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
3
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
4
|
+
export declare const DEFAULT_API_BASE_URL = "https://api.cdp.coinbase.com/platform";
|
|
5
|
+
export interface Config {
|
|
6
|
+
/**
|
|
7
|
+
* CDP API Key ID (UUID format or legacy `organizations/.../apiKeys/...` format).
|
|
8
|
+
*/
|
|
9
|
+
readonly apiKeyId: string;
|
|
10
|
+
/**
|
|
11
|
+
* CDP API Key Secret (Ed25519 base64 or EC PEM private key).
|
|
12
|
+
* Used to sign JWT bearer tokens for API authentication.
|
|
13
|
+
*/
|
|
14
|
+
readonly apiKeySecret: string;
|
|
15
|
+
/**
|
|
16
|
+
* CDP Wallet Secret (base64-encoded DER EC private key).
|
|
17
|
+
* Required only for sensitive wallet operations (POST/DELETE/PUT to account endpoints).
|
|
18
|
+
* If not provided, wallet-auth-requiring operations will fail.
|
|
19
|
+
*/
|
|
20
|
+
readonly walletSecret?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Base URL for the Coinbase CDP API.
|
|
23
|
+
* @default "https://api.cdp.coinbase.com/platform"
|
|
24
|
+
*/
|
|
25
|
+
readonly apiBaseUrl: string;
|
|
26
|
+
}
|
|
27
|
+
declare const Credentials_base: ServiceMap.ServiceClass<Credentials, "CoinbaseCredentials", Config>;
|
|
28
|
+
export declare class Credentials extends Credentials_base {
|
|
29
|
+
}
|
|
30
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError, never>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,0CAA0C,CAAC;AAE5E,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,eAAO,MAAM,kBAAkB,8CA2B9B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
4
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
5
|
+
export const DEFAULT_API_BASE_URL = "https://api.cdp.coinbase.com/platform";
|
|
6
|
+
export class Credentials extends ServiceMap.Service()("CoinbaseCredentials") {
|
|
7
|
+
}
|
|
8
|
+
export const CredentialsFromEnv = Layer.effect(Credentials, Effect.gen(function* () {
|
|
9
|
+
const apiKeyId = process.env.CDP_API_KEY_ID ?? process.env.CDP_API_KEY_NAME;
|
|
10
|
+
const apiKeySecret = process.env.CDP_API_KEY_SECRET;
|
|
11
|
+
const walletSecret = process.env.CDP_WALLET_SECRET;
|
|
12
|
+
if (!apiKeyId) {
|
|
13
|
+
return yield* new ConfigError({
|
|
14
|
+
message: "CDP_API_KEY_ID (or CDP_API_KEY_NAME) environment variable is required",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (!apiKeySecret) {
|
|
18
|
+
return yield* new ConfigError({
|
|
19
|
+
message: "CDP_API_KEY_SECRET environment variable is required",
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
apiKeyId,
|
|
24
|
+
apiKeySecret,
|
|
25
|
+
walletSecret,
|
|
26
|
+
apiBaseUrl: DEFAULT_API_BASE_URL,
|
|
27
|
+
};
|
|
28
|
+
}));
|
|
29
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AA4B5E,MAAM,OAAO,WAAY,SAAQ,UAAU,CAAC,OAAO,EAAuB,CACxE,qBAAqB,CACtB;CAAG;AAEJ,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAC5C,WAAW,EACX,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC5E,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAEnD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC;YAC5B,OAAO,EACL,uEAAuE;SAC1E,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC;YAC5B,OAAO,EAAE,qDAAqD;SAC/D,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,YAAY;QACZ,YAAY;QACZ,UAAU,EAAE,oBAAoB;KACjC,CAAC;AACJ,CAAC,CAAC,CACH,CAAC"}
|