@secondlayer/stacks 0.2.2 → 1.0.0-alpha.0
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/shared/stacks-02actsrx.cjs.map +2 -2
- package/dist/shared/{stacks-xp9n3r0t.js → stacks-09wa7ewe.js} +108 -108
- package/dist/shared/stacks-09wa7ewe.js.map +15 -0
- package/dist/shared/{stacks-ky14tdf6.cjs → stacks-0nfexv24.cjs} +20 -8
- package/dist/shared/stacks-0nfexv24.cjs.map +14 -0
- package/dist/shared/{stacks-an5k8n4t.cjs → stacks-14pgpkrr.cjs} +82 -73
- package/dist/shared/stacks-14pgpkrr.cjs.map +23 -0
- package/dist/shared/{stacks-v6ja2eh7.cjs → stacks-17sdtaxg.cjs} +106 -102
- package/dist/shared/stacks-17sdtaxg.cjs.map +15 -0
- package/dist/shared/{stacks-96gaxfcf.js → stacks-1s5w4ncf.js} +44 -32
- package/dist/shared/stacks-1s5w4ncf.js.map +17 -0
- package/dist/shared/stacks-24h5k94q.cjs.map +3 -3
- package/dist/shared/{stacks-evnzth1q.cjs → stacks-4vzmhw3q.cjs} +3 -3
- package/dist/shared/stacks-4vzmhw3q.cjs.map +10 -0
- package/dist/shared/{stacks-k9p8m3wf.js → stacks-4x2bcc2k.js} +87 -78
- package/dist/shared/stacks-4x2bcc2k.js.map +23 -0
- package/dist/shared/stacks-5tprhns9.cjs.map +3 -3
- package/dist/shared/stacks-709tra19.js.map +2 -2
- package/dist/shared/{stacks-q79dx28x.js → stacks-70p84bgg.js} +3 -3
- package/dist/shared/stacks-70p84bgg.js.map +10 -0
- package/dist/shared/{stacks-k2p5tv6x.js → stacks-913a2rx7.js} +3 -3
- package/dist/shared/stacks-913a2rx7.js.map +10 -0
- package/dist/shared/{stacks-jrnmh4kc.js → stacks-96d6m1zy.js} +15 -6
- package/dist/shared/stacks-96d6m1zy.js.map +11 -0
- package/dist/shared/stacks-9g0jhab3.cjs.map +2 -2
- package/dist/shared/stacks-dr5en54r.cjs.map +2 -2
- package/dist/shared/stacks-fcaefc5b.cjs.map +2 -2
- package/dist/shared/stacks-gck1sq7h.cjs.map +2 -2
- package/dist/shared/stacks-je937aas.js.map +2 -2
- package/dist/shared/{stacks-k58k970n.js → stacks-kg1npstf.js} +5 -3
- package/dist/shared/stacks-kg1npstf.js.map +10 -0
- package/dist/shared/{stacks-qvg7c24g.cjs → stacks-n98w7g57.cjs} +5 -3
- package/dist/shared/stacks-n98w7g57.cjs.map +10 -0
- package/dist/shared/{stacks-6m1z4j07.js → stacks-nqae5amn.cjs} +74 -160
- package/dist/shared/stacks-nqae5amn.cjs.map +10 -0
- package/dist/shared/stacks-qcae5852.js.map +2 -2
- package/dist/shared/stacks-qt8ehebn.js.map +3 -3
- package/dist/shared/stacks-ra02bpny.cjs.map +3 -3
- package/dist/shared/stacks-rwfgts3s.js.map +2 -2
- package/dist/shared/stacks-s10yb9gz.js.map +2 -2
- package/dist/shared/{stacks-etf219gs.cjs → stacks-s30kkvm8.js} +101 -118
- package/dist/shared/stacks-s30kkvm8.js.map +10 -0
- package/dist/shared/stacks-s7z5q8be.js.map +3 -3
- package/dist/shared/stacks-v9jqcpd4.js.map +2 -2
- package/dist/shared/stacks-vdfag81a.cjs.map +2 -2
- package/dist/shared/{stacks-rg1g0fja.js → stacks-wjem3xw9.js} +21 -9
- package/dist/shared/stacks-wjem3xw9.js.map +14 -0
- package/dist/shared/{stacks-k08tgzyp.cjs → stacks-wyxj879g.cjs} +3 -3
- package/dist/shared/stacks-wyxj879g.cjs.map +13 -0
- package/dist/shared/stacks-y3dh7hv1.js.map +3 -3
- package/dist/shared/{stacks-2ar4prfz.cjs → stacks-y5262j0z.cjs} +14 -5
- package/dist/shared/stacks-y5262j0z.cjs.map +11 -0
- package/dist/shared/stacks-ya3x01yd.cjs.map +2 -2
- package/dist/shared/{stacks-p93g814f.js → stacks-zf7rbpzp.js} +4 -4
- package/dist/shared/stacks-zf7rbpzp.js.map +13 -0
- package/dist/shared/{stacks-61rvzkz1.cjs → stacks-znrb59ce.cjs} +41 -29
- package/dist/shared/stacks-znrb59ce.cjs.map +17 -0
- package/dist/src/accounts/index.cjs +2 -2
- package/dist/src/accounts/index.cjs.map +5 -5
- package/dist/src/accounts/index.js +2 -6
- package/dist/src/accounts/index.js.map +5 -5
- package/dist/src/actions/index.d.cts +29 -29
- package/dist/src/actions/index.d.ts +29 -29
- package/dist/src/actions/index.js +7 -7
- package/dist/src/bns/index.cjs +55 -43
- package/dist/src/bns/index.cjs.map +9 -9
- package/dist/src/bns/index.d.cts +29 -29
- package/dist/src/bns/index.d.ts +29 -29
- package/dist/src/bns/index.js +62 -50
- package/dist/src/bns/index.js.map +9 -9
- package/dist/src/clarity/index.js +4 -4
- package/dist/src/connect/index.cjs +114 -112
- package/dist/src/connect/index.cjs.map +13 -13
- package/dist/src/connect/index.js +114 -112
- package/dist/src/connect/index.js.map +13 -13
- package/dist/src/connect/walletconnect/index.cjs +3 -3
- package/dist/src/connect/walletconnect/index.cjs.map +10 -10
- package/dist/src/connect/walletconnect/index.js +3 -3
- package/dist/src/connect/walletconnect/index.js.map +10 -10
- package/dist/src/index.cjs +108 -2
- package/dist/src/index.cjs.map +19 -15
- package/dist/src/index.d.cts +291 -112
- package/dist/src/index.d.ts +291 -112
- package/dist/src/index.js +122 -9
- package/dist/src/index.js.map +19 -15
- package/dist/src/pox/index.cjs.map +6 -6
- package/dist/src/pox/index.d.cts +29 -29
- package/dist/src/pox/index.d.ts +29 -29
- package/dist/src/pox/index.js +5 -5
- package/dist/src/pox/index.js.map +6 -6
- package/dist/src/stackingdao/index.cjs +31 -6
- package/dist/src/stackingdao/index.cjs.map +6 -6
- package/dist/src/stackingdao/index.d.cts +29 -29
- package/dist/src/stackingdao/index.d.ts +29 -29
- package/dist/src/stackingdao/index.js +37 -12
- package/dist/src/stackingdao/index.js.map +6 -6
- package/dist/src/subscriptions/index.d.cts +29 -29
- package/dist/src/subscriptions/index.d.ts +29 -29
- package/dist/src/tools/btc/index.cjs +130 -0
- package/dist/src/tools/btc/index.cjs.map +10 -0
- package/dist/src/tools/btc/index.d.cts +8 -0
- package/dist/src/tools/btc/index.d.ts +8 -0
- package/dist/src/tools/btc/index.js +89 -0
- package/dist/src/tools/btc/index.js.map +10 -0
- package/dist/src/tools/index.cjs +2470 -0
- package/dist/src/tools/index.cjs.map +61 -0
- package/dist/src/tools/index.d.cts +144 -0
- package/dist/src/tools/index.d.ts +144 -0
- package/dist/src/tools/index.js +2435 -0
- package/dist/src/tools/index.js.map +61 -0
- package/dist/src/transactions/index.js +3 -3
- package/dist/src/triggers/index.cjs +66 -0
- package/dist/src/triggers/index.cjs.map +10 -0
- package/dist/src/triggers/index.d.cts +120 -0
- package/dist/src/triggers/index.d.ts +120 -0
- package/dist/src/triggers/index.js +25 -0
- package/dist/src/triggers/index.js.map +10 -0
- package/dist/src/tx/index.cjs +65 -0
- package/dist/src/tx/index.cjs.map +10 -0
- package/dist/src/tx/index.d.cts +42 -0
- package/dist/src/tx/index.d.ts +42 -0
- package/dist/src/tx/index.js +22 -0
- package/dist/src/tx/index.js.map +10 -0
- package/dist/src/ui/index.cjs +431 -0
- package/dist/src/ui/index.cjs.map +27 -0
- package/dist/src/ui/index.d.cts +107 -0
- package/dist/src/ui/index.d.ts +107 -0
- package/dist/src/ui/index.js +391 -0
- package/dist/src/ui/index.js.map +27 -0
- package/dist/src/ui/schemas.cjs +134 -0
- package/dist/src/ui/schemas.cjs.map +18 -0
- package/dist/src/ui/schemas.d.cts +83 -0
- package/dist/src/ui/schemas.d.ts +83 -0
- package/dist/src/ui/schemas.js +91 -0
- package/dist/src/ui/schemas.js.map +18 -0
- package/dist/src/utils/index.cjs +3 -3
- package/dist/src/utils/index.cjs.map +4 -4
- package/dist/src/utils/index.js +4 -4
- package/dist/src/utils/index.js.map +4 -4
- package/package.json +156 -105
- package/dist/shared/stacks-2ar4prfz.cjs.map +0 -11
- package/dist/shared/stacks-61rvzkz1.cjs.map +0 -17
- package/dist/shared/stacks-6m1z4j07.js.map +0 -10
- package/dist/shared/stacks-96gaxfcf.js.map +0 -17
- package/dist/shared/stacks-an5k8n4t.cjs.map +0 -23
- package/dist/shared/stacks-etf219gs.cjs.map +0 -10
- package/dist/shared/stacks-evnzth1q.cjs.map +0 -10
- package/dist/shared/stacks-jrnmh4kc.js.map +0 -11
- package/dist/shared/stacks-k08tgzyp.cjs.map +0 -13
- package/dist/shared/stacks-k2p5tv6x.js.map +0 -10
- package/dist/shared/stacks-k58k970n.js.map +0 -10
- package/dist/shared/stacks-k9p8m3wf.js.map +0 -23
- package/dist/shared/stacks-ky14tdf6.cjs.map +0 -13
- package/dist/shared/stacks-p93g814f.js.map +0 -13
- package/dist/shared/stacks-q79dx28x.js.map +0 -10
- package/dist/shared/stacks-qvg7c24g.cjs.map +0 -10
- package/dist/shared/stacks-rg1g0fja.js.map +0 -13
- package/dist/shared/stacks-v6ja2eh7.cjs.map +0 -15
- package/dist/shared/stacks-xp9n3r0t.js.map +0 -15
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Tool } from "ai";
|
|
2
|
+
/** Account derived from a local private key (mnemonic or raw key). */
|
|
3
|
+
type LocalAccount = {
|
|
4
|
+
type: "local"
|
|
5
|
+
address: string
|
|
6
|
+
/** Compressed public key (hex) */
|
|
7
|
+
publicKey: string
|
|
8
|
+
/** Raw ECDSA sign over a hash */
|
|
9
|
+
sign(hash: Uint8Array): Uint8Array
|
|
10
|
+
/** Sign a structured message (SIP-018) */
|
|
11
|
+
signMessage(message: string | Uint8Array): string
|
|
12
|
+
};
|
|
13
|
+
/** Account with a user-provided signing function (sync or async). */
|
|
14
|
+
type CustomAccount = {
|
|
15
|
+
type: "custom"
|
|
16
|
+
address: string
|
|
17
|
+
publicKey: string
|
|
18
|
+
sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
|
|
19
|
+
};
|
|
20
|
+
/** Browser wallet provider interface (e.g. Leather, Xverse). */
|
|
21
|
+
type StacksProvider = {
|
|
22
|
+
request(method: string, params?: any): Promise<any>
|
|
23
|
+
};
|
|
24
|
+
/** Account backed by a browser wallet {@link StacksProvider}. */
|
|
25
|
+
type ProviderAccount = {
|
|
26
|
+
type: "provider"
|
|
27
|
+
address: string
|
|
28
|
+
publicKey: string
|
|
29
|
+
provider: StacksProvider
|
|
30
|
+
};
|
|
31
|
+
/** Full chain descriptor used by clients and transports for network-aware operations. */
|
|
32
|
+
type StacksChain = {
|
|
33
|
+
/** Chain ID (e.g. 0x00000001 for mainnet) */
|
|
34
|
+
id: number
|
|
35
|
+
/** Human-readable name */
|
|
36
|
+
name: string
|
|
37
|
+
/** Network type */
|
|
38
|
+
network: "mainnet" | "testnet"
|
|
39
|
+
/** Transaction version byte for serialization */
|
|
40
|
+
transactionVersion: number
|
|
41
|
+
/** Peer network ID for P2P broadcasting */
|
|
42
|
+
peerNetworkId: number
|
|
43
|
+
/** Address version bytes */
|
|
44
|
+
addressVersion: {
|
|
45
|
+
singleSig: number
|
|
46
|
+
multiSig: number
|
|
47
|
+
}
|
|
48
|
+
/** Magic bytes for network identification */
|
|
49
|
+
magicBytes: string
|
|
50
|
+
/** Boot address (system contracts deployer) */
|
|
51
|
+
bootAddress: string
|
|
52
|
+
/** Native currency info */
|
|
53
|
+
nativeCurrency: {
|
|
54
|
+
name: string
|
|
55
|
+
symbol: string
|
|
56
|
+
decimals: number
|
|
57
|
+
}
|
|
58
|
+
/** Default RPC URLs */
|
|
59
|
+
rpcUrls: {
|
|
60
|
+
default: {
|
|
61
|
+
http: string[]
|
|
62
|
+
ws?: string[]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** Block explorer URLs */
|
|
66
|
+
blockExplorers?: {
|
|
67
|
+
default: {
|
|
68
|
+
name: string
|
|
69
|
+
url: string
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/** Function that sends an HTTP request to a Stacks node API path. */
|
|
74
|
+
type RequestFn = (path: string, options?: RequestOptions) => Promise<any>;
|
|
75
|
+
/** Options for a transport-level HTTP request. */
|
|
76
|
+
type RequestOptions = {
|
|
77
|
+
method?: "GET" | "POST" | "PUT" | "DELETE"
|
|
78
|
+
body?: unknown
|
|
79
|
+
headers?: Record<string, string>
|
|
80
|
+
};
|
|
81
|
+
/** Shared configuration for all transport types. */
|
|
82
|
+
type TransportConfig = {
|
|
83
|
+
url?: string
|
|
84
|
+
timeout?: number
|
|
85
|
+
retryCount?: number
|
|
86
|
+
retryDelay?: number
|
|
87
|
+
fetchOptions?: RequestInit
|
|
88
|
+
apiKey?: string
|
|
89
|
+
};
|
|
90
|
+
/** A resolved transport instance with a bound request function. */
|
|
91
|
+
type Transport = {
|
|
92
|
+
type: string
|
|
93
|
+
request: RequestFn
|
|
94
|
+
config: TransportConfig
|
|
95
|
+
destroy?: () => void
|
|
96
|
+
};
|
|
97
|
+
/** Union of all supported account types (local key, custom signer, or browser provider). */
|
|
98
|
+
type Account = LocalAccount | CustomAccount | ProviderAccount;
|
|
99
|
+
/**
|
|
100
|
+
* Core client instance that holds chain context, transport, and extensible actions.
|
|
101
|
+
* Created via {@link createClient}, {@link createPublicClient}, or {@link createWalletClient}.
|
|
102
|
+
*/
|
|
103
|
+
type Client<TExtended extends Record<string, unknown> = Record<string, unknown>> = {
|
|
104
|
+
chain?: StacksChain
|
|
105
|
+
account?: Account
|
|
106
|
+
transport: Transport
|
|
107
|
+
request: RequestFn
|
|
108
|
+
extend: <const TNew extends Record<string, unknown>>(fn: (client: Client<TExtended>) => TNew) => Client<TExtended & TNew> & TNew
|
|
109
|
+
} & TExtended;
|
|
110
|
+
/**
|
|
111
|
+
* Any Stacks client that can perform read-only RPC requests. We only need
|
|
112
|
+
* the base `Client.request` contract; public actions are invoked as
|
|
113
|
+
* free functions in `tools/index.ts`, so we keep this loose.
|
|
114
|
+
*/
|
|
115
|
+
type StacksReadClient = Client<Record<string, unknown>>;
|
|
116
|
+
type LooseTool = Tool<any, any>;
|
|
117
|
+
interface StacksTools {
|
|
118
|
+
getStxBalance: LooseTool;
|
|
119
|
+
getAccountInfo: LooseTool;
|
|
120
|
+
getBlock: LooseTool;
|
|
121
|
+
getBlockHeight: LooseTool;
|
|
122
|
+
readContract: LooseTool;
|
|
123
|
+
estimateFee: LooseTool;
|
|
124
|
+
bnsResolve: LooseTool;
|
|
125
|
+
bnsReverse: LooseTool;
|
|
126
|
+
getTransaction: LooseTool;
|
|
127
|
+
getAccountHistory: LooseTool;
|
|
128
|
+
getMempoolStats: LooseTool;
|
|
129
|
+
getNftHoldings: LooseTool;
|
|
130
|
+
}
|
|
131
|
+
declare function createStacksTools(client: StacksReadClient): StacksTools;
|
|
132
|
+
declare const getStxBalance: LooseTool;
|
|
133
|
+
declare const getAccountInfo: LooseTool;
|
|
134
|
+
declare const getBlock: LooseTool;
|
|
135
|
+
declare const getBlockHeight: LooseTool;
|
|
136
|
+
declare const readContract: LooseTool;
|
|
137
|
+
declare const estimateFee: LooseTool;
|
|
138
|
+
declare const bnsResolve: LooseTool;
|
|
139
|
+
declare const bnsReverse: LooseTool;
|
|
140
|
+
declare const getTransaction: LooseTool;
|
|
141
|
+
declare const getAccountHistory: LooseTool;
|
|
142
|
+
declare const getMempoolStats: LooseTool;
|
|
143
|
+
declare const getNftHoldings: LooseTool;
|
|
144
|
+
export { readContract, getTransaction, getStxBalance, getNftHoldings, getMempoolStats, getBlockHeight, getBlock, getAccountInfo, getAccountHistory, estimateFee, createStacksTools, bnsReverse, bnsResolve, StacksTools };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Tool } from "ai";
|
|
2
|
+
/** Account derived from a local private key (mnemonic or raw key). */
|
|
3
|
+
type LocalAccount = {
|
|
4
|
+
type: "local"
|
|
5
|
+
address: string
|
|
6
|
+
/** Compressed public key (hex) */
|
|
7
|
+
publicKey: string
|
|
8
|
+
/** Raw ECDSA sign over a hash */
|
|
9
|
+
sign(hash: Uint8Array): Uint8Array
|
|
10
|
+
/** Sign a structured message (SIP-018) */
|
|
11
|
+
signMessage(message: string | Uint8Array): string
|
|
12
|
+
};
|
|
13
|
+
/** Account with a user-provided signing function (sync or async). */
|
|
14
|
+
type CustomAccount = {
|
|
15
|
+
type: "custom"
|
|
16
|
+
address: string
|
|
17
|
+
publicKey: string
|
|
18
|
+
sign(hash: Uint8Array): Promise<Uint8Array> | Uint8Array
|
|
19
|
+
};
|
|
20
|
+
/** Browser wallet provider interface (e.g. Leather, Xverse). */
|
|
21
|
+
type StacksProvider = {
|
|
22
|
+
request(method: string, params?: any): Promise<any>
|
|
23
|
+
};
|
|
24
|
+
/** Account backed by a browser wallet {@link StacksProvider}. */
|
|
25
|
+
type ProviderAccount = {
|
|
26
|
+
type: "provider"
|
|
27
|
+
address: string
|
|
28
|
+
publicKey: string
|
|
29
|
+
provider: StacksProvider
|
|
30
|
+
};
|
|
31
|
+
/** Full chain descriptor used by clients and transports for network-aware operations. */
|
|
32
|
+
type StacksChain = {
|
|
33
|
+
/** Chain ID (e.g. 0x00000001 for mainnet) */
|
|
34
|
+
id: number
|
|
35
|
+
/** Human-readable name */
|
|
36
|
+
name: string
|
|
37
|
+
/** Network type */
|
|
38
|
+
network: "mainnet" | "testnet"
|
|
39
|
+
/** Transaction version byte for serialization */
|
|
40
|
+
transactionVersion: number
|
|
41
|
+
/** Peer network ID for P2P broadcasting */
|
|
42
|
+
peerNetworkId: number
|
|
43
|
+
/** Address version bytes */
|
|
44
|
+
addressVersion: {
|
|
45
|
+
singleSig: number
|
|
46
|
+
multiSig: number
|
|
47
|
+
}
|
|
48
|
+
/** Magic bytes for network identification */
|
|
49
|
+
magicBytes: string
|
|
50
|
+
/** Boot address (system contracts deployer) */
|
|
51
|
+
bootAddress: string
|
|
52
|
+
/** Native currency info */
|
|
53
|
+
nativeCurrency: {
|
|
54
|
+
name: string
|
|
55
|
+
symbol: string
|
|
56
|
+
decimals: number
|
|
57
|
+
}
|
|
58
|
+
/** Default RPC URLs */
|
|
59
|
+
rpcUrls: {
|
|
60
|
+
default: {
|
|
61
|
+
http: string[]
|
|
62
|
+
ws?: string[]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** Block explorer URLs */
|
|
66
|
+
blockExplorers?: {
|
|
67
|
+
default: {
|
|
68
|
+
name: string
|
|
69
|
+
url: string
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/** Function that sends an HTTP request to a Stacks node API path. */
|
|
74
|
+
type RequestFn = (path: string, options?: RequestOptions) => Promise<any>;
|
|
75
|
+
/** Options for a transport-level HTTP request. */
|
|
76
|
+
type RequestOptions = {
|
|
77
|
+
method?: "GET" | "POST" | "PUT" | "DELETE"
|
|
78
|
+
body?: unknown
|
|
79
|
+
headers?: Record<string, string>
|
|
80
|
+
};
|
|
81
|
+
/** Shared configuration for all transport types. */
|
|
82
|
+
type TransportConfig = {
|
|
83
|
+
url?: string
|
|
84
|
+
timeout?: number
|
|
85
|
+
retryCount?: number
|
|
86
|
+
retryDelay?: number
|
|
87
|
+
fetchOptions?: RequestInit
|
|
88
|
+
apiKey?: string
|
|
89
|
+
};
|
|
90
|
+
/** A resolved transport instance with a bound request function. */
|
|
91
|
+
type Transport = {
|
|
92
|
+
type: string
|
|
93
|
+
request: RequestFn
|
|
94
|
+
config: TransportConfig
|
|
95
|
+
destroy?: () => void
|
|
96
|
+
};
|
|
97
|
+
/** Union of all supported account types (local key, custom signer, or browser provider). */
|
|
98
|
+
type Account = LocalAccount | CustomAccount | ProviderAccount;
|
|
99
|
+
/**
|
|
100
|
+
* Core client instance that holds chain context, transport, and extensible actions.
|
|
101
|
+
* Created via {@link createClient}, {@link createPublicClient}, or {@link createWalletClient}.
|
|
102
|
+
*/
|
|
103
|
+
type Client<TExtended extends Record<string, unknown> = Record<string, unknown>> = {
|
|
104
|
+
chain?: StacksChain
|
|
105
|
+
account?: Account
|
|
106
|
+
transport: Transport
|
|
107
|
+
request: RequestFn
|
|
108
|
+
extend: <const TNew extends Record<string, unknown>>(fn: (client: Client<TExtended>) => TNew) => Client<TExtended & TNew> & TNew
|
|
109
|
+
} & TExtended;
|
|
110
|
+
/**
|
|
111
|
+
* Any Stacks client that can perform read-only RPC requests. We only need
|
|
112
|
+
* the base `Client.request` contract; public actions are invoked as
|
|
113
|
+
* free functions in `tools/index.ts`, so we keep this loose.
|
|
114
|
+
*/
|
|
115
|
+
type StacksReadClient = Client<Record<string, unknown>>;
|
|
116
|
+
type LooseTool = Tool<any, any>;
|
|
117
|
+
interface StacksTools {
|
|
118
|
+
getStxBalance: LooseTool;
|
|
119
|
+
getAccountInfo: LooseTool;
|
|
120
|
+
getBlock: LooseTool;
|
|
121
|
+
getBlockHeight: LooseTool;
|
|
122
|
+
readContract: LooseTool;
|
|
123
|
+
estimateFee: LooseTool;
|
|
124
|
+
bnsResolve: LooseTool;
|
|
125
|
+
bnsReverse: LooseTool;
|
|
126
|
+
getTransaction: LooseTool;
|
|
127
|
+
getAccountHistory: LooseTool;
|
|
128
|
+
getMempoolStats: LooseTool;
|
|
129
|
+
getNftHoldings: LooseTool;
|
|
130
|
+
}
|
|
131
|
+
declare function createStacksTools(client: StacksReadClient): StacksTools;
|
|
132
|
+
declare const getStxBalance: LooseTool;
|
|
133
|
+
declare const getAccountInfo: LooseTool;
|
|
134
|
+
declare const getBlock: LooseTool;
|
|
135
|
+
declare const getBlockHeight: LooseTool;
|
|
136
|
+
declare const readContract: LooseTool;
|
|
137
|
+
declare const estimateFee: LooseTool;
|
|
138
|
+
declare const bnsResolve: LooseTool;
|
|
139
|
+
declare const bnsReverse: LooseTool;
|
|
140
|
+
declare const getTransaction: LooseTool;
|
|
141
|
+
declare const getAccountHistory: LooseTool;
|
|
142
|
+
declare const getMempoolStats: LooseTool;
|
|
143
|
+
declare const getNftHoldings: LooseTool;
|
|
144
|
+
export { readContract, getTransaction, getStxBalance, getNftHoldings, getMempoolStats, getBlockHeight, getBlock, getAccountInfo, getAccountHistory, estimateFee, createStacksTools, bnsReverse, bnsResolve, StacksTools };
|