near-kit 0.1.0 → 0.2.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/README.md +232 -130
- package/dist/core/config-schemas.d.ts +7 -2
- package/dist/core/config-schemas.d.ts.map +1 -1
- package/dist/core/config-schemas.js +3 -1
- package/dist/core/config-schemas.js.map +1 -1
- package/dist/core/near.d.ts.map +1 -1
- package/dist/core/transaction.d.ts.map +1 -1
- package/dist/core/transaction.js +4 -0
- package/dist/core/transaction.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/keys/index.d.ts +3 -1
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +3 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/rotating-keystore.d.ts +207 -0
- package/dist/keys/rotating-keystore.d.ts.map +1 -0
- package/dist/keys/rotating-keystore.js +240 -0
- package/dist/keys/rotating-keystore.js.map +1 -0
- package/dist/utils/amount.d.ts +23 -12
- package/dist/utils/amount.d.ts.map +1 -1
- package/dist/utils/amount.js.map +1 -1
- package/dist/utils/gas.d.ts +4 -4
- package/dist/utils/gas.d.ts.map +1 -1
- package/dist/utils/gas.js.map +1 -1
- package/dist/utils/validation.d.ts +12 -2
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# near-kit
|
|
2
|
+
|
|
2
3
|
[](https://www.npmjs.com/package/near-kit)
|
|
3
4
|
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
[](https://www.typescriptlang.org/)
|
|
@@ -26,75 +27,129 @@ bun install near-kit
|
|
|
26
27
|
## Quick Start
|
|
27
28
|
|
|
28
29
|
```typescript
|
|
29
|
-
import { Near } from
|
|
30
|
+
import { Near } from "near-kit"
|
|
30
31
|
|
|
31
|
-
// Initialize
|
|
32
|
+
// Initialize for backend/scripts
|
|
32
33
|
const near = new Near({
|
|
33
|
-
network:
|
|
34
|
-
privateKey:
|
|
35
|
-
defaultSignerId:
|
|
36
|
-
})
|
|
34
|
+
network: "testnet",
|
|
35
|
+
privateKey: "ed25519:...",
|
|
36
|
+
defaultSignerId: "alice.testnet",
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
// View methods (read-only, no gas)
|
|
40
|
+
const balance = await near.view("example.testnet", "get_balance", {
|
|
41
|
+
account_id: "alice.testnet",
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
// Call methods (requires signature, costs gas)
|
|
45
|
+
await near.call(
|
|
46
|
+
"example.testnet",
|
|
47
|
+
"increment",
|
|
48
|
+
{},
|
|
49
|
+
{attachedDeposit: "0.1 NEAR"}
|
|
50
|
+
)
|
|
37
51
|
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
52
|
+
// Send NEAR tokens
|
|
53
|
+
await near.send("bob.testnet", "5 NEAR")
|
|
54
|
+
```
|
|
42
55
|
|
|
43
|
-
|
|
44
|
-
await near.call('example.testnet', 'increment', {}, {
|
|
45
|
-
attachedDeposit: '0.1' // Attach 0.1 NEAR
|
|
46
|
-
});
|
|
56
|
+
## Getting Started
|
|
47
57
|
|
|
48
|
-
|
|
49
|
-
await near.send('bob.testnet', '5'); // Send 5 NEAR to Bob
|
|
58
|
+
near-kit provides a unified API that works across different environments. Configuration varies by environment, but the API for calling contracts, sending transactions, and building transactions remains identical.
|
|
50
59
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
### Backend & Scripts
|
|
61
|
+
|
|
62
|
+
For local testing, use the sandbox (no network or key configuration needed):
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { Sandbox } from "near-kit"
|
|
66
|
+
|
|
67
|
+
const sandbox = await Sandbox.start()
|
|
68
|
+
const near = new Near({ network: sandbox })
|
|
69
|
+
|
|
70
|
+
// Test with automatically provisioned accounts
|
|
71
|
+
await near.call("contract.test.near", "method", {})
|
|
72
|
+
|
|
73
|
+
await sandbox.stop()
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
For testnet/mainnet development, pass a private key directly:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
const near = new Near({
|
|
80
|
+
network: "testnet",
|
|
81
|
+
privateKey: "ed25519:...",
|
|
82
|
+
defaultSignerId: "alice.testnet",
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For production applications, use a keyStore:
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { FileKeyStore } from "near-kit"
|
|
90
|
+
|
|
91
|
+
const near = new Near({
|
|
92
|
+
network: "testnet",
|
|
93
|
+
keyStore: new FileKeyStore("~/.near-credentials"),
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Frontend & Wallets
|
|
98
|
+
|
|
99
|
+
In the browser, connect to user wallets. The same `near.call()`, `near.send()`, and `near.transaction()` methods work seamlessly:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { fromWalletSelector } from "near-kit"
|
|
103
|
+
|
|
104
|
+
const near = new Near({
|
|
105
|
+
network: "testnet",
|
|
106
|
+
wallet: fromWalletSelector(walletInstance),
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
// Same API as backend
|
|
110
|
+
await near.call("contract.near", "method", { arg: "value" })
|
|
54
111
|
```
|
|
55
112
|
|
|
113
|
+
This works through a signer abstraction - whether you pass `privateKey`, `keyStore`, `wallet`, or `sandbox`, they all implement the same signing interface internally.
|
|
114
|
+
|
|
56
115
|
## Core API
|
|
57
116
|
|
|
58
117
|
### Initialization
|
|
59
118
|
|
|
60
119
|
```typescript
|
|
61
120
|
// Simple - defaults to mainnet
|
|
62
|
-
const near = new Near()
|
|
121
|
+
const near = new Near()
|
|
63
122
|
|
|
64
123
|
// With network selection
|
|
65
|
-
const near = new Near({ network:
|
|
124
|
+
const near = new Near({ network: "testnet" })
|
|
66
125
|
|
|
67
126
|
// With custom configuration
|
|
68
127
|
const near = new Near({
|
|
69
|
-
network:
|
|
70
|
-
privateKey:
|
|
71
|
-
})
|
|
128
|
+
network: "testnet",
|
|
129
|
+
privateKey: "ed25519:...",
|
|
130
|
+
})
|
|
72
131
|
```
|
|
73
132
|
|
|
74
133
|
### Basic Operations
|
|
75
134
|
|
|
76
135
|
```typescript
|
|
77
136
|
// View methods (free, no signature required)
|
|
78
|
-
const result = await near.view(
|
|
79
|
-
'contract.near',
|
|
80
|
-
'get_data',
|
|
81
|
-
{ key: 'value' }
|
|
82
|
-
);
|
|
137
|
+
const result = await near.view("contract.near", "get_data", { key: "value" })
|
|
83
138
|
|
|
84
139
|
// Check account balance
|
|
85
|
-
const balance = await near.getBalance(
|
|
140
|
+
const balance = await near.getBalance("alice.near")
|
|
86
141
|
|
|
87
142
|
// Check if account exists
|
|
88
|
-
const exists = await near.accountExists(
|
|
143
|
+
const exists = await near.accountExists("alice.near")
|
|
89
144
|
|
|
90
145
|
// Get network status
|
|
91
|
-
const status = await near.getStatus()
|
|
146
|
+
const status = await near.getStatus()
|
|
92
147
|
```
|
|
93
148
|
|
|
94
149
|
### Type-Safe Contracts
|
|
95
150
|
|
|
96
151
|
```typescript
|
|
97
|
-
import type { Contract } from
|
|
152
|
+
import type { Contract } from "near-kit"
|
|
98
153
|
|
|
99
154
|
// Define contract interface using Contract<> helper
|
|
100
155
|
type MyContract = Contract<{
|
|
@@ -109,17 +164,17 @@ type MyContract = Contract<{
|
|
|
109
164
|
}>
|
|
110
165
|
|
|
111
166
|
// Create type-safe contract
|
|
112
|
-
const contract = near.contract<MyContract>(
|
|
167
|
+
const contract = near.contract<MyContract>("example.near")
|
|
113
168
|
|
|
114
169
|
// Fully typed method calls
|
|
115
|
-
const balance = await contract.view.get_balance({ account_id:
|
|
116
|
-
const info = await contract.view.get_info()
|
|
170
|
+
const balance = await contract.view.get_balance({ account_id: "alice.near" })
|
|
171
|
+
const info = await contract.view.get_info()
|
|
117
172
|
|
|
118
173
|
// Call methods automatically get options parameter
|
|
119
174
|
await contract.call.transfer(
|
|
120
|
-
{ to:
|
|
121
|
-
{ attachedDeposit:
|
|
122
|
-
)
|
|
175
|
+
{ to: "bob.near", amount: "10" },
|
|
176
|
+
{ attachedDeposit: "1 NEAR" }
|
|
177
|
+
)
|
|
123
178
|
```
|
|
124
179
|
|
|
125
180
|
### Transaction Builder
|
|
@@ -127,12 +182,16 @@ await contract.call.transfer(
|
|
|
127
182
|
```typescript
|
|
128
183
|
// Alice builds a transaction with multiple actions
|
|
129
184
|
// 'alice.near' is the signer - the account that signs and pays for this transaction
|
|
130
|
-
const receipt = await near
|
|
131
|
-
.
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
185
|
+
const receipt = await near
|
|
186
|
+
.transaction("alice.near") // Alice signs
|
|
187
|
+
.transfer("bob.near", "10 NEAR") // Alice sends Bob 10 NEAR
|
|
188
|
+
.functionCall(
|
|
189
|
+
"market.near",
|
|
190
|
+
"buy",
|
|
191
|
+
{ id: "123" },
|
|
192
|
+
{ attachedDeposit: "5 NEAR" } // Alice attaches 5 NEAR to the call
|
|
193
|
+
)
|
|
194
|
+
.send()
|
|
136
195
|
```
|
|
137
196
|
|
|
138
197
|
### Batch Operations
|
|
@@ -140,125 +199,167 @@ const receipt = await near.transaction('alice.near') // Alice signs
|
|
|
140
199
|
```typescript
|
|
141
200
|
// Run multiple operations in parallel
|
|
142
201
|
const [balance, status, exists] = await near.batch(
|
|
143
|
-
near.getBalance(
|
|
202
|
+
near.getBalance("alice.near"),
|
|
144
203
|
near.getStatus(),
|
|
145
|
-
near.accountExists(
|
|
146
|
-
)
|
|
204
|
+
near.accountExists("bob.near")
|
|
205
|
+
)
|
|
147
206
|
```
|
|
148
207
|
|
|
149
208
|
## Local Testing with Sandbox
|
|
150
209
|
|
|
151
210
|
```typescript
|
|
152
|
-
import { Sandbox } from
|
|
211
|
+
import { Sandbox } from "near-kit"
|
|
153
212
|
|
|
154
|
-
const sandbox = await Sandbox.start()
|
|
155
|
-
const near = new Near({ network: sandbox })
|
|
213
|
+
const sandbox = await Sandbox.start()
|
|
214
|
+
const near = new Near({ network: sandbox })
|
|
156
215
|
// ... run tests
|
|
157
|
-
await sandbox.stop()
|
|
216
|
+
await sandbox.stop()
|
|
158
217
|
```
|
|
159
218
|
|
|
160
219
|
**With test framework:**
|
|
220
|
+
|
|
161
221
|
```typescript
|
|
162
|
-
let sandbox: Sandbox
|
|
163
|
-
beforeAll(async () => {
|
|
164
|
-
|
|
222
|
+
let sandbox: Sandbox
|
|
223
|
+
beforeAll(async () => {
|
|
224
|
+
sandbox = await Sandbox.start()
|
|
225
|
+
})
|
|
226
|
+
afterAll(async () => {
|
|
227
|
+
await sandbox.stop()
|
|
228
|
+
})
|
|
165
229
|
```
|
|
166
230
|
|
|
167
231
|
## Key Management
|
|
168
232
|
|
|
169
233
|
```typescript
|
|
170
|
-
import { InMemoryKeyStore, FileKeyStore } from
|
|
234
|
+
import { InMemoryKeyStore, FileKeyStore, RotatingKeyStore } from "near-kit"
|
|
171
235
|
|
|
172
236
|
// In-memory (runtime only)
|
|
173
237
|
const near = new Near({
|
|
174
238
|
keyStore: new InMemoryKeyStore({
|
|
175
|
-
|
|
176
|
-
})
|
|
177
|
-
})
|
|
239
|
+
"alice.near": "ed25519:...",
|
|
240
|
+
}),
|
|
241
|
+
})
|
|
178
242
|
|
|
179
243
|
// File-based (persistent)
|
|
180
244
|
const near = new Near({
|
|
181
|
-
keyStore: new FileKeyStore(
|
|
182
|
-
})
|
|
245
|
+
keyStore: new FileKeyStore("~/.near-credentials"),
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
// Rotating keys for high-throughput concurrent transactions
|
|
249
|
+
const near = new Near({
|
|
250
|
+
keyStore: new RotatingKeyStore({
|
|
251
|
+
"alice.near": [
|
|
252
|
+
"ed25519:key1...",
|
|
253
|
+
"ed25519:key2...",
|
|
254
|
+
"ed25519:key3...",
|
|
255
|
+
],
|
|
256
|
+
}),
|
|
257
|
+
})
|
|
183
258
|
```
|
|
184
259
|
|
|
185
260
|
## Wallet Integration
|
|
186
261
|
|
|
187
|
-
near-kit
|
|
262
|
+
near-kit integrates with Wallet Selector and HOT Connector through a signer abstraction. Wallet adapters are converted to signers via `fromWalletSelector()` and `fromHotConnect()` shims, allowing the same API to work across backend and frontend without separate client implementations.
|
|
188
263
|
|
|
189
264
|
### NEAR Wallet Selector
|
|
190
265
|
|
|
191
266
|
```typescript
|
|
192
|
-
import { Near, fromWalletSelector } from
|
|
193
|
-
import { setupWalletSelector } from
|
|
194
|
-
import { setupMyNearWallet } from
|
|
195
|
-
import { setupHereWallet } from
|
|
267
|
+
import { Near, fromWalletSelector } from "near-kit"
|
|
268
|
+
import { setupWalletSelector } from "@near-wallet-selector/core"
|
|
269
|
+
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet"
|
|
270
|
+
import { setupHereWallet } from "@near-wallet-selector/here-wallet"
|
|
196
271
|
|
|
197
272
|
// Setup wallet selector
|
|
198
273
|
const selector = await setupWalletSelector({
|
|
199
|
-
network:
|
|
200
|
-
modules: [
|
|
201
|
-
|
|
202
|
-
setupHereWallet(),
|
|
203
|
-
],
|
|
204
|
-
});
|
|
274
|
+
network: "testnet",
|
|
275
|
+
modules: [setupMyNearWallet(), setupHereWallet()],
|
|
276
|
+
})
|
|
205
277
|
|
|
206
278
|
// Get wallet instance (after user connects)
|
|
207
|
-
const wallet = await selector.wallet()
|
|
279
|
+
const wallet = await selector.wallet()
|
|
208
280
|
|
|
209
281
|
// Use with near-kit
|
|
210
282
|
const near = new Near({
|
|
211
|
-
network:
|
|
283
|
+
network: "testnet",
|
|
212
284
|
wallet: fromWalletSelector(wallet),
|
|
213
|
-
})
|
|
285
|
+
})
|
|
214
286
|
|
|
215
287
|
// All operations now use the wallet for signing
|
|
216
|
-
await near.call(
|
|
217
|
-
await near.send(
|
|
288
|
+
await near.call("contract.near", "method", { arg: "value" })
|
|
289
|
+
await near.send("bob.near", "10 NEAR")
|
|
218
290
|
```
|
|
219
291
|
|
|
220
292
|
### HOT Connector
|
|
221
293
|
|
|
222
294
|
```typescript
|
|
223
|
-
import { Near, fromHotConnect } from
|
|
224
|
-
import { NearConnector } from
|
|
295
|
+
import { Near, fromHotConnect } from "near-kit"
|
|
296
|
+
import { NearConnector } from "@hot-labs/near-connect"
|
|
225
297
|
|
|
226
298
|
// Create connector
|
|
227
|
-
const connector = new NearConnector({ network:
|
|
299
|
+
const connector = new NearConnector({ network: "testnet" })
|
|
228
300
|
|
|
229
301
|
// Wait for user to connect
|
|
230
|
-
connector.on(
|
|
302
|
+
connector.on("wallet:signIn", async () => {
|
|
231
303
|
const near = new Near({
|
|
232
|
-
network:
|
|
304
|
+
network: "testnet",
|
|
233
305
|
wallet: fromHotConnect(connector),
|
|
234
|
-
})
|
|
306
|
+
})
|
|
235
307
|
|
|
236
308
|
// Use near-kit with the connected wallet
|
|
237
|
-
await near.call(
|
|
238
|
-
})
|
|
309
|
+
await near.call("contract.near", "method", { arg: "value" })
|
|
310
|
+
})
|
|
239
311
|
|
|
240
312
|
// Trigger wallet connection
|
|
241
|
-
await connector.signIn()
|
|
313
|
+
await connector.signIn()
|
|
242
314
|
```
|
|
243
315
|
|
|
244
316
|
## Error Handling
|
|
245
317
|
|
|
318
|
+
Errors are organized by category and include detailed context for debugging. Use `instanceof` checks to handle specific error types.
|
|
319
|
+
|
|
320
|
+
#### Network Errors
|
|
321
|
+
|
|
246
322
|
```typescript
|
|
247
|
-
import {
|
|
248
|
-
InsufficientBalanceError,
|
|
249
|
-
FunctionCallError,
|
|
250
|
-
NetworkError,
|
|
251
|
-
} from 'near-kit';
|
|
323
|
+
import { NetworkError, TimeoutError } from "near-kit"
|
|
252
324
|
|
|
253
325
|
try {
|
|
254
|
-
await near.call(
|
|
326
|
+
await near.call("contract.near", "method", {})
|
|
255
327
|
} catch (error) {
|
|
256
|
-
if (error instanceof
|
|
257
|
-
console.log(
|
|
258
|
-
} else if (error instanceof FunctionCallError) {
|
|
259
|
-
console.log(`Contract error: ${error.panic}`);
|
|
328
|
+
if (error instanceof TimeoutError) {
|
|
329
|
+
console.log("Request timed out - already retried automatically")
|
|
260
330
|
} else if (error instanceof NetworkError) {
|
|
261
|
-
//
|
|
331
|
+
// Handle other network issues
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### Transaction Errors
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
import { InsufficientBalanceError, InvalidNonceError } from "near-kit"
|
|
340
|
+
|
|
341
|
+
try {
|
|
342
|
+
await near.send("bob.near", "1000000 NEAR")
|
|
343
|
+
} catch (error) {
|
|
344
|
+
if (error instanceof InsufficientBalanceError) {
|
|
345
|
+
console.log(`Need ${error.required}, have ${error.available}`)
|
|
346
|
+
} else if (error instanceof InvalidNonceError) {
|
|
347
|
+
// Already retried automatically - only thrown if retries exhausted
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
#### Contract Errors
|
|
353
|
+
|
|
354
|
+
```typescript
|
|
355
|
+
import { FunctionCallError } from "near-kit"
|
|
356
|
+
|
|
357
|
+
try {
|
|
358
|
+
await near.call("contract.near", "method", {})
|
|
359
|
+
} catch (error) {
|
|
360
|
+
if (error instanceof FunctionCallError) {
|
|
361
|
+
console.log(`Contract panicked: ${error.panic}`)
|
|
362
|
+
console.log(`Logs:`, error.logs)
|
|
262
363
|
}
|
|
263
364
|
}
|
|
264
365
|
```
|
|
@@ -270,14 +371,15 @@ try {
|
|
|
270
371
|
Deploy and initialize a contract in a single transaction:
|
|
271
372
|
|
|
272
373
|
```typescript
|
|
273
|
-
const contractWasm = await fs.readFile(
|
|
274
|
-
|
|
275
|
-
await near
|
|
276
|
-
.
|
|
277
|
-
.
|
|
278
|
-
.
|
|
279
|
-
.
|
|
280
|
-
.
|
|
374
|
+
const contractWasm = await fs.readFile("./contract.wasm")
|
|
375
|
+
|
|
376
|
+
await near
|
|
377
|
+
.transaction("alice.near")
|
|
378
|
+
.createAccount("contract.alice.near")
|
|
379
|
+
.transfer("contract.alice.near", "10 NEAR")
|
|
380
|
+
.deployContract("contract.alice.near", contractWasm)
|
|
381
|
+
.functionCall("contract.alice.near", "init", { owner: "alice.near" })
|
|
382
|
+
.send()
|
|
281
383
|
```
|
|
282
384
|
|
|
283
385
|
### NEP-413 Message Signing
|
|
@@ -286,16 +388,16 @@ Authenticate users without gas fees:
|
|
|
286
388
|
|
|
287
389
|
```typescript
|
|
288
390
|
const signedMessage = await near.signMessage({
|
|
289
|
-
message:
|
|
290
|
-
recipient:
|
|
291
|
-
nonce: crypto.getRandomValues(new Uint8Array(32))
|
|
292
|
-
})
|
|
391
|
+
message: "Login to MyApp",
|
|
392
|
+
recipient: "myapp.near",
|
|
393
|
+
nonce: crypto.getRandomValues(new Uint8Array(32)),
|
|
394
|
+
})
|
|
293
395
|
|
|
294
396
|
// Send to backend for verification
|
|
295
|
-
await fetch(
|
|
296
|
-
method:
|
|
297
|
-
body: JSON.stringify(signedMessage)
|
|
298
|
-
})
|
|
397
|
+
await fetch("/api/auth", {
|
|
398
|
+
method: "POST",
|
|
399
|
+
body: JSON.stringify(signedMessage),
|
|
400
|
+
})
|
|
299
401
|
```
|
|
300
402
|
|
|
301
403
|
### Delegate Actions (NEP-366)
|
|
@@ -305,25 +407,25 @@ Enable meta-transactions and sponsored transactions where a relayer pays the gas
|
|
|
305
407
|
```typescript
|
|
306
408
|
// User creates and signs a delegate action (no gas cost to user)
|
|
307
409
|
const userNear = new Near({
|
|
308
|
-
network:
|
|
309
|
-
privateKey:
|
|
310
|
-
})
|
|
410
|
+
network: "testnet",
|
|
411
|
+
privateKey: "ed25519:...", // User's key
|
|
412
|
+
})
|
|
311
413
|
|
|
312
414
|
const signedDelegateAction = await userNear
|
|
313
|
-
.transaction(
|
|
314
|
-
.transfer(
|
|
315
|
-
.delegate({ blockHeightOffset: 100 })
|
|
415
|
+
.transaction("user.near")
|
|
416
|
+
.transfer("recipient.near", "1 NEAR")
|
|
417
|
+
.delegate({ blockHeightOffset: 100 })
|
|
316
418
|
|
|
317
419
|
// Relayer submits the transaction (pays the gas)
|
|
318
420
|
const relayerNear = new Near({
|
|
319
|
-
network:
|
|
320
|
-
privateKey:
|
|
321
|
-
})
|
|
421
|
+
network: "testnet",
|
|
422
|
+
privateKey: "ed25519:...", // Relayer's key
|
|
423
|
+
})
|
|
322
424
|
|
|
323
425
|
await relayerNear
|
|
324
|
-
.transaction(
|
|
426
|
+
.transaction("relayer.near")
|
|
325
427
|
.signedDelegateAction(signedDelegateAction)
|
|
326
|
-
.send()
|
|
428
|
+
.send()
|
|
327
429
|
```
|
|
328
430
|
|
|
329
431
|
### Automatic Nonce Management
|
|
@@ -333,10 +435,10 @@ No more nonce conflicts - the library handles nonce tracking and retries automat
|
|
|
333
435
|
```typescript
|
|
334
436
|
// Safe to run multiple transactions concurrently
|
|
335
437
|
await Promise.all([
|
|
336
|
-
near.send(
|
|
337
|
-
near.send(
|
|
338
|
-
near.send(
|
|
339
|
-
])
|
|
438
|
+
near.send("bob.near", "1 NEAR"),
|
|
439
|
+
near.send("charlie.near", "1 NEAR"),
|
|
440
|
+
near.send("dave.near", "1 NEAR"),
|
|
441
|
+
])
|
|
340
442
|
// Nonces are automatically managed and conflicts are retried
|
|
341
443
|
```
|
|
342
444
|
|
|
@@ -346,7 +448,7 @@ Automatic retries for network errors with exponential backoff:
|
|
|
346
448
|
|
|
347
449
|
```typescript
|
|
348
450
|
try {
|
|
349
|
-
await near.call(
|
|
451
|
+
await near.call("contract.near", "method", {})
|
|
350
452
|
} catch (error) {
|
|
351
453
|
if (error instanceof TimeoutError && error.retryable) {
|
|
352
454
|
// Already retried automatically
|
|
@@ -367,7 +469,7 @@ bun test
|
|
|
367
469
|
bun run build
|
|
368
470
|
|
|
369
471
|
# Run examples
|
|
370
|
-
bun run examples/
|
|
472
|
+
bun run examples/quickstart.ts
|
|
371
473
|
```
|
|
372
474
|
|
|
373
475
|
## License
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* these schemas as an implementation detail.
|
|
8
8
|
*/
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
import { type PrivateKey } from "../utils/validation.js";
|
|
10
|
+
import { type Amount, type Gas, type PrivateKey } from "../utils/validation.js";
|
|
11
11
|
/**
|
|
12
12
|
* Schema for network presets (mainnet, testnet, localnet)
|
|
13
13
|
*/
|
|
@@ -70,7 +70,12 @@ export declare const CallOptionsSchema: z.ZodObject<{
|
|
|
70
70
|
FINAL: "FINAL";
|
|
71
71
|
}>>;
|
|
72
72
|
}, z.core.$strip>;
|
|
73
|
-
export type CallOptions =
|
|
73
|
+
export type CallOptions = {
|
|
74
|
+
gas?: Gas;
|
|
75
|
+
attachedDeposit?: Amount;
|
|
76
|
+
signerId?: string;
|
|
77
|
+
waitUntil?: z.infer<typeof TxExecutionStatusSchema>;
|
|
78
|
+
};
|
|
74
79
|
/**
|
|
75
80
|
* Block reference for RPC queries
|
|
76
81
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-schemas.d.ts","sourceRoot":"","sources":["../../src/core/config-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,
|
|
1
|
+
{"version":3,"file":"config-schemas.d.ts","sourceRoot":"","sources":["../../src/core/config-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAK/B;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;EAA6C,CAAA;AAE7E;;GAEG;AACH,eAAO,MAAM,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CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACtD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,GAAG;IAC5D,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;CACrC,CAAA;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG;IAC7D,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC/B,CA0BA"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* these schemas as an implementation detail.
|
|
8
8
|
*/
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
import { PrivateKeySchema } from "../utils/validation.js";
|
|
10
|
+
import { PrivateKeySchema, } from "../utils/validation.js";
|
|
11
11
|
import { NETWORK_PRESETS } from "./constants.js";
|
|
12
12
|
// ==================== Network Config Schema ====================
|
|
13
13
|
/**
|
|
@@ -48,6 +48,8 @@ export const TxExecutionStatusSchema = z.enum([
|
|
|
48
48
|
* Schema for function call options
|
|
49
49
|
*/
|
|
50
50
|
export const CallOptionsSchema = z.object({
|
|
51
|
+
// Runtime validation: keep loose string/bigint types so config
|
|
52
|
+
// parsing fails fast on obviously invalid shapes.
|
|
51
53
|
gas: z.string().optional(),
|
|
52
54
|
attachedDeposit: z.union([z.string(), z.bigint()]).optional(),
|
|
53
55
|
signerId: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-schemas.js","sourceRoot":"","sources":["../../src/core/config-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,
|
|
1
|
+
{"version":3,"file":"config-schemas.js","sourceRoot":"","sources":["../../src/core/config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KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC1E,IACE,UAAU;YACV,CAAC,UAAU,KAAK,SAAS;gBACvB,UAAU,KAAK,SAAS;gBACxB,UAAU,KAAK,UAAU,CAAC,EAC5B,CAAC;YACD,OAAO,eAAe,CAAC,UAA2B,CAAC,CAAA;QACrD,CAAC;QACD,OAAO,eAAe,CAAC,OAAO,CAAA;IAChC,CAAC;IAED,oCAAoC;IACpC,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAEpD,iBAAiB;IACjB,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,eAAe,CAAC,SAA0B,CAAC,CAAA;IACpD,CAAC;IAED,4CAA4C;IAC5C,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
package/dist/core/near.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"near.d.ts","sourceRoot":"","sources":["../../src/core/near.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAM/D,OAAO,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"near.d.ts","sourceRoot":"","sources":["../../src/core/near.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAM/D,OAAO,KAAK,EAAE,MAAM,EAAO,MAAM,wBAAwB,CAAA;AAGzD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EACV,qBAAqB,EACrB,oCAAoC,EACrC,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EACV,WAAW,E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