Pipeline Class
Pipeline is a custom class to sign transactions with MyAlgo Connect, check balances and send transactions (via AlgoExplorer).
tip
We recommend using this class only for more advanced users who do not wish to use the Algo Components with hard-coded onClick functions.
Note: For faster loading, the codesandbox example below imports the Pipeline class from @pipeline-ui-2/pipeline
. If you have installed pipeline-ui
, the class is bundled with it and can be imported like below:
import { Pipeline } from 'pipeline-ui';
Note: Pipeline.connect
, Pipeline.send
and Pipeline.balance
are 'asyc' functions. They initally return a promise, so to get the returned data, the .then(data => doSomeThingwithData)
notation must be used when calling them (if the returned data is needed.)
#
Use Examplewarning
The above example will send 1 micro Algo to the Headline Dev Team test account. We recommend changing the value const recipient
(currently on line 5) to your preferred testing addressing before sending a transaction.
#
MethodsMethod | Returns | Description |
---|---|---|
Pipeline.init() | new instance of MyAlgo | Must be called once before connect or send methods |
Pipeline.balance() | string (balance + "Algos") | Takes input string address. Pipeline.init not neccesary for use. |
Pipeline.connect() | string (address) | Generates pop-up to sign in. Must be called before Pipeline.send |
Pipeline.send() | string (transaction id) | Can only be called after Pipeline.init and Pipeline.connect. |
#
Arguments#
Pipeline.balance()Argument | Type | Description |
---|---|---|
address | string | Algorand address |
#
Pipeline.connect()Argument | Type | Description |
---|---|---|
wallet | reference | instance of Pipeline.init() that is called once in app |
#
Pipeline.send()Argument | Type | Description |
---|---|---|
address | string | recipient's Algorand address |
amt | integer | amount to send in microAlgos |
myNote | string | note |
sendingAddress | string | senders's Algorand address |
wallet | reference | instance of Pipeline.init() that is called once in app |
index | integer | 0 = Algorand, otherwise asset index number |