Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-md committed Dec 5, 2024
1 parent 72855e6 commit e01625e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 53 deletions.
3 changes: 1 addition & 2 deletions components/ApiReference/Path.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const Path: React.FC<{ path: string; method: string }> = ({ path, method }) => {
overflow: 'auto'
}}
>
/api
{path.split('/').map((p, i) => {
const isParam = p.startsWith('{')
return (
Expand All @@ -54,7 +53,7 @@ const Path: React.FC<{ path: string; method: string }> = ({ path, method }) => {
mt: 0.6
}}
>
<CopyToClipboard getValue={() => `${network}/api${path}`} />
<CopyToClipboard getValue={() => `${network}${path}`} />
</Box>
</Grid>
)
Expand Down
96 changes: 48 additions & 48 deletions components/ApiReference/paths-metadata.json
Original file line number Diff line number Diff line change
@@ -1,271 +1,271 @@
{
"/v1/about/ethereum-rpc/": {
"/api/v1/about/ethereum-rpc/": {
"get": {
"title": "Ethereum RPC",
"additionalInfo": "This is an example of more detailed information about Ethereum RPC endpoint. This should support MDX."
}
},
"/v1/about/": {
"/api/v1/about/": {
"get": {
"title": "General Information"
}
},
"/v1/about/ethereum-tracing-rpc/": {
"/api/v1/about/ethereum-tracing-rpc/": {
"get": {
"title": "Ethereum Tracing RPC"
}
},
"/v1/about/indexing/": {
"/api/v1/about/indexing/": {
"get": {
"title": "Indexing"
}
},
"/v1/about/master-copies/": {
"/api/v1/about/master-copies/": {
"get": {
"title": "Master Copies"
}
},
"/v1/about/singletons/": {
"/api/v1/about/singletons/": {
"get": {
"title": "Singletons"
}
},
"/v1/about/deployments/": {
"/api/v1/about/deployments/": {
"get": {
"title": "List deployments"
}
},
"/v1/contracts/": {
"/api/v1/contracts/": {
"get": {
"title": "List Contracts"
}
},
"/v1/contracts/{address}/": {
"/api/v1/contracts/{address}/": {
"get": {
"title": "Get Specific Contract"
}
},
"/v1/data-decoder/": {
"/api/v1/data-decoder/": {
"post": {
"title": "Get Decoded Data"
}
},
"/v1/delegates/": {
"/api/v1/delegates/": {
"get": {
"title": "List Delegates"
},
"post": {
"title": "Create Delegate"
}
},
"/v1/delegates/{delegate_address}/": {
"/api/v1/delegates/{delegate_address}/": {
"delete": {
"title": "Delete Delegate"
}
},
"/v1/messages/{message_hash}/": {
"/api/v1/messages/{message_hash}/": {
"get": {
"title": "Get Message"
}
},
"/v1/messages/{message_hash}/signatures/": {
"/api/v1/messages/{message_hash}/signatures/": {
"post": {
"title": "Sign Message"
}
},
"/v1/module-transaction/{module_transaction_id}": {
"/api/v1/module-transaction/{module_transaction_id}": {
"get": {
"title": "Get Module Transaction"
}
},
"/v1/modules/{address}/safes/": {
"/api/v1/modules/{address}/safes/": {
"get": {
"title": "List Safes that use a Specific Module"
}
},
"/v1/multisig-transactions/{safe_tx_hash}/": {
"/api/v1/multisig-transactions/{safe_tx_hash}/": {
"get": {
"title": "Get Multisig Transaction"
},
"delete": {
"title": "Delete Queued Multisig Transaction"
}
},
"/v1/multisig-transactions/{safe_tx_hash}/confirmations/": {
"/api/v1/multisig-transactions/{safe_tx_hash}/confirmations/": {
"get": {
"title": "List Multisig Confirmations"
},
"post": {
"title": "Confirm Multisig Transaction"
}
},
"/v1/notifications/devices/": {
"/api/v1/notifications/devices/": {
"post": {
"title": "Create Device"
}
},
"/v1/notifications/devices/{uuid}/": {
"/api/v1/notifications/devices/{uuid}/": {
"delete": {
"title": "Delete Device"
}
},
"/v1/notifications/devices/{uuid}/safes/{address}/": {
"/api/v1/notifications/devices/{uuid}/safes/{address}/": {
"delete": {
"title": "Remove a Safe from a Device"
}
},
"/v1/owners/{address}/safes/": {
"/api/v1/owners/{address}/safes/": {
"get": {
"title": "List Safes from a Specific Owner"
}
},
"/v1/safe-operations/{safe_operation_hash}/confirmations/": {
"/api/v1/safe-operations/{safe_operation_hash}/confirmations/": {
"get": {
"title": "Get the list of confirmations for a multisig transaction"
},
"post": {
"title": "Add a confirmation for a transaction"
}
},
"/v1/safes/{address}/": {
"/api/v1/safes/{address}/": {
"get": {
"title": "Get Safe Status"
}
},
"/v1/safes/{address}/all-transactions/": {
"/api/v1/safes/{address}/all-transactions/": {
"get": {
"title": "List Transactions"
}
},
"/v1/safes/{address}/balances/": {
"/api/v1/safes/{address}/balances/": {
"get": {
"title": "List a Safe's Balances (Deprecated)"
}
},
"/v1/safes/{address}/balances/usd/": {
"/api/v1/safes/{address}/balances/usd/": {
"get": {
"title": "List a Safe's Balances in USD (Deprecated)"
}
},
"/v1/safes/{address}/creation/": {
"/api/v1/safes/{address}/creation/": {
"get": {
"title": "Get Safe Creation Status"
}
},
"/v2/safes/{address}/balances/": {
"/api/v2/safes/{address}/balances/": {
"get": {
"title": "Get Safe Balances"
}
},
"/v1/safes/{address}/delegates/{delegate_address}/": {
"/api/v1/safes/{address}/delegates/{delegate_address}/": {
"delete": {
"title": "Remove Delegate from Safe"
}
},
"/v1/safes/{address}/incoming-transfers/": {
"/api/v1/safes/{address}/incoming-transfers/": {
"get": {
"title": "List Incoming Transfers"
}
},
"/v1/safes/{address}/messages/": {
"/api/v1/safes/{address}/messages/": {
"get": {
"title": "List Messages"
},
"post": {
"title": "Create Signed Message"
}
},
"/v1/safes/{address}/module-transactions/": {
"/api/v1/safes/{address}/module-transactions/": {
"get": {
"title": "List a Safe's Module Transactions"
}
},
"/v1/safes/{address}/multisig-transactions/": {
"/api/v1/safes/{address}/multisig-transactions/": {
"get": {
"title": "List a Safe's Multisig Transactions"
},
"post": {
"title": "Create Multisig Transaction"
}
},
"/v1/safes/{address}/multisig-transactions/estimations/": {
"/api/v1/safes/{address}/multisig-transactions/estimations/": {
"post": {
"title": "Estimate Gas Costs for a Multisig Transaction"
}
},
"/v1/safes/{address}/transactions/": {
"/api/v1/safes/{address}/transactions/": {
"get": {
"title": "List a Safe's Transactions (Deprecated)"
},
"post": {
"title": "Create Transaction (Deprecated)"
}
},
"/v1/safes/{address}/transfers/": {
"/api/v1/safes/{address}/transfers/": {
"get": {
"title": "List Transfers"
}
},
"/v1/safes/{address}/safe-operations/": {
"/api/v1/safes/{address}/safe-operations/": {
"get": {
"title": "List Safe Operations"
},
"post": {
"title": "Create Safe Operation"
}
},
"/v1/safes/{address}/user-operations/": {
"/api/v1/safes/{address}/user-operations/": {
"get": {
"title": "List User Operations"
}
},
"/v1/safe-operations/{safe_operation_hash}/": {
"/api/v1/safe-operations/{safe_operation_hash}/": {
"get": {
"title": "Get Safe Operation"
}
},
"/v1/tokens/": {
"/api/v1/tokens/": {
"get": {
"title": "List Tokens"
}
},
"/v1/tokens/{address}/": {
"/api/v1/tokens/{address}/": {
"get": {
"title": "Get a Specific Token's Information"
}
},
"/v1/transactions/{safe_tx_hash}/": {
"/api/v1/transactions/{safe_tx_hash}/": {
"get": {
"title": "Get Transaction (Deprecated)"
},
"delete": {
"title": "Delete Queued Transaction (Deprecated)"
}
},
"/v1/transfer/{transfer_id}": {
"/api/v1/transfer/{transfer_id}": {
"get": {
"title": "Get Transfer"
}
},
"/v1/user-operations/{user_operation_hash}/": {
"/api/v1/user-operations/{user_operation_hash}/": {
"get": {
"title": "Get User Operation"
}
},
"/v2/delegates/": {
"/api/v2/delegates/": {
"get": {
"title": "List Delegates"
},
"post": {
"title": "Create Delegate"
}
},
"/v2/delegates/{delegate_address}/": {
"/api/v2/delegates/{delegate_address}/": {
"delete": {
"title": "Delete Delegate"
}
},
"/v2/safes/{address}/collectibles/": {
"/api/v2/safes/{address}/collectibles/": {
"get": {
"title": "List Collectibles"
}
Expand Down
5 changes: 2 additions & 3 deletions lib/mdx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export const slugify: (text: string) => string = text =>
export const getHeadingChildren: (heading: string) => Heading[] = heading => {
const allMethods = Object.entries(swagger.paths)
.map(([k, v]) => Object.entries(v))
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.flat() as Array<[string, any]>
.flat()

return allMethods
.filter(
Expand All @@ -43,7 +42,7 @@ export const getHeadingChildren: (heading: string) => Heading[] = heading => {
)
.map(([methodName, method]) => {
const title =
pathsMetadata?.[method.path as '/v1/about/ethereum-rpc/']?.[
pathsMetadata?.[method.path as '/api/v1/about/ethereum-rpc/']?.[
methodName as 'get'
]?.title ?? method.path + ' - ' + methodName?.toUpperCase()
return {
Expand Down

0 comments on commit e01625e

Please sign in to comment.