diff --git a/packages/node/src/starknet/safe-api.ts b/packages/node/src/starknet/safe-api.ts index 4796209..1bfd029 100644 --- a/packages/node/src/starknet/safe-api.ts +++ b/packages/node/src/starknet/safe-api.ts @@ -6,10 +6,14 @@ import { getLogger } from '@subql/node-core'; import { BigNumberish, BlockIdentifier, + Call, + CompiledSierra, GetTransactionReceiptResponse, + LegacyContractClass, RpcProvider, waitForTransactionOptions, } from 'starknet'; +import spec from 'starknet-types-07'; const logger = getLogger('safe.api.starknet'); @@ -18,6 +22,41 @@ export default class SafeStarknetProvider extends RpcProvider { super(); } + async getStorageAt( + contractAddress: BigNumberish, + key: BigNumberish, + blockIdentifier?: BlockIdentifier, + ): Promise { + return this.baseApi.getStorageAt(contractAddress, key, this.blockHeight); + } + async getClass( + classHash: BigNumberish, + blockIdentifier?: BlockIdentifier, + ): Promise { + return this.baseApi.getClass(classHash, this.blockHeight); + } + async getClassAt( + contractAddress: BigNumberish, + blockIdentifier?: BlockIdentifier, + ): Promise { + return this.baseApi.getClassAt(contractAddress, this.blockHeight); + } + + async estimateMessageFee( + message: spec.L1Message, + blockIdentifier?: BlockIdentifier, + ): Promise { + // @ts-ignore + return this.baseApi.estimateMessageFee(message, this.blockHeight); + } + + async callContract( + call: Call, + blockIdentifier?: BlockIdentifier, + ): Promise { + return this.baseApi.callContract(call, this.blockHeight); + } + // eslint-disable-next-line @typescript-eslint/promise-function-async getBlockWithTxs(blockHashOrBlockTag: BlockIdentifier): Promise { throw new Error('Method `getBlockWithTransactions` not supported.');