@gobob/bob-sdk 2.3.3 → 2.3.5
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/esplora.js +13 -13
- package/dist/esplora.js.map +1 -1
- package/dist/gateway/client.d.ts +3 -3
- package/dist/gateway/client.js +55 -56
- package/dist/gateway/client.js.map +1 -1
- package/dist/gateway/index.d.ts +2 -2
- package/dist/gateway/index.js +1 -3
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/tokens.d.ts +1 -1
- package/dist/gateway/tokens.js +66 -50
- package/dist/gateway/tokens.js.map +1 -1
- package/dist/gateway/types.d.ts +30 -29
- package/dist/gateway/types.js +1 -8
- package/dist/gateway/types.js.map +1 -1
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.js +5 -3
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/inscription.d.ts +2 -2
- package/dist/inscription.js +11 -13
- package/dist/inscription.js.map +1 -1
- package/dist/ordinal-api/index.d.ts +1 -1
- package/dist/ordinal-api/index.js +11 -11
- package/dist/ordinals/commit.d.ts +2 -2
- package/dist/ordinals/index.d.ts +3 -3
- package/dist/ordinals/index.js +1 -1
- package/dist/ordinals/reveal.d.ts +3 -3
- package/dist/ordinals/reveal.js.map +1 -1
- package/dist/ordinals/signer.d.ts +1 -1
- package/dist/relay.d.ts +1 -1
- package/dist/relay.js +5 -6
- package/dist/relay.js.map +1 -1
- package/dist/scripts/relay-genesis.js +47 -47
- package/dist/scripts/relay-genesis.js.map +1 -1
- package/dist/scripts/relay-retarget.js +33 -33
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +19 -17
- package/dist/utils.js.map +1 -1
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/inscriptions.d.ts +2 -2
- package/dist/wallet/inscriptions.js +1 -1
- package/dist/wallet/utxo.d.ts +4 -4
- package/dist/wallet/utxo.js +13 -13
- package/dist/wallet/utxo.js.map +1 -1
- package/package.json +13 -7
package/dist/gateway/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EsploraClient } from
|
|
1
|
+
import type { EsploraClient } from '../esplora';
|
|
2
2
|
type ChainSlug = string | number;
|
|
3
3
|
type TokenSymbol = string;
|
|
4
4
|
export type EvmAddress = string;
|
|
@@ -29,13 +29,13 @@ export interface GatewayQuoteParams {
|
|
|
29
29
|
amount: number | string;
|
|
30
30
|
maxSlippage?: number;
|
|
31
31
|
affiliateId?: string;
|
|
32
|
-
type?:
|
|
32
|
+
type?: 'swap' | 'deposit' | 'withdraw' | 'claim';
|
|
33
33
|
fee?: number;
|
|
34
34
|
gasRefill?: number;
|
|
35
35
|
fromUserPublicKey?: string;
|
|
36
36
|
strategyAddress?: string;
|
|
37
37
|
}
|
|
38
|
-
type GatewayIntegrationType =
|
|
38
|
+
type GatewayIntegrationType = 'bridge' | 'dex' | 'staking' | 'lending';
|
|
39
39
|
interface GatewayIntegration {
|
|
40
40
|
type: GatewayIntegrationType;
|
|
41
41
|
slug: string;
|
|
@@ -43,7 +43,7 @@ interface GatewayIntegration {
|
|
|
43
43
|
logo: string;
|
|
44
44
|
monetization: boolean;
|
|
45
45
|
}
|
|
46
|
-
type GatewayStrategyType =
|
|
46
|
+
type GatewayStrategyType = 'deposit' | 'withdraw' | 'claim' | 'router' | 'bridge';
|
|
47
47
|
interface GatewayToken {
|
|
48
48
|
symbol: string;
|
|
49
49
|
address: string;
|
|
@@ -51,7 +51,7 @@ interface GatewayToken {
|
|
|
51
51
|
decimals: number;
|
|
52
52
|
chain: string;
|
|
53
53
|
}
|
|
54
|
-
type GatewayChainType =
|
|
54
|
+
type GatewayChainType = 'evm' | 'ibc' | 'solana' | 'multiversx' | 'bitcoin' | 'ton' | 'tron';
|
|
55
55
|
interface GatewayChain {
|
|
56
56
|
id: string;
|
|
57
57
|
chainId: number;
|
|
@@ -95,25 +95,6 @@ export type GatewayCreateOrderRequest = {
|
|
|
95
95
|
strategyExtraData?: string;
|
|
96
96
|
satoshis: number;
|
|
97
97
|
};
|
|
98
|
-
export type OrderStatusData = {
|
|
99
|
-
confirmations: number;
|
|
100
|
-
confirmed: boolean;
|
|
101
|
-
};
|
|
102
|
-
export declare enum OrderStatusType {
|
|
103
|
-
Success = "Success",
|
|
104
|
-
Failed = "Failed",
|
|
105
|
-
Pending = "Pending"
|
|
106
|
-
}
|
|
107
|
-
export type OrderStatus = {
|
|
108
|
-
status: OrderStatusType.Success;
|
|
109
|
-
data: OrderStatusData;
|
|
110
|
-
} | {
|
|
111
|
-
status: OrderStatusType.Failed;
|
|
112
|
-
data: OrderStatusData;
|
|
113
|
-
} | {
|
|
114
|
-
status: OrderStatusType.Pending;
|
|
115
|
-
data: OrderStatusData;
|
|
116
|
-
};
|
|
117
98
|
export interface GatewayOrderResponse {
|
|
118
99
|
gatewayAddress: EvmAddress;
|
|
119
100
|
baseTokenAddress: EvmAddress;
|
|
@@ -130,15 +111,35 @@ export interface GatewayOrderResponse {
|
|
|
130
111
|
outputTokenAddress?: EvmAddress;
|
|
131
112
|
outputTokenAmount?: string;
|
|
132
113
|
txHash?: string;
|
|
114
|
+
}
|
|
115
|
+
export type OrderStatusData = {
|
|
116
|
+
confirmations: number;
|
|
117
|
+
};
|
|
118
|
+
export type OrderStatus = {
|
|
119
|
+
confirmed: false;
|
|
120
|
+
pending?: never;
|
|
121
|
+
success?: never;
|
|
122
|
+
data: OrderStatusData;
|
|
123
|
+
} | {
|
|
124
|
+
confirmed?: never;
|
|
125
|
+
pending: true;
|
|
126
|
+
success?: never;
|
|
127
|
+
data: OrderStatusData;
|
|
128
|
+
} | {
|
|
129
|
+
confirmed?: never;
|
|
130
|
+
pending?: never;
|
|
131
|
+
success: boolean;
|
|
132
|
+
data: OrderStatusData;
|
|
133
|
+
};
|
|
134
|
+
export type GatewayOrder = Omit<GatewayOrderResponse & {
|
|
135
|
+
gasRefill: number;
|
|
136
|
+
}, 'satsToConvertToEth'> & {
|
|
133
137
|
getTokenAddress(): string | undefined;
|
|
134
138
|
getToken(): Token | undefined;
|
|
135
139
|
getAmount(): string | number | undefined;
|
|
136
140
|
getConfirmations(esploraClient: EsploraClient, latestHeight?: number): Promise<number>;
|
|
137
141
|
getStatus(esploraClient: EsploraClient, latestHeight?: number): Promise<OrderStatus>;
|
|
138
|
-
}
|
|
139
|
-
export type GatewayOrder = Omit<GatewayOrderResponse & {
|
|
140
|
-
gasRefill: number;
|
|
141
|
-
}, "satsToConvertToEth">;
|
|
142
|
+
};
|
|
142
143
|
export type GatewayTokensInfo = {
|
|
143
144
|
baseToken: Token;
|
|
144
145
|
outputToken?: Token;
|
|
@@ -155,7 +156,7 @@ export type GatewayStartOrder = GatewayCreateOrderResponse & {
|
|
|
155
156
|
export interface GatewayStrategy {
|
|
156
157
|
strategyAddress: string;
|
|
157
158
|
strategyName: string;
|
|
158
|
-
strategyType:
|
|
159
|
+
strategyType: 'staking' | 'lending';
|
|
159
160
|
projectName: string;
|
|
160
161
|
projectLogo?: string;
|
|
161
162
|
inputTokenAddress: string;
|
package/dist/gateway/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ChainId = exports.Chain = void 0;
|
|
4
4
|
var Chain;
|
|
5
5
|
(function (Chain) {
|
|
6
6
|
Chain["BITCOIN"] = "bitcoin";
|
|
@@ -12,11 +12,4 @@ var ChainId;
|
|
|
12
12
|
ChainId[ChainId["BOB"] = 60808] = "BOB";
|
|
13
13
|
ChainId[ChainId["BOB_SEPOLIA"] = 808813] = "BOB_SEPOLIA";
|
|
14
14
|
})(ChainId || (exports.ChainId = ChainId = {}));
|
|
15
|
-
var OrderStatusType;
|
|
16
|
-
(function (OrderStatusType) {
|
|
17
|
-
OrderStatusType["Success"] = "Success";
|
|
18
|
-
OrderStatusType["Failed"] = "Failed";
|
|
19
|
-
OrderStatusType["Pending"] = "Pending";
|
|
20
|
-
})(OrderStatusType || (exports.OrderStatusType = OrderStatusType = {}));
|
|
21
|
-
;
|
|
22
15
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gateway/types.ts"],"names":[],"mappings":";;;AAOA,IAAY,KAKX;AALD,WAAY,KAAK;IAEb,4BAAmB,CAAA;IACnB,oBAAW,CAAA;IACX,oCAA2B,CAAA;AAC/B,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAED,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,uCAAW,CAAA;IACX,wDAAoB,CAAA;AACxB,CAAC,EAHW,OAAO,uBAAP,OAAO,QAGlB
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gateway/types.ts"],"names":[],"mappings":";;;AAOA,IAAY,KAKX;AALD,WAAY,KAAK;IAEb,4BAAmB,CAAA;IACnB,oBAAW,CAAA;IACX,oCAA2B,CAAA;AAC/B,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAED,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,uCAAW,CAAA;IACX,wDAAoB,CAAA;AACxB,CAAC,EAHW,OAAO,uBAAP,OAAO,QAGlB"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { EsploraClient } from
|
|
2
|
-
import { OrdinalsClient } from
|
|
1
|
+
import { EsploraClient } from './esplora';
|
|
2
|
+
import { OrdinalsClient } from './ordinal-api';
|
|
3
3
|
export declare function getInscriptionIds(esploraClient: EsploraClient, ordinalsClient: OrdinalsClient, bitcoinAddress: string): Promise<string[]>;
|
package/dist/helpers.js
CHANGED
|
@@ -29,11 +29,13 @@ const ordinal_api_1 = require("./ordinal-api");
|
|
|
29
29
|
const bitcoin = __importStar(require("bitcoinjs-lib"));
|
|
30
30
|
async function getInscriptionIds(esploraClient, ordinalsClient, bitcoinAddress) {
|
|
31
31
|
const utxos = await esploraClient.getAddressUtxos(bitcoinAddress);
|
|
32
|
-
const inscriptionIds = await Promise.all(utxos
|
|
32
|
+
const inscriptionIds = await Promise.all(utxos
|
|
33
|
+
.sort((a, b) => {
|
|
33
34
|
const heightA = a.height || Number.MAX_SAFE_INTEGER;
|
|
34
35
|
const heightB = b.height || Number.MAX_SAFE_INTEGER;
|
|
35
36
|
return heightA - heightB;
|
|
36
|
-
})
|
|
37
|
+
})
|
|
38
|
+
.map((utxo) => getInscriptionIdsForUtxo(esploraClient, ordinalsClient, utxo)));
|
|
37
39
|
return inscriptionIds.flat();
|
|
38
40
|
}
|
|
39
41
|
async function getInscriptionIdsForUtxo(esploraClient, ordinalsClient, utxo) {
|
|
@@ -45,7 +47,7 @@ async function getInscriptionIdsForUtxo(esploraClient, ordinalsClient, utxo) {
|
|
|
45
47
|
const tx = bitcoin.Transaction.fromHex(txHex);
|
|
46
48
|
if (utxo.vout == 0) {
|
|
47
49
|
const parentInscriptions = await Promise.all(tx.ins.map(async (txInput) => {
|
|
48
|
-
const txid = txInput.hash.reverse().toString(
|
|
50
|
+
const txid = txInput.hash.reverse().toString('hex');
|
|
49
51
|
const outputJson = await ordinalsClient.getInscriptionsFromOutPoint({ txid, vout: txInput.index });
|
|
50
52
|
return outputJson.inscriptions;
|
|
51
53
|
}));
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,8CAkBC;AAvBD,+CAAkD;AAClD,+CAA8D;AAC9D,uDAAyC;AAGlC,KAAK,UAAU,iBAAiB,CACnC,aAA4B,EAC5B,cAA8B,EAC9B,cAAsB;IAEtB,MAAM,KAAK,GAA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AAG,MAAM,cAAc,CAAC,2BAA2B,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;YACnG,OAAO,UAAU,CAAC,YAAY,CAAC;QACnC,CAAC,CAAC,CACL,CAAC;QACF,MAAM,cAAc,GAAG,kBAAkB,CAAC,IAAI,EAAE,CAAC;QACjD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,cAAc,CAAC;QAC1B,CAAC;IACL,CAAC;IAGD,MAAM,YAAY,GAAG,IAAA,+BAAiB,EAAC,EAAE,CAAC,CAAC;IAE3C,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACd,CAAC;SAAM,CAAC;QAEJ,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,2BAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC9F,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from './esplora';
|
|
2
|
+
export * from './relay';
|
|
3
|
+
export * from './utils';
|
|
4
|
+
export * from './ordinals';
|
|
5
|
+
export * from './helpers';
|
|
6
|
+
export * from './wallet';
|
|
7
|
+
export * from './gateway';
|
package/dist/inscription.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as bitcoin from
|
|
2
|
-
import { EsploraClient } from
|
|
1
|
+
import * as bitcoin from 'bitcoinjs-lib';
|
|
2
|
+
import { EsploraClient } from './esplora';
|
|
3
3
|
export declare const PROTOCOL_ID: Buffer;
|
|
4
4
|
export declare const MAX_CHUNK_SIZE = 520;
|
|
5
5
|
export declare function chunkContent(data: Buffer): Buffer[];
|
package/dist/inscription.js
CHANGED
|
@@ -33,7 +33,7 @@ const ordinal_api_1 = require("./ordinal-api");
|
|
|
33
33
|
const textEncoder = new TextEncoder();
|
|
34
34
|
const OP_INT_BASE = bitcoin.opcodes.OP_RESERVED;
|
|
35
35
|
const TAPROOT_ANNEX_PREFIX = 0x50;
|
|
36
|
-
exports.PROTOCOL_ID = Buffer.from(
|
|
36
|
+
exports.PROTOCOL_ID = Buffer.from('6f7264', 'hex');
|
|
37
37
|
const CONTENT_TYPE_TAG = bitcoin.opcodes.OP_1;
|
|
38
38
|
const CONTENT_ENCODING_TAG = bitcoin.opcodes.OP_9;
|
|
39
39
|
exports.MAX_CHUNK_SIZE = 520;
|
|
@@ -60,14 +60,14 @@ class Inscription {
|
|
|
60
60
|
getContentType() {
|
|
61
61
|
const data = this.tags[CONTENT_TYPE_TAG];
|
|
62
62
|
if (Buffer.isBuffer(data)) {
|
|
63
|
-
return data.toString(
|
|
63
|
+
return data.toString('utf-8');
|
|
64
64
|
}
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
67
|
getContentEncoding() {
|
|
68
68
|
const data = this.tags[CONTENT_ENCODING_TAG];
|
|
69
69
|
if (Buffer.isBuffer(data)) {
|
|
70
|
-
return data.toString(
|
|
70
|
+
return data.toString('utf-8');
|
|
71
71
|
}
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
@@ -90,11 +90,9 @@ class Inscription {
|
|
|
90
90
|
bitcoin.opcodes.OP_0,
|
|
91
91
|
bitcoin.opcodes.OP_IF,
|
|
92
92
|
exports.PROTOCOL_ID,
|
|
93
|
-
...this.getTags()
|
|
94
|
-
1,
|
|
95
|
-
|
|
96
|
-
value,
|
|
97
|
-
]).flat(),
|
|
93
|
+
...this.getTags()
|
|
94
|
+
.map(([key, value]) => [1, key, value])
|
|
95
|
+
.flat(),
|
|
98
96
|
bitcoin.opcodes.OP_0,
|
|
99
97
|
...chunkContent(this.body),
|
|
100
98
|
bitcoin.opcodes.OP_ENDIF,
|
|
@@ -104,11 +102,11 @@ class Inscription {
|
|
|
104
102
|
exports.Inscription = Inscription;
|
|
105
103
|
(function (Inscription) {
|
|
106
104
|
function createTextInscription(text) {
|
|
107
|
-
return Inscription.createInscription(
|
|
105
|
+
return Inscription.createInscription('text/plain;charset=utf-8', Buffer.from(textEncoder.encode(text)));
|
|
108
106
|
}
|
|
109
107
|
Inscription.createTextInscription = createTextInscription;
|
|
110
108
|
function createInscription(contentType, content) {
|
|
111
|
-
const inscription = new Inscription;
|
|
109
|
+
const inscription = new Inscription();
|
|
112
110
|
inscription.setContentType(contentType);
|
|
113
111
|
inscription.body = content;
|
|
114
112
|
return inscription;
|
|
@@ -131,7 +129,7 @@ function getTapscript(witness) {
|
|
|
131
129
|
return bitcoin.script.decompile(witness[len - scriptPosFromLast]);
|
|
132
130
|
}
|
|
133
131
|
function parseInscriptions(tx) {
|
|
134
|
-
|
|
132
|
+
const inscriptions = [];
|
|
135
133
|
for (const txInput of tx.ins) {
|
|
136
134
|
const tapscript = getTapscript(txInput.witness);
|
|
137
135
|
if (tapscript == null) {
|
|
@@ -149,8 +147,8 @@ function parseInscriptions(tx) {
|
|
|
149
147
|
if (!Buffer.isBuffer(data) && !data.equals(exports.PROTOCOL_ID)) {
|
|
150
148
|
continue;
|
|
151
149
|
}
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
const tags = new Map();
|
|
151
|
+
const body = [];
|
|
154
152
|
let isBody = false;
|
|
155
153
|
for (let chunk = chunks.next(); !chunk.done; chunk = chunks.next()) {
|
|
156
154
|
if (chunk.value == bitcoin.opcodes.OP_ENDIF) {
|
package/dist/inscription.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inscription.js","sourceRoot":"","sources":["../src/inscription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,oCAQ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,EAAE,IAAY;IAC9E,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,iBAAiB,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC;AAEM,KAAK,UAAU,oBAAoB,CAAC,aAA4B,EAAE,aAAqB;IAC1F,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,2BAAa,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,MAAM,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAClE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -70,7 +70,7 @@ export interface InscriptionJson<InscriptionId, SatPoint> {
|
|
|
70
70
|
children: InscriptionId[];
|
|
71
71
|
content_length: number | null;
|
|
72
72
|
content_type: string | null;
|
|
73
|
-
effective_content_type:
|
|
73
|
+
effective_content_type: string | null;
|
|
74
74
|
fee: number;
|
|
75
75
|
height: number;
|
|
76
76
|
id: InscriptionId;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrdinalsClient = exports.SatPoint = exports.OutPoint = exports.InscriptionId = exports.TESTNET_ORD_BASE_PATH = exports.MAINNET_ORD_BASE_PATH = exports.REGTEST_ORD_BASE_PATH = void 0;
|
|
4
|
-
exports.REGTEST_ORD_BASE_PATH =
|
|
5
|
-
exports.MAINNET_ORD_BASE_PATH =
|
|
6
|
-
exports.TESTNET_ORD_BASE_PATH =
|
|
4
|
+
exports.REGTEST_ORD_BASE_PATH = 'http://0.0.0.0:3003';
|
|
5
|
+
exports.MAINNET_ORD_BASE_PATH = 'https://ordinals-mainnet.gobob.xyz';
|
|
6
|
+
exports.TESTNET_ORD_BASE_PATH = 'https://ordinals-testnet.gobob.xyz';
|
|
7
7
|
var InscriptionId;
|
|
8
8
|
(function (InscriptionId) {
|
|
9
9
|
function toString(id) {
|
|
@@ -11,7 +11,7 @@ var InscriptionId;
|
|
|
11
11
|
}
|
|
12
12
|
InscriptionId.toString = toString;
|
|
13
13
|
function fromString(id) {
|
|
14
|
-
const [txid, index] = id.split(
|
|
14
|
+
const [txid, index] = id.split('i');
|
|
15
15
|
return {
|
|
16
16
|
txid,
|
|
17
17
|
index: parseInt(index, 10),
|
|
@@ -26,7 +26,7 @@ var OutPoint;
|
|
|
26
26
|
}
|
|
27
27
|
OutPoint.toString = toString;
|
|
28
28
|
function fromString(id) {
|
|
29
|
-
const [txid, vout] = id.split(
|
|
29
|
+
const [txid, vout] = id.split(':');
|
|
30
30
|
return {
|
|
31
31
|
txid,
|
|
32
32
|
vout: parseInt(vout, 10),
|
|
@@ -41,7 +41,7 @@ var SatPoint;
|
|
|
41
41
|
}
|
|
42
42
|
SatPoint.toString = toString;
|
|
43
43
|
function fromString(id) {
|
|
44
|
-
const [txid, vout, offset] = id.split(
|
|
44
|
+
const [txid, vout, offset] = id.split(':');
|
|
45
45
|
return {
|
|
46
46
|
outpoint: {
|
|
47
47
|
txid,
|
|
@@ -53,15 +53,15 @@ var SatPoint;
|
|
|
53
53
|
SatPoint.fromString = fromString;
|
|
54
54
|
})(SatPoint || (exports.SatPoint = SatPoint = {}));
|
|
55
55
|
class OrdinalsClient {
|
|
56
|
-
constructor(networkOrUrl =
|
|
56
|
+
constructor(networkOrUrl = 'mainnet') {
|
|
57
57
|
switch (networkOrUrl) {
|
|
58
|
-
case
|
|
58
|
+
case 'mainnet':
|
|
59
59
|
this.basePath = exports.MAINNET_ORD_BASE_PATH;
|
|
60
60
|
break;
|
|
61
|
-
case
|
|
61
|
+
case 'testnet':
|
|
62
62
|
this.basePath = exports.TESTNET_ORD_BASE_PATH;
|
|
63
63
|
break;
|
|
64
|
-
case
|
|
64
|
+
case 'regtest':
|
|
65
65
|
this.basePath = exports.REGTEST_ORD_BASE_PATH;
|
|
66
66
|
break;
|
|
67
67
|
default:
|
|
@@ -106,7 +106,7 @@ class OrdinalsClient {
|
|
|
106
106
|
async getJson(url) {
|
|
107
107
|
const response = await fetch(url, {
|
|
108
108
|
headers: {
|
|
109
|
-
Accept:
|
|
109
|
+
Accept: 'application/json',
|
|
110
110
|
},
|
|
111
111
|
});
|
|
112
112
|
if (!response.ok) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as bitcoin from
|
|
2
|
-
import { Inscription } from
|
|
1
|
+
import * as bitcoin from 'bitcoinjs-lib';
|
|
2
|
+
import { Inscription } from '../inscription';
|
|
3
3
|
export interface CommitTxData {
|
|
4
4
|
scriptTaproot: bitcoin.payments.Payment;
|
|
5
5
|
tapLeafScript: {
|
package/dist/ordinals/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as bitcoin from
|
|
2
|
-
import { RemoteSigner } from
|
|
3
|
-
import { Inscription } from
|
|
1
|
+
import * as bitcoin from 'bitcoinjs-lib';
|
|
2
|
+
import { RemoteSigner } from './signer';
|
|
3
|
+
import { Inscription } from '../inscription';
|
|
4
4
|
export { RemoteSigner };
|
|
5
5
|
export declare function inscribeData(signer: RemoteSigner, toAddress: string, feeRate: number, inscription: Inscription, postage?: number): Promise<bitcoin.Transaction>;
|
package/dist/ordinals/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function estimateTxSize(network, publicKey, commitTxData, toAddress, amount) {
|
|
|
51
51
|
}
|
|
52
52
|
async function inscribeData(signer, toAddress, feeRate, inscription, postage = 10000) {
|
|
53
53
|
const bitcoinNetwork = await signer.getNetwork();
|
|
54
|
-
const publicKey = Buffer.from(await signer.getPublicKey(),
|
|
54
|
+
const publicKey = Buffer.from(await signer.getPublicKey(), 'hex');
|
|
55
55
|
const commitTxData = (0, commit_1.createCommitTxData)(bitcoinNetwork, publicKey, inscription);
|
|
56
56
|
const revealTxSize = estimateTxSize(bitcoinNetwork, publicKey, commitTxData, toAddress, postage);
|
|
57
57
|
const revealFee = revealTxSize * feeRate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as bitcoin from
|
|
2
|
-
import { RemoteSigner } from
|
|
3
|
-
import { CommitTxData } from
|
|
1
|
+
import * as bitcoin from 'bitcoinjs-lib';
|
|
2
|
+
import { RemoteSigner } from './signer';
|
|
3
|
+
import { CommitTxData } from './commit';
|
|
4
4
|
export interface CommitTxResult {
|
|
5
5
|
tx: bitcoin.Transaction;
|
|
6
6
|
outputIndex: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reveal.js","sourceRoot":"","sources":["../../src/ordinals/reveal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,wCA4BC;
|
|
1
|
+
{"version":3,"file":"reveal.js","sourceRoot":"","sources":["../../src/ordinals/reveal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,wCA4BC;AAiBD,oCAQC;AAtED,uDAAyC;AACzC,4EAA8D;AAK9D,MAAM,EAAE,2BAA2B,EAAE,GAAG,SAAS,CAAC;AAWlD,SAAgB,cAAc,CAC1B,OAAwB,EACxB,YAA0B,EAC1B,cAA8B,EAC9B,SAAiB,EACjB,MAAc;IAEd,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,YAAY,CAAC;IAEtD,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAE3C,IAAI,CAAC,QAAQ,CAAC;QACV,IAAI,EAAE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE;QAC/B,KAAK,EAAE,cAAc,CAAC,WAAW;QACjC,WAAW,EAAE;YACT,KAAK,EAAE,cAAc,CAAC,YAAY;YAClC,MAAM,EAAE,aAAa,CAAC,MAAO;SAChC;QACD,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE;QAC5C,aAAa,EAAE,CAAC,aAAa,CAAC;KACjC,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,CAAC;QACX,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,SAAS;KACrB,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AAChB,CAAC;AAEM,MAAM,eAAe,GAAG,CAAC,YAA0B,EAAE,EAAE;IAC1D,MAAM,EAAE,aAAa,EAAE,GAAG,YAAY,CAAC;IAGvC,OAAO,CAAC,UAAkB,EAAE,KAAU,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC;aACrD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;aAC5B,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAExC,OAAO;YACH,kBAAkB,EAAE,2BAA2B,CAAC,OAAO,CAAC;SAC3D,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,eAAe,mBAa1B;AAEK,KAAK,UAAU,YAAY,CAAC,MAAoB,EAAE,YAA0B,EAAE,IAAkB;IAEnG,IAAI,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAGvC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAA,uBAAe,EAAC,YAAY,CAAC,CAAC,CAAC;IAErD,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;AACrC,CAAC"}
|
package/dist/relay.d.ts
CHANGED
package/dist/relay.js
CHANGED
|
@@ -13,12 +13,11 @@ async function getBitcoinTxInfo(esploraClient, txId, forWitness) {
|
|
|
13
13
|
const locktimeBuffer = Buffer.allocUnsafe(4);
|
|
14
14
|
locktimeBuffer.writeInt32LE(tx.locktime);
|
|
15
15
|
return {
|
|
16
|
-
version: versionBuffer.toString(
|
|
17
|
-
inputVector: (0, utils_1.encodeRawInput)(tx).toString(
|
|
18
|
-
outputVector: (0, utils_1.encodeRawOutput)(tx).toString(
|
|
19
|
-
locktime: locktimeBuffer.toString(
|
|
20
|
-
witnessVector: forWitness ? (0, utils_1.encodeRawWitness)(tx).toString(
|
|
21
|
-
witnessVector: forWitness ? (0, utils_1.encodeRawWitness)(tx).toString("hex") : undefined,
|
|
16
|
+
version: versionBuffer.toString('hex'),
|
|
17
|
+
inputVector: (0, utils_1.encodeRawInput)(tx).toString('hex'),
|
|
18
|
+
outputVector: (0, utils_1.encodeRawOutput)(tx).toString('hex'),
|
|
19
|
+
locktime: locktimeBuffer.toString('hex'),
|
|
20
|
+
witnessVector: forWitness ? (0, utils_1.encodeRawWitness)(tx).toString('hex') : undefined,
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
23
|
async function getBitcoinTxProof(esploraClient, txId, txProofDifficultyFactor) {
|
package/dist/relay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relay.js","sourceRoot":"","sources":["../src/relay.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"relay.js","sourceRoot":"","sources":["../src/relay.ts"],"names":[],"mappings":";;AAqDA,4CAqBC;AAmCD,8CAaC;AA0BD,8CAiBC;AAlKD,iDAA4C;AAQ5C,mCAA4E;AA0CrE,KAAK,UAAU,gBAAgB,CAClC,aAA4B,EAC5B,IAAY,EACZ,UAAoB;IAEpB,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,EAAE,GAAG,2BAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5C,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAEvC,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7C,cAAc,CAAC,YAAY,CAAC,EA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