Add an existing smart contract to your library of contracts. It also can be done in the Web3 Services Console.
Represents the input for deploying a contract.
Address is the address of the contract to be imported.
The blockchain network that the resource is to be created on or is currently on. Required along with sourceAddress
if you don't provide walletId
. The blockchain
and walletId
fields are mutually exclusive.
The description for a contract.
The contract's name.
The optional idempotency key. An idempotency key is a unique identifier used to identify and handle duplicate requests in order to ensure idempotent behavior, where multiple identical requests have the same effect as a single request.
We will generate one if you do not provide it.
1const response = await client.importContract({
2 name: 'testContract',
3 description: 'testDescription',
4 address: '0xa51c9c604b79a0fadbfed35dd576ca1bce71da0a',
5 blockchain: 'ETH-SEPOLIA',
6})
7console.log(response.data)