mainnet-js 1.1.34-alpha.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/{mainnet-1.1.34-alpha.1.js → mainnet-2.0.0.js} +26 -338
  3. package/dist/module/db/SqlProvider.d.ts +2 -2
  4. package/dist/module/db/SqlProvider.d.ts.map +1 -1
  5. package/dist/module/db/SqlProvider.js +6 -24
  6. package/dist/module/db/SqlProvider.js.map +1 -1
  7. package/dist/module/index.d.ts +0 -3
  8. package/dist/module/index.d.ts.map +1 -1
  9. package/dist/module/index.js +3 -6
  10. package/dist/module/index.js.map +1 -1
  11. package/dist/module/transaction/Wif.d.ts +4 -8
  12. package/dist/module/transaction/Wif.d.ts.map +1 -1
  13. package/dist/module/transaction/Wif.js +6 -10
  14. package/dist/module/transaction/Wif.js.map +1 -1
  15. package/dist/module/util/deriveCashaddr.d.ts +1 -0
  16. package/dist/module/util/deriveCashaddr.d.ts.map +1 -1
  17. package/dist/module/util/deriveCashaddr.js +8 -1
  18. package/dist/module/util/deriveCashaddr.js.map +1 -1
  19. package/dist/module/wallet/Base.d.ts +1 -1
  20. package/dist/module/wallet/Base.js +1 -1
  21. package/dist/module/wallet/Bcmr.d.ts.map +1 -1
  22. package/dist/module/wallet/Bcmr.js +0 -1
  23. package/dist/module/wallet/Bcmr.js.map +1 -1
  24. package/dist/module/wallet/Util.d.ts +2 -2
  25. package/dist/module/wallet/Util.js +2 -2
  26. package/dist/module/wallet/Wif.d.ts +0 -28
  27. package/dist/module/wallet/Wif.d.ts.map +1 -1
  28. package/dist/module/wallet/Wif.js +2 -109
  29. package/dist/module/wallet/Wif.js.map +1 -1
  30. package/dist/module/wallet/createWallet.d.ts +0 -12
  31. package/dist/module/wallet/createWallet.d.ts.map +1 -1
  32. package/dist/module/wallet/createWallet.js +0 -43
  33. package/dist/module/wallet/createWallet.js.map +1 -1
  34. package/dist/module/wallet/interface.d.ts +0 -2
  35. package/dist/module/wallet/interface.d.ts.map +1 -1
  36. package/dist/module/webhook/Webhook.d.ts +1 -6
  37. package/dist/module/webhook/Webhook.d.ts.map +1 -1
  38. package/dist/module/webhook/Webhook.js +0 -4
  39. package/dist/module/webhook/Webhook.js.map +1 -1
  40. package/dist/module/webhook/index.d.ts +0 -1
  41. package/dist/module/webhook/index.d.ts.map +1 -1
  42. package/dist/module/webhook/index.js +0 -1
  43. package/dist/module/webhook/index.js.map +1 -1
  44. package/dist/module/webhook/interface.d.ts +0 -1
  45. package/dist/module/webhook/interface.d.ts.map +1 -1
  46. package/dist/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +5 -10
  48. package/src/db/SqlProvider.test.ts +2 -18
  49. package/src/db/SqlProvider.ts +5 -26
  50. package/src/index.ts +3 -7
  51. package/src/transaction/Wif.ts +2 -19
  52. package/src/util/deriveCashaddr.test.ts +8 -0
  53. package/src/util/deriveCashaddr.ts +9 -0
  54. package/src/wallet/Base.ts +1 -1
  55. package/src/wallet/Bcmr.ts +0 -1
  56. package/src/wallet/Util.ts +2 -2
  57. package/src/wallet/Wif.test.ts +0 -23
  58. package/src/wallet/Wif.ts +2 -148
  59. package/src/wallet/createWallet.ts +0 -53
  60. package/src/wallet/interface.ts +0 -2
  61. package/src/webhook/Webhook.ts +4 -10
  62. package/src/webhook/index.ts +0 -1
  63. package/src/webhook/interface.ts +0 -1
  64. package/webpack.config.cjs +7 -7
  65. package/dist/module/slp/GsppProvider.d.ts +0 -55
  66. package/dist/module/slp/GsppProvider.d.ts.map +0 -1
  67. package/dist/module/slp/GsppProvider.js +0 -204
  68. package/dist/module/slp/GsppProvider.js.map +0 -1
  69. package/dist/module/slp/SlpDbProvider.d.ts +0 -52
  70. package/dist/module/slp/SlpDbProvider.d.ts.map +0 -1
  71. package/dist/module/slp/SlpDbProvider.js +0 -175
  72. package/dist/module/slp/SlpDbProvider.js.map +0 -1
  73. package/dist/module/slp/SlpDbTemplates.d.ts +0 -313
  74. package/dist/module/slp/SlpDbTemplates.d.ts.map +0 -1
  75. package/dist/module/slp/SlpDbTemplates.js +0 -375
  76. package/dist/module/slp/SlpDbTemplates.js.map +0 -1
  77. package/dist/module/slp/SlpLibAuth.d.ts +0 -210
  78. package/dist/module/slp/SlpLibAuth.d.ts.map +0 -1
  79. package/dist/module/slp/SlpLibAuth.js +0 -451
  80. package/dist/module/slp/SlpLibAuth.js.map +0 -1
  81. package/dist/module/slp/SlpProvider.d.ts +0 -24
  82. package/dist/module/slp/SlpProvider.d.ts.map +0 -1
  83. package/dist/module/slp/SlpProvider.js +0 -29
  84. package/dist/module/slp/SlpProvider.js.map +0 -1
  85. package/dist/module/slp/index.d.ts +0 -6
  86. package/dist/module/slp/index.d.ts.map +0 -1
  87. package/dist/module/slp/index.js +0 -5
  88. package/dist/module/slp/index.js.map +0 -1
  89. package/dist/module/slp/interface.d.ts +0 -114
  90. package/dist/module/slp/interface.d.ts.map +0 -1
  91. package/dist/module/slp/interface.js +0 -7
  92. package/dist/module/slp/interface.js.map +0 -1
  93. package/dist/module/util/bchaddr.d.ts +0 -2
  94. package/dist/module/util/bchaddr.d.ts.map +0 -1
  95. package/dist/module/util/bchaddr.js +0 -16
  96. package/dist/module/util/bchaddr.js.map +0 -1
  97. package/dist/module/wallet/Slp.d.ts +0 -431
  98. package/dist/module/wallet/Slp.d.ts.map +0 -1
  99. package/dist/module/wallet/Slp.js +0 -770
  100. package/dist/module/wallet/Slp.js.map +0 -1
  101. package/dist/module/webhook/WebhookSlp.d.ts +0 -15
  102. package/dist/module/webhook/WebhookSlp.d.ts.map +0 -1
  103. package/dist/module/webhook/WebhookSlp.js +0 -100
  104. package/dist/module/webhook/WebhookSlp.js.map +0 -1
  105. package/src/slp/GsppProvider.test.ts +0 -40
  106. package/src/slp/GsppProvider.ts +0 -329
  107. package/src/slp/SlpDbProvider.test.ts +0 -27
  108. package/src/slp/SlpDbProvider.ts +0 -291
  109. package/src/slp/SlpDbTemplates.ts +0 -400
  110. package/src/slp/SlpLibAuth.test.ts +0 -162
  111. package/src/slp/SlpLibAuth.ts +0 -532
  112. package/src/slp/SlpProvider.ts +0 -100
  113. package/src/slp/index.ts +0 -6
  114. package/src/slp/interface.ts +0 -128
  115. package/src/util/bchaddr.test.ts +0 -27
  116. package/src/util/bchaddr.ts +0 -27
  117. package/src/wallet/Slp.test.headless.js +0 -120
  118. package/src/wallet/Slp.test.ts +0 -1000
  119. package/src/wallet/Slp.ts +0 -1014
  120. package/src/webhook/WebhookSlp.test.ts +0 -288
  121. package/src/webhook/WebhookSlp.ts +0 -123
@@ -1,375 +0,0 @@
1
- // Slp Utxos for bch operation, to prevent accident burning of tokens and baton
2
- // prettier-ignore
3
- export const SlpAllUtxosTemplate = (slpaddr) => ({
4
- "v": 3,
5
- "q": {
6
- "db": ["g"],
7
- "aggregate": [
8
- {
9
- "$match": {
10
- "graphTxn.outputs.address": slpaddr,
11
- "graphTxn.outputs.status": {
12
- "$in": [
13
- "UNSPENT",
14
- "BATON_UNSPENT"
15
- ]
16
- }
17
- }
18
- },
19
- {
20
- "$unwind": "$graphTxn.outputs"
21
- },
22
- {
23
- "$match": {
24
- "graphTxn.outputs.address": slpaddr,
25
- "graphTxn.outputs.status": {
26
- "$in": [
27
- "UNSPENT",
28
- "BATON_UNSPENT"
29
- ]
30
- }
31
- }
32
- }
33
- ],
34
- "limit": 1e6,
35
- },
36
- "r": {
37
- "f": "[ .[] | { txid: .graphTxn.txid, vout: .graphTxn.outputs.vout, satoshis: .graphTxn.outputs.bchSatoshis, value: .graphTxn.outputs.slpAmount, decimals: .graphTxn.details.decimals, ticker: .graphTxn.details.symbol, tokenId: .graphTxn.details.tokenIdHex, type: .graphTxn.details.versionType, parentTokenId: .tokenDetails.nftGroupIdHex } ]"
38
- }
39
- });
40
- // Slp outpoints for bch operation, to prevent accident burning of tokens and baton
41
- // prettier-ignore
42
- export const SlpAllOutpointsTemplate = (slpaddr) => ({
43
- "v": 3,
44
- "q": {
45
- "db": ["g"],
46
- "aggregate": [
47
- {
48
- "$match": {
49
- "graphTxn.outputs.address": slpaddr,
50
- "graphTxn.outputs.status": {
51
- "$in": [
52
- "UNSPENT",
53
- "BATON_UNSPENT"
54
- ]
55
- }
56
- }
57
- },
58
- {
59
- "$unwind": "$graphTxn.outputs"
60
- },
61
- {
62
- "$match": {
63
- "graphTxn.outputs.address": slpaddr,
64
- "graphTxn.outputs.status": {
65
- "$in": [
66
- "UNSPENT",
67
- "BATON_UNSPENT"
68
- ]
69
- }
70
- }
71
- },
72
- {
73
- "$project": {
74
- "graphTxn": 1
75
- }
76
- }
77
- ],
78
- "limit": 1e6,
79
- },
80
- "r": {
81
- "f": "[ .[] | [.graphTxn.txid, .graphTxn.outputs.vout | tostring] | join(\":\") ]"
82
- }
83
- });
84
- // Slp Utxos for spending
85
- // prettier-ignore
86
- export const SlpSpendableUtxosTemplate = (slpaddr, tokenId) => {
87
- let q = {
88
- "v": 3,
89
- "q": {
90
- "db": ["g"],
91
- "aggregate": [
92
- {
93
- "$match": {
94
- "graphTxn.outputs.address": slpaddr,
95
- "graphTxn.outputs.status": "UNSPENT"
96
- }
97
- },
98
- {
99
- "$unwind": "$graphTxn.outputs"
100
- },
101
- {
102
- "$match": {
103
- "graphTxn.outputs.address": slpaddr,
104
- "graphTxn.outputs.status": "UNSPENT"
105
- }
106
- },
107
- {
108
- "$lookup": {
109
- "from": "tokens",
110
- "localField": "graphTxn.details.tokenIdHex",
111
- "foreignField": "tokenDetails.tokenIdHex",
112
- "as": "token"
113
- }
114
- }
115
- ]
116
- },
117
- "r": {
118
- "f": "[ .[] | { txid: .graphTxn.txid, vout: .graphTxn.outputs.vout, satoshis: .graphTxn.outputs.bchSatoshis, value: .graphTxn.outputs.slpAmount, decimals: .token[0].tokenDetails.decimals, ticker: .token[0].tokenDetails.symbol, tokenId: .graphTxn.details.tokenIdHex, type: .graphTxn.details.versionType, parentTokenId: .token[0].nftParentId } ]"
119
- }
120
- };
121
- if (tokenId) {
122
- q["q"]["aggregate"][0]["$match"]["graphTxn.details.tokenIdHex"] = tokenId;
123
- }
124
- // console.log(JSON.stringify(q, null, 2));
125
- return q;
126
- };
127
- // prettier-ignore
128
- export const SlpAllTokenBalancesTemplate = (slpaddr) => {
129
- let q = {
130
- "v": 3,
131
- "q": {
132
- "db": ["g"],
133
- "aggregate": [
134
- {
135
- "$match": {
136
- "graphTxn.outputs.status": "UNSPENT",
137
- "graphTxn.outputs.address": slpaddr
138
- }
139
- },
140
- {
141
- "$unwind": "$graphTxn.outputs"
142
- },
143
- {
144
- "$match": {
145
- "graphTxn.outputs.status": "UNSPENT",
146
- "graphTxn.outputs.address": slpaddr
147
- }
148
- },
149
- {
150
- "$group": {
151
- "_id": "$tokenDetails.tokenIdHex",
152
- "slpAmount": {
153
- "$sum": "$graphTxn.outputs.slpAmount"
154
- }
155
- }
156
- },
157
- {
158
- "$sort": {
159
- "slpAmount": -1
160
- }
161
- },
162
- {
163
- "$lookup": {
164
- "from": "tokens",
165
- "localField": "_id",
166
- "foreignField": "tokenDetails.tokenIdHex",
167
- "as": "token"
168
- }
169
- },
170
- {
171
- "$match": {
172
- "slpAmount": {
173
- "$gt": 0
174
- }
175
- }
176
- }
177
- ],
178
- "sort": {
179
- "slpAmount": -1
180
- }
181
- },
182
- "r": {
183
- "f": "[ .[] | { value: .slpAmount, ticker: .token[0].tokenDetails.symbol, name: .token[0].tokenDetails.name, tokenId: ._id, type: .token[0].tokenDetails.versionType, parentTokenId: .token[0].nftParentId } ]"
184
- }
185
- };
186
- return q;
187
- };
188
- // prettier-ignore
189
- export const SlpTokenBalanceTemplate = (slpaddr, tokenId) => {
190
- let q = {
191
- "v": 3,
192
- "q": {
193
- "db": ["g"],
194
- "aggregate": [
195
- {
196
- "$match": {
197
- "tokenDetails.tokenIdHex": tokenId
198
- }
199
- },
200
- {
201
- "$match": {
202
- "graphTxn.outputs.status": "UNSPENT",
203
- "graphTxn.outputs.address": slpaddr
204
- }
205
- },
206
- {
207
- "$unwind": "$graphTxn.outputs"
208
- },
209
- {
210
- "$match": {
211
- "graphTxn.outputs.status": "UNSPENT",
212
- "graphTxn.outputs.address": slpaddr
213
- }
214
- },
215
- {
216
- "$group": {
217
- "_id": "$tokenDetails.tokenIdHex",
218
- "slpAmount": {
219
- "$sum": "$graphTxn.outputs.slpAmount"
220
- }
221
- }
222
- },
223
- {
224
- "$sort": {
225
- "slpAmount": -1
226
- }
227
- },
228
- {
229
- "$lookup": {
230
- "from": "tokens",
231
- "localField": "_id",
232
- "foreignField": "tokenDetails.tokenIdHex",
233
- "as": "token"
234
- }
235
- }
236
- ],
237
- "sort": {
238
- "slpAmount": -1
239
- }
240
- },
241
- "r": {
242
- "f": "[ .[] | { value: .slpAmount, ticker: .token[0].tokenDetails.symbol, name: .token[0].tokenDetails.name, tokenId: ._id, type: .token[0].tokenDetails.versionType, parentTokenId: .token[0].nftParentId } ]"
243
- }
244
- };
245
- // console.log(JSON.stringify(q, null, 2));
246
- return q;
247
- };
248
- // prettier-ignore
249
- export const SlpAddressTransactionHistoryTemplate = (address, tokenId, limit = 100, skip = 0) => {
250
- const q = {
251
- "v": 3,
252
- "q": {
253
- "db": ["c", "u"],
254
- "find": {
255
- "$query": {
256
- "$or": [
257
- { "in.e.a": address },
258
- { "out.e.a": address },
259
- ],
260
- "$and": [
261
- { "slp.valid": true },
262
- ]
263
- },
264
- },
265
- "sort": { "blk.i": 1 },
266
- "limit": limit,
267
- "skip": skip,
268
- },
269
- "r": {
270
- "f": "[ .[] | { tx_hash: .tx.h, height: .blk.i, details: . } ]"
271
- }
272
- };
273
- if (tokenId) {
274
- q["q"]["find"]["$query"]["$and"].push({ "slp.detail.tokenIdHex": tokenId });
275
- }
276
- // console.log(JSON.stringify(q, null, 2));
277
- return q;
278
- };
279
- // prettier-ignore
280
- export const SlpWaitForTransactionTemplate = (slpaddr, tokenId) => {
281
- let q = {
282
- "v": 3,
283
- "q": {
284
- "db": ["c", "u"],
285
- "find": {}
286
- }
287
- };
288
- if (slpaddr) {
289
- q["q"]["find"]["$or"] = [
290
- {
291
- "in.e.a": slpaddr
292
- },
293
- {
294
- "out.e.a": slpaddr
295
- }
296
- ];
297
- }
298
- if (tokenId) {
299
- q["q"]["find"]["slp.detail.tokenIdHex"] = tokenId;
300
- }
301
- return q;
302
- };
303
- // Lookup SLP token information
304
- // prettier-ignore
305
- export const SlpTokenInfoTemplate = (tokenId, limit = 100, skip = 0) => {
306
- let q = {
307
- "v": 3,
308
- "q": {
309
- "db": ["t"],
310
- "find": {},
311
- "sort": {
312
- "tokenStats.approx_txns_since_genesis": -1
313
- },
314
- "limit": limit,
315
- "skip": skip,
316
- },
317
- "r": {
318
- "f": "[ .[] | { ticker: .tokenDetails.symbol, name: .tokenDetails.name, tokenId: .tokenDetails.tokenIdHex, decimals: .tokenDetails.decimals, documentUrl: .tokenDetails.documentUri, documentHash: .tokenDetails.documentSha256Hex, initialAmount: .tokenDetails.genesisOrMintQuantity, type: .tokenDetails.versionType, parentTokenId: .nftParentId } ]"
319
- }
320
- };
321
- if (tokenId) {
322
- q["q"]["find"]["tokenDetails.tokenIdHex"] = tokenId;
323
- }
324
- // console.log(q);
325
- return q;
326
- };
327
- // Slp Utxos for bch operation, to prevent accident burning of tokens and baton
328
- // prettier-ignore
329
- export const SlpBatonUtxosTemplate = (slpaddr, tokenId) => {
330
- let q = {
331
- "v": 3,
332
- "q": {
333
- "db": ["g"],
334
- "aggregate": [
335
- {
336
- "$match": {
337
- "graphTxn.outputs.address": slpaddr,
338
- "graphTxn.outputs.status": "BATON_UNSPENT"
339
- }
340
- },
341
- {
342
- "$unwind": "$graphTxn.outputs"
343
- },
344
- {
345
- "$match": {
346
- "graphTxn.outputs.address": slpaddr,
347
- "graphTxn.outputs.status": "BATON_UNSPENT"
348
- }
349
- },
350
- {
351
- "$project": {
352
- "graphTxn": 1
353
- }
354
- },
355
- {
356
- "$lookup": {
357
- "from": "tokens",
358
- "localField": "graphTxn.details.tokenIdHex",
359
- "foreignField": "tokenDetails.tokenIdHex",
360
- "as": "token"
361
- }
362
- }
363
- ]
364
- },
365
- "r": {
366
- "f": "[ .[] | { txid: .graphTxn.txid, vout: .graphTxn.outputs.vout, satoshis: .graphTxn.outputs.bchSatoshis, value: .graphTxn.outputs.slpAmount, decimals: .token[0].tokenDetails.decimals, ticker: .token[0].tokenDetails.symbol, tokenId: .graphTxn.details.tokenIdHex, type: .graphTxn.details.versionType } ]"
367
- }
368
- };
369
- if (tokenId) {
370
- q["q"]["aggregate"][0]["$match"]["graphTxn.details.tokenIdHex"] = tokenId;
371
- }
372
- // console.log(JSON.stringify(q, null, 2));
373
- return q;
374
- };
375
- //# sourceMappingURL=SlpDbTemplates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlpDbTemplates.js","sourceRoot":"","sources":["../../../src/slp/SlpDbTemplates.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,kBAAkB;AAClB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC;IACrD,GAAG,EAAE,CAAC;IACN,GAAG,EAAE;QACD,IAAI,EAAE,CAAC,GAAG,CAAC;QACX,WAAW,EAAE;YACT;gBACI,QAAQ,EAAE;oBACN,0BAA0B,EAAE,OAAO;oBACnC,yBAAyB,EAAE;wBAC3B,KAAK,EAAE;4BACH,SAAS;4BACT,eAAe;yBACd;qBACJ;iBACJ;aACJ;YACD;gBACI,SAAS,EAAE,mBAAmB;aACjC;YACD;gBACI,QAAQ,EAAE;oBACN,0BAA0B,EAAE,OAAO;oBACnC,yBAAyB,EAAE;wBACvB,KAAK,EAAE;4BACH,SAAS;4BACT,eAAe;yBACd;qBACJ;iBACR;aACJ;SACJ;QACD,OAAO,EAAE,GAAG;KACf;IACD,GAAG,EAAE;QACH,GAAG,EAAE,+UAA+U;KACrV;CACJ,CAAC,CAAC;AAEH,mFAAmF;AACnF,kBAAkB;AAClB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,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AAE,6SAA6S;SACnT;KACF,CAAA;IAED,IAAI,OAAO,EAAE;QACV,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,CAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,6BAA6B,CAAC,GAAG,OAAO,CAAC;KACvF;IAED,2CAA2C;IAC3C,OAAO,CAAC,CAAC;AACX,CAAC,CAAA"}
@@ -1,210 +0,0 @@
1
- import { Output } from "@bitauth/libauth";
2
- import { SendRequest } from "../wallet/model.js";
3
- import { SlpGenesisOptions, SlpMintOptions, SlpSendRequest, SlpUtxoI } from "../slp/interface.js";
4
- export declare const bigIntToBinUint64BE: (value: any) => Uint8Array;
5
- export declare const SlpGetGenesisOutputs: (options: SlpGenesisOptions) => Promise<{
6
- SlpOutputs: Output<Uint8Array, Uint8Array>[];
7
- FundingSlpUtxos: never[];
8
- BchSendRequests: SendRequest[];
9
- }>;
10
- export declare const SlpGetMintOutputs: (options: SlpMintOptions, slpBatonUtxos: SlpUtxoI[]) => Promise<{
11
- SlpOutputs: Output<Uint8Array, Uint8Array>[];
12
- FundingSlpUtxos: SlpUtxoI[];
13
- BchSendRequests: SendRequest[];
14
- }>;
15
- export declare const SlpGetSendOutputs: (changeSlpaddr: string, slpUtxos: SlpUtxoI[], sendRequests: SlpSendRequest[]) => Promise<{
16
- SlpOutputs: Output<Uint8Array, Uint8Array>[];
17
- FundingSlpUtxos: SlpUtxoI[];
18
- BchSendRequests: SendRequest[];
19
- }>;
20
- export declare const SlpTxoTemplate: {
21
- $schema: string;
22
- description: string;
23
- name: string;
24
- entities: {
25
- genesis_variables: {
26
- description: string;
27
- name: string;
28
- scripts: string[];
29
- variables: {
30
- g_token_type: {
31
- description: string;
32
- name: string;
33
- type: string;
34
- };
35
- g_token_ticker: {
36
- description: string;
37
- name: string;
38
- type: string;
39
- };
40
- g_token_name: {
41
- description: string;
42
- name: string;
43
- type: string;
44
- };
45
- g_token_document_url: {
46
- description: string;
47
- name: string;
48
- type: string;
49
- };
50
- g_token_document_hash: {
51
- description: string;
52
- name: string;
53
- type: string;
54
- };
55
- g_decimals: {
56
- description: string;
57
- name: string;
58
- type: string;
59
- };
60
- g_mint_baton_vout: {
61
- description: string;
62
- name: string;
63
- type: string;
64
- };
65
- g_initial_token_mint_quantity: {
66
- description: string;
67
- name: string;
68
- type: string;
69
- };
70
- };
71
- };
72
- send_variables: {
73
- description: string;
74
- name: string;
75
- scripts: string[];
76
- variables: {
77
- s_token_type: {
78
- description: string;
79
- name: string;
80
- type: string;
81
- };
82
- s_token_id: {
83
- description: string;
84
- name: string;
85
- type: string;
86
- };
87
- s_token_output_quantities: {
88
- description: string;
89
- name: string;
90
- type: string;
91
- };
92
- };
93
- };
94
- mint_variables: {
95
- description: string;
96
- name: string;
97
- scripts: string[];
98
- variables: {
99
- m_token_type: {
100
- description: string;
101
- name: string;
102
- type: string;
103
- };
104
- m_token_id: {
105
- description: string;
106
- name: string;
107
- type: string;
108
- };
109
- m_mint_baton_vout: {
110
- description: string;
111
- name: string;
112
- type: string;
113
- };
114
- m_additional_token_quantity: {
115
- description: string;
116
- name: string;
117
- type: string;
118
- };
119
- };
120
- };
121
- };
122
- scenarios: {
123
- genesis: {
124
- data: {
125
- bytecode: {
126
- g_token_type: string;
127
- g_token_ticker: string;
128
- g_token_name: string;
129
- g_token_document_url: string;
130
- g_token_document_hash: string;
131
- g_decimals: string;
132
- g_mint_baton_vout: string;
133
- g_initial_token_mint_quantity: string;
134
- };
135
- };
136
- description: string;
137
- name: string;
138
- transaction: {
139
- locktime: number;
140
- };
141
- };
142
- send: {
143
- data: {
144
- bytecode: {
145
- s_token_type: string;
146
- s_token_id: string;
147
- s_token_output_quantities: string;
148
- };
149
- };
150
- description: string;
151
- name: string;
152
- transaction: {
153
- locktime: number;
154
- };
155
- };
156
- mint: {
157
- data: {
158
- bytecode: {
159
- m_token_type: string;
160
- m_token_id: string;
161
- m_mint_baton_vout: string;
162
- m_additional_token_quantity: string;
163
- };
164
- };
165
- description: string;
166
- name: string;
167
- transaction: {
168
- locktime: number;
169
- };
170
- };
171
- };
172
- scripts: {
173
- genesis_unlock: {
174
- fails: string[];
175
- name: string;
176
- script: string;
177
- unlocks: string;
178
- };
179
- send_unlock: {
180
- fails: string[];
181
- name: string;
182
- script: string;
183
- unlocks: string;
184
- };
185
- mint_unlock: {
186
- fails: string[];
187
- name: string;
188
- script: string;
189
- unlocks: string;
190
- };
191
- genesis_lock: {
192
- lockingType: string;
193
- name: string;
194
- script: string;
195
- };
196
- send_lock: {
197
- lockingType: string;
198
- name: string;
199
- script: string;
200
- };
201
- mint_lock: {
202
- lockingType: string;
203
- name: string;
204
- script: string;
205
- };
206
- };
207
- supported: string[];
208
- version: number;
209
- };
210
- //# sourceMappingURL=SlpLibAuth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlpLibAuth.d.ts","sourceRoot":"","sources":["../../../src/slp/SlpLibAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,MAAM,EAEP,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,cAAc,EAEd,QAAQ,EACT,MAAM,qBAAqB,CAAC;AAO7B,eAAO,MAAM,mBAAmB,4BAE/B,CAAC;AAiBF,eAAO,MAAM,oBAAoB,YAAmB,iBAAiB;;;;EAsFpE,CAAC;AAEF,eAAO,MAAM,iBAAiB,YACnB,cAAc,iBACR,QAAQ,EAAE;;;;EAsE1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,kBACb,MAAM,YACX,QAAQ,EAAE,gBACN,cAAc,EAAE;;;;EAiH/B,CAAC;AAGF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8M1B,CAAA"}