From d9d63e21aa6b1afb1b9a9e81618bd875a200b841 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 15 Nov 2023 10:56:17 -0500 Subject: [PATCH 1/3] add alchemy_simulateUserOperationAssetChanges and GH action to update it --- .github/workflows/sync-apis.yaml | 8 +- ...emy_simulateUserOperationAssetChanges.yaml | 132 ++++++++++++++++++ 2 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml diff --git a/.github/workflows/sync-apis.yaml b/.github/workflows/sync-apis.yaml index 3a43cd3d..a9921a59 100644 --- a/.github/workflows/sync-apis.yaml +++ b/.github/workflows/sync-apis.yaml @@ -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: diff --git a/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml b/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml new file mode 100644 index 00000000..94e62024 --- /dev/null +++ b/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml @@ -0,0 +1,132 @@ +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 + minItems: 2 + items: + oneOf: + - $ref: '../components/schemas.yaml#/UserOperation' + - $ref: '#/components/schemas/EntrypointOrBlockNumber' + 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'] + EntrypointOrBlockNumber: + title: Entry Point or Block Number + oneOf: + - $ref: '../components/schemas.yaml#/EntryPoint' + - type: string + title: Block Number + description: 'Optional block number override' + default: '0x113CF6E' From 682629b7925ca5c64f990db3492eedcf6357de08 Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 15 Nov 2023 12:19:16 -0500 Subject: [PATCH 2/3] update alchemy_simulateUserOpAssetChanges --- ...alchemy_simulateUserOperationAssetChanges.yaml | 15 +++++---------- components/schemas.yaml | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml b/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml index 94e62024..6ea46e36 100644 --- a/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml +++ b/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml @@ -53,11 +53,14 @@ components: default: alchemy_simulateUserOperationAssetChanges params: type: array - minItems: 2 items: oneOf: - $ref: '../components/schemas.yaml#/UserOperation' - - $ref: '#/components/schemas/EntrypointOrBlockNumber' + description: User operation to simulate. Please note that the `signature` does not need to be a valid signature, only a dummy value is required. + - $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 @@ -122,11 +125,3 @@ components: type: [string, 'null'] tokenId: type: [number, 'null'] - EntrypointOrBlockNumber: - title: Entry Point or Block Number - oneOf: - - $ref: '../components/schemas.yaml#/EntryPoint' - - type: string - title: Block Number - description: 'Optional block number override' - default: '0x113CF6E' diff --git a/components/schemas.yaml b/components/schemas.yaml index e57b9b60..f5ebcffb 100644 --- a/components/schemas.yaml +++ b/components/schemas.yaml @@ -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' From 1c488e2e3b32e1a9708ef03956e5677f1f25e57b Mon Sep 17 00:00:00 2001 From: Sahil Aujla Date: Wed, 15 Nov 2023 13:26:12 -0500 Subject: [PATCH 3/3] update --- .../alchemy_simulateUserOperationAssetChanges.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml b/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml index 6ea46e36..4868574b 100644 --- a/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml +++ b/account-abstraction/alchemy_simulateUserOperationAssetChanges.yaml @@ -56,7 +56,7 @@ components: 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. + 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