dart_bip21

Creator: coderz1093

Last updated:

0 purchases

dart_bip21 Image
dart_bip21 Images

Languages

Categories

Add to Cart

Description:

dart bip21

dart-bip21 #
A BIP21 compatible URL encoding package developed for DartLang.
Example #
import 'package:dart_bip21/dart_bip21.dart';

void main() {
BIP21 decoded = bip21.decode(
'bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar');
print({
"address": decoded.address,
"options": decoded.options,
});

/// => {address: 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH, options: {amount: 20.3, label: Foobar}}

print(bip21.tryEncode('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'));

/// => bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH
print(bip21.tryEncode('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH',
{"amount": 20.3, "label": 'Foobar'}));

/// => bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar

print(bip21.encode(decoded));
/// => bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar
}
copied to clipboard
License MIT #

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.