nim-ethers/ethers
Eric Mastro ff3173986f
Support distinct types for Event fields
Add support for indexed (and non-indexed) Event fields types that are distinct `ValueType` or `SmallByteArray`. For example,
```nim
type
  DistinctAlias = distinct array[32, byte]
  MyEvent = object of Event
    a {.indexed.}: DistinctAlias
    b: DistinctAlias # also allowed for non-indexed fields

## The below funcs generally need to be included for ABI
## encoding/decoding purposes when implementing distinct types.

func toArray(value: DistinctAlias): array[32, byte] =
  array[32, byte](value)

func encode*(encoder: var AbiEncoder, value: DistinctAlias) =
  encoder.write(value.toArray)

func decode*(decoder: var AbiDecoder,
             T: type DistinctAlias): ?!T =
  let d = ?decoder.read(type array[32, byte])
  success DistinctAlias(d)
```
2022-09-05 15:35:50 +10:00
..
providers [wallet] cleanup 2022-08-08 15:07:41 +02:00
basics.nim Add Signer.populateTransaction() 2022-01-25 10:25:09 +01:00
blocktag.nim Adds Signer.getTransactionCount() 2022-01-24 12:14:31 +01:00
contract.nim Changes to TransactionOverrides to support EIP1559 2022-08-08 12:40:36 +02:00
events.nim Support distinct types for Event fields 2022-09-05 15:35:50 +10:00
fields.nim Fix for Nim 1.4.x 2022-02-09 14:50:51 +01:00
provider.nim [provider] Rename sendRawTransaction -> sendTransaction 2022-08-08 15:07:41 +02:00
signer.nim Change Transaction type to support EIP1559 2022-08-08 12:40:36 +02:00
transaction.nim Change Transaction type to support EIP1559 2022-08-08 12:40:36 +02:00
wallet.nim [wallet] cleanup 2022-08-08 15:07:41 +02:00