sats-connect
Advanced tools
Comparing version 1.1.1-9aab971 to 1.1.1-a719580
@@ -1,2 +0,2 @@ | ||
import type { Capability } from 'src/provider'; | ||
import type { Capability } from '../provider'; | ||
import type { RequestOptions, RequestPayload } from '../types'; | ||
@@ -3,0 +3,0 @@ export interface GetCapabilitiesPayload extends RequestPayload { |
@@ -6,8 +6,6 @@ "use strict"; | ||
const provider_1 = require("../provider"); | ||
const MAX_CONTENT_LENGTH = 400e3; // 400kb is the max miners will mine | ||
const MAX_CONTENT_LENGTH_MAINNET = 400e3; // 400kb is the max miners will mine | ||
const MAX_CONTENT_LENGTH_TESTNET = 60e3; // 60kb limit on Testnet to prevent spam | ||
const validateInscriptionPayload = (payload) => { | ||
const { contentType, content, payloadType, network, appFeeAddress, appFee } = payload; | ||
if (network.type !== 'Mainnet') { | ||
throw new Error('Only mainnet is currently supported for inscriptions'); | ||
} | ||
if (!/^[a-z]+\/[a-z0-9\-\.\+]+(?=;.*|$)/.test(contentType)) { | ||
@@ -22,3 +20,4 @@ throw new Error('Invalid content type detected'); | ||
} | ||
if (content.length > MAX_CONTENT_LENGTH) { | ||
if (content.length > | ||
(network.type === 'Mainnet' ? MAX_CONTENT_LENGTH_MAINNET : MAX_CONTENT_LENGTH_TESTNET)) { | ||
throw new Error('Content too large'); | ||
@@ -25,0 +24,0 @@ } |
{ | ||
"name": "sats-connect", | ||
"version": "1.1.1-9aab971", | ||
"version": "1.1.1-a719580", | ||
"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
64797
611