mainnet-js 1.1.34 → 2.0.1

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 (122) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/{mainnet-1.1.34.js → mainnet-2.0.1.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 +3 -1
  22. package/dist/module/wallet/Bcmr.d.ts.map +1 -1
  23. package/dist/module/wallet/Bcmr.js +4 -8
  24. package/dist/module/wallet/Bcmr.js.map +1 -1
  25. package/dist/module/wallet/Util.d.ts +2 -2
  26. package/dist/module/wallet/Util.js +2 -2
  27. package/dist/module/wallet/Wif.d.ts +0 -28
  28. package/dist/module/wallet/Wif.d.ts.map +1 -1
  29. package/dist/module/wallet/Wif.js +2 -109
  30. package/dist/module/wallet/Wif.js.map +1 -1
  31. package/dist/module/wallet/createWallet.d.ts +0 -12
  32. package/dist/module/wallet/createWallet.d.ts.map +1 -1
  33. package/dist/module/wallet/createWallet.js +0 -43
  34. package/dist/module/wallet/createWallet.js.map +1 -1
  35. package/dist/module/wallet/interface.d.ts +0 -2
  36. package/dist/module/wallet/interface.d.ts.map +1 -1
  37. package/dist/module/webhook/Webhook.d.ts +1 -6
  38. package/dist/module/webhook/Webhook.d.ts.map +1 -1
  39. package/dist/module/webhook/Webhook.js +0 -4
  40. package/dist/module/webhook/Webhook.js.map +1 -1
  41. package/dist/module/webhook/index.d.ts +0 -1
  42. package/dist/module/webhook/index.d.ts.map +1 -1
  43. package/dist/module/webhook/index.js +0 -1
  44. package/dist/module/webhook/index.js.map +1 -1
  45. package/dist/module/webhook/interface.d.ts +0 -1
  46. package/dist/module/webhook/interface.d.ts.map +1 -1
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +5 -10
  49. package/src/db/SqlProvider.test.ts +2 -18
  50. package/src/db/SqlProvider.ts +5 -26
  51. package/src/index.ts +3 -7
  52. package/src/transaction/Wif.ts +2 -19
  53. package/src/util/deriveCashaddr.test.ts +8 -0
  54. package/src/util/deriveCashaddr.ts +9 -0
  55. package/src/wallet/Base.ts +1 -1
  56. package/src/wallet/Bcmr.ts +4 -9
  57. package/src/wallet/Util.ts +2 -2
  58. package/src/wallet/Wif.test.ts +0 -23
  59. package/src/wallet/Wif.ts +2 -148
  60. package/src/wallet/createWallet.ts +0 -53
  61. package/src/wallet/interface.ts +0 -2
  62. package/src/webhook/Webhook.ts +4 -10
  63. package/src/webhook/index.ts +0 -1
  64. package/src/webhook/interface.ts +0 -1
  65. package/webpack.config.cjs +7 -7
  66. package/dist/module/slp/GsppProvider.d.ts +0 -55
  67. package/dist/module/slp/GsppProvider.d.ts.map +0 -1
  68. package/dist/module/slp/GsppProvider.js +0 -204
  69. package/dist/module/slp/GsppProvider.js.map +0 -1
  70. package/dist/module/slp/SlpDbProvider.d.ts +0 -52
  71. package/dist/module/slp/SlpDbProvider.d.ts.map +0 -1
  72. package/dist/module/slp/SlpDbProvider.js +0 -175
  73. package/dist/module/slp/SlpDbProvider.js.map +0 -1
  74. package/dist/module/slp/SlpDbTemplates.d.ts +0 -313
  75. package/dist/module/slp/SlpDbTemplates.d.ts.map +0 -1
  76. package/dist/module/slp/SlpDbTemplates.js +0 -375
  77. package/dist/module/slp/SlpDbTemplates.js.map +0 -1
  78. package/dist/module/slp/SlpLibAuth.d.ts +0 -210
  79. package/dist/module/slp/SlpLibAuth.d.ts.map +0 -1
  80. package/dist/module/slp/SlpLibAuth.js +0 -451
  81. package/dist/module/slp/SlpLibAuth.js.map +0 -1
  82. package/dist/module/slp/SlpProvider.d.ts +0 -24
  83. package/dist/module/slp/SlpProvider.d.ts.map +0 -1
  84. package/dist/module/slp/SlpProvider.js +0 -29
  85. package/dist/module/slp/SlpProvider.js.map +0 -1
  86. package/dist/module/slp/index.d.ts +0 -6
  87. package/dist/module/slp/index.d.ts.map +0 -1
  88. package/dist/module/slp/index.js +0 -5
  89. package/dist/module/slp/index.js.map +0 -1
  90. package/dist/module/slp/interface.d.ts +0 -114
  91. package/dist/module/slp/interface.d.ts.map +0 -1
  92. package/dist/module/slp/interface.js +0 -7
  93. package/dist/module/slp/interface.js.map +0 -1
  94. package/dist/module/util/bchaddr.d.ts +0 -2
  95. package/dist/module/util/bchaddr.d.ts.map +0 -1
  96. package/dist/module/util/bchaddr.js +0 -16
  97. package/dist/module/util/bchaddr.js.map +0 -1
  98. package/dist/module/wallet/Slp.d.ts +0 -431
  99. package/dist/module/wallet/Slp.d.ts.map +0 -1
  100. package/dist/module/wallet/Slp.js +0 -770
  101. package/dist/module/wallet/Slp.js.map +0 -1
  102. package/dist/module/webhook/WebhookSlp.d.ts +0 -15
  103. package/dist/module/webhook/WebhookSlp.d.ts.map +0 -1
  104. package/dist/module/webhook/WebhookSlp.js +0 -100
  105. package/dist/module/webhook/WebhookSlp.js.map +0 -1
  106. package/src/slp/GsppProvider.test.ts +0 -40
  107. package/src/slp/GsppProvider.ts +0 -329
  108. package/src/slp/SlpDbProvider.test.ts +0 -27
  109. package/src/slp/SlpDbProvider.ts +0 -291
  110. package/src/slp/SlpDbTemplates.ts +0 -400
  111. package/src/slp/SlpLibAuth.test.ts +0 -162
  112. package/src/slp/SlpLibAuth.ts +0 -532
  113. package/src/slp/SlpProvider.ts +0 -100
  114. package/src/slp/index.ts +0 -6
  115. package/src/slp/interface.ts +0 -128
  116. package/src/util/bchaddr.test.ts +0 -27
  117. package/src/util/bchaddr.ts +0 -27
  118. package/src/wallet/Slp.test.headless.js +0 -120
  119. package/src/wallet/Slp.test.ts +0 -1000
  120. package/src/wallet/Slp.ts +0 -1014
  121. package/src/webhook/WebhookSlp.test.ts +0 -288
  122. package/src/webhook/WebhookSlp.ts +0 -123
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/mainnet-cash/mainnet-js/issues"
10
10
  },
11
11
  "name": "mainnet-js",
12
- "version": "1.1.34",
12
+ "version": "2.0.1",
13
13
  "homepage": "https://mainnet.cash",
14
14
  "module": "dist/module/index.js",
15
15
  "browser": {
@@ -40,24 +40,19 @@
40
40
  "dependencies": {
41
41
  "@bitauth/libauth": "^2.0.0-alpha.8",
42
42
  "axios": "^0.21.1",
43
- "bchaddrjs-slp": "^0.2.12",
44
- "bignumber": "^1.1.0",
45
- "bignumber.js": "^9.0.1",
46
43
  "bip39": "^3.0.3",
47
44
  "buffer": "^6.0.3",
48
- "cashaddrjs": "^0.4.4",
49
45
  "electrum-cash": "^2.0.10",
50
46
  "events": "^3.2.0",
51
47
  "eventsource": "^1.0.7",
52
- "qrcode-svg": "1.1.0",
53
- "slp-parser": "^0.0.4"
48
+ "qrcode-svg": "1.1.0"
54
49
  },
55
50
  "devDependencies": {
56
- "fake-indexeddb": "^3.1.2"
51
+ "fake-indexeddb": "^3.1.2",
52
+ "@types/pg": "8.6.0",
53
+ "@types/pg-format": "^1.0.1"
57
54
  },
58
55
  "optionalDependencies": {
59
- "@types/pg": "8.6.0",
60
- "@types/pg-format": "^1.0.1",
61
56
  "dexie": "3.2.2",
62
57
  "dotenv": "^10.0.0",
63
58
  "node-postgres": "^0.6.2",
@@ -103,21 +103,6 @@ test("Should handle basic sql injection", async () => {
103
103
  sh.close();
104
104
  });
105
105
 
106
- test("Should fail registering SLP webhook without tokenId", async () => {
107
- let db = new SqlProvider(`regtest ${Math.random()}`);
108
- await db.init();
109
- await expect(
110
- db.addWebhook({
111
- cashaddr: "",
112
- url: "https://example.com/fail",
113
- type: WebhookType.slpTransactionIn,
114
- recurrence: WebhookRecurrence.recurrent,
115
- })
116
- ).rejects.toThrow();
117
-
118
- db.close();
119
- });
120
-
121
106
  test("Test wallet database name regression", async () => {
122
107
  const name = `test ${Math.random()}`;
123
108
 
@@ -279,14 +264,13 @@ test("Should not have ssl property when unconfigured", async () => {
279
264
  test("Store and retrieve faucet queue items", async () => {
280
265
  let db = new SqlProvider(`testnet ${Math.random()}`);
281
266
  await db.init();
282
- await db.addFaucetQueueItem("0x00", "", "0x0a");
283
- await db.addFaucetQueueItem("0x01", "", "0x0b");
267
+ await db.addFaucetQueueItem("0x00", "0x0a");
268
+ await db.addFaucetQueueItem("0x01", "0x0b");
284
269
 
285
270
  await db.beginTransaction();
286
271
  const items = await db.getFaucetQueue();
287
272
  expect(items.length).toBe(2);
288
273
  expect(items[0].address).toBe("0x00");
289
- expect(items[0].token).toBe("");
290
274
  expect(items[0].value).toBe("0x0a");
291
275
  await db.deleteFaucetQueueItems(items);
292
276
  await db.commitTransaction();
@@ -3,7 +3,6 @@ import { sslConfigI, WalletI, FaucetQueueItemI } from "./interface.js";
3
3
  import { TxI } from "../interface.js";
4
4
  import { Webhook, WebhookRecurrence, WebhookType } from "../webhook/Webhook.js";
5
5
  import { RegisterWebhookParams } from "../webhook/interface.js";
6
- import { isCashAddress } from "../util/bchaddr.js";
7
6
  import { getSslConfig } from "./util.js";
8
7
  import parseDbUrl from "parse-database-url";
9
8
  import pg from "pg";
@@ -64,7 +63,6 @@ export default class SqlProvider implements StorageProvider {
64
63
  "status TEXT," +
65
64
  "tx_seen JSON," +
66
65
  "last_height INTEGER," +
67
- "token_id TEXT," +
68
66
  "expires_at TIMESTAMPTZ" +
69
67
  ");",
70
68
  this.webhookTable
@@ -75,7 +73,6 @@ export default class SqlProvider implements StorageProvider {
75
73
  "CREATE TABLE IF NOT EXISTS %I (" +
76
74
  "id SERIAL PRIMARY KEY," +
77
75
  "address TEXT," +
78
- "token TEXT," +
79
76
  "value TEXT" +
80
77
  ");",
81
78
  this.faucetQueueTable
@@ -144,19 +141,8 @@ export default class SqlProvider implements StorageProvider {
144
141
  }
145
142
 
146
143
  public async webhookFromDb(hook: Webhook) {
147
- // map tokenId field from postgres
148
- hook.tokenId = (hook as any).token_id;
149
- delete (hook as any).token_id;
150
-
151
- if (hook.type.indexOf("slp") === 0) {
152
- const { WebhookSlp } = await import("../webhook/WebhookSlp.js");
153
- return new WebhookSlp(hook);
154
- } else if (isCashAddress(hook.cashaddr)) {
155
- const { WebhookBch } = await import("../webhook/WebhookBch.js");
156
- return new WebhookBch(hook);
157
- }
158
-
159
- throw new Error(`Unsupported or incorrect hook address ${hook.cashaddr}`);
144
+ const { WebhookBch } = await import("../webhook/WebhookBch.js");
145
+ return new WebhookBch(hook);
160
146
  }
161
147
 
162
148
  public async addWebhook(params: RegisterWebhookParams): Promise<Webhook> {
@@ -170,17 +156,12 @@ export default class SqlProvider implements StorageProvider {
170
156
  params.duration_sec = params.duration_sec || expireTimeout;
171
157
  params.duration_sec =
172
158
  params.duration_sec > expireTimeout ? expireTimeout : params.duration_sec;
173
- params.tokenId = params.tokenId || "";
174
-
175
- if (params.type.indexOf("slp") === 0 && !params.tokenId) {
176
- throw new Error("'tokenId' parameter is required for SLP webhooks");
177
- }
178
159
 
179
160
  const expires_at = new Date(
180
161
  new Date().getTime() + params.duration_sec * 1000
181
162
  );
182
163
  let text = this.formatter(
183
- "INSERT into %I (cashaddr,type,recurrence,url,status,tx_seen,last_height,token_id,expires_at) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING *;",
164
+ "INSERT into %I (cashaddr,type,recurrence,url,status,tx_seen,last_height,expires_at) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *;",
184
165
  this.webhookTable
185
166
  );
186
167
 
@@ -192,7 +173,6 @@ export default class SqlProvider implements StorageProvider {
192
173
  "",
193
174
  "[]",
194
175
  0,
195
- params.tokenId,
196
176
  expires_at.toISOString(),
197
177
  ]);
198
178
  const hook = await this.webhookFromDb(result.rows[0]);
@@ -266,14 +246,13 @@ export default class SqlProvider implements StorageProvider {
266
246
 
267
247
  public async addFaucetQueueItem(
268
248
  address: string,
269
- tokenId: string,
270
249
  value: string
271
250
  ): Promise<boolean> {
272
251
  let text = this.formatter(
273
- "INSERT into %I (address,token,value) VALUES ($1, $2, $3);",
252
+ "INSERT into %I (address,value) VALUES ($1, $2);",
274
253
  this.faucetQueueTable
275
254
  );
276
- return await this.db.query(text, [address, tokenId, value]);
255
+ return await this.db.query(text, [address, value]);
277
256
  }
278
257
 
279
258
  public async getFaucetQueue(): Promise<Array<FaucetQueueItemI>> {
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export * from "./db/index.js";
2
2
  export * from "./mine/index.js";
3
- export * from "./slp/index.js";
4
3
  export * from "./test/expect.js";
5
4
  export * from "./test/axios.js";
6
5
  export * from "./webhook/index.js";
@@ -50,9 +49,6 @@ export {
50
49
  } from "./message/interface.js";
51
50
  export { WalletRequestI, WalletResponseI } from "./wallet/interface.js";
52
51
 
53
- // TODO move this up to util (Mainnet) ?
54
- export * from "./util/bchaddr.js";
55
-
56
- export function cube(x: number) {
57
- return x * x * x;
58
- }
52
+ // export function cube(x: number) {
53
+ // return x * x * x;
54
+ // }
@@ -39,7 +39,6 @@ export async function buildP2pkhNonHdTransaction({
39
39
  sourceAddress,
40
40
  fee = 0,
41
41
  discardChange = false,
42
- slpOutputs = [],
43
42
  feePaidBy = FeePaidByEnum.change,
44
43
  changeAddress = "",
45
44
  }: {
@@ -49,7 +48,6 @@ export async function buildP2pkhNonHdTransaction({
49
48
  sourceAddress: string;
50
49
  fee?: number;
51
50
  discardChange?: boolean;
52
- slpOutputs?: Output[];
53
51
  feePaidBy?: FeePaidByEnum;
54
52
  changeAddress?: string;
55
53
  }) {
@@ -101,7 +99,7 @@ export async function buildP2pkhNonHdTransaction({
101
99
  const result = generateTransaction({
102
100
  inputs: preparedInputs,
103
101
  locktime: 0,
104
- outputs: [...slpOutputs, ...lockedOutputs],
102
+ outputs: lockedOutputs,
105
103
  version: 2,
106
104
  });
107
105
 
@@ -429,7 +427,6 @@ export async function getFeeAmountSimple({
429
427
  utxos,
430
428
  sendRequests,
431
429
  relayFeePerByteInSatoshi,
432
- slpOutputs,
433
430
  discardChange,
434
431
  }: {
435
432
  utxos: UtxoI[];
@@ -437,7 +434,6 @@ export async function getFeeAmountSimple({
437
434
  privateKey: Uint8Array;
438
435
  sourceAddress: string;
439
436
  relayFeePerByteInSatoshi: number;
440
- slpOutputs: Output[];
441
437
  feePaidBy: FeePaidByEnum;
442
438
  discardChange?: boolean;
443
439
  }) {
@@ -479,15 +475,8 @@ export async function getFeeAmountSimple({
479
475
  const outputTotalSize =
480
476
  sendRequests.reduce((prev, curr) => prev + outputSize(curr), 0) +
481
477
  (discardChange ? 0 : outputSizeP2pkh);
482
- const slpTotalSize = slpOutputs.reduce(
483
- (prev, curr) => prev + curr.lockingBytecode.length,
484
- 0
485
- );
486
478
 
487
- return (
488
- (inputTotalSize + outputTotalSize + slpTotalSize + 16) *
489
- relayFeePerByteInSatoshi
490
- );
479
+ return (inputTotalSize + outputTotalSize + 16) * relayFeePerByteInSatoshi;
491
480
  }
492
481
 
493
482
  // precise fee estimation
@@ -497,7 +486,6 @@ export async function getFeeAmount({
497
486
  privateKey,
498
487
  sourceAddress,
499
488
  relayFeePerByteInSatoshi,
500
- slpOutputs,
501
489
  feePaidBy,
502
490
  discardChange,
503
491
  }: {
@@ -506,7 +494,6 @@ export async function getFeeAmount({
506
494
  privateKey: Uint8Array;
507
495
  sourceAddress: string;
508
496
  relayFeePerByteInSatoshi: number;
509
- slpOutputs: Output[];
510
497
  feePaidBy: FeePaidByEnum;
511
498
  discardChange?: boolean;
512
499
  }) {
@@ -521,7 +508,6 @@ export async function getFeeAmount({
521
508
  sourceAddress,
522
509
  fee: 0, //DUST_UTXO_THRESHOLD
523
510
  discardChange: discardChange ?? false,
524
- slpOutputs,
525
511
  feePaidBy,
526
512
  changeAddress: "",
527
513
  });
@@ -542,7 +528,6 @@ export async function buildEncodedTransaction({
542
528
  sourceAddress,
543
529
  fee = 0,
544
530
  discardChange = false,
545
- slpOutputs = [],
546
531
  feePaidBy = FeePaidByEnum.change,
547
532
  changeAddress = "",
548
533
  buildUnsigned = false,
@@ -553,7 +538,6 @@ export async function buildEncodedTransaction({
553
538
  sourceAddress: string;
554
539
  fee?: number;
555
540
  discardChange?: boolean;
556
- slpOutputs?: Output[];
557
541
  feePaidBy?: FeePaidByEnum;
558
542
  changeAddress?: string;
559
543
  buildUnsigned?: boolean;
@@ -565,7 +549,6 @@ export async function buildEncodedTransaction({
565
549
  sourceAddress,
566
550
  fee,
567
551
  discardChange,
568
- slpOutputs,
569
552
  feePaidBy,
570
553
  changeAddress,
571
554
  });
@@ -3,6 +3,7 @@ import {
3
3
  deriveCashaddr,
4
4
  deriveTokenaddr,
5
5
  isTokenaddr,
6
+ isValidAddress,
6
7
  toCashaddr,
7
8
  toTokenaddr,
8
9
  } from "./deriveCashaddr";
@@ -41,3 +42,10 @@ test("Test address conversion", async () => {
41
42
  expect(isTokenaddr(wallet.cashaddr!)).toBe(false);
42
43
  expect(isTokenaddr(wallet.tokenaddr!)).toBe(true);
43
44
  });
45
+
46
+ test("Test isValidAddress", async () => {
47
+ const wallet = await RegTestWallet.watchOnly(process.env.ADDRESS!);
48
+ expect(isValidAddress(wallet.cashaddr!)).toBe(true);
49
+ expect(isValidAddress(wallet.tokenaddr!)).toBe(true);
50
+ expect(isValidAddress("asdf")).toBe(false);
51
+ });
@@ -13,6 +13,15 @@ import {
13
13
 
14
14
  import { hash160 } from "./hash160.js";
15
15
 
16
+ export function isValidAddress(cashaddr: string): boolean {
17
+ const result = decodeCashAddress(cashaddr);
18
+ if (typeof result === "string") {
19
+ return false;
20
+ }
21
+
22
+ return true;
23
+ }
24
+
16
25
  export function deriveCashaddr(
17
26
  privateKey: Uint8Array,
18
27
  networkPrefix: CashAddressNetworkPrefix
@@ -153,7 +153,7 @@ export class BaseWallet implements WalletI {
153
153
  * such kind of wallet does not have a private key and is unable to spend any funds
154
154
  * however it still allows to use many utility functions such as getting and watching balance, etc.
155
155
  *
156
- * @param address cashaddress, token aware cashaddress or slpaddress of a wallet
156
+ * @param address cashaddress, token aware cashaddress of a wallet
157
157
  *
158
158
  * @returns instantiated wallet
159
159
  */
@@ -402,7 +402,9 @@ export class BCMR {
402
402
  *
403
403
  * @param {string} options.chaingraphUrl (required) URL of a chaingraph indexer instance to fetch info from
404
404
  * @param {string} options.transactionHash (required) transaction hash from which to build the auth chain
405
- * @param {string?} options.network (default=mainnet) network to query the data from, specific to the queried instance, can be mainnet, chipnet, or anything else
405
+ * @param {string?} options.network (default=undefined) network to query the data from, specific to the queried instance,
406
+ * can be 'mainnet', 'chipnet', or anything else.
407
+ * if left undefined all chaingraph transactions will be looked at, disregarding the chain
406
408
  *
407
409
  * @returns {AuthChain} returns the resolved authchain
408
410
  */
@@ -415,10 +417,6 @@ export class BCMR {
415
417
  throw new Error("Provide `chaingraphUrl` param.");
416
418
  }
417
419
 
418
- if (options.network === undefined) {
419
- options.network = "mainnet";
420
- }
421
-
422
420
  const response = await axios.post(
423
421
  options.chaingraphUrl,
424
422
  {
@@ -429,10 +427,7 @@ export class BCMR {
429
427
  transaction(
430
428
  where: {
431
429
  hash:{_eq:"\\\\x${options.transactionHash}"},
432
- _or: [
433
- {node_validation_timeline:{node:{name:{_ilike:"%${options.network}%"}}}},
434
- {block_inclusions:{block:{accepted_by:{node:{name:{_ilike:"%${options.network}%"}}}}}},
435
- ]
430
+ ${options.network ? `node_validation_timeline:{node:{name:{_ilike:"%${options.network}%"}}}` : ""}
436
431
  }
437
432
  ) {
438
433
  hash
@@ -166,7 +166,7 @@ export class Util {
166
166
 
167
167
  //#region Specific wallet classes
168
168
  /**
169
- * Class to manage an slp enabled testnet wallet.
169
+ * Class to manage a testnet wallet.
170
170
  */
171
171
  export class TestNetUtil extends Util {
172
172
  static get walletType() {
@@ -175,7 +175,7 @@ export class TestNetUtil extends Util {
175
175
  }
176
176
 
177
177
  /**
178
- * Class to manage an slp enabled regtest wallet.
178
+ * Class to manage a regtest wallet.
179
179
  */
180
180
  export class RegTestUtil extends Util {
181
181
  static get walletType() {
@@ -887,29 +887,6 @@ describe(`Wallet subscriptions`, () => {
887
887
  delay(3000);
888
888
  expect(response.balance!.sat!).toBe(0);
889
889
  });
890
-
891
- test.skip("Should get testnet slp tokens and send them back", async () => {
892
- let aliceWif = `${process.env.ALICE_TESTNET_WALLET_ID!}`;
893
- let aliceWallet = await TestNetWallet.fromId(aliceWif);
894
-
895
- const wallet = (await TestNetWallet.newRandom()) as TestNetWallet;
896
-
897
- // send bob some bch gas to enable him to send slp
898
- await aliceWallet
899
- .slpAware()
900
- .send([{ cashaddr: wallet.cashaddr!, value: 5000, unit: "sat" }]);
901
-
902
- const txid = await wallet.getTestnetSlp("MNC");
903
- expect(txid.length).toBe(64);
904
- let balance = await wallet.slp.getBalance("MNC");
905
- expect(balance[0].value.toNumber()).toBe(10);
906
-
907
- const tokenId = balance[0].tokenId;
908
- const response = await wallet.returnTestnetSlp(tokenId);
909
- expect(response.balance).toBe(0);
910
-
911
- await wallet.slpAware(false).sendMax(aliceWallet.cashaddr!);
912
- });
913
890
  });
914
891
 
915
892
  describe(`Wallet extrema behavior regression testing`, () => {