1.0.3 • Published 8 months ago

plenty-sdk v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

plenty-sdk

NPM maintainability

access Plenty Network DEX on Tezos with ease.

API USAGE

    import * as plentySdk from "plenty-sdk"
    import * as tezallet from "tezallet"
    
    //
    // init tezallet w/ custom RPC_URL
    //
    const mnemonic = '...'
    tezallet.init_tezos_toolkit(tezallet.RPC_URL.Marigold_Mainnet)

    // create signer & use index[0]
    tezallet.create_signer(mnemonic, 0)

    // show debug info
    plentySdk.set_debug_info()

    //
    // swap: 27.7 PLY -> 0.091 CTez 
    //
    const swap_test = await plentySdk.swap_by_amount(tezallet.toolkit, 
        'CTez', // Token A
        'PLY',  // Token B
        '89464',// Amount A
        true)   // is estimation or real swap ?

    // => expecting amount-out: 89060 
    console.log(`TEST_RESULT\n`,swap_test)

NOTE

I made this in a morning to understand how this DEX work while waiting for other DEX like QuipuSwap upgrade its package deps. So eventually, after some days I come back to polish it to the point of stable and make it public. Real usage could be applied into my Tezos Tipbot name "Gonut_bot" on Telegram.

USE AT YOUR OWN RISK.

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago