Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit faea798

Browse files
authored
Merge pull request #491 from alchemyplatform/solana-gas-manager-admin
updates to gas manager admin api to add solana options
2 parents c639aef + aff15c7 commit faea798

File tree

2 files changed

+53
-25
lines changed

2 files changed

+53
-25
lines changed

account-abstraction/gas_manager_admin.yaml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ paths:
3232
default: 'My Policy'
3333
policyType:
3434
type: string
35-
description: Type of the policy (e.g. "sponsorship")
35+
description: Type of the policy (e.g. "sponsorship"). Currently we support "sponsorship" (for EVM network policies) and "solana" (for Solana network policies).
3636
default: 'sponsorship'
3737
appId:
3838
type: string
@@ -41,15 +41,11 @@ paths:
4141
Learn how to find your app ID [here](https://docs.alchemy.com/reference/notify-api-faq#where-can-i-find-the-app-id).
4242
default: '6d834x9k1yh4dx6z'
4343
rules:
44-
description: Rules for the policy
44+
description: Rules for "sponsorship" policy type. Empty if `policyType` is not "sponsorship".
4545
$ref: './schemas.yaml#/components/schemas/Rules'
46-
networks:
47-
description: Networks for the policy
48-
type: array
49-
items:
50-
type: string
51-
default:
52-
- ETH_MAINNET
46+
solanaRules:
47+
description: Rules for "solana" policy type. Empty if `policyType` is not "solana".
48+
$ref: './schemas.yaml#/components/schemas/SolanaRules'
5349
responses:
5450
'200':
5551
description: Policy created successfully
@@ -150,13 +146,10 @@ paths:
150146
default: 'My Policy'
151147
rules:
152148
$ref: './schemas.yaml#/components/schemas/Rules'
153-
networks:
154-
description: Networks for the policy
155-
type: array
156-
items:
157-
type: string
158-
default:
159-
- ETH_MAINNET
149+
description: Rules for "sponsorship" policy type. Empty if `policyType` is not "sponsorship".
150+
solanaRules:
151+
$ref: './schemas.yaml#/components/schemas/SolanaRules'
152+
description: Rules for "solana" policy type. Empty if `policyType` is not "solana".
160153
responses:
161154
'200':
162155
description: Policy rules replaced successfully

account-abstraction/schemas.yaml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,49 @@ components:
7171
required:
7272
- webhookUrl
7373
- approveOnFailure
74+
networks:
75+
description: Networks for the policy
76+
type: array
77+
items:
78+
type: string
79+
default:
80+
- ETH_MAINNET
7481
required:
7582
- startTimeUnix
7683
- sponsorshipExpiryMs
7784

85+
SolanaRules:
86+
type: object
87+
properties:
88+
maxSpendUsd:
89+
type: string
90+
description: Maximum amount of USD that can be spent by the Gas Manager
91+
default: '6500.00'
92+
maxSpendPerTxnUsd:
93+
type: string
94+
description: Maximum amount of USD that can be spent per transaction
95+
default: '30.00'
96+
maxCount:
97+
type: string
98+
description: Maximum number of transactions that can be sponsored through the policy
99+
default: '200'
100+
startTimeUnix:
101+
type: string
102+
description: Unix timestamp of when the policy starts
103+
default: '1674228753'
104+
endTimeUnix:
105+
type: string
106+
description: Unix timestamp of when the policy ends
107+
default: '1679340742'
108+
networks:
109+
type: array
110+
items:
111+
type: string
112+
description: List of networks the policy is active on
113+
default:
114+
- 'SOLANA_MAINNET'
115+
116+
78117
Policy:
79118
type: object
80119
properties:
@@ -92,6 +131,10 @@ components:
92131
default: active
93132
rules:
94133
$ref: '#/components/schemas/Rules'
134+
description: Rules for "sponsorship" policy type. Empty if `policyType` is not "sponsorship".
135+
solanaRules:
136+
$ref: '#/components/schemas/SolanaRules'
137+
description: Rules for "solana" policy type. Empty if `policyType` is not "solana".
95138
policyName:
96139
type: string
97140
description: Name of the policy
@@ -106,24 +149,16 @@ components:
106149
default: 0
107150
policyType:
108151
type: string
109-
description: Type of the policy
152+
description: Type of the policy. "sponsorship" for EVM policies, "solana" for Solana policies.
110153
default: 'sponsorship'
111154
policyState:
112155
type: string
113156
description: State of the policy
114157
default: 'ongoing'
115-
networks:
116-
type: array
117-
items:
118-
type: string
119-
description: List of networks the policy is active on
120-
default:
121-
- 'ETH_MAINNET'
122158
required:
123159
- policyId
124160
- appId
125161
- status
126-
- rules
127162

128163
Sponsorship:
129164
type: object

0 commit comments

Comments
 (0)