@gobob/bob-sdk 3.1.3 → 3.1.4

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.
package/dist/runes.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as bitcoin from 'bitcoinjs-lib';
2
2
  import { EsploraClient } from './esplora';
3
- import { Runestone } from 'runestone-js';
4
- export declare function parseRunestone(tx: bitcoin.Transaction): Runestone | undefined;
5
- export declare function getTxRunestone(esploraClient: EsploraClient, txid: string): Promise<Runestone>;
3
+ import { Cenotaph, RunestoneSpec } from '@magiceden-oss/runestone-lib';
4
+ export declare function parseRunestone(tx: bitcoin.Transaction): RunestoneSpec | Cenotaph | null;
5
+ export declare function getTxRunestone(esploraClient: EsploraClient, txid: string): Promise<RunestoneSpec | Cenotaph>;
package/dist/runes.js CHANGED
@@ -26,14 +26,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.parseRunestone = parseRunestone;
27
27
  exports.getTxRunestone = getTxRunestone;
28
28
  const bitcoin = __importStar(require("bitcoinjs-lib"));
29
- const runestone_js_1 = require("runestone-js");
29
+ const runestone_lib_1 = require("@magiceden-oss/runestone-lib");
30
30
  function parseRunestone(tx) {
31
- for (const out of tx.outs) {
32
- if (out.script[0] === bitcoin.opcodes.OP_RETURN && out.script[1] === bitcoin.opcodes.OP_13) {
33
- const pureOutputBuffer = out.script.subarray(3);
34
- return runestone_js_1.Runestone.dechiper(pureOutputBuffer);
35
- }
36
- }
31
+ const rune = (0, runestone_lib_1.tryDecodeRunestone)({
32
+ vout: tx.outs.map((out) => ({
33
+ scriptPubKey: {
34
+ hex: out.script.toString('hex'),
35
+ },
36
+ })),
37
+ });
38
+ return rune;
37
39
  }
38
40
  async function getTxRunestone(esploraClient, txid) {
39
41
  const txHex = await esploraClient.getTransactionHex(txid);
package/dist/runes.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"runes.js","sourceRoot":"","sources":["../src/runes.ts"],"names":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N,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AAChB,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,aAA4B,EAAE,IAAY;IAC3E,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,cAAc,CAAC,EAAE,CAAC,CAAC;AAC9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobob/bob-sdk",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -39,11 +39,11 @@
39
39
  "yargs": "^17.5.1"
40
40
  },
41
41
  "dependencies": {
42
+ "@magiceden-oss/runestone-lib": "^1.0.2",
42
43
  "@scure/base": "^1.1.7",
43
44
  "@scure/btc-signer": "^1.3.2",
44
45
  "bitcoin-address-validation": "^2.2.3",
45
46
  "bitcoinjs-lib": "^6.1.6",
46
- "ethers": "^6.13.2",
47
- "runestone-js": "0.3.0"
47
+ "ethers": "^6.13.2"
48
48
  }
49
49
  }