mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
added bip21 typedefinition
This commit is contained in:
9
bip21/bip21-tests.ts
Normal file
9
bip21/bip21-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference path='bip21.d.ts' />
|
||||
|
||||
let decoded:any = bip21.decode('bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar');
|
||||
|
||||
let encoded:string = bip21.encode('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH', {
|
||||
amount: 20.3,
|
||||
label: 'Foobar'
|
||||
});
|
||||
|
||||
13
bip21/bip21.d.ts
vendored
Normal file
13
bip21/bip21.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for bip21 v1.1.2
|
||||
// Project: https://github.com/bitcoinjs/bip21
|
||||
// Definitions by: Stefan Huber <https://github.com/stefanhuber/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module bip21 {
|
||||
export function decode(uri:string) : {address:string,amount?:number};
|
||||
export function encode(address:string,options?:any) : string;
|
||||
}
|
||||
|
||||
declare module "bip21" {
|
||||
export = bip21;
|
||||
}
|
||||
Reference in New Issue
Block a user