asnap

command module
v0.1.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

asnap

Cardano address snap utility.

Asnap is a tool that uses cardano-cli to query a bunch of addresses, puts that information in a data-structure, and then applies a text-template of your choice to it, to produce the desired output. The text template can be one of the built-in ones, or you can write your own.

Install

go install gitlab.com/wmoco/asnap@latest

And make sure that $HOME/go/bin is in your PATH!

Developed and tested on linux, running cardano node 1.34.1 in a nix-shell.

Doc

For detailed info, see:

Quick demo

Standard use
$ asnap mediator.address buyer.address seller.address 

Gives this output:

(note: as of v0.1.3 the default template shown is 'top' and no longer 'std').

Custom template
$ cat t402.tpl 

«range .Alias2AddressMap.seller.TxixList»«if .FlagGreatestPureAda»  --tx-in-collateral «.Txix» \ 
«end»«end»«range .Alias2AddressMap.payout.TxixList»«if gt .AggregateLovelace 3000001»  --tx-in «.Txix» \
«end»«end»«range .Alias2AddressMap.seller.TxixList»  --tx-in «.Txix» \
«end» 

When applying the above template (contained in file t402.tpl) to these addresses:

$ asnap -f t402.tpl mediator.address buyer.address seller.address contract.address payout.address 

You get this output:

  --tx-in-collateral 9e6279a46380f9b15cb3018a18f06d4569343b5130a9d548c92b4b51e6da1e82#0 \ 
  --tx-in 8b9547d1e7ee5c266ae104b6ff893447582302a4b6d52655f0775a9340e3005f#2 \
  --tx-in 9e6279a46380f9b15cb3018a18f06d4569343b5130a9d548c92b4b51e6da1e82#0 \
  --tx-in f91ef669bd6a5c9d489e54931eaab3c7498c6c83737d5a237ca5fa156783f560#2 \

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL