@1sat/actions 0.0.1
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/balance/index.d.ts +41 -0
- package/dist/balance/index.d.ts.map +1 -0
- package/dist/balance/index.js +111 -0
- package/dist/balance/index.js.map +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/inscriptions/index.d.ts +26 -0
- package/dist/inscriptions/index.d.ts.map +1 -0
- package/dist/inscriptions/index.js +116 -0
- package/dist/inscriptions/index.js.map +1 -0
- package/dist/locks/index.d.ts +48 -0
- package/dist/locks/index.d.ts.map +1 -0
- package/dist/locks/index.js +296 -0
- package/dist/locks/index.js.map +1 -0
- package/dist/ordinals/index.d.ts +118 -0
- package/dist/ordinals/index.d.ts.map +1 -0
- package/dist/ordinals/index.js +850 -0
- package/dist/ordinals/index.js.map +1 -0
- package/dist/payments/index.d.ts +49 -0
- package/dist/payments/index.d.ts.map +1 -0
- package/dist/payments/index.js +194 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/registry.d.ts +62 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +75 -0
- package/dist/registry.js.map +1 -0
- package/dist/signing/index.d.ts +36 -0
- package/dist/signing/index.d.ts.map +1 -0
- package/dist/signing/index.js +82 -0
- package/dist/signing/index.js.map +1 -0
- package/dist/sweep/index.d.ts +38 -0
- package/dist/sweep/index.d.ts.map +1 -0
- package/dist/sweep/index.js +748 -0
- package/dist/sweep/index.js.map +1 -0
- package/dist/sweep/types.d.ts +79 -0
- package/dist/sweep/types.d.ts.map +1 -0
- package/dist/sweep/types.js +5 -0
- package/dist/sweep/types.js.map +1 -0
- package/dist/tokens/index.d.ts +88 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +548 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/types.d.ts +72 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Balance Module
|
|
3
|
+
*
|
|
4
|
+
* Actions for querying wallet balance and payment UTXOs.
|
|
5
|
+
*/
|
|
6
|
+
import type { Action } from '../types';
|
|
7
|
+
export interface Balance {
|
|
8
|
+
/** Balance in satoshis */
|
|
9
|
+
satoshis: number;
|
|
10
|
+
/** Balance in BSV */
|
|
11
|
+
bsv: number;
|
|
12
|
+
/** Balance in USD cents */
|
|
13
|
+
usdInCents: number;
|
|
14
|
+
}
|
|
15
|
+
export interface PaymentUtxo {
|
|
16
|
+
txid: string;
|
|
17
|
+
vout: number;
|
|
18
|
+
satoshis: number;
|
|
19
|
+
script: string;
|
|
20
|
+
}
|
|
21
|
+
/** Input for getBalance action (no required params) */
|
|
22
|
+
export type GetBalanceInput = Record<string, never>;
|
|
23
|
+
/**
|
|
24
|
+
* Get wallet balance with USD conversion.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getBalance: Action<GetBalanceInput, Balance>;
|
|
27
|
+
/** Input for getPaymentUtxos action (no required params) */
|
|
28
|
+
export type GetPaymentUtxosInput = Record<string, never>;
|
|
29
|
+
/**
|
|
30
|
+
* Get payment UTXOs for external use.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getPaymentUtxos: Action<GetPaymentUtxosInput, PaymentUtxo[]>;
|
|
33
|
+
/** Input for getExchangeRate action (no required params) */
|
|
34
|
+
export type GetExchangeRateInput = Record<string, never>;
|
|
35
|
+
/**
|
|
36
|
+
* Get current BSV/USD exchange rate.
|
|
37
|
+
*/
|
|
38
|
+
export declare const getExchangeRate: Action<GetExchangeRateInput, number>;
|
|
39
|
+
/** All balance actions for registry */
|
|
40
|
+
export declare const balanceActions: (Action<GetBalanceInput, Balance> | Action<GetPaymentUtxosInput, PaymentUtxo[]> | Action<GetExchangeRateInput, number>)[];
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/balance/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAMtC,MAAM,WAAW,OAAO;IACvB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACd;AAyCD,uDAAuD;AACvD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAEnD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,eAAe,EAAE,OAAO,CAqBvD,CAAA;AAED,4DAA4D;AAC5D,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,oBAAoB,EAAE,WAAW,EAAE,CA0BvE,CAAA;AAED,4DAA4D;AAC5D,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAahE,CAAA;AAMD,uCAAuC;AACvC,eAAO,MAAM,cAAc,2HAAiD,CAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Balance Module
|
|
3
|
+
*
|
|
4
|
+
* Actions for querying wallet balance and payment UTXOs.
|
|
5
|
+
*/
|
|
6
|
+
import { EXCHANGE_RATE_CACHE_TTL, FUNDING_BASKET, WOC_MAINNET_URL, WOC_TESTNET_URL, } from '../constants';
|
|
7
|
+
// Module-level cache for exchange rate
|
|
8
|
+
let exchangeRateCache = null;
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Internal helpers
|
|
11
|
+
// ============================================================================
|
|
12
|
+
async function fetchExchangeRate(chain, wocApiKey) {
|
|
13
|
+
if (exchangeRateCache &&
|
|
14
|
+
Date.now() - exchangeRateCache.timestamp < EXCHANGE_RATE_CACHE_TTL) {
|
|
15
|
+
return exchangeRateCache.rate;
|
|
16
|
+
}
|
|
17
|
+
const baseUrl = chain === 'main' ? WOC_MAINNET_URL : WOC_TESTNET_URL;
|
|
18
|
+
const headers = {};
|
|
19
|
+
if (wocApiKey)
|
|
20
|
+
headers['woc-api-key'] = wocApiKey;
|
|
21
|
+
try {
|
|
22
|
+
const response = await fetch(`${baseUrl}/exchangerate`, { headers });
|
|
23
|
+
if (!response.ok)
|
|
24
|
+
throw new Error(`Failed to fetch: ${response.statusText}`);
|
|
25
|
+
const data = await response.json();
|
|
26
|
+
const rate = Number(data.rate.toFixed(2));
|
|
27
|
+
exchangeRateCache = { rate, timestamp: Date.now() };
|
|
28
|
+
return rate;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return exchangeRateCache?.rate ?? 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get wallet balance with USD conversion.
|
|
36
|
+
*/
|
|
37
|
+
export const getBalance = {
|
|
38
|
+
meta: {
|
|
39
|
+
name: 'getBalance',
|
|
40
|
+
description: 'Get wallet balance in satoshis, BSV, and USD cents',
|
|
41
|
+
category: 'balance',
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
properties: {},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
async execute(ctx) {
|
|
48
|
+
const exchangeRate = await fetchExchangeRate(ctx.chain, ctx.wocApiKey);
|
|
49
|
+
const result = await ctx.wallet.listOutputs({
|
|
50
|
+
basket: FUNDING_BASKET,
|
|
51
|
+
limit: 10000,
|
|
52
|
+
});
|
|
53
|
+
const satoshis = result.outputs.reduce((sum, o) => sum + o.satoshis, 0);
|
|
54
|
+
const bsv = satoshis / 100_000_000;
|
|
55
|
+
const usdInCents = Math.round(bsv * exchangeRate * 100);
|
|
56
|
+
return { satoshis, bsv, usdInCents };
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Get payment UTXOs for external use.
|
|
61
|
+
*/
|
|
62
|
+
export const getPaymentUtxos = {
|
|
63
|
+
meta: {
|
|
64
|
+
name: 'getPaymentUtxos',
|
|
65
|
+
description: 'Get payment UTXOs from the wallet for external use',
|
|
66
|
+
category: 'balance',
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
async execute(ctx) {
|
|
73
|
+
const result = await ctx.wallet.listOutputs({
|
|
74
|
+
basket: FUNDING_BASKET,
|
|
75
|
+
include: 'locking scripts',
|
|
76
|
+
limit: 10000,
|
|
77
|
+
});
|
|
78
|
+
return result.outputs.map((o) => {
|
|
79
|
+
const [txid, voutStr] = o.outpoint.split('.');
|
|
80
|
+
return {
|
|
81
|
+
txid,
|
|
82
|
+
vout: Number.parseInt(voutStr, 10),
|
|
83
|
+
satoshis: o.satoshis,
|
|
84
|
+
script: o.lockingScript || '',
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Get current BSV/USD exchange rate.
|
|
91
|
+
*/
|
|
92
|
+
export const getExchangeRate = {
|
|
93
|
+
meta: {
|
|
94
|
+
name: 'getExchangeRate',
|
|
95
|
+
description: 'Get current BSV/USD exchange rate from WhatsOnChain',
|
|
96
|
+
category: 'balance',
|
|
97
|
+
inputSchema: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
properties: {},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
async execute(ctx) {
|
|
103
|
+
return fetchExchangeRate(ctx.chain, ctx.wocApiKey);
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
// ============================================================================
|
|
107
|
+
// Module exports
|
|
108
|
+
// ============================================================================
|
|
109
|
+
/** All balance actions for registry */
|
|
110
|
+
export const balanceActions = [getBalance, getPaymentUtxos, getExchangeRate];
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/balance/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACN,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,eAAe,GACf,MAAM,cAAc,CAAA;AAuBrB,uCAAuC;AACvC,IAAI,iBAAiB,GAA+C,IAAI,CAAA;AAExE,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,KAAK,UAAU,iBAAiB,CAC/B,KAAsB,EACtB,SAAkB;IAElB,IACC,iBAAiB;QACjB,IAAI,CAAC,GAAG,EAAE,GAAG,iBAAiB,CAAC,SAAS,GAAG,uBAAuB,EACjE,CAAC;QACF,OAAO,iBAAiB,CAAC,IAAI,CAAA;IAC9B,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAA;IACpE,MAAM,OAAO,GAA2B,EAAE,CAAA;IAC1C,IAAI,SAAS;QAAE,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IAEjD,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,eAAe,EAAE,EAAE,OAAO,E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AAO,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IACnD,CAAC;CACD,CAAA;AAED,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,uCAAuC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,eAAe,CAAC,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { BSV21_BASKET, BSV21_FEE_SATS, BSV21_PROTOCOL, EXCHANGE_RATE_CACHE_TTL, FUNDING_BASKET, LOCK_BASKET, LOCK_PREFIX, LOCK_SUFFIX, MAX_INSCRIPTION_BYTES, MIN_UNLOCK_SATS, MESSAGE_SIGNING_PROTOCOL, ONESAT_MAINNET_CONTENT_URL, ONESAT_MAINNET_URL, ONESAT_PROTOCOL, ONESAT_TESTNET_CONTENT_URL, ONESAT_TESTNET_URL, ORDINALS_BASKET, ORD_LOCK_PREFIX, ORD_LOCK_SUFFIX, WOC_MAINNET_URL, WOC_TESTNET_URL, } from '@1sat/types';
|
|
2
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,GACf,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { BSV21_BASKET, BSV21_FEE_SATS, BSV21_PROTOCOL, EXCHANGE_RATE_CACHE_TTL, FUNDING_BASKET, LOCK_BASKET, LOCK_PREFIX, LOCK_SUFFIX, MAX_INSCRIPTION_BYTES, MIN_UNLOCK_SATS, MESSAGE_SIGNING_PROTOCOL, ONESAT_MAINNET_CONTENT_URL, ONESAT_MAINNET_URL, ONESAT_PROTOCOL, ONESAT_TESTNET_CONTENT_URL, ONESAT_TESTNET_URL, ORDINALS_BASKET, ORD_LOCK_PREFIX, ORD_LOCK_SUFFIX, WOC_MAINNET_URL, WOC_TESTNET_URL, } from '@1sat/types';
|
|
2
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,GACf,MAAM,aAAa,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 1Sat Actions
|
|
3
|
+
*
|
|
4
|
+
* This module provides actions (self-describing operations) for interacting with the 1Sat ecosystem.
|
|
5
|
+
* All actions work with any BRC-100 compatible wallet interface via OneSatContext.
|
|
6
|
+
*/
|
|
7
|
+
export { type Action, type ActionCategory, type ActionMetadata, type JsonSchemaProperty, type OneSatContext, createContext, } from './types';
|
|
8
|
+
export { ActionRegistry, actionRegistry, type McpTool } from './registry';
|
|
9
|
+
export * from './constants';
|
|
10
|
+
export * from './balance';
|
|
11
|
+
export * from './payments';
|
|
12
|
+
export * from './ordinals';
|
|
13
|
+
export * from './tokens';
|
|
14
|
+
export * from './inscriptions';
|
|
15
|
+
export * from './locks';
|
|
16
|
+
export * from './signing';
|
|
17
|
+
export * from './sweep';
|
|
18
|
+
export type { CreateActionArgs, CreateActionInput, CreateActionOutput, CreateActionResult, ListOutputsArgs, ListOutputsResult, WalletInterface, WalletOutput, } from '@bsv/sdk';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACN,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,aAAa,GACb,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AAGzE,cAAc,aAAa,CAAA;AAG3B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AAGzB,cAAc,SAAS,CAAA;AAwBvB,YAAY,EACX,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,YAAY,GACZ,MAAM,UAAU,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 1Sat Actions
|
|
3
|
+
*
|
|
4
|
+
* This module provides actions (self-describing operations) for interacting with the 1Sat ecosystem.
|
|
5
|
+
* All actions work with any BRC-100 compatible wallet interface via OneSatContext.
|
|
6
|
+
*/
|
|
7
|
+
// Export action types and helpers
|
|
8
|
+
export { createContext, } from './types';
|
|
9
|
+
// Export action registry
|
|
10
|
+
export { ActionRegistry, actionRegistry } from './registry';
|
|
11
|
+
// Export constants
|
|
12
|
+
export * from './constants';
|
|
13
|
+
// Export module actions and types
|
|
14
|
+
export * from './balance';
|
|
15
|
+
export * from './payments';
|
|
16
|
+
export * from './ordinals';
|
|
17
|
+
export * from './tokens';
|
|
18
|
+
export * from './inscriptions';
|
|
19
|
+
export * from './locks';
|
|
20
|
+
export * from './signing';
|
|
21
|
+
// Export sweep module (uses external signing, not action-based)
|
|
22
|
+
export * from './sweep';
|
|
23
|
+
import { balanceActions } from './balance';
|
|
24
|
+
import { inscriptionsActions } from './inscriptions';
|
|
25
|
+
import { locksActions } from './locks';
|
|
26
|
+
import { ordinalsActions } from './ordinals';
|
|
27
|
+
import { paymentsActions } from './payments';
|
|
28
|
+
import { actionRegistry } from './registry';
|
|
29
|
+
import { signingActions } from './signing';
|
|
30
|
+
import { sweepActions } from './sweep';
|
|
31
|
+
import { tokensActions } from './tokens';
|
|
32
|
+
actionRegistry.registerAll([
|
|
33
|
+
...balanceActions,
|
|
34
|
+
...paymentsActions,
|
|
35
|
+
...ordinalsActions,
|
|
36
|
+
...tokensActions,
|
|
37
|
+
...inscriptionsActions,
|
|
38
|
+
...locksActions,
|
|
39
|
+
...signingActions,
|
|
40
|
+
...sweepActions,
|
|
41
|
+
]);
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kCAAkC;AAClC,OAAO,EAMN,aAAa,GACb,MAAM,SAAS,CAAA;AAEhB,yBAAyB;AACzB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAgB,MAAM,YAAY,CAAA;AAEzE,mBAAmB;AACnB,cAAc,aAAa,CAAA;AAE3B,kCAAkC;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AAEzB,gEAAgE;AAChE,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,cAAc,CAAC,WAAW,CAAC;IAC1B,GAAG,cAAc;IACjB,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,GAAG,aAAa;IAChB,GAAG,mBAAmB;IACtB,GAAG,YAAY;IACf,GAAG,cAAc;IACjB,GAAG,YAAY;CACf,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inscriptions Module
|
|
3
|
+
*
|
|
4
|
+
* Actions for creating inscriptions.
|
|
5
|
+
*/
|
|
6
|
+
import type { Action } from '../types';
|
|
7
|
+
export interface InscribeRequest {
|
|
8
|
+
/** Base64 encoded content */
|
|
9
|
+
base64Content: string;
|
|
10
|
+
/** Content type (MIME type) */
|
|
11
|
+
contentType: string;
|
|
12
|
+
/** Optional MAP metadata */
|
|
13
|
+
map?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export interface InscribeResponse {
|
|
16
|
+
txid?: string;
|
|
17
|
+
rawtx?: string;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create an inscription.
|
|
22
|
+
*/
|
|
23
|
+
export declare const inscribe: Action<InscribeRequest, InscribeResponse>;
|
|
24
|
+
/** All inscription actions for registry */
|
|
25
|
+
export declare const inscriptionsActions: Action<InscribeRequest, InscribeResponse>[];
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inscriptions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAMtC,MAAM,WAAW,eAAe;IAC/B,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AA0BD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAwF9D,CAAA;AAMD,2CAA2C;AAC3C,eAAO,MAAM,mBAAmB,6CAAa,CAAA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inscriptions Module
|
|
3
|
+
*
|
|
4
|
+
* Actions for creating inscriptions.
|
|
5
|
+
*/
|
|
6
|
+
import { Inscription } from '@bopen-io/templates';
|
|
7
|
+
import { P2PKH, PublicKey, Script, Utils } from '@bsv/sdk';
|
|
8
|
+
import { MAX_INSCRIPTION_BYTES, ONESAT_PROTOCOL, ORDINALS_BASKET, } from '../constants';
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Internal helpers
|
|
11
|
+
// ============================================================================
|
|
12
|
+
function buildInscriptionScript(address, base64Content, contentType) {
|
|
13
|
+
const content = Utils.toArray(base64Content, 'base64');
|
|
14
|
+
const inscription = Inscription.create(new Uint8Array(content), contentType);
|
|
15
|
+
const inscriptionScript = inscription.lock();
|
|
16
|
+
const p2pkhScript = new P2PKH().lock(address);
|
|
17
|
+
const combined = new Script();
|
|
18
|
+
for (const chunk of inscriptionScript.chunks)
|
|
19
|
+
combined.chunks.push(chunk);
|
|
20
|
+
for (const chunk of p2pkhScript.chunks)
|
|
21
|
+
combined.chunks.push(chunk);
|
|
22
|
+
return combined;
|
|
23
|
+
}
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// Actions
|
|
26
|
+
// ============================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Create an inscription.
|
|
29
|
+
*/
|
|
30
|
+
export const inscribe = {
|
|
31
|
+
meta: {
|
|
32
|
+
name: 'inscribe',
|
|
33
|
+
description: 'Create a new inscription with the given content and type',
|
|
34
|
+
category: 'inscriptions',
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
base64Content: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Base64 encoded content',
|
|
41
|
+
},
|
|
42
|
+
contentType: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Content type (MIME type)',
|
|
45
|
+
},
|
|
46
|
+
map: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
description: 'Optional MAP metadata',
|
|
49
|
+
properties: {},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ['base64Content', 'contentType'],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
async execute(ctx, input) {
|
|
56
|
+
try {
|
|
57
|
+
const decoded = Utils.toArray(input.base64Content, 'base64');
|
|
58
|
+
if (decoded.length > MAX_INSCRIPTION_BYTES) {
|
|
59
|
+
return {
|
|
60
|
+
error: `Inscription data too large: ${decoded.length} bytes (max ${MAX_INSCRIPTION_BYTES})`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const keyID = Date.now().toString();
|
|
64
|
+
const { publicKey } = await ctx.wallet.getPublicKey({
|
|
65
|
+
protocolID: ONESAT_PROTOCOL,
|
|
66
|
+
keyID,
|
|
67
|
+
counterparty: 'self',
|
|
68
|
+
forSelf: true,
|
|
69
|
+
});
|
|
70
|
+
const address = PublicKey.fromString(publicKey).toAddress();
|
|
71
|
+
const lockingScript = buildInscriptionScript(address, input.base64Content, input.contentType);
|
|
72
|
+
// Build tags - type is always included, name from MAP if provided
|
|
73
|
+
const tags = [`type:${input.contentType}`];
|
|
74
|
+
if (input.map?.name) {
|
|
75
|
+
tags.push(`name:${input.map.name}`);
|
|
76
|
+
}
|
|
77
|
+
const result = await ctx.wallet.createAction({
|
|
78
|
+
description: 'Create inscription',
|
|
79
|
+
outputs: [
|
|
80
|
+
{
|
|
81
|
+
lockingScript: lockingScript.toHex(),
|
|
82
|
+
satoshis: 1,
|
|
83
|
+
outputDescription: 'Inscription',
|
|
84
|
+
basket: ORDINALS_BASKET,
|
|
85
|
+
tags,
|
|
86
|
+
customInstructions: JSON.stringify({
|
|
87
|
+
protocolID: ONESAT_PROTOCOL,
|
|
88
|
+
keyID,
|
|
89
|
+
...(input.map?.name && { name: input.map.name.slice(0, 64) }),
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
options: { signAndProcess: true, acceptDelayedBroadcast: false },
|
|
94
|
+
});
|
|
95
|
+
if (!result.txid) {
|
|
96
|
+
return { error: 'no-txid-returned' };
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
txid: result.txid,
|
|
100
|
+
rawtx: result.tx ? Utils.toHex(result.tx) : undefined,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
console.error('[inscribe]', error);
|
|
105
|
+
return {
|
|
106
|
+
error: error instanceof Error ? error.message : 'unknown-error',
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
// ============================================================================
|
|
112
|
+
// Module exports
|
|
113
|
+
// ============================================================================
|
|
114
|
+
/** All inscription actions for registry */
|
|
115
|
+
export const inscriptionsActions = [inscribe];
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inscriptions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,EACN,qBAAqB,EACrB,eAAe,EACf,eAAe,GACf,MAAM,cAAc,CAAA;AAsBrB,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,SAAS,sBAAsB,CAC9B,OAAe,EACf,aAAqB,EACrB,WAAmB;IAEnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IACtD,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAA;IAC5E,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,EAAE,CAAA;IAC5C,MAAM,WAAW,GAAG,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAE7C,MAAM,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAA;IAC7B,KAAK,MAAM,KAAK,IAAI,iBAAiB,CAAC,MAAM;QAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACzE,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,MAAM;QAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACnE,OAAO,QAAQ,CAAA;AAChB,CAAC;AAED,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E;;GA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AE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;YAClC,OAAO;gBACN,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAC/D,CAAA;QACF,CAAC;IACF,CAAC;CACD,CAAA;AAED,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,CAAC,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locks Module
|
|
3
|
+
*
|
|
4
|
+
* Actions for time-locking BSV.
|
|
5
|
+
*/
|
|
6
|
+
import type { Action } from '../types';
|
|
7
|
+
export interface LockBsvRequest {
|
|
8
|
+
/** Amount in satoshis to lock */
|
|
9
|
+
satoshis: number;
|
|
10
|
+
/** Block height until which to lock */
|
|
11
|
+
until: number;
|
|
12
|
+
}
|
|
13
|
+
export interface LockData {
|
|
14
|
+
/** Total locked satoshis */
|
|
15
|
+
totalLocked: number;
|
|
16
|
+
/** Unlockable satoshis (matured locks) */
|
|
17
|
+
unlockable: number;
|
|
18
|
+
/** Next unlock block height */
|
|
19
|
+
nextUnlock: number;
|
|
20
|
+
}
|
|
21
|
+
export interface LockOperationResponse {
|
|
22
|
+
txid?: string;
|
|
23
|
+
rawtx?: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Input for getLockData action (no required params) */
|
|
27
|
+
export type GetLockDataInput = Record<string, never>;
|
|
28
|
+
/**
|
|
29
|
+
* Get lock data summary.
|
|
30
|
+
*/
|
|
31
|
+
export declare const getLockData: Action<GetLockDataInput, LockData>;
|
|
32
|
+
/** Input for lockBsv action */
|
|
33
|
+
export interface LockBsvInput {
|
|
34
|
+
requests: LockBsvRequest[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Lock BSV until a block height.
|
|
38
|
+
*/
|
|
39
|
+
export declare const lockBsv: Action<LockBsvInput, LockOperationResponse>;
|
|
40
|
+
/** Input for unlockBsv action (no required params) */
|
|
41
|
+
export type UnlockBsvInput = Record<string, never>;
|
|
42
|
+
/**
|
|
43
|
+
* Unlock matured BSV locks.
|
|
44
|
+
*/
|
|
45
|
+
export declare const unlockBsv: Action<UnlockBsvInput, LockOperationResponse>;
|
|
46
|
+
/** All lock actions for registry */
|
|
47
|
+
export declare const locksActions: (Action<GetLockDataInput, LockData> | Action<LockBsvInput, LockOperationResponse> | Action<UnlockBsvInput, LockOperationResponse>)[];
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAatC,MAAM,WAAW,cAAc;IAC9B,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,QAAQ;IACxB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAmBD,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CA4C1D,CAAA;AAED,+BAA+B;AAC/B,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,qBAAqB,CAoF/D,CAAA;AAED,sDAAsD;AACtD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,qBAAqB,CAoKnE,CAAA;AAMD,oCAAoC;AACpC,eAAO,MAAM,YAAY,sIAAoC,CAAA"}
|