( address: string, chainId: number | string )
| 63 | * @returns The block number where the contract was deployed, or undefined if not found. |
| 64 | */ |
| 65 | export async function fetchContractDeployHeight( |
| 66 | address: string, |
| 67 | chainId: number | string |
| 68 | ): Promise<number | undefined> { |
| 69 | const result = await runRequest<{blockNumber: string}[]>(chainId, { |
| 70 | module: 'contract', |
| 71 | action: 'getcontractcreation', |
| 72 | contractaddresses: address, |
| 73 | }); |
| 74 | |
| 75 | if (!result) { |
| 76 | return undefined; |
| 77 | } |
| 78 | |
| 79 | return parseInt(result[0].blockNumber, 10); |
| 80 | } |
no outgoing calls
no test coverage detected