1.4.3 • Published 4 months ago

@rsksmart/flyover-sdk v1.4.3

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

Flyover SDK

Flyover SDK simplifies the integration between client applications and the components of the Flyover Protocol by providing an easy to use interface.

Installation

npm install @rsksmart/flyover-sdk

Usage

Create Flyover client instance

    const flyover = new Flyover({ network: 'Regtest'})

If you want, you can provide your own Regtest environment URL, if custom environment URL is not secure, then you must allow insecure connections

    const flyover = new Flyover({
        network: 'Regtest',
        customRegtestUrl: 'http://localhost:8080',
        allowInsecureConnections: true
    })

Then you can start doing operations with the client

    const providers = await flyover.getLiquidityProviders()
    flyover.useLiquidityProvider(providers.at(0))
    const quotes = await flyover.getQuotes({ /* QuoteRequest data... */ })
    const acceptedQuote = await flyover.acceptQuote(quotes.at(0))

You can read more about Flyover Protocol here or in its integration manual.

Connect to RSK

If you need to connect to RSK to execute some operation then you need to create an RSKConnection and provide it to Flyover object

    const rsk = await BlockchainConnection.createUsingStandard(window.ethereum)
    const flyover = new Flyover({ rskConnection: rsk, network: 'Regtest' })

or you can set it after creation

    const rsk = await BlockchainConnection.createUsingStandard(window.ethereum)
    await flyover.connectToRsk(rsk)

Also you can provide your own regtest LBC address if you want to connect to a local node for development purposes

    const rsk = await BlockchainConnection.createUsingStandard(window.ethereum)
    const flyover = new Flyover({ 
        rskConnection: rsk, 
        network: 'Regtest', 
        customLbcAddress: '0x1eD614cd3443EFd9c70F04b6d777aed947A4b0c4' 
    })

There are 3 ways to create an RSK connection, you can check them in RSKConnection class documentation

Model Syncrhonization

To synchronize the data structures of the project with the ones of the Liquidity Provider Server you need to run npm run api-sync <branch name>. This will update the src/api/bindings folder updating each structure to match LPS. All fields types will coincide with server structures, but its important to clarify that fields whose name contains the word fee, nonce, amount, cost or value will be build as bigint in TS interface instead of number. To synchronize the ABI of the LBC you need to run npm run api-sync <branch name>.

Application Programming Interface

To see the full API of this package please refer to the the docs folder of this project

1.4.3

4 months ago

1.4.2

4 months ago

1.4.0

4 months ago

1.3.8

5 months ago

1.2.0

8 months ago

1.2.8

7 months ago

1.2.7

8 months ago

1.2.6

8 months ago

1.2.4

8 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.3.7

6 months ago

1.3.6

6 months ago

1.3.5

6 months ago

1.3.4

6 months ago

1.3.3

6 months ago

1.3.2

7 months ago

1.3.1

7 months ago

1.3.0

7 months ago

1.1.2

8 months ago

1.0.0

11 months ago

0.8.2

11 months ago

0.8.0

11 months ago

0.7.7

11 months ago

0.7.6

11 months ago

0.7.5

11 months ago

0.7.4

11 months ago

0.7.3

12 months ago

0.7.2

12 months ago

0.7.1

1 year ago

0.7.0

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago