forked from mainnet-cash/mainnet-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SlpLibAuth.ts
85 lines (85 loc) · 2.44 KB
/
SlpLibAuth.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
export const SlpGenesisTemplate = {
$schema: "https://bitauth.com/schemas/authentication-template-v0.schema.json",
description: "SLP Token Genesis transaction output",
name: "SLP Genesis",
entities: {
vars: {
description: "Variables used in template.",
name: "Variables",
scripts: ["lock", "unlock"],
variables: {
token_ticker: {
description: "0 to ∞ bytes, suggested utf-8",
name: "token_ticker",
type: "AddressData",
},
token_name: {
description: "0 to ∞ bytes, suggested utf-8",
name: "token_name",
type: "AddressData",
},
token_document_url: {
description: "0 to ∞ bytes, suggested ascii",
name: "token_document_url",
type: "AddressData",
},
token_document_hash: {
description: "0 bytes or 32 bytes",
name: "token_document_hash",
type: "AddressData",
},
decimals: {
description: "1 byte in range 0x00-0x09",
name: "decimals",
type: "AddressData",
},
mint_baton_vout: {
description: "0 bytes, or 1 byte in range 0x02-0xff",
name: "mint_baton_vout",
type: "AddressData",
},
initial_token_mint_quantity: {
description: "8 byte integer",
name: "initial_token_mint_quantity",
type: "AddressData",
},
},
},
},
scenarios: {
genesis: {
data: {
bytecode: {
token_ticker: "0x00",
token_name: "0x00",
token_document_url: "0x00",
token_document_hash: "",
decimals: "0x09",
mint_baton_vout: "0x02",
initial_token_mint_quantity: "0x0102030405060708",
},
},
description: "Genesis",
name: "Genesis",
transaction: {
locktime: 100,
},
},
},
scripts: {
unlock: {
fails: ["genesis"],
name: "Unlock",
script: "// unlock script is required, so we leave it empty",
unlocks: "lock",
},
lock: {
lockingType: "standard",
name: "Txo",
script:
"OP_RETURN <'SLP'0x00> $(<0x0101>) <'GENESIS'> <token_ticker> <token_name> <token_document_url> <token_document_hash> $(<0x01 decimals>) $(<0x01 mint_baton_vout>) $(<0x08 initial_token_mint_quantity>)",
},
},
supported: ["BCH_2019_05", "BCH_2019_11", "BCH_2020_05"],
version: 0,
};