@ibearua/bitmask-core-dev 1.0.0-beta.11 → 1.0.0-beta.13

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/rgb.d.ts ADDED
@@ -0,0 +1,363 @@
1
+ export declare const getVersion: () => string;
2
+ export declare const getContract: (nostrHexSk: string, request: string) => Promise<ContractResponse>;
3
+ export declare const listContracts: (nostrHexSk: string, hidden: boolean) => Promise<ContractResponse[]>;
4
+ export declare const importContract: (nostrHexSk: string, request: string) => Promise<ContractResponse>;
5
+ export declare const issueContract: (nostrHexSk: string, request: IssueRequest) => Promise<IssueResponse>;
6
+ export declare const createInvoice: (nostrHexSk: string, request: RgbInvoiceRequest) => Promise<RgbInvoiceResponse>;
7
+ export declare const canCreateTransfer: (nostrHexSk: string, request: RgbTransferRequest) => Promise<RgbValidationResponse>;
8
+ export declare const createTransfer: (nostrHexSk: string, request: RgbTransferRequest) => Promise<RgbTransferResponse>;
9
+ export declare const createAndPublishTransfer: (nostrHexSk: string, request: RgbTransferRequest, secrets: string[]) => Promise<RgbTransferResponse>;
10
+ export declare const acceptTransfer: (nostrHexSk: string, request: AcceptRequest) => Promise<AcceptResponse>;
11
+ export declare const removeInvoice: (nostrHexSk: string, request: string) => Promise<void>;
12
+ export declare const listInvoices: (nostrHexSk: string) => Promise<RgbInvoiceStatusResponse[]>;
13
+ export declare const saveTransfer: (nostrHexSk: string, request: SaveTransferRequest) => Promise<RgbTransferItem>;
14
+ export declare const listTransfers: (nostrHexSk: string) => Promise<RgbTransferItem[]>;
15
+ export declare const verifyTransfers: (nostrHexSk: string) => Promise<RgbTransferItem[]>;
16
+ export declare const listOffers: (nostrHexSk: string) => Promise<RgbOfferResponse[]>;
17
+ export declare const offers: (nostrHexSk: string) => Promise<RgbOfferResponse[]>;
18
+ export declare const bids: (nostrHexSk: string) => Promise<WatcherWalletResponse>;
19
+ export declare const offerSwapSuppl: (nostrHexSk: string, offerId: string) => Promise<SwapSupplement>;
20
+ export declare const bidSwapSuppl: (nostrHexSk: string, bidId: string) => Promise<SwapSupplement>;
21
+ export declare const canCreateOffer: (nostrHexSk: string, request: RgbOfferRequest, secrets: string[]) => Promise<RgbValidationResponse>;
22
+ export declare const createOffer: (nostrHexSk: string, request: RgbOfferRequest, secrets: string[]) => Promise<RgbOfferResponse>;
23
+ export declare const cancelOffer: (nostrHexSk: string, request: RgbCancelOffersRequest) => Promise<RgbSwapCancelResponse>;
24
+ export declare const canCreateBid: (nostrHexSk: string, request: RgbBidRequest, secrets: string[]) => Promise<RgbValidationResponse>;
25
+ export declare const createBid: (nostrHexSk: string, request: RgbBidRequest, secrets: string[]) => Promise<RgbBidResponse>;
26
+ export declare const cancelBid: (nostrHexSk: string, request: RgbCancelBidsRequest) => Promise<RgbSwapCancelResponse>;
27
+ export declare const backupWallet: (nostrHexSk: string) => Promise<boolean>;
28
+ export declare const restoreWallet: (nostrHexSk: string) => Promise<boolean>;
29
+ export declare const getRgbWallet: (nostrHexSk: string) => Promise<WatcherWalletResponse>;
30
+ export declare const decodeInvoice: (invoice: string) => Promise<RgbInvoiceDecoded>;
31
+ export declare const psbtPublishFile: (request: PublishPsbtRequest) => Promise<SignedPsbtResponse>;
32
+ export declare const psbtSignAndPublishFile: (_nostrHexSk: string, request: SignPsbtRequest) => Promise<PublishedPsbtResponse>;
33
+ export declare const toContractAmountRaw: (decimal: string, precision: number) => string;
34
+ export declare const toContractAmountStr: (amount: bigint, precision: number) => string;
35
+ export declare const toContractAmount: (amount: string) => ContractAmount;
36
+ export declare const toContractPrecision: (amount: string, precision: number) => string;
37
+ export interface RgbContainer {
38
+ rgbStock?: string;
39
+ rgbAccount?: string;
40
+ rgbTransfers?: string;
41
+ }
42
+ export interface IssueRequest {
43
+ ticker: string;
44
+ name: string;
45
+ iface: string;
46
+ description: string;
47
+ supply: string;
48
+ precision: number;
49
+ seal: string;
50
+ chain: string;
51
+ meta?: IssueMedia;
52
+ }
53
+ export type ChainFee = {
54
+ value?: bigint;
55
+ feeRate?: number;
56
+ none?: string;
57
+ };
58
+ export interface IssueMedia {
59
+ preview?: MediaData;
60
+ media?: MediaData;
61
+ attachments: MediaData[];
62
+ }
63
+ export interface MediaData {
64
+ type: string;
65
+ uri: string;
66
+ }
67
+ export type ContractResponse = IssueResponse;
68
+ export interface IssueResponse {
69
+ contractId: string;
70
+ iface: string;
71
+ issueUtxo: string;
72
+ ticker: string;
73
+ name: string;
74
+ created: bigint;
75
+ description: string;
76
+ supply: bigint;
77
+ precision: number;
78
+ balance: ContractValue;
79
+ contract: string;
80
+ allocations: ContractAllocation[];
81
+ meta?: UDAItem;
82
+ }
83
+ export type ContractValue = {
84
+ value?: bigint;
85
+ uda?: UDAValue;
86
+ };
87
+ export interface UDAValue {
88
+ tokenIndex: number;
89
+ fraction: bigint;
90
+ }
91
+ export interface ContractAllocation {
92
+ utxo: string;
93
+ value: ContractValue;
94
+ derivation: string;
95
+ isMine: boolean;
96
+ isSpent: boolean;
97
+ }
98
+ export interface UDAItem {
99
+ tokenIndex: number;
100
+ media: IssueMedia;
101
+ }
102
+ export interface RgbInvoiceRequest {
103
+ contractId?: string;
104
+ iface?: string;
105
+ amount: RgbInvoiceValue;
106
+ seal: RgbSelection;
107
+ expireAt?: number;
108
+ }
109
+ export interface RgbSelection {
110
+ next_utxo?: string;
111
+ next_address?: string;
112
+ utxo?: string;
113
+ address?: string;
114
+ }
115
+ export interface RgbInvoiceValue {
116
+ value?: string;
117
+ uda?: UDAValue;
118
+ }
119
+ export interface RgbInvoiceResponse {
120
+ invoice: string;
121
+ }
122
+ export interface RgbInvoiceStatusResponse {
123
+ assetName: String;
124
+ assetTicker: String;
125
+ contractId: String;
126
+ amount: RgbInvoiceValue;
127
+ status: RgbInvoiceStatus;
128
+ invoice: String;
129
+ }
130
+ export type RgbInvoiceStatusItem = RgbInvoiceStatusResponse;
131
+ export interface RgbInvoiceStatus {
132
+ opened?: string;
133
+ payed?: string;
134
+ canceled?: string;
135
+ }
136
+ export interface RgbTransferRequest {
137
+ contractId: string;
138
+ iface: string;
139
+ invoice: string;
140
+ senderAmount?: RgbInvoiceValue;
141
+ chain: string;
142
+ chainFee: ChainFee;
143
+ }
144
+ export interface RgbTransferResponse {
145
+ consigId: string;
146
+ consig: string;
147
+ txid: string;
148
+ psbt: string;
149
+ commit?: string;
150
+ }
151
+ export interface AcceptRequest {
152
+ consignment: string;
153
+ force: boolean;
154
+ }
155
+ export interface SaveTransferRequest {
156
+ consignment: string;
157
+ }
158
+ export interface AcceptResponse {
159
+ transferId: string;
160
+ contractId: string;
161
+ valid: boolean;
162
+ txid: string;
163
+ }
164
+ export interface RgbTransferItem {
165
+ contractId: String;
166
+ iface: String;
167
+ direction: Direction;
168
+ }
169
+ export interface Direction {
170
+ in?: TransferIn;
171
+ out?: TransferOut;
172
+ }
173
+ export interface TransferIn {
174
+ txId: String;
175
+ txStatus: TxStatus;
176
+ invoice: String;
177
+ transfer?: TransferItem;
178
+ amount?: ContractAmount;
179
+ uda?: UDAValue;
180
+ }
181
+ export interface TransferOut {
182
+ txId: String;
183
+ txStatus: TxStatus;
184
+ invoice: String;
185
+ transfer: TransferItem;
186
+ amount?: ContractAmount;
187
+ uda?: UDAValue;
188
+ }
189
+ export interface TransferItem {
190
+ transferId: String;
191
+ transfer: String;
192
+ isAccept: boolean;
193
+ }
194
+ export interface SignPsbtRequest {
195
+ psbt: string;
196
+ descriptors: string[];
197
+ }
198
+ export interface SignedPsbtResponse {
199
+ sign: boolean;
200
+ psbt: string;
201
+ }
202
+ export interface PublishPsbtRequest {
203
+ psbt: string;
204
+ }
205
+ export interface PublishedPsbtResponse {
206
+ sign: boolean;
207
+ txid: string;
208
+ }
209
+ export interface WatcherRequest {
210
+ name: string;
211
+ btcXpub: string;
212
+ rgbXpub: string;
213
+ recover: boolean;
214
+ }
215
+ export interface WatcherResponse {
216
+ name: string;
217
+ network: string;
218
+ migrate: boolean;
219
+ }
220
+ export interface WatcherStatusResponse {
221
+ name: string;
222
+ created: boolean;
223
+ }
224
+ export interface WatcherStatusResponse {
225
+ name: string;
226
+ created: boolean;
227
+ }
228
+ export interface WatcherWalletResponse {
229
+ nextUtxo?: string;
230
+ nextUtxoValue?: number;
231
+ nextAddress?: string;
232
+ listContracts: ContractResponse[];
233
+ transfers: RgbTransferItem[];
234
+ invoices: RgbInvoiceStatusItem[];
235
+ }
236
+ export interface NextUtxoResponse {
237
+ utxo?: string;
238
+ value?: number;
239
+ }
240
+ export interface NextAddressResponse {
241
+ address: string;
242
+ network: string;
243
+ }
244
+ export interface TxStatus {
245
+ notFound?: any;
246
+ error?: string;
247
+ mempool?: any;
248
+ block?: {
249
+ height: number;
250
+ timestamp: number;
251
+ };
252
+ confirmed?: string;
253
+ }
254
+ export interface RgbInvoiceDecoded {
255
+ contractId: string;
256
+ amount: RgbInvoiceValue;
257
+ expiry?: number;
258
+ endpoints?: string[];
259
+ }
260
+ export interface ContractAmount {
261
+ int: number;
262
+ fract: number;
263
+ precision: number;
264
+ }
265
+ export interface RgbOfferRequest {
266
+ strategy: RgbSwap;
267
+ offers: RgbOfferItem[];
268
+ }
269
+ export declare enum RgbSwap {
270
+ auction = "auction",
271
+ p2p = "p2p",
272
+ hotSwap = "hotswap",
273
+ airdrop = "airdrop"
274
+ }
275
+ export interface RgbOfferItem {
276
+ contractId: string;
277
+ contractAmount: string;
278
+ counterParty: OrderValue;
279
+ expireAt?: number;
280
+ }
281
+ export interface RgbOfferResponse {
282
+ id: string;
283
+ status: string;
284
+ contract: ContractKit;
285
+ amount: ContractAmount;
286
+ counterParty: OrderValue;
287
+ }
288
+ export interface RgbBidRequest {
289
+ offerId: string;
290
+ assetPrice: OrderValue;
291
+ fee: ChainFee;
292
+ bundle?: string;
293
+ }
294
+ export interface RgbBidResponse {
295
+ id: string;
296
+ offerId: string;
297
+ status: string;
298
+ asset: AssetKit;
299
+ amount: ContractAmount;
300
+ counterParty: OrderValue;
301
+ txid: string;
302
+ }
303
+ export interface RgbAuctionCloseRequest {
304
+ bundleId: string;
305
+ }
306
+ export interface RgbSwapRequest {
307
+ offerId: string;
308
+ bidId: string;
309
+ sharedKey: string;
310
+ }
311
+ export interface RgbSwapResponse {
312
+ consigId: string;
313
+ consig: string;
314
+ txid: string;
315
+ psbt: string;
316
+ }
317
+ export interface RgbCancelOffersRequest {
318
+ offers: string[];
319
+ }
320
+ export interface RgbCancelBidsRequest {
321
+ bids: string[];
322
+ }
323
+ export interface RgbSwapCancelResponse {
324
+ records: number;
325
+ offers: string[];
326
+ bids: string[];
327
+ }
328
+ export interface RgbValidationResponse {
329
+ valid: boolean;
330
+ message: string;
331
+ warnings: string[];
332
+ failures: string[];
333
+ }
334
+ export interface ContractKit {
335
+ info: ContractInfo;
336
+ armored: string;
337
+ }
338
+ export interface ContractInfo {
339
+ contractId: string;
340
+ contractType: string;
341
+ name: string;
342
+ ticker: string;
343
+ precision: number;
344
+ }
345
+ export interface AssetKit {
346
+ bitcoin?: string;
347
+ contract?: ContractKit;
348
+ }
349
+ export interface OrderValue {
350
+ bitcoin?: BigInt;
351
+ contract?: ContractCounterParty;
352
+ }
353
+ export interface ContractCounterParty {
354
+ kit: ContractKit;
355
+ amount: ContractAmount;
356
+ }
357
+ export interface SwapSupplement {
358
+ transferId: string;
359
+ transfer: string;
360
+ tapret: string;
361
+ psbt: string;
362
+ }
363
+ //# sourceMappingURL=rgb.d.ts.map
package/rgb.js ADDED
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ // Methods meant to work with RGB contracts defined within the web::rgb module from bitmask-core:
3
+ // https://github.com/diba-io/bitmask-core/blob/development/src/web.rs
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
27
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
28
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29
+ return new (P || (P = Promise))(function (resolve, reject) {
30
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
31
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
32
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
33
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
34
+ });
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.RgbSwap = exports.toContractPrecision = exports.toContractAmount = exports.toContractAmountStr = exports.toContractAmountRaw = exports.psbtSignAndPublishFile = exports.psbtPublishFile = exports.decodeInvoice = exports.getRgbWallet = exports.restoreWallet = exports.backupWallet = exports.cancelBid = exports.createBid = exports.canCreateBid = exports.cancelOffer = exports.createOffer = exports.canCreateOffer = exports.bidSwapSuppl = exports.offerSwapSuppl = exports.bids = exports.offers = exports.listOffers = exports.verifyTransfers = exports.listTransfers = exports.saveTransfer = exports.listInvoices = exports.removeInvoice = exports.acceptTransfer = exports.createAndPublishTransfer = exports.createTransfer = exports.canCreateTransfer = exports.createInvoice = exports.issueContract = exports.importContract = exports.listContracts = exports.getContract = exports.getVersion = void 0;
38
+ const BMC = __importStar(require("./bitmask_core"));
39
+ const getVersion = () => JSON.parse(BMC.get_rgb_version());
40
+ exports.getVersion = getVersion;
41
+ const getContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_contract(nostrHexSk, request)); });
42
+ exports.getContract = getContract;
43
+ const listContracts = (nostrHexSk, hidden) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_contracts(nostrHexSk, hidden)); });
44
+ exports.listContracts = listContracts;
45
+ const importContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.import_contract(nostrHexSk, request)); });
46
+ exports.importContract = importContract;
47
+ const issueContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.issue_contract_proxy(nostrHexSk, request)); });
48
+ exports.issueContract = issueContract;
49
+ const createInvoice = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_rgb_invoice(nostrHexSk, request)); });
50
+ exports.createInvoice = createInvoice;
51
+ const canCreateTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.can_create_transfer_contract(nostrHexSk, request)); });
52
+ exports.canCreateTransfer = canCreateTransfer;
53
+ const createTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_rgb_transfer(nostrHexSk, request)); });
54
+ exports.createTransfer = createTransfer;
55
+ const createAndPublishTransfer = (nostrHexSk, request, secrets) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_and_publish_rgb_transfer(nostrHexSk, request, secrets)); });
56
+ exports.createAndPublishTransfer = createAndPublishTransfer;
57
+ const acceptTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.accept_transfer(nostrHexSk, request)); });
58
+ exports.acceptTransfer = acceptTransfer;
59
+ const removeInvoice = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () {
60
+ yield BMC.remove_rgb_invoice(nostrHexSk, request);
61
+ });
62
+ exports.removeInvoice = removeInvoice;
63
+ const listInvoices = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_rgb_invoices(nostrHexSk)); });
64
+ exports.listInvoices = listInvoices;
65
+ const saveTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.save_transfer(nostrHexSk, request)); });
66
+ exports.saveTransfer = saveTransfer;
67
+ const listTransfers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_transfers(nostrHexSk)); });
68
+ exports.listTransfers = listTransfers;
69
+ const verifyTransfers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.verify_transfers(nostrHexSk)); });
70
+ exports.verifyTransfers = verifyTransfers;
71
+ const listOffers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_offers(nostrHexSk)); });
72
+ exports.listOffers = listOffers;
73
+ const offers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.offers(nostrHexSk)); });
74
+ exports.offers = offers;
75
+ const bids = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.bids(nostrHexSk)); });
76
+ exports.bids = bids;
77
+ const offerSwapSuppl = (nostrHexSk, offerId) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.offer_swap_suppl(nostrHexSk, offerId)); });
78
+ exports.offerSwapSuppl = offerSwapSuppl;
79
+ const bidSwapSuppl = (nostrHexSk, bidId) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.bid_swap_suppl(nostrHexSk, bidId)); });
80
+ exports.bidSwapSuppl = bidSwapSuppl;
81
+ const canCreateOffer = (nostrHexSk, request, secrets) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.can_create_offer(nostrHexSk, request, secrets)); });
82
+ exports.canCreateOffer = canCreateOffer;
83
+ const createOffer = (nostrHexSk, request, secrets) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_offer(nostrHexSk, request, secrets)); });
84
+ exports.createOffer = createOffer;
85
+ const cancelOffer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.cancel_offer(nostrHexSk, request)); });
86
+ exports.cancelOffer = cancelOffer;
87
+ const canCreateBid = (nostrHexSk, request, secrets) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.can_create_bid(nostrHexSk, request, secrets)); });
88
+ exports.canCreateBid = canCreateBid;
89
+ const createBid = (nostrHexSk, request, secrets) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_bid(nostrHexSk, request, secrets)); });
90
+ exports.createBid = createBid;
91
+ const cancelBid = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.cancel_bid(nostrHexSk, request)); });
92
+ exports.cancelBid = cancelBid;
93
+ // BITCOIN
94
+ const backupWallet = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.backup_rgb_data(nostrHexSk)); });
95
+ exports.backupWallet = backupWallet;
96
+ const restoreWallet = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.restore_rgb_data(nostrHexSk)); });
97
+ exports.restoreWallet = restoreWallet;
98
+ const getRgbWallet = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_rgb_wallet(nostrHexSk)); });
99
+ exports.getRgbWallet = getRgbWallet;
100
+ const decodeInvoice = (invoice) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.decode_rgb_invoice(invoice)); });
101
+ exports.decodeInvoice = decodeInvoice;
102
+ const psbtPublishFile = (request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.psbt_publish_file(request)); });
103
+ exports.psbtPublishFile = psbtPublishFile;
104
+ const psbtSignAndPublishFile = (_nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.psbt_sign_and_publish_file(request)); });
105
+ exports.psbtSignAndPublishFile = psbtSignAndPublishFile;
106
+ const toContractAmountRaw = (decimal, precision) => JSON.parse(BMC.convert_contract_amount_raw(decimal, precision));
107
+ exports.toContractAmountRaw = toContractAmountRaw;
108
+ const toContractAmountStr = (amount, precision) => JSON.parse(BMC.convert_contract_amount_string(amount, precision));
109
+ exports.toContractAmountStr = toContractAmountStr;
110
+ const toContractAmount = (amount) => JSON.parse(BMC.parse_contract_amount(amount));
111
+ exports.toContractAmount = toContractAmount;
112
+ const toContractPrecision = (amount, precision) => JSON.parse(BMC.parse_contract_amount_precision(amount, precision));
113
+ exports.toContractPrecision = toContractPrecision;
114
+ var RgbSwap;
115
+ (function (RgbSwap) {
116
+ RgbSwap["auction"] = "auction";
117
+ RgbSwap["p2p"] = "p2p";
118
+ RgbSwap["hotSwap"] = "hotswap";
119
+ RgbSwap["airdrop"] = "airdrop";
120
+ })(RgbSwap || (exports.RgbSwap = RgbSwap = {}));