@secondlayer/cli 5.6.2 → 5.6.4
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/LICENSE +21 -0
- package/dist/cli.js +39 -31
- package/dist/cli.js.map +3 -3
- package/package.json +12 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ryan Waits
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/dist/cli.js
CHANGED
|
@@ -32321,7 +32321,13 @@ var {
|
|
|
32321
32321
|
// package.json
|
|
32322
32322
|
var package_default = {
|
|
32323
32323
|
name: "@secondlayer/cli",
|
|
32324
|
-
version: "5.6.
|
|
32324
|
+
version: "5.6.4",
|
|
32325
|
+
repository: {
|
|
32326
|
+
type: "git",
|
|
32327
|
+
url: "git+https://github.com/ryanwaits/secondlayer.git",
|
|
32328
|
+
directory: "packages/cli"
|
|
32329
|
+
},
|
|
32330
|
+
homepage: "https://github.com/ryanwaits/secondlayer/tree/main/packages/cli#readme",
|
|
32325
32331
|
description: "CLI for subgraphs and blockchain indexing on Stacks",
|
|
32326
32332
|
type: "module",
|
|
32327
32333
|
bin: {
|
|
@@ -32363,11 +32369,11 @@ var package_default = {
|
|
|
32363
32369
|
license: "MIT",
|
|
32364
32370
|
dependencies: {
|
|
32365
32371
|
"@inquirer/prompts": "^8.2.0",
|
|
32366
|
-
"@secondlayer/bundler": "^0.3.
|
|
32367
|
-
"@secondlayer/sdk": "^4.0.
|
|
32368
|
-
"@secondlayer/shared": "^6.4.
|
|
32369
|
-
"@secondlayer/stacks": "^2.2.
|
|
32370
|
-
"@secondlayer/subgraphs": "^3.
|
|
32372
|
+
"@secondlayer/bundler": "^0.3.7",
|
|
32373
|
+
"@secondlayer/sdk": "^4.0.2",
|
|
32374
|
+
"@secondlayer/shared": "^6.4.5",
|
|
32375
|
+
"@secondlayer/stacks": "^2.2.1",
|
|
32376
|
+
"@secondlayer/subgraphs": "^3.2.1",
|
|
32371
32377
|
"@biomejs/js-api": "^0.7.0",
|
|
32372
32378
|
"@biomejs/wasm-nodejs": "^1.9.0",
|
|
32373
32379
|
esbuild: "^0.19.0",
|
|
@@ -34804,7 +34810,7 @@ export default defineSubgraph({
|
|
|
34804
34810
|
// { type: "stx_transfer", minAmount: 1000000n }
|
|
34805
34811
|
// { type: "nft_transfer", assetIdentifier: "SP...nft::nft-name" }
|
|
34806
34812
|
sources: {
|
|
34807
|
-
handler: { type: "
|
|
34813
|
+
handler: { type: "ft_transfer" },
|
|
34808
34814
|
},
|
|
34809
34815
|
|
|
34810
34816
|
// Schema defines the tables this subgraph creates.
|
|
@@ -34825,9 +34831,11 @@ export default defineSubgraph({
|
|
|
34825
34831
|
// ctx.patchOrInsert(), ctx.findOne(), ctx.findMany()
|
|
34826
34832
|
handlers: {
|
|
34827
34833
|
handler: (event, ctx) => {
|
|
34834
|
+
// event is typed from the source — for ft_transfer: sender, recipient,
|
|
34835
|
+
// amount (bigint), assetIdentifier. ctx.insert is checked against schema.
|
|
34828
34836
|
ctx.insert("data", {
|
|
34829
|
-
sender:
|
|
34830
|
-
amount: event.amount
|
|
34837
|
+
sender: event.sender,
|
|
34838
|
+
amount: event.amount,
|
|
34831
34839
|
memo: null,
|
|
34832
34840
|
});
|
|
34833
34841
|
},
|
|
@@ -34957,18 +34965,22 @@ export default defineSubgraph({
|
|
|
34957
34965
|
|
|
34958
34966
|
handlers: {
|
|
34959
34967
|
registry: (event, ctx) => {
|
|
34960
|
-
|
|
34961
|
-
|
|
34962
|
-
|
|
34963
|
-
|
|
34964
|
-
|
|
34965
|
-
|
|
34968
|
+
if (!event.topic) return;
|
|
34969
|
+
// event.data is untyped across topics — cast to the fields you read, or
|
|
34970
|
+
// declare \`prints\` per topic on the source for fully typed event.data.
|
|
34971
|
+
const data = event.data as {
|
|
34972
|
+
requestId?: bigint;
|
|
34973
|
+
amount?: bigint | string;
|
|
34974
|
+
sender?: string;
|
|
34975
|
+
bitcoinTxid?: string;
|
|
34976
|
+
burnHeight?: bigint;
|
|
34977
|
+
};
|
|
34966
34978
|
ctx.insert("flows", {
|
|
34967
|
-
topic,
|
|
34979
|
+
topic: event.topic,
|
|
34968
34980
|
request_id: data.requestId ?? null,
|
|
34969
34981
|
amount: data.amount != null ? String(data.amount) : null,
|
|
34970
|
-
sender:
|
|
34971
|
-
bitcoin_txid:
|
|
34982
|
+
sender: data.sender ?? null,
|
|
34983
|
+
bitcoin_txid: data.bitcoinTxid ?? null,
|
|
34972
34984
|
burn_height: data.burnHeight ?? null,
|
|
34973
34985
|
});
|
|
34974
34986
|
},
|
|
@@ -35017,12 +35029,11 @@ export default defineSubgraph({
|
|
|
35017
35029
|
|
|
35018
35030
|
handlers: {
|
|
35019
35031
|
pox: (event, ctx) => {
|
|
35020
|
-
//
|
|
35021
|
-
|
|
35022
|
-
|
|
35023
|
-
const resultHex = (event as any).rawResult ?? "";
|
|
35032
|
+
// contract_call events are typed: functionName, resultHex, args, sender.
|
|
35033
|
+
// (Add an \`abi\` to the source to also get typed \`event.input\`.)
|
|
35034
|
+
const resultHex = event.resultHex ?? "";
|
|
35024
35035
|
ctx.insert("calls", {
|
|
35025
|
-
function_name:
|
|
35036
|
+
function_name: event.functionName || ctx.tx.functionName || "",
|
|
35026
35037
|
caller: ctx.tx.sender,
|
|
35027
35038
|
result_ok: resultHex.startsWith("0x07"), // 0x07 = response-ok type tag
|
|
35028
35039
|
});
|
|
@@ -35071,20 +35082,17 @@ export default defineSubgraph({
|
|
|
35071
35082
|
|
|
35072
35083
|
handlers: {
|
|
35073
35084
|
bns: (event, ctx) => {
|
|
35074
|
-
|
|
35075
|
-
const
|
|
35076
|
-
const topic = typeof e.topic === "string" ? e.topic : null;
|
|
35077
|
-
if (!topic) return;
|
|
35078
|
-
const data = (e.data ?? {}) as Record<string, unknown>;
|
|
35085
|
+
if (!event.topic) return;
|
|
35086
|
+
const data = event.data as { namespace?: unknown; name?: unknown; owner?: string };
|
|
35079
35087
|
const namespace = decodeBuffUtf8(data.namespace);
|
|
35080
35088
|
const nameLabel = decodeBuffUtf8(data.name);
|
|
35081
35089
|
if (!namespace || !nameLabel) return;
|
|
35082
35090
|
ctx.insert("names", {
|
|
35083
|
-
topic,
|
|
35091
|
+
topic: event.topic,
|
|
35084
35092
|
namespace,
|
|
35085
35093
|
name: nameLabel,
|
|
35086
35094
|
fqn: \`\${nameLabel}.\${namespace}\`,
|
|
35087
|
-
owner: topic === "burn-name" ? null : (
|
|
35095
|
+
owner: event.topic === "burn-name" ? null : (data.owner ?? null),
|
|
35088
35096
|
});
|
|
35089
35097
|
},
|
|
35090
35098
|
},
|
|
@@ -37218,5 +37226,5 @@ registerAccountCommand(program);
|
|
|
37218
37226
|
registerBillingCommand(program);
|
|
37219
37227
|
program.parse();
|
|
37220
37228
|
|
|
37221
|
-
//# debugId=
|
|
37229
|
+
//# debugId=1B5D42B5E71F8A7A64756E2164756E21
|
|
37222
37230
|
//# sourceMappingURL=cli.js.map
|