celo-org / viem

TypeScript Interface for Ethereum
https://viem.sh
Other
0 stars 0 forks source link

CIP-66 support #13

Closed shazarre closed 1 week ago

shazarre commented 5 months ago

Implement CIP 66 transaction serialization and parsing

Compatibility

CIP66 is an upcoming Celo Transaction type for paying for gas with Tokens.

For this implementation, a CIP-66 (AKA type 122) transaction will ONLY be created if you manually calculate and pass in maxFeeInFeeCurrency, feeCurrency and the maxFeePerGas and maxPriorityFeePerGas fields. Otherwise if feeCurrency is provided a cip64 transaction will be created else a typical 1559 transaction gets created.

Not implemented

We have not implemented fetching the maxFeeInFeeToken, and right now if feeCurrency exists it will always fetch the maxFeePerGas / maxPriorityFeePerGas denominated in the FeeCurrency (cip64 style)

github-actions[bot] commented 5 months ago

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
viem (esm) 59.21 KB (0%) 1.2 s (0%) 7.4 s (-36.36% 🔽) 8.6 s
viem (cjs) 69.64 KB (0%) 1.4 s (0%) 22.4 s (-3.39% 🔽) 23.7 s
viem (minimal surface - tree-shaking) 6.13 KB (0%) 123 ms (0%) 516 ms (+34.02% 🔺) 638 ms
viem/accounts 74.1 KB (0%) 1.5 s (0%) 7 s (-4.42% 🔽) 8.4 s
viem/accounts (tree-shaking) 19.05 KB (0%) 382 ms (0%) 1.6 s (-39.59% 🔽) 2 s
viem/actions 45.38 KB (0%) 908 ms (0%) 5.9 s (+26.52% 🔺) 6.8 s
viem/actions (tree-shaking) 318 B (0%) 10 ms (0%) 47 ms (+8.63% 🔺) 57 ms
viem/chains 29.64 KB (+0.78% 🔺) 593 ms (+0.78% 🔺) 5.1 s (-32.18% 🔽) 5.6 s
viem/chains (tree-shaking) 324 B (0%) 10 ms (0%) 48 ms (-81.06% 🔽) 58 ms
viem/chains/utils 1.02 KB (0%) 21 ms (0%) 123 ms (-36.53% 🔽) 144 ms
viem/ens 45.38 KB (0%) 908 ms (0%) 8.2 s (+52.53% 🔺) 9.1 s
viem/ens (tree-shaking) 22.03 KB (0%) 441 ms (0%) 10.9 s (+55.33% 🔺) 11.4 s
viem/siwe 30.12 KB (0%) 603 ms (0%) 4.5 s (-45.6% 🔽) 5.1 s
viem/siwe (tree-shaking) 29.06 KB (0%) 582 ms (0%) 9.3 s (+40.94% 🔺) 9.8 s
aaronmgdr commented 5 months ago

i think it might be smart ot not merge this into main until we actually want it to be in the viem release which would not be until closer to l2 launch

aaronmgdr commented 1 week ago

closing as 66 has been taking off standards track