@4mica/sdk 1.2.3 → 1.2.5
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 +6 -5
- package/dist/abi/core4mica.d.ts +492 -9
- package/dist/abi/core4mica.js +649 -19
- package/dist/client/user.d.ts +3 -1
- package/dist/client/user.js +2 -2
- package/dist/config.d.ts +4 -4
- package/dist/config.js +6 -6
- package/dist/contract.d.ts +3 -1
- package/dist/contract.js +7 -3
- package/dist/networks.d.ts +4 -4
- package/dist/networks.js +8 -4
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ Node.js 18+ is required.
|
|
|
29
29
|
|
|
30
30
|
| Shorthand | CAIP-2 | Core API URL |
|
|
31
31
|
| ------------------ | ----------------- | ----------------------------------------- |
|
|
32
|
+
| `base` | `eip155:8453` | `https://base.api.4mica.xyz/` |
|
|
32
33
|
| `ethereum-sepolia` | `eip155:11155111` | `https://ethereum.sepolia.api.4mica.xyz/` |
|
|
33
34
|
| `base-sepolia` | `eip155:84532` | `https://base.sepolia.api.4mica.xyz/` |
|
|
34
35
|
|
|
@@ -38,8 +39,8 @@ variable to switch networks.
|
|
|
38
39
|
```ts
|
|
39
40
|
import { NETWORKS } from '@4mica/sdk';
|
|
40
41
|
|
|
41
|
-
console.log(NETWORKS['base
|
|
42
|
-
console.log(NETWORKS['base
|
|
42
|
+
console.log(NETWORKS['base'].caip2); // "eip155:8453"
|
|
43
|
+
console.log(NETWORKS['base'].rpcUrl); // "https://base.api.4mica.xyz/"
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
## Initialization and Configuration
|
|
@@ -67,7 +68,7 @@ import { Client, ConfigBuilder } from '@4mica/sdk';
|
|
|
67
68
|
|
|
68
69
|
async function main() {
|
|
69
70
|
const cfg = new ConfigBuilder()
|
|
70
|
-
.network('base
|
|
71
|
+
.network('base') // or "ethereum-sepolia" (default)
|
|
71
72
|
.walletPrivateKey('0x...')
|
|
72
73
|
.build();
|
|
73
74
|
|
|
@@ -86,7 +87,7 @@ Set environment variables (example `.env`):
|
|
|
86
87
|
|
|
87
88
|
```bash
|
|
88
89
|
4MICA_WALLET_PRIVATE_KEY="0x..."
|
|
89
|
-
4MICA_NETWORK="base
|
|
90
|
+
4MICA_NETWORK="base" # shorthand or CAIP-2 id
|
|
90
91
|
# or override URL directly:
|
|
91
92
|
# 4MICA_RPC_URL="https://base.sepolia.api.4mica.xyz/"
|
|
92
93
|
4MICA_ETHEREUM_HTTP_RPC_URL="http://localhost:8545"
|
|
@@ -101,7 +102,7 @@ If you want to set them inline for a single command, use `env` since most shells
|
|
|
101
102
|
variable names that start with a digit:
|
|
102
103
|
|
|
103
104
|
```bash
|
|
104
|
-
env 4MICA_WALLET_PRIVATE_KEY="0x..." 4MICA_NETWORK="base
|
|
105
|
+
env 4MICA_WALLET_PRIVATE_KEY="0x..." 4MICA_NETWORK="base" node app.js
|
|
105
106
|
```
|
|
106
107
|
|
|
107
108
|
Then in code:
|