Skip to content

Commit

Permalink
Merge pull request #311 from alchemyplatform/userOpSimulation
Browse files Browse the repository at this point in the history
add alchemy_simulateUserOperationAssetChanges and GH action to update it
  • Loading branch information
SahilAujla authored Nov 15, 2023
2 parents 86dae24 + 1c488e2 commit 6e0c0aa
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/sync-apis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,13 @@ jobs:
working-directory: ./account-abstraction
run: rdme openapi rundler_maxPriorityFeePerGas.yaml --key=$README_API_KEY --id=64df886f8b288c002455bba1


- name: Update AA API - alchemy_simulateUserOperationAssetChanges
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
working-directory: ./account-abstraction
run: rdme openapi alchemy_simulateUserOperationAssetChanges.yaml --key=$README_API_KEY --id=6554e8dc1914ac000f50da38


# Update Debug APIs
- name: Update Debug API - debug_traceBlockByHash
env:
Expand Down
127 changes: 127 additions & 0 deletions account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
openapi: 3.1.0
info:
title: alchemy_simulateUserOperationAssetChanges
version: '1.0'
servers:
- url: https://{network}.g.alchemy.com/v2
variables:
network:
enum:
- eth-mainnet
- eth-sepolia
- eth-goerli
- arb-mainnet
- arb-goerli
- arb-sepolia
- opt-mainnet
- opt-goerli
- polygon-mainnet
- polygon-mumbai
- base-mainnet
- base-goerli
default: eth-mainnet
x-sandbox:
category:
type:
$ref: '../components/sandbox.yaml#/Category'
value: bundler
x-readme:
samples-languages:
- curl
- javascript
- python
paths:
/{apiKey}:
$ref: '#/components/pathItems/path'
components:
pathItems:
path:
post:
summary: alchemy_simulateUserOperationAssetChanges
operationId: alchemy-simulateuseroperationassetchanges
description: Simulates user operations and returns a list of asset changes.
parameters:
- $ref: ../components/parameters.yaml#/ApiKey
requestBody:
content:
application/json:
schema:
type: object
properties:
method:
type: string
default: alchemy_simulateUserOperationAssetChanges
params:
type: array
items:
oneOf:
- $ref: '../components/schemas.yaml#/UserOperation'
description: User operation to simulate. Please note that the `signature` does not need to be a valid signature, only a dummy value is required similar to the one that's used for estimating gas.
- $ref: '../components/schemas.yaml#/EntryPoint'
description: EntryPoint to use for the simulation. This MUST be one of the entry points returned by the `supportedEntryPoints` RPC call.
minItems: 2
maxItems: 2
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- changes
properties:
changes:
type: array
items:
$ref: '#/components/schemas/AssetChange'
schemas:
AssetChange:
type: object
required:
- assetType
- changeType
- from
- to
- rawAmount
- amount
- symbol
- decimals
- contractAddress
- name
- logo
- tokenId
properties:
assetType:
type: string
enum:
- NATIVE
- ERC20
- ERC721
- ERC1155
- SPECIAL_NFT
changeType:
type: string
enum:
- APPROVE
- TRANSFER
from:
$ref: '../components/schemas.yaml#/FromAddress'
to:
$ref: '../components/schemas.yaml#/ToAddress'
rawAmount:
type: string
amount:
type: string
symbol:
type: string
decimals:
type: [number, 'null']
contractAddress:
type: [string, 'null']
name:
type: [string, 'null']
logo:
type: [string, 'null']
tokenId:
type: [number, 'null']
2 changes: 1 addition & 1 deletion components/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,5 @@ UserOperationReceipt:
EntryPoint:
$ref: '#/Hex'
title: Entrypoint Address
description: The entrypoint address the request should be sent through. This MUST be one of the entry points returned by the `supportedEntryPoints` rpc call.
description: The entrypoint address the request should be sent through. This MUST be one of the entry points returned by the `supportedEntryPoints` RPC call.
default: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'

0 comments on commit 6e0c0aa

Please sign in to comment.