Giter VIP home page Giter VIP logo

celo-ethers-wrapper's People

Contributors

aaronmgdr avatar anarkrypto avatar arthurgousset avatar dependabot[bot] avatar jmrossy avatar nicolasbrugneaux avatar shazarre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

celo-ethers-wrapper's Issues

Ability to read the transaction logs

Hello @jmrossy,
Thanks for this wrapper.
While using the wrapper I came across an issue: I'm unable to access the transaction logs.
In my case, an NFT is minted using this wrapper in our infra and there is no way to get the tokenID since that can be obtained from transaction logs.
Typically while using WAGMI and after the mint function in the transaction log I can find the tokenID something like this

txData.logs[0].topics[3]

    tokenContract: txData.to,
    tokenID: parseInt(txData.logs[0].topics[3] as string, 16).toString(),
    tokenMintingTx: txData.transactionHash,
    nftOwner: txData.from,

Is it possible to get the same outcome from the wrapper? if so how?
Thank you.

Error: invalid address

I don't know if this is an appropriate place so I'll just open and then close it again but if you happen to run into the following error:

Error: invalid address (argument="address", value="0x0149fb", code=INVALID_ARGUMENT, version=address/5.4.0)
    at Logger.makeError /node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
    at Logger.throwError /node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at Logger.throwArgumentError /node_modules/@ethersproject/logger/src.ts/index.ts:241:21)
    at Object.getAddress /node_modules/@ethersproject/address/src.ts/index.ts:109:16)
    at handleAddress /node_modules/@celo-tools/celo-ethers-wrapper/src/lib/transactions.ts:265:2)
    at Object.parseCeloTransaction /node_modules/@celo-tools/celo-ethers-wrapper/src/lib/transactions.ts:200:5)
    at CeloProvider.sendTransaction /node_modules/@celo-tools/celo-ethers-wrapper/src/lib/CeloProvider.ts:29:16)

Then it might be because you are using wallet.connect(provider) which will fall back to the Wallet#connect function to create Wallet instance, not a CeloWallet instance as you might imagine

Missing support for contracts

Seems like the Contract class does its own separate tx fields check, so when trying to create a new Contract with a CeloProvider and sending a tx it still complains about "feeCurrency"

Unable to send transaction

I am trying to send 1 Celo on Baklava, but keep getting an insufficient funds error when using this library. It works perfectly fine when I try the same with @celo/ contractkit. There is sufficient balance (100+ Celo) in the account and I am following the exact same steps as in the documentation. What could be going wrong?

Code

import {
     CeloProvider,
     CeloTransactionRequest,
     CeloWallet,
 } from '@celo-tools/celo-ethers-wrapper'
 import { utils } from 'ethers'
 
 const provider = new CeloProvider('https://baklava-forno.celo-testnet.org')
 await provider.ready
 
 const wallet = new CeloWallet(PRIVATE_KEY_HERE, provider)
 const amount = utils.parseEther('1')
 
 const txResponse = await wallet.sendTransaction({
         chainId: 62320,
         to: 'ADDRESS_HERE',
         value: amount,
     })
 
 const txReceipt = await txResponse.wait()

Error

Unhandled Rejection at Promise: [object Promise]. Reason: Error: insufficient funds for intrinsic transaction cost (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":49,\"error\":{\"code\":-32000,\"message\":\"insufficient funds for transfer (after fees)\"}}\n","error":{"code":-32000},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"gasPrice\":\"0x1dcd6500\",\"value\":\"0xde0b6b3a7640000\",\"to\":\"ADDRESS\"}],\"id\":49,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://baklava-forno.celo-testnet.org"}, method="estimateGas", transaction={"gasPrice":{"type":"BigNumber","hex":"0x1dcd6500"},"to":"ADDRESS","value":{"type":"BigNumber","hex":"0x0de0b6b3a7640000"},"accessList":null}, code=INSUFFICIENT_FUNDS, version=providers/5.1.2)

Invalid address

I was trying to use ethers.js + celo-ethers-wrapper to deploy some contracts.

Unfortunately, the logic in celo-ethers-wrapper is incomplete. Based on:

