mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 04:34:19 +01:00
[SDK] Export ListVtxos (#282)
This commit is contained in:
committed by
GitHub
parent
c183f99244
commit
e46f2ce392
@@ -209,6 +209,26 @@ func (a *arkClient) Receive(ctx context.Context) (string, string, error) {
|
||||
return offchainAddr, onchainAddr, nil
|
||||
}
|
||||
|
||||
func (a *arkClient) ListVtxos(
|
||||
ctx context.Context,
|
||||
) (spendableVtxos, spentVtxos []client.Vtxo, err error) {
|
||||
offchainAddrs, _, _, err := a.wallet.GetAddresses(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, addr := range offchainAddrs {
|
||||
spendable, spent, err := a.client.ListVtxos(ctx, addr)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
spendableVtxos = append(spendableVtxos, spendable...)
|
||||
spentVtxos = append(spentVtxos, spent...)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (a *arkClient) ping(
|
||||
ctx context.Context, paymentID string,
|
||||
) func() {
|
||||
|
||||
Reference in New Issue
Block a user