@gobob/bob-sdk 1.2.0 → 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 (62) hide show
  1. package/README.md +50 -4
  2. package/dist/{electrs.d.ts → esplora.d.ts} +2 -2
  3. package/dist/{electrs.js → esplora.js} +6 -6
  4. package/dist/{electrs.js.map → esplora.js.map} +1 -1
  5. package/dist/gateway/client.d.ts +45 -0
  6. package/dist/gateway/client.js +127 -0
  7. package/dist/gateway/client.js.map +1 -0
  8. package/dist/gateway/index.d.ts +2 -0
  9. package/dist/gateway/index.js +6 -0
  10. package/dist/gateway/index.js.map +1 -0
  11. package/dist/gateway/tokens.d.ts +12 -0
  12. package/dist/gateway/tokens.js +64 -0
  13. package/dist/gateway/tokens.js.map +1 -0
  14. package/dist/gateway/types.d.ts +17 -0
  15. package/dist/gateway/types.js +3 -0
  16. package/dist/gateway/types.js.map +1 -0
  17. package/dist/helpers.d.ts +2 -2
  18. package/dist/helpers.js +6 -7
  19. package/dist/helpers.js.map +1 -1
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.js +3 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/inscription.d.ts +3 -4
  24. package/dist/inscription.js +11 -11
  25. package/dist/inscription.js.map +1 -1
  26. package/dist/ordinal-api/index.d.ts +10 -1
  27. package/dist/ordinal-api/index.js +1 -0
  28. package/dist/ordinal-api/index.js.map +1 -1
  29. package/dist/ordinals/commit.d.ts +0 -1
  30. package/dist/ordinals/commit.js +1 -2
  31. package/dist/ordinals/commit.js.map +1 -1
  32. package/dist/ordinals/index.js +1 -2
  33. package/dist/ordinals/index.js.map +1 -1
  34. package/dist/ordinals/reveal.d.ts +0 -1
  35. package/dist/ordinals/reveal.js +3 -3
  36. package/dist/ordinals/reveal.js.map +1 -1
  37. package/dist/ordinals/signer.d.ts +0 -1
  38. package/dist/relay.d.ts +4 -4
  39. package/dist/relay.js +11 -12
  40. package/dist/relay.js.map +1 -1
  41. package/dist/scripts/relay-genesis.d.ts +1 -0
  42. package/dist/scripts/relay-genesis.js +120 -0
  43. package/dist/scripts/relay-genesis.js.map +1 -0
  44. package/dist/scripts/relay-retarget.d.ts +1 -0
  45. package/dist/scripts/relay-retarget.js +115 -0
  46. package/dist/scripts/relay-retarget.js.map +1 -0
  47. package/dist/utils.d.ts +1 -1
  48. package/dist/utils.js +42 -5
  49. package/dist/utils.js.map +1 -1
  50. package/dist/wallet/address.d.ts +2 -0
  51. package/dist/wallet/address.js +19 -0
  52. package/dist/wallet/address.js.map +1 -0
  53. package/dist/wallet/index.d.ts +2 -0
  54. package/dist/wallet/index.js +19 -0
  55. package/dist/wallet/index.js.map +1 -0
  56. package/dist/wallet/inscriptions.d.ts +4 -0
  57. package/dist/wallet/inscriptions.js +43 -0
  58. package/dist/wallet/inscriptions.js.map +1 -0
  59. package/dist/wallet/utxo.d.ts +23 -0
  60. package/dist/wallet/utxo.js +91 -0
  61. package/dist/wallet/utxo.js.map +1 -0
  62. package/package.json +13 -9
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidBtcAddress = void 0;
4
+ const BTC_MAINNET_REGEX = /\b([13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[ac-hj-np-zAC-HJ-NP-Z02-9]{11,71})\b/;
5
+ const BTC_TESTNET_REGEX = /\b([2mn][a-km-zA-HJ-NP-Z1-9]{25,34}|tb1[ac-hj-np-zAC-HJ-NP-Z02-9]{11,71})\b/;
6
+ const mainnetRegex = new RegExp(BTC_MAINNET_REGEX);
7
+ const testnetRegex = new RegExp(BTC_TESTNET_REGEX);
8
+ const isValidBtcAddress = (network, address) => {
9
+ switch (network) {
10
+ case 'mainnet':
11
+ return mainnetRegex.test(address);
12
+ case 'testnet':
13
+ return testnetRegex.test(address);
14
+ default:
15
+ throw new Error(`Invalid bitcoin network configured: ${network}. Valid values are: mainnet | testnet.`);
16
+ }
17
+ };
18
+ exports.isValidBtcAddress = isValidBtcAddress;
19
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/wallet/address.ts"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,GAAG,4EAA4E,CAAC;AACvG,MAAM,iBAAiB,GAAG,6EAA6E,CAAC;AAExG,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACnD,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAE5C,MAAM,iBAAiB,GAAG,CAAC,OAA2B,EAAE,OAAe,EAAW,EAAE;IACzF,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,SAAS;YACZ,OAAO,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,KAAK,SAAS;YACZ,OAAO,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC;YACE,MAAM,IAAI,KAAK,CAAC,uCAAuC,OAAO,wCAAwC,CAAC,CAAC;IAC5G,CAAC;AACH,CAAC,CAAC;AATW,QAAA,iBAAiB,qBAS5B"}
@@ -0,0 +1,2 @@
1
+ export * from "./address";
2
+ export * from "./utxo";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./address"), exports);
18
+ __exportStar(require("./utxo"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wallet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,yCAAuB"}
@@ -0,0 +1,4 @@
1
+ import { EsploraClient, UTXO } from "../esplora";
2
+ import { OrdinalsClient } from "../ordinal-api";
3
+ export declare function findUtxoForInscriptionId(esploraClient: EsploraClient, ordinalsClient: OrdinalsClient, utxos: UTXO[], inscriptionId: string): Promise<UTXO | undefined>;
4
+ export declare function findUtxosWithoutInscriptions(network: string, utxos: UTXO[]): Promise<UTXO[]>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findUtxoForInscriptionId = findUtxoForInscriptionId;
4
+ exports.findUtxosWithoutInscriptions = findUtxosWithoutInscriptions;
5
+ const inscription_1 = require("../inscription");
6
+ const ordinal_api_1 = require("../ordinal-api");
7
+ async function findUtxoForInscriptionId(esploraClient, ordinalsClient, utxos, inscriptionId) {
8
+ const { txid, index } = ordinal_api_1.InscriptionId.fromString(inscriptionId);
9
+ for (const utxo of utxos) {
10
+ if (utxo.confirmed) {
11
+ const inscriptionUtxo = await ordinalsClient.getInscriptionsFromOutPoint(utxo);
12
+ if (inscriptionUtxo.inscriptions && inscriptionUtxo.inscriptions.includes(inscriptionId)) {
13
+ return utxo;
14
+ }
15
+ }
16
+ else if (txid == utxo.txid) {
17
+ const inscriptions = await (0, inscription_1.getTxInscriptions)(esploraClient, utxo.txid);
18
+ if (typeof inscriptions[index] !== 'undefined') {
19
+ return utxo;
20
+ }
21
+ }
22
+ }
23
+ return undefined;
24
+ }
25
+ async function findUtxosWithoutInscriptions(network, utxos) {
26
+ const ordinalsClient = new ordinal_api_1.DefaultOrdinalsClient(network);
27
+ const safeUtxos = [];
28
+ await Promise.all([
29
+ utxos.map(async (utxo) => {
30
+ if (utxo.confirmed) {
31
+ const inscription = await ordinalsClient.getInscriptionsFromOutPoint({
32
+ txid: utxo.txid,
33
+ vout: utxo.vout
34
+ });
35
+ if (inscription.inscriptions.length === 0) {
36
+ safeUtxos.push(utxo);
37
+ }
38
+ }
39
+ })
40
+ ]);
41
+ return safeUtxos;
42
+ }
43
+ //# sourceMappingURL=inscriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inscriptions.js","sourceRoot":"","sources":["../../src/wallet/inscriptions.ts"],"names":[],"mappings":";;AAIA,4DA0BC;AAED,oEAsBC;AArDD,gDAAmD;AACnD,gDAAsF;AAE/E,KAAK,UAAU,wBAAwB,CAC1C,aAA4B,EAC5B,cAA8B,EAC9B,KAAa,EACb,aAAqB;IAIrB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,2BAAa,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAE/D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,MAAM,eAAe,GAAG,MAAM,cAAc,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAA;YAC9E,IAAI,eAAe,CAAC,YAAY,IAAI,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;gBACvF,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;aAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC3B,MAAM,YAAY,GAAG,MAAM,IAAA,+BAAiB,EAAC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAEvE,IAAI,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE,CAAC;gBAC7C,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAEM,KAAK,UAAU,4BAA4B,CAAC,OAAe,EAAE,KAAa;IAC7E,MAAM,cAAc,GAAG,IAAI,mCAAqB,CAAC,OAAO,CAAC,CAAC;IAE1D,MAAM,SAAS,GAAW,EAAE,CAAC;IAG7B,MAAM,OAAO,CAAC,GAAG,CAAC;QACd,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACrB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACjB,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,2BAA2B,CAAC;oBACjE,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,IAAI,EAAE,IAAI,CAAC,IAAI;iBAClB,CAAC,CAAC;gBAEH,IAAI,WAAW,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACxC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACzB,CAAC;YACL,CAAC;QACL,CAAC,CAAC;KACL,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Transaction } from '@scure/btc-signer';
2
+ import { AddressType } from 'bitcoin-address-validation';
3
+ import { UTXO } from '../esplora';
4
+ export type BitcoinNetworkName = 'mainnet' | 'testnet';
5
+ export declare const getBtcNetwork: (name: BitcoinNetworkName) => {
6
+ bech32: string;
7
+ pubKeyHash: number;
8
+ scriptHash: number;
9
+ wif: number;
10
+ };
11
+ export interface Input {
12
+ txid: string;
13
+ index: number;
14
+ witness_script?: Uint8Array;
15
+ redeemScript?: Uint8Array;
16
+ witnessUtxo?: {
17
+ script: Uint8Array;
18
+ amount: bigint;
19
+ };
20
+ nonWitnessUtxo?: Uint8Array;
21
+ }
22
+ export declare function createTransfer(network: BitcoinNetworkName, addressType: AddressType, fromAddress: string, toAddress: string, amount: number, publicKey?: string, opReturnData?: string, confirmationTarget?: number): Promise<Transaction>;
23
+ export declare function getInputFromUtxoAndTx(network: BitcoinNetworkName, utxo: UTXO, transaction: Transaction, addressType: AddressType, pubKey?: string): Input;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBtcNetwork = void 0;
4
+ exports.createTransfer = createTransfer;
5
+ exports.getInputFromUtxoAndTx = getInputFromUtxoAndTx;
6
+ const btc_signer_1 = require("@scure/btc-signer");
7
+ const base_1 = require("@scure/base");
8
+ const bitcoin_address_validation_1 = require("bitcoin-address-validation");
9
+ const esplora_1 = require("../esplora");
10
+ const bitcoinNetworks = {
11
+ mainnet: btc_signer_1.NETWORK,
12
+ testnet: btc_signer_1.TEST_NETWORK
13
+ };
14
+ const getBtcNetwork = (name) => {
15
+ return bitcoinNetworks[name];
16
+ };
17
+ exports.getBtcNetwork = getBtcNetwork;
18
+ async function createTransfer(network, addressType, fromAddress, toAddress, amount, publicKey, opReturnData, confirmationTarget = 3) {
19
+ const esploraClient = new esplora_1.DefaultEsploraClient(network);
20
+ const [confirmedUtxos, feeRate] = await Promise.all([
21
+ esploraClient.getAddressUtxos(fromAddress),
22
+ esploraClient.getFeeEstimate(confirmationTarget)
23
+ ]);
24
+ if (confirmedUtxos.length === 0) {
25
+ throw new Error('No confirmed UTXOs');
26
+ }
27
+ let possibleInputs = [];
28
+ await Promise.all(confirmedUtxos.map(async (utxo) => {
29
+ const hex = await esploraClient.getTransactionHex(utxo.txid);
30
+ const transaction = btc_signer_1.Transaction.fromRaw(Buffer.from(hex, 'hex'), { allowUnknownOutputs: true });
31
+ const input = getInputFromUtxoAndTx(network, utxo, transaction, addressType, publicKey);
32
+ possibleInputs.push(input);
33
+ }));
34
+ const outputs = [
35
+ {
36
+ address: toAddress,
37
+ amount: BigInt(amount)
38
+ }
39
+ ];
40
+ if (opReturnData) {
41
+ if (opReturnData.startsWith('0x')) {
42
+ opReturnData = opReturnData.slice(2);
43
+ }
44
+ outputs.push({
45
+ script: btc_signer_1.Script.encode(['RETURN', base_1.hex.decode(opReturnData)]),
46
+ amount: BigInt(0)
47
+ });
48
+ }
49
+ const transaction = (0, btc_signer_1.selectUTXO)(possibleInputs, outputs, 'default', {
50
+ changeAddress: fromAddress,
51
+ feePerByte: BigInt(Math.ceil(feeRate)),
52
+ bip69: true,
53
+ createTx: true,
54
+ network: (0, exports.getBtcNetwork)(network),
55
+ allowUnknownOutputs: true,
56
+ allowLegacyWitnessUtxo: true
57
+ });
58
+ if (!transaction || !transaction.tx) {
59
+ throw new Error('Failed to create transaction. Do you have enough funds?');
60
+ }
61
+ return transaction.tx;
62
+ }
63
+ function getInputFromUtxoAndTx(network, utxo, transaction, addressType, pubKey) {
64
+ const output = transaction.getOutput(utxo.vout);
65
+ let redeemScript = {};
66
+ if (addressType === bitcoin_address_validation_1.AddressType.p2sh) {
67
+ const inner = (0, btc_signer_1.p2wpkh)(Buffer.from(pubKey, 'hex'), (0, exports.getBtcNetwork)(network));
68
+ redeemScript = (0, btc_signer_1.p2sh)(inner);
69
+ }
70
+ const scriptMixin = {
71
+ ...redeemScript
72
+ };
73
+ const nonWitnessUtxo = {
74
+ nonWitnessUtxo: Buffer.from(transaction.hex, 'hex')
75
+ };
76
+ const witnessUtxo = {
77
+ witnessUtxo: {
78
+ script: output.script,
79
+ amount: output.amount
80
+ }
81
+ };
82
+ const witnessMixin = transaction.hasWitnesses ? witnessUtxo : nonWitnessUtxo;
83
+ const input = {
84
+ txid: utxo.txid,
85
+ index: utxo.vout,
86
+ ...scriptMixin,
87
+ ...witnessMixin
88
+ };
89
+ return input;
90
+ }
91
+ //# sourceMappingURL=utxo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utxo.js","sourceRoot":"","sources":["../../src/wallet/utxo.ts"],"names":[],"mappings":";;;AA+BA,wCA4EC;AAGD,sDAgDC;AA9JD,kDAAyG;AACzG,sCAAkC;AAClC,2EAAyD;AAEzD,wCAAwD;AAIxD,MAAM,eAAe,GAA+C;IAClE,OAAO,EAAE,oBAAO;IAChB,OAAO,EAAE,yBAAY;CACtB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rC,MAAM,KAAK,GAAG,IAAA,mBAAM,EAAC,MAAM,CAAC,IAAI,CAAC,MAAO,EAAE,KAAK,CAAC,EAAE,IAAA,qBAAa,EAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,YAAY,GAAG,IAAA,iBAAI,EAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAGD,MAAM,WAAW,GAAG;QAClB,GAAG,YAAY;KAChB,CAAC;IAGF,MAAM,cAAc,GAAG;QACrB,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC;KACpD,CAAC;IACF,MAAM,WAAW,GAAG;QAClB,WAAW,EAAE;YACX,MAAM,EAAE,MAAM,CAAC,MAAO;YACtB,MAAM,EAAE,MAAM,CAAC,MAAO;SACvB;KACF,CAAC;IACF,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC;IAG7E,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,KAAK,EAAE,IAAI,CAAC,IAAI;QAChB,GAAG,WAAW;QACd,GAAG,YAAY;KAChB,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@gobob/bob-sdk",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
7
7
  "test": "vitest run test/*.ts",
8
- "deploy-relay": "ts-node scripts/relay-genesis.ts",
9
- "update-relay": "ts-node scripts/relay-retarget.ts",
8
+ "deploy-relay": "ts-node src/scripts/relay-genesis.ts",
9
+ "update-relay": "ts-node src/scripts/relay-retarget.ts",
10
10
  "build": "tsc -p tsconfig.json"
11
11
  },
12
12
  "files": [
@@ -18,17 +18,21 @@
18
18
  "README.md"
19
19
  ],
20
20
  "devDependencies": {
21
- "@types/node": "^20.11.25",
22
- "@types/yargs": "^17.0.32",
21
+ "@types/node": "^22.0.0",
22
+ "@types/yargs": "^17.0.33",
23
23
  "ecpair": "^2.1.0",
24
- "mocha": "^10.3.0",
24
+ "mocha": "^10.7.3",
25
25
  "tiny-secp256k1": "^2.2.3",
26
26
  "ts-node": "^10.0.0",
27
- "typescript": "^5.4.2",
28
- "vitest": "^1.3.1",
27
+ "typescript": "^5.5.4",
28
+ "vitest": "^2.0.5",
29
29
  "yargs": "^17.5.1"
30
30
  },
31
31
  "dependencies": {
32
- "bitcoinjs-lib": "^6.1.5"
32
+ "@scure/base": "^1.1.7",
33
+ "@scure/btc-signer": "^1.3.2",
34
+ "bitcoin-address-validation": "^2.2.3",
35
+ "bitcoinjs-lib": "^6.1.6",
36
+ "ethers": "^6.13.2"
33
37
  }
34
38
  }