wharfkit / antelope

Core types, client interfaces, and other tools for working with Antelope-based blockchains.
Other
42 stars 23 forks source link

Missing ExtendedSymbol #25

Closed aaroncox closed 8 months ago

aaroncox commented 2 years ago

We don't have types for this.

https://developers.eos.io/manuals/eosio.cdt/v1.7/classeosio_1_1extended__symbol

Unsure if we need it or if Symbol itself handles it? I'm outta my depth without some research.

jeisses commented 11 months ago

I was missing this type the other day. It is similar to ExtendedAsset which is provided by this library, so it would make sense if ExtendedSymbol is also there.

It's simple enough to get around this with a Struct, so nothing important. This is what I do now:

@Struct.type('extended_symbol')
class ExtendedSymbol extends Struct {
    static abiName = 'extended_symbol'
    static abiFields = [{name: 'sym', type: 'symbol'},{name: 'contract', type: 'name'}]
    constructor(sym: Asset.SymbolType, contract: NameType) {
        super({'sym': sym, 'contract': contract});
    }
}

const efx = new ExtendedSymbol('4,EFX', 'effecttokens')
aaroncox commented 8 months ago

Closing, more discussion here: https://github.com/wharfkit/antelope/pull/90