This is a TypeScript SDK for interacting with the Circle Web3 Services REST API. Keep reading for more information.
This SDK exposes the following classes for interacting with the Circle Web3 Services REST API:
CircleSdk
- This is a convenience class for working with all the other classes described below.
- Instantiate with
const circle: CircleSdk = new CircleSdk(apiKey, secret);
then initialize withawait circle.init();
.
FaucetApi
- Exposed by the
CircleSdk
class as thefaucet
property (i.e.CircleSdk.faucet
). - Supports the following Circle Web3 Services REST API endpoints:
- Request testnet tokens
(
FaucetApi.request
)
- Request testnet tokens
(
- Exposed by the
MonitoredTokensApi
- Exposed by the
CircleSdk
class as themonitoredTokens
property (i.e.CircleSdk.monitoredTokens
). - Supports the following Circle Web3 Services REST API endpoints:
- Set monitored tokens
(
MonitoredTokensApi.set
) - Update monitored tokens
(
MonitoredTokensApi.update
) - Retrieve existing monitored tokens
(
MonitoredTokensApi.get
) - Delete monitored tokens
(
MonitoredTokensApi.delete
) - Update monitored tokens scope
(
MonitoredTokensApi.updateScope
)
- Set monitored tokens
(
- Exposed by the
SecretApi
- Exposed by the
CircleSdk
class as thesecret
property (i.e.CircleSdk.secret
). - Supports the following Circle Web3 Services REST API endpoints:
- Get public key for entity
(
SecretApi.getPublicKey
) - Get configuration for entity
(
SecretApi.getConfig
)
- Get public key for entity
(
- Exposed by the
SignApi
- Exposed by the
CircleSdk
class as thesign
property (i.e.CircleSdk.sign
). - Supports the following Circle Web3 Services REST API endpoints:
- Sign message
(
SignApi.signMessage
) - Sign typed data
(
SignApi.signTypedData
) - Sign transaction
(
SignApi.signTransaction
) - Sign delegate action
(
SignApi.signDelegateAction
)
- Sign message
(
- Exposed by the
SmartContractApi
- Exposed by the
CircleSdk
class as thesmartContract
property (i.e.CircleSdk.smartContract
). - Supports the following Circle Web3 Services REST API endpoints:
- List contracts
(
SmartContractApi.list
) - Get a contract
(
SmartContractApi.get
) - Update a contract
(
SmartContractApi.update
) - Import a contract
(
SmartContractApi.import
) - Estimate a contract deployment
(
SmartContractApi.estimateDeploymentFee
) - Deploy a contract
(
SmartContractApi.deploy
) - Execute a query function on a contract
(
SmartContractApi.query
)
- List contracts
(
- Exposed by the
SmartContractEventMonitorApi
- Exposed by the
CircleSdk
class as thesmartContractEventMonitor
property (i.e.CircleSdk.smartContractEventMonitor
). - Supports the following Circle Web3 Services REST API endpoints:
- Get event monitors
(
SmartContractEventMonitorApi.get
) - Create event monitor
(
SmartContractEventMonitorApi.create
) - Update an event monitor
(
SmartContractEventMonitorApi.update
) - Delete event monitor
(
SmartContractEventMonitorApi.delete
) - Get event logs
(
SmartContractEventMonitorApi.getEventLogs
)
- Get event monitors
(
- Exposed by the
SmartContractTemplateApi
- Exposed by the
CircleSdk
class as thesmartContractTemplate
property (i.e.CircleSdk.smartContractTemplate
). - Supports the following Circle Web3 Services REST API endpoints:
- Estimate fee for a contract template deployment
(
SmartContractTemplateApi.estimateDeploymentFee
) - Deploy a contract from a template
(
SmartContractTemplateApi.deploy
)
- Estimate fee for a contract template deployment
(
- Exposed by the
TokenLookupApi
- Exposed by the
CircleSdk
class as thetokenLookup
property (i.e.CircleSdk.tokenLookup
). - Supports the following Circle Web3 Services REST API endpoints:
- Get token details
(
TokenLookupApi.get
)
- Get token details
(
- Exposed by the
TransactionApi
- Exposed by the
CircleSdk
class as thetransaction
property (i.e.CircleSdk.transaction
). - Supports the following Circle Web3 Services REST API endpoints:
- List transactions
(
TransactionApi.list
) - Get a transaction
(
TransactionApi.get
) - Create a transfer transaction
(
TransactionApi.createTransfer
) - Validate an address
(
TransactionApi.validateAddress
) - Estimate fee for a contract execution transaction
(
TransactionApi.estimateContractExecutionFee
) - Estimate fee for a transfer transaction
(
TransactionApi.estimateTransferFee
) - Create a contract execution transaction
(
TransactionApi.createContractExecutionTransaction
) - Cancel a transaction
(
TransactionApi.cancel
) - Accelerate a transaction
(
TransactionApi.accelerate
)
- List transactions
(
- Exposed by the
WalletApi
- Exposed by the
CircleSdk
class as thewallet
property (i.e.CircleSdk.wallet
). - Supports the following Circle Web3 Services REST API endpoints:
- Create wallets
(
WalletApi.create
) - List wallets
(
WalletApi.list
) - Retrieve a wallet
(
WalletApi.get
) - Update a wallet
(
WalletApi.update
) - Get token balance for a wallet
(
WalletApi.balance
) - Get NFTs for a wallet
(
WalletApi.nfts
)
- Create wallets
(
- Exposed by the
WalletSetApi
- Exposed by the
CircleSdk
class as thewalletSet
property (i.e.CircleSdk.walletSet
). - Supports the following Circle Web3 Services REST API endpoints:
- Create a new wallet set
(
WalletSetApi.create
) - Update a wallet set
(
WalletSetApi.update
) - Get all wallet sets
(
WalletSetApi.list
) - Get a wallet set
(
WalletSetApi.get
)
- Create a new wallet set
(
- Exposed by the
Helpful constant variables are defined in
src/constants.ts
.
The types for interacting with the Circle Web3 Services REST API are defined in
src/types.ts
.