aeternity / aepp-sdk-js

JavaScript SDK for the æternity blockchain
http://docs.aeternity.com/aepp-sdk-js/
ISC License
120 stars 59 forks source link

rethink & consolidate usage of BigInt / BigNumber throughout the SDK #1290

Open marc0olo opened 3 years ago

marc0olo commented 3 years ago

known related issues / PRs:

we should maybe also consult with @dincho here.

marc0olo commented 3 years ago

we should make a proposal how to proceed here.

marc0olo commented 3 years ago

here the calldata-lib implementation:

one important note here:

marc0olo commented 3 years ago

another library related to that which is included in the SDK right now:

davidyuk commented 1 year ago

Some time before I was investigating the ability to implement a custom wrapper around bigint to represent ae coints, but this feature on TS side is missed https://github.com/microsoft/TypeScript/issues/2361

davidyuk commented 1 year ago

Approximate roadmap (each step may be done separately):

I've touched on this topic in #1762 but it is too heavy for sdk@13

marc0olo commented 1 year ago

almost forgot about this one 😅 good to see it being tackled 👍

davidyuk commented 1 year ago

Optionally we can have a fancy way to define ae amounts

const aeAmount = ae`42.4`;
const fee = aettos`19320000000000`;

Also, may be useful to define something between ae and aettos, a multiple of MIN_GAS_PRICE (1e9). Because in the protocol amounts less than MIN_GAS_PRICE don't make sense.

dincho commented 1 year ago

Some time before I was investigating the ability to implement a custom wrapper around bigint to represent ae coints, but this feature on TS side is missed microsoft/TypeScript#2361

That's the right way to go IMO