The Gas Manager Admin API endpoints allows you to programmatically create, update and manage gas policies.
What is the Gas Manager Admin API?
The Gas Manager Admin API is a REST API with endpoints that allow you to programmatically create, update and manage gas policies. Programmatically managing gas policies is for "power" users with complex use cases who need to manage this process dynamically through code instead of incrementally in the Alchemy Dashboard.
How to Use the Gas Manager Admin API to Create a Policy
To use Gas Manager Admin API, follow these steps:
- Create an Alchemy app: to create gas policies, you first need to create an Alchemy app through your Alchemy Dashboard.
- Create access keys for your account: To call Gas Manager Admin APIs, an authorization header is required in all the requests. This
auth
header should be your access key. Follow this guide for creating access keys. - Create the policy: Next, make a request to the Create Policy endpoint with your policy rules.
Methods
Method | Description |
---|---|
Create Policy | Creates a new gas manager policy with the specified rules. Returns the policy id of a successfully created policy. |
Get Policy | Returns policy information by id. |
Delete Policy | Deletes a policy by id. |
Replace Policy | Accepts a rules object and replaces all rules in an existing policy by id. |
Get All Policies | Accepts an app id and returns all policies under that app. |
Update Policy Status | Modifies the status of a policy to either "active" or "inactive". |
Get Policy Stats | Returns stats about a policy specified by ID, including signatures mined, signatures expired, signatures pending, USD mined, and USD pending. |
Get Sponsorships | Returns a list of sponsorships associated with the specified policy ID. The results are paginated. |