sats-connect
Advanced tools
Comparing version 0.5.0-6d20add to 0.5.0-6f10033
export * from './addresses'; | ||
export * from './call'; | ||
export * from './inscriptions'; | ||
export * from './messages'; | ||
@@ -4,0 +5,0 @@ export * from './provider'; |
@@ -19,2 +19,3 @@ "use strict"; | ||
__exportStar(require("./call"), exports); | ||
__exportStar(require("./inscriptions"), exports); | ||
__exportStar(require("./messages"), exports); | ||
@@ -21,0 +22,0 @@ __exportStar(require("./provider"), exports); |
@@ -1,3 +0,3 @@ | ||
export * from './binaryInscription'; | ||
export * from './fileInscription'; | ||
export * from './textInscription'; | ||
export * from './types'; |
@@ -17,5 +17,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./binaryInscription"), exports); | ||
__exportStar(require("./fileInscription"), exports); | ||
__exportStar(require("./textInscription"), exports); | ||
__exportStar(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -6,15 +6,7 @@ "use strict"; | ||
const provider_1 = require("../provider"); | ||
const common_1 = require("./common"); | ||
const createTextInscription = async (options) => { | ||
const { getProvider } = options; | ||
const provider = await (0, provider_1.getProviderOrThrow)(getProvider); | ||
const { contentType, network, text } = options.payload; | ||
if (network.type !== 'Mainnet') { | ||
throw new Error('Only mainnet is currently supported for inscriptions'); | ||
} | ||
if (!text || text.length === 0) { | ||
throw new Error('Empty content not allowed'); | ||
} | ||
if (!/^[a-z]+\/[a-z0-9\-\.\+](?=;.*|$)/.test(contentType)) { | ||
throw new Error('Invalid content type detected'); | ||
} | ||
(0, common_1.validateInscriptionPayload)(options.payload); | ||
try { | ||
@@ -21,0 +13,0 @@ const request = (0, jsontokens_1.createUnsecuredToken)(options.payload); |
@@ -5,14 +5,18 @@ import type { RequestOptions, RequestPayload } from '../types'; | ||
}; | ||
export interface CreateTextInscriptionPayload extends RequestPayload { | ||
text: string; | ||
interface BaseCreateInscriptionPayload extends RequestPayload { | ||
contentType: string; | ||
inscriptionFee?: number; | ||
feeAddress?: string; | ||
initialFeeRate?: number; | ||
} | ||
export interface CreateTextInscriptionPayload extends BaseCreateInscriptionPayload { | ||
text: string; | ||
} | ||
export type CreateTextInscriptionResponse = CreateInscriptionResponse; | ||
export type CreateTextInscriptionOptions = RequestOptions<CreateTextInscriptionPayload, CreateTextInscriptionResponse>; | ||
export interface CreateBinaryInscriptionPayload extends RequestPayload { | ||
export interface CreateFileInscriptionPayload extends BaseCreateInscriptionPayload { | ||
dataBase64: string; | ||
contentType: string; | ||
} | ||
export type CreateBinaryInscriptionResponse = CreateInscriptionResponse; | ||
export type CreateBinaryInscriptionOptions = RequestOptions<CreateBinaryInscriptionPayload, CreateBinaryInscriptionResponse>; | ||
export type CreateFileInscriptionResponse = CreateInscriptionResponse; | ||
export type CreateFileInscriptionOptions = RequestOptions<CreateFileInscriptionPayload, CreateFileInscriptionResponse>; | ||
export {}; |
import type { GetAddressResponse } from '../addresses'; | ||
import type { CallWalletResponse } from '../call'; | ||
import type { CreateBinaryInscriptionResponse, CreateTextInscriptionResponse } from '../inscriptions'; | ||
import type { CreateFileInscriptionResponse, CreateTextInscriptionResponse } from '../inscriptions'; | ||
import type { SignMessageResponse } from '../messages'; | ||
@@ -13,3 +13,3 @@ import type { SendBtcTransactionResponse, SignTransactionResponse } from '../transactions'; | ||
createTextInscription: (request: string) => Promise<CreateTextInscriptionResponse>; | ||
createBinaryInscription: (request: string) => Promise<CreateBinaryInscriptionResponse>; | ||
createFileInscription: (request: string) => Promise<CreateFileInscriptionResponse>; | ||
} | ||
@@ -16,0 +16,0 @@ declare global { |
{ | ||
"name": "sats-connect", | ||
"version": "0.5.0-6d20add", | ||
"version": "0.5.0-6f10033", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
58621
60
523
0