My code:

provider = new CeloProvider(process.env.NETWORK_RPC_URL);
if (process.env.MNEMONIC)
          wallet = new CeloWallet.fromMnemonic(process.env.MNEMONIC);
if (process.env.PRIVATE_KEY) 
          wallet = new CeloWallet(process.env.PRIVATE_KEY);
owner = wallet.connect(provider);
console.info("Deploying OPF Community Fee");
const OPFCommunityFeeCollector = await ethers.getContractFactory(
      "OPFCommunityFeeCollector",
      owner
    );
const opfcommunityfeecollector = await OPFCommunityFeeCollector.connect(owner).deploy(
      OPFOwner,
      OPFOwner,
      options
    );

fails with:

Deploying OPF Community Fee
Error: invalid address (argument="address", value="0x015e0a", code=INVALID_ARGUMENT, version=address/5.6.0)
    at Logger.makeError (/ocean/contracts_v4/contracts/node_modules/@ethersproject/logger/lib/index.js:233:21)
    at Logger.throwError (/ocean/contracts_v4/contracts/node_modules/@ethersproject/logger/lib/index.js:242:20)
    at Logger.throwArgumentError (/ocean/contracts_v4/contracts/node_modules/@ethersproject/logger/lib/index.js:245:21)
    at Object.getAddress (/ocean/contracts_v4/contracts/node_modules/@ethersproject/address/lib/index.js:96:16)
    at handleAddress (/ocean/contracts_v4/contracts/node_modules/@celo-tools/celo-ethers-wrapper/build/main/lib/transactions.js:179:27)
    at Object.parseCeloTransaction (/ocean/contracts_v4/contracts/node_modules/@celo-tools/celo-ethers-wrapper/build/main/lib/transactions.js:120:13)
    at CeloProvider.sendTransaction (/ocean/contracts_v4/contracts/node_modules/@celo-tools/celo-ethers-wrapper/build/main/lib/CeloProvider.js:24:35)
    at processTicksAndRejections (node:internal/process/task_queues:94:5) {
  reason: 'invalid address',
  code: 'INVALID_ARGUMENT',
  argument: 'address',
  value: '0x015e0a'
}

I have added additional logging, and got my rawTx (added console.log before and after https://github.com/celo-tools/celo-ethers-wrapper/blob/master/src/lib/transactions.ts#L182):

0xf90b310e841dcd65008401312d008080b90adb608060405234801561001057600080fd5b50604051610a9b380380610a9b83398101604081905261002f9161023a565b6100383361010a565b6001600160a01b0382161580159061005857506001600160a01b03811615155b6100df5760405162461bcd60e51b815260206004820152604760248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20636f6c6c656360448201527f746f722061646472657373206f72206f776e657220697320696e76616c6964206064820152666164647265737360c81b608482015260a4015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0384161790556101038161015a565b5050610274565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146101b45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016100d6565b6001600160a01b0381166102195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100d6565b6102228161010a565b50565b6001600160a01b038116811461022257600080fd5b6000806040838503121561024d57600080fd5b825161025881610225565b602084015190925061026981610225565b809150509250929050565b610818806102836000396000f3fe6080604052600436106100555760003560e01c8063715018a6146100575780637781127e1461006c578063894760691461008c5780638da5cb5b146100ac578063e086e5ec146100d8578063f2fde38b146100e0575b005b34801561006357600080fd5b50610055610100565b34801561007857600080fd5b506100556100873660046106d6565b61013f565b34801561009857600080fd5b506100556100a73660046106d6565b6101fd565b3480156100b857600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b610055610301565b3480156100ec57600080fd5b506100556100fb3660046106d6565b61033a565b6000546001600160a01b031633146101335760405162461bcd60e51b815260040161012a906106f3565b60405180910390fd5b61013d60006103ce565b565b6000546001600160a01b031633146101695760405162461bcd60e51b815260040161012a906106f3565b6001600160a01b0381166101db5760405162461bcd60e51b815260206004820152603360248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20696e76616c696044820152726420636f6c6c6563746f72206164647265737360681b606482015260840161012a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166102795760405162461bcd60e51b815260206004820152603860248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20696e76616c6960448201527f6420746f6b656e20636f6e747261637420616464726573730000000000000000606482015260840161012a565b6001546040516370a0823160e01b81523060048201526102fe916001600160a01b0390811691908416906370a0823190602401602060405180830381865afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed9190610728565b6001600160a01b038416919061041e565b50565b6001546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156102fe573d6000803e3d6000fd5b6000546001600160a01b031633146103645760405162461bcd60e51b815260040161012a906106f3565b6001600160a01b0381166103c95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161012a565b6102fe815b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610470908490610475565b505050565b60006104ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166105479092919063ffffffff16565b80519091501561047057808060200190518101906104e89190610741565b6104705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161012a565b60606105568484600085610560565b90505b9392505050565b6060824710156105c15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161012a565b843b61060f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161012a565b600080866001600160a01b0316858760405161062b9190610793565b60006040518083038185875af1925050503d8060008114610668576040519150601f19603f3d011682016040523d82523d6000602084013e61066d565b606091505b509150915061067d828286610688565b979650505050505050565b60608315610697575081610559565b8251156106a75782518084602001fd5b8160405162461bcd60e51b815260040161012a91906107af565b6001600160a01b03811681146102fe57600080fd5b6000602082840312156106e857600080fd5b8135610559816106c1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561073a57600080fd5b5051919050565b60006020828403121561075357600080fd5b8151801515811461055957600080fd5b60005b8381101561077e578181015183820152602001610766565b8381111561078d576000848401525b50505050565b600082516107a5818460208701610763565b9190910192915050565b60208152600082518060208401526107ce816040850160208701610763565b601f01601f1916919091016040019291505056fea26469706673582212204cb55ec488ee19322ce4f7fe6420a69e94b2a42af90c92705f4cf47ae5bd528f64736f6c634300080c003300000000000000000000000006100ab868206861a4d7936166a91668c2ce131200000000000000000000000006100ab868206861a4d7936166a91668c2ce131283015e0aa0175b7fb70c14ce96576c5a092b71a85f9629b321b909aa110e5a61764a7c41e3a02576a3945ac0b191b9342436c4c37226980f8293e17761d30002bcc9b89a8921
[
  '0x0e',
  '0x1dcd6500',
  '0x01312d00',
  '0x',
  '0x',
  '0x608060405234801561001057600080fd5b50604051610a9b380380610a9b83398101604081905261002f9161023a565b6100383361010a565b6001600160a01b0382161580159061005857506001600160a01b03811615155b6100df5760405162461bcd60e51b815260206004820152604760248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20636f6c6c656360448201527f746f722061646472657373206f72206f776e657220697320696e76616c6964206064820152666164647265737360c81b608482015260a4015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0384161790556101038161015a565b5050610274565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146101b45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016100d6565b6001600160a01b0381166102195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100d6565b6102228161010a565b50565b6001600160a01b038116811461022257600080fd5b6000806040838503121561024d57600080fd5b825161025881610225565b602084015190925061026981610225565b809150509250929050565b610818806102836000396000f3fe6080604052600436106100555760003560e01c8063715018a6146100575780637781127e1461006c578063894760691461008c5780638da5cb5b146100ac578063e086e5ec146100d8578063f2fde38b146100e0575b005b34801561006357600080fd5b50610055610100565b34801561007857600080fd5b506100556100873660046106d6565b61013f565b34801561009857600080fd5b506100556100a73660046106d6565b6101fd565b3480156100b857600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b610055610301565b3480156100ec57600080fd5b506100556100fb3660046106d6565b61033a565b6000546001600160a01b031633146101335760405162461bcd60e51b815260040161012a906106f3565b60405180910390fd5b61013d60006103ce565b565b6000546001600160a01b031633146101695760405162461bcd60e51b815260040161012a906106f3565b6001600160a01b0381166101db5760405162461bcd60e51b815260206004820152603360248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20696e76616c696044820152726420636f6c6c6563746f72206164647265737360681b606482015260840161012a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166102795760405162461bcd60e51b815260206004820152603860248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20696e76616c6960448201527f6420746f6b656e20636f6e747261637420616464726573730000000000000000606482015260840161012a565b6001546040516370a0823160e01b81523060048201526102fe916001600160a01b0390811691908416906370a0823190602401602060405180830381865afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed9190610728565b6001600160a01b038416919061041e565b50565b6001546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156102fe573d6000803e3d6000fd5b6000546001600160a01b031633146103645760405162461bcd60e51b815260040161012a906106f3565b6001600160a01b0381166103c95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161012a565b6102fe815b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610470908490610475565b505050565b60006104ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166105479092919063ffffffff16565b80519091501561047057808060200190518101906104e89190610741565b6104705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161012a565b60606105568484600085610560565b90505b9392505050565b6060824710156105c15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161012a565b843b61060f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161012a565b600080866001600160a01b0316858760405161062b9190610793565b60006040518083038185875af1925050503d8060008114610668576040519150601f19603f3d011682016040523d82523d6000602084013e61066d565b606091505b509150915061067d828286610688565b979650505050505050565b60608315610697575081610559565b8251156106a75782518084602001fd5b8160405162461bcd60e51b815260040161012a91906107af565b6001600160a01b03811681146102fe57600080fd5b6000602082840312156106e857600080fd5b8135610559816106c1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561073a57600080fd5b5051919050565b60006020828403121561075357600080fd5b8151801515811461055957600080fd5b60005b8381101561077e578181015183820152602001610766565b8381111561078d576000848401525b50505050565b600082516107a5818460208701610763565b9190910192915050565b60208152600082518060208401526107ce816040850160208701610763565b601f01601f1916919091016040019291505056fea26469706673582212204cb55ec488ee19322ce4f7fe6420a69e94b2a42af90c92705f4cf47ae5bd528f64736f6c634300080c003300000000000000000000000006100ab868206861a4d7936166a91668c2ce131200000000000000000000000006100ab868206861a4d7936166a91668c2ce1312',
  '0x015e0a',
  '0x175b7fb70c14ce96576c5a092b71a85f9629b321b909aa110e5a61764a7c41e3',
  '0x2576a3945ac0b191b9342436c4c37226980f8293e17761d30002bcc9b89a8921'
]

ethereum standard decoded tx looks fine (used https://flightwallet.github.io/decode-eth-tx/)

{
  "nonce": 14,
  "gasPrice": 500000000,
  "gasLimit": 20000000,
  "to": "0x",
  "value": 0,
  "data": "608060405234801561001057600080fd5b50604051610a9b380380610a9b83398101604081905261002f9161023a565b6100383361010a565b6001600160a01b0382161580159061005857506001600160a01b03811615155b6100df5760405162461bcd60e51b815260206004820152604760248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20636f6c6c656360448201527f746f722061646472657373206f72206f776e657220697320696e76616c6964206064820152666164647265737360c81b608482015260a4015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0384161790556101038161015a565b5050610274565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146101b45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016100d6565b6001600160a01b0381166102195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100d6565b6102228161010a565b50565b6001600160a01b038116811461022257600080fd5b6000806040838503121561024d57600080fd5b825161025881610225565b602084015190925061026981610225565b809150509250929050565b610818806102836000396000f3fe6080604052600436106100555760003560e01c8063715018a6146100575780637781127e1461006c578063894760691461008c5780638da5cb5b146100ac578063e086e5ec146100d8578063f2fde38b146100e0575b005b34801561006357600080fd5b50610055610100565b34801561007857600080fd5b506100556100873660046106d6565b61013f565b34801561009857600080fd5b506100556100a73660046106d6565b6101fd565b3480156100b857600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b610055610301565b3480156100ec57600080fd5b506100556100fb3660046106d6565b61033a565b6000546001600160a01b031633146101335760405162461bcd60e51b815260040161012a906106f3565b60405180910390fd5b61013d60006103ce565b565b6000546001600160a01b031633146101695760405162461bcd60e51b815260040161012a906106f3565b6001600160a01b0381166101db5760405162461bcd60e51b815260206004820152603360248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20696e76616c696044820152726420636f6c6c6563746f72206164647265737360681b606482015260840161012a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166102795760405162461bcd60e51b815260206004820152603860248201527f4f5046436f6d6d756e697479466565436f6c6c6563746f723a20696e76616c6960448201527f6420746f6b656e20636f6e747261637420616464726573730000000000000000606482015260840161012a565b6001546040516370a0823160e01b81523060048201526102fe916001600160a01b0390811691908416906370a0823190602401602060405180830381865afa1580156102c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ed9190610728565b6001600160a01b038416919061041e565b50565b6001546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156102fe573d6000803e3d6000fd5b6000546001600160a01b031633146103645760405162461bcd60e51b815260040161012a906106f3565b6001600160a01b0381166103c95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161012a565b6102fe815b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610470908490610475565b505050565b60006104ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166105479092919063ffffffff16565b80519091501561047057808060200190518101906104e89190610741565b6104705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161012a565b60606105568484600085610560565b90505b9392505050565b6060824710156105c15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161012a565b843b61060f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161012a565b600080866001600160a01b0316858760405161062b9190610793565b60006040518083038185875af1925050503d8060008114610668576040519150601f19603f3d011682016040523d82523d6000602084013e61066d565b606091505b509150915061067d828286610688565b979650505050505050565b60608315610697575081610559565b8251156106a75782518084602001fd5b8160405162461bcd60e51b815260040161012a91906107af565b6001600160a01b03811681146102fe57600080fd5b6000602082840312156106e857600080fd5b8135610559816106c1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561073a57600080fd5b5051919050565b60006020828403121561075357600080fd5b8151801515811461055957600080fd5b60005b8381101561077e578181015183820152602001610766565b8381111561078d576000848401525b50505050565b600082516107a5818460208701610763565b9190910192915050565b60208152600082518060208401526107ce816040850160208701610763565b601f01601f1916919091016040019291505056fea26469706673582212204cb55ec488ee19322ce4f7fe6420a69e94b2a42af90c92705f4cf47ae5bd528f64736f6c634300080c003300000000000000000000000006100ab868206861a4d7936166a91668c2ce131200000000000000000000000006100ab868206861a4d7936166a91668c2ce1312",
  "from": "0xc7ec1970b09224b317c52d92f37f5e1e4ff6b687",
  "r": "175b7fb70c14ce96576c5a092b71a85f9629b321b909aa110e5a61764a7c41e3",
  "v": "015e0a",
  "s": "2576a3945ac0b191b9342436c4c37226980f8293e17761d30002bcc9b89a8921"
}

but when looking at https://github.com/celo-tools/celo-ethers-wrapper/blob/master/src/lib/transactions.ts#L192-L203

const tx: CeloTransaction = {
    nonce: handleNumber(transaction[0]).toNumber(),
    gasPrice: handleNumber(transaction[1]),
    gasLimit: handleNumber(transaction[2]),
    feeCurrency: handleAddress(transaction[3]),
    gatewayFeeRecipient: handleAddress(transaction[4]),
    gatewayFee: handleNumber(transaction[5]),
    to: handleAddress(transaction[6]),
    value: handleNumber(transaction[7]),
    data: transaction[8],
    chainId: 0,
  };

of course it will complain about invalid_addresses. (transaction[6] is the v field, instead of address)

Am I missing something ?

Add Support for CIp64 Transactions

Current

celo-ethers-wrapper currently only supports legacy style transaction encoding. Supporting gasPrice, feeCurrency and GateWay fields. However gateway is deprecated.

Future

support cip64 which can be thought of as FeeMarket eip1559 tx + feeCurrency field.

getBlockWithTransactions issue - invalid BigNumber

This wrapper works with getBlock but not with getBlockWithTransactions,

Would it be possible to apply the same ethers workaround there as well please?

    try {
        const block = await localProvider.getBlockWithTransactions(blockNumber);
        console.log('getBlockWithTransactions ', block);
    } catch (error) {
        console.log('error ', error.message);
    }

error invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.5.0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.