@sequence0/sdk 0.1.0 → 1.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/README.md +63 -5
- package/dist/chains/bitcoin.d.ts +15 -3
- package/dist/chains/bitcoin.d.ts.map +1 -1
- package/dist/chains/bitcoin.js +23 -3
- package/dist/chains/bitcoin.js.map +1 -1
- package/dist/chains/ethereum.d.ts +3 -0
- package/dist/chains/ethereum.d.ts.map +1 -1
- package/dist/chains/ethereum.js +156 -20
- package/dist/chains/ethereum.js.map +1 -1
- package/dist/core/client.d.ts +132 -2
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +501 -32
- package/dist/core/client.js.map +1 -1
- package/dist/core/types.d.ts +55 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -3
- package/dist/index.js.map +1 -1
- package/dist/utils/discovery.d.ts +95 -0
- package/dist/utils/discovery.d.ts.map +1 -0
- package/dist/utils/discovery.js +212 -0
- package/dist/utils/discovery.js.map +1 -0
- package/dist/utils/errors.d.ts +26 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +32 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/fee.d.ts +107 -0
- package/dist/utils/fee.d.ts.map +1 -0
- package/dist/utils/fee.js +220 -0
- package/dist/utils/fee.js.map +1 -0
- package/dist/utils/http.d.ts +98 -2
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/http.js +238 -6
- package/dist/utils/http.js.map +1 -1
- package/dist/utils/logger.d.ts +43 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +129 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +43 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +99 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/validation.d.ts +74 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +380 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/wallet/wallet.d.ts +13 -1
- package/dist/wallet/wallet.d.ts.map +1 -1
- package/dist/wallet/wallet.js +86 -21
- package/dist/wallet/wallet.js.map +1 -1
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @sequence0/sdk
|
|
2
2
|
|
|
3
3
|
> **Decentralized threshold signatures for any blockchain.**
|
|
4
|
-
> Create wallets, sign transactions, and broadcast to
|
|
4
|
+
> Create wallets, sign transactions, and broadcast to 67 chains — no private keys required.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ const s0 = new Sequence0({ network: 'mainnet' });
|
|
|
20
20
|
// 2. Create a threshold wallet (DKG ceremony with 24 agents)
|
|
21
21
|
const wallet = await s0.createWallet({ chain: 'ethereum' });
|
|
22
22
|
console.log('Address:', wallet.address);
|
|
23
|
-
console.log('Threshold:', wallet.threshold); // { t:
|
|
23
|
+
console.log('Threshold:', wallet.threshold); // { t: 16, n: 24 }
|
|
24
24
|
|
|
25
25
|
// 3. Sign and send a transaction
|
|
26
26
|
const txHash = await wallet.sendTransaction({
|
|
@@ -34,7 +34,7 @@ console.log('TX Hash:', txHash);
|
|
|
34
34
|
|
|
35
35
|
| Feature | Description |
|
|
36
36
|
|---------|-------------|
|
|
37
|
-
| **Multi-Chain** | Ethereum, Bitcoin, Solana, Polygon, Arbitrum, Base, and
|
|
37
|
+
| **Multi-Chain** | Ethereum, Bitcoin, Solana, Polygon, Arbitrum, Base, and 60+ more (67 total) |
|
|
38
38
|
| **Threshold Signing** | FROST (t-of-n) — no single point of failure |
|
|
39
39
|
| **No Private Keys** | Keys are sharded across the agent network |
|
|
40
40
|
| **Real-Time Events** | WebSocket subscriptions for signing progress |
|
|
@@ -48,6 +48,8 @@ Ethereum, Polygon, Arbitrum, Optimism, Base, BSC, Avalanche
|
|
|
48
48
|
### Non-EVM
|
|
49
49
|
Bitcoin (Schnorr/Taproot), Solana (Ed25519)
|
|
50
50
|
|
|
51
|
+
> **Note:** Bitcoin, Dogecoin, and Litecoin support wallet creation and raw message signing via `sign()`. However, `sendTransaction()` is not yet supported for UTXO chains — full transaction serialization requires `bitcoinjs-lib`. Use `sign()` to get the Schnorr signature and construct the raw transaction externally.
|
|
52
|
+
|
|
51
53
|
## API Reference
|
|
52
54
|
|
|
53
55
|
### `Sequence0` — Main Client
|
|
@@ -61,6 +63,35 @@ const s0 = new Sequence0({
|
|
|
61
63
|
});
|
|
62
64
|
```
|
|
63
65
|
|
|
66
|
+
### Ownership Verification
|
|
67
|
+
|
|
68
|
+
Every `/sign` request requires an ownership proof. Configure an `ownerSigner` or `ownerPrivateKey` when creating the SDK instance:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// Option 1: Private key (SDK derives signer automatically)
|
|
72
|
+
const s0 = new Sequence0({
|
|
73
|
+
network: 'mainnet',
|
|
74
|
+
ownerPrivateKey: '0xYourPrivateKey...',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// Option 2: Custom signer function
|
|
78
|
+
const s0 = new Sequence0({
|
|
79
|
+
network: 'mainnet',
|
|
80
|
+
ownerSigner: async (digest: Uint8Array) => {
|
|
81
|
+
// Sign the 32-byte digest and return 65-byte hex signature
|
|
82
|
+
return myWallet.signDigest(digest);
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
When creating a wallet, pass the `creator` address to record ownership on-chain:
|
|
88
|
+
```typescript
|
|
89
|
+
const wallet = await s0.createWallet({
|
|
90
|
+
chain: 'ethereum',
|
|
91
|
+
creator: '0xYourAddress...',
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
64
95
|
#### Methods
|
|
65
96
|
|
|
66
97
|
| Method | Returns | Description |
|
|
@@ -80,7 +111,7 @@ const s0 = new Sequence0({
|
|
|
80
111
|
```typescript
|
|
81
112
|
const wallet = await s0.createWallet({
|
|
82
113
|
chain: 'ethereum',
|
|
83
|
-
threshold: { t:
|
|
114
|
+
threshold: { t: 16, n: 24 }, // optional, default shown
|
|
84
115
|
curve: 'secp256k1', // auto-detected from chain
|
|
85
116
|
});
|
|
86
117
|
```
|
|
@@ -137,6 +168,33 @@ try {
|
|
|
137
168
|
}
|
|
138
169
|
```
|
|
139
170
|
|
|
171
|
+
## Any Language (REST API)
|
|
172
|
+
|
|
173
|
+
This SDK wraps a plain **HTTP + JSON** REST API exposed by every agent node. You can integrate from **any language** — Python, Go, Rust, Java, etc. — by calling the API directly:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Health check
|
|
177
|
+
curl http://AGENT_URL:8080/health
|
|
178
|
+
|
|
179
|
+
# Create a wallet (DKG)
|
|
180
|
+
curl -X POST http://AGENT_URL:8080/dkg/initiate \
|
|
181
|
+
-H 'Content-Type: application/json' \
|
|
182
|
+
-d '{"wallet_id":"my-wallet","participants":["peer1","peer2"],"threshold":2,"curve":"secp256k1"}'
|
|
183
|
+
|
|
184
|
+
# Sign a message
|
|
185
|
+
curl -X POST http://AGENT_URL:8080/sign \
|
|
186
|
+
-H 'Content-Type: application/json' \
|
|
187
|
+
-d '{"wallet_id":"my-wallet","message":"48656c6c6f"}'
|
|
188
|
+
|
|
189
|
+
# Poll for signature
|
|
190
|
+
curl http://AGENT_URL:8080/sign/REQUEST_ID
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Testnet agent**: `http://3.140.248.117:8080` (operated by Sequence0)
|
|
194
|
+
**Mainnet**: Auto-discover agents from on-chain AgentRegistry, or connect to a known agent URL.
|
|
195
|
+
|
|
196
|
+
Full REST API reference: [sequence0.network/docs](https://sequence0.network/docs#app-rest-api)
|
|
197
|
+
|
|
140
198
|
## Networks
|
|
141
199
|
|
|
142
200
|
| | Mainnet | Testnet |
|
|
@@ -147,7 +205,7 @@ try {
|
|
|
147
205
|
|
|
148
206
|
## Economics
|
|
149
207
|
|
|
150
|
-
Signing fees are always paid in
|
|
208
|
+
Signing fees are always paid in **ETH on the Sequence0 chain** (chain 800801). Fees are collected by the FeeCollector contract and distributed to participating agents.
|
|
151
209
|
|
|
152
210
|
## License
|
|
153
211
|
|
package/dist/chains/bitcoin.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bitcoin Chain Adapter
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* and
|
|
4
|
+
* Provides UTXO selection and balance queries via Mempool.space API.
|
|
5
|
+
* Wallet creation and raw message signing work (agent node is curve-agnostic).
|
|
6
|
+
*
|
|
7
|
+
* LIMITATIONS:
|
|
8
|
+
* - Transaction building returns a signing payload, not a wire-format TX.
|
|
9
|
+
* Full P2TR transaction serialization requires bitcoinjs-lib which is
|
|
10
|
+
* not yet integrated. Use sign() for raw Schnorr signatures and
|
|
11
|
+
* construct the final TX externally if needed.
|
|
12
|
+
* - broadcast() will fail until proper TX serialization is added.
|
|
6
13
|
*/
|
|
7
14
|
import { ChainAdapter, BtcTransaction } from '../core/types';
|
|
8
15
|
export declare class BitcoinAdapter implements ChainAdapter {
|
|
@@ -24,7 +31,12 @@ export declare class BitcoinAdapter implements ChainAdapter {
|
|
|
24
31
|
*/
|
|
25
32
|
attachSignature(unsignedTx: string, signature: string): Promise<string>;
|
|
26
33
|
/**
|
|
27
|
-
* Broadcast a signed transaction to the Bitcoin network
|
|
34
|
+
* Broadcast a signed transaction to the Bitcoin network.
|
|
35
|
+
*
|
|
36
|
+
* NOTE: This requires a properly serialized raw Bitcoin transaction (hex).
|
|
37
|
+
* The built-in buildTransaction() returns a signing payload, not a
|
|
38
|
+
* wire-format TX. For full P2TR broadcast support, integrate bitcoinjs-lib
|
|
39
|
+
* to serialize the transaction with witness data before calling this method.
|
|
28
40
|
*/
|
|
29
41
|
broadcast(signedTx: string): Promise<string>;
|
|
30
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../src/chains/bitcoin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../src/chains/bitcoin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAc7D,qBAAa,cAAe,YAAW,YAAY;IAC/C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAU;gBAEf,OAAO,GAAE,SAAS,GAAG,SAAqB,EAAE,MAAM,CAAC,EAAE,MAAM;IAKvE,SAAS,IAAI,MAAM;IAInB;;;;;;;OAOG;IACG,gBAAgB,CAAC,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqDhF;;OAEG;IACG,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB7E;;;;;;;OAOG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAiClD;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYlD,iCAAiC;YACnB,UAAU;IAMxB,gCAAgC;IAC1B,WAAW,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CASpF;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,SAAS,GAAG,SAAqB,GAAG,cAAc,CAE/F"}
|
package/dist/chains/bitcoin.js
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Bitcoin Chain Adapter
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* and
|
|
5
|
+
* Provides UTXO selection and balance queries via Mempool.space API.
|
|
6
|
+
* Wallet creation and raw message signing work (agent node is curve-agnostic).
|
|
7
|
+
*
|
|
8
|
+
* LIMITATIONS:
|
|
9
|
+
* - Transaction building returns a signing payload, not a wire-format TX.
|
|
10
|
+
* Full P2TR transaction serialization requires bitcoinjs-lib which is
|
|
11
|
+
* not yet integrated. Use sign() for raw Schnorr signatures and
|
|
12
|
+
* construct the final TX externally if needed.
|
|
13
|
+
* - broadcast() will fail until proper TX serialization is added.
|
|
7
14
|
*/
|
|
8
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
16
|
exports.BitcoinAdapter = void 0;
|
|
@@ -93,10 +100,23 @@ class BitcoinAdapter {
|
|
|
93
100
|
}
|
|
94
101
|
}
|
|
95
102
|
/**
|
|
96
|
-
* Broadcast a signed transaction to the Bitcoin network
|
|
103
|
+
* Broadcast a signed transaction to the Bitcoin network.
|
|
104
|
+
*
|
|
105
|
+
* NOTE: This requires a properly serialized raw Bitcoin transaction (hex).
|
|
106
|
+
* The built-in buildTransaction() returns a signing payload, not a
|
|
107
|
+
* wire-format TX. For full P2TR broadcast support, integrate bitcoinjs-lib
|
|
108
|
+
* to serialize the transaction with witness data before calling this method.
|
|
97
109
|
*/
|
|
98
110
|
async broadcast(signedTx) {
|
|
99
111
|
try {
|
|
112
|
+
// Detect if this is our internal JSON format (not a raw BTC TX)
|
|
113
|
+
const decoded = Buffer.from(signedTx, 'hex').toString();
|
|
114
|
+
if (decoded.startsWith('{')) {
|
|
115
|
+
throw new Error('Bitcoin transaction broadcasting requires a properly serialized raw transaction (hex). ' +
|
|
116
|
+
'The built-in transaction builder produces a signing payload only. ' +
|
|
117
|
+
'Use bitcoinjs-lib to construct the final P2TR transaction with the FROST signature, ' +
|
|
118
|
+
'then pass the raw hex to broadcast().');
|
|
119
|
+
}
|
|
100
120
|
const response = await fetch(`${this.apiUrl}/tx`, {
|
|
101
121
|
method: 'POST',
|
|
102
122
|
headers: { 'Content-Type': 'text/plain' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitcoin.js","sourceRoot":"","sources":["../../src/chains/bitcoin.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"bitcoin.js","sourceRoot":"","sources":["../../src/chains/bitcoin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AA6LH,oDAEC;AA5LD,4CAA6C;AAU7C,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAChD,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAExD,MAAa,cAAc;IAIvB,YAAY,UAAiC,SAAS,EAAE,MAAe;QACnE,IAAI,CAAC,SAAS,GAAG,OAAO,KAAK,SAAS,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACzE,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,gBAAgB,CAAC,EAAkB,EAAE,WAAmB;QAC1D,IAAI,CAAC;YACD,cAAc;YACd,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YACjD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACrB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;YAC1C,CAAC;YAED,qCAAqC;YACrC,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,oBAAoB;YACtD,MAAM,aAAa,GAAG,GAAG,CAAC,CAAC,sBAAsB;YACjD,MAAM,GAAG,GAAG,OAAO,GAAG,aAAa,CAAC;YACpC,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,GAAG,GA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CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3D,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAW,CAAC;IAC7C,CAAC;IAED,gCAAgC;IAChC,KAAK,CAAC,WAAW;QACb,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,sBAAsB,CAAC,CAAC;QACnE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAS,CAAC;QAC1C,OAAO;YACH,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,QAAQ,EAAE,IAAI,CAAC,WAAW;YAC1B,IAAI,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACN,CAAC;CACJ;AA3KD,wCA2KC;AAED,SAAgB,oBAAoB,CAAC,UAAiC,SAAS;IAC3E,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -42,9 +42,12 @@ export declare class EthereumAdapter implements ChainAdapter {
|
|
|
42
42
|
estimateGas(tx: EvmTransaction, from: string): Promise<bigint>;
|
|
43
43
|
/** Get current gas price info */
|
|
44
44
|
getGasPrice(): Promise<{
|
|
45
|
+
gasPrice: bigint;
|
|
45
46
|
maxFeePerGas: bigint;
|
|
46
47
|
maxPriorityFeePerGas: bigint;
|
|
47
48
|
}>;
|
|
49
|
+
/** Check if this chain uses legacy (type 0) transactions */
|
|
50
|
+
isLegacyChain(): boolean;
|
|
48
51
|
/** Get current block number */
|
|
49
52
|
getBlockNumber(): Promise<number>;
|
|
50
53
|
/** Get transaction receipt */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../src/chains/ethereum.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"eth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C;AACnC,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAEtE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAErE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAEtE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAElE"}
|
package/dist/chains/ethereum.js
CHANGED
|
@@ -16,23 +16,135 @@ const ethers_1 = require("ethers");
|
|
|
16
16
|
const errors_1 = require("../utils/errors");
|
|
17
17
|
/** Default RPC URLs per EVM chain */
|
|
18
18
|
const DEFAULT_RPC = {
|
|
19
|
+
// Layer 1s
|
|
19
20
|
ethereum: 'https://eth.llamarpc.com',
|
|
20
21
|
polygon: 'https://polygon-rpc.com',
|
|
22
|
+
bsc: 'https://bsc-dataseed.binance.org',
|
|
23
|
+
avalanche: 'https://api.avax.network/ext/bc/C/rpc',
|
|
24
|
+
fantom: 'https://rpc.ftm.tools',
|
|
25
|
+
gnosis: 'https://rpc.gnosischain.com',
|
|
26
|
+
celo: 'https://forno.celo.org',
|
|
27
|
+
cronos: 'https://evm.cronos.org',
|
|
28
|
+
moonbeam: 'https://rpc.api.moonbeam.network',
|
|
29
|
+
moonriver: 'https://rpc.api.moonriver.moonbeam.network',
|
|
30
|
+
harmony: 'https://api.harmony.one',
|
|
31
|
+
kava: 'https://evm.kava.io',
|
|
32
|
+
canto: 'https://canto.slingshot.finance',
|
|
33
|
+
aurora: 'https://mainnet.aurora.dev',
|
|
34
|
+
klaytn: 'https://public-en-cypress.klaytn.net',
|
|
35
|
+
okc: 'https://exchainrpc.okex.org',
|
|
36
|
+
fuse: 'https://rpc.fuse.io',
|
|
37
|
+
evmos: 'https://evmos-evm-rpc.publicnode.com',
|
|
38
|
+
core: 'https://rpc.coredao.org',
|
|
39
|
+
flare: 'https://flare-api.flare.network/ext/C/rpc',
|
|
40
|
+
iotex: 'https://babel-api.mainnet.iotex.io',
|
|
41
|
+
rootstock: 'https://public-node.rsk.co',
|
|
42
|
+
telos: 'https://mainnet.telos.net/evm',
|
|
43
|
+
thundercore: 'https://mainnet-rpc.thundercore.com',
|
|
44
|
+
// Layer 2s
|
|
21
45
|
arbitrum: 'https://arb1.arbitrum.io/rpc',
|
|
22
46
|
optimism: 'https://mainnet.optimism.io',
|
|
23
47
|
base: 'https://mainnet.base.org',
|
|
24
|
-
|
|
25
|
-
|
|
48
|
+
zksync: 'https://mainnet.era.zksync.io',
|
|
49
|
+
scroll: 'https://rpc.scroll.io',
|
|
50
|
+
linea: 'https://rpc.linea.build',
|
|
51
|
+
mantle: 'https://rpc.mantle.xyz',
|
|
52
|
+
blast: 'https://rpc.blast.io',
|
|
53
|
+
mode: 'https://mainnet.mode.network',
|
|
54
|
+
manta: 'https://pacific-rpc.manta.network/http',
|
|
55
|
+
'polygon-zkevm': 'https://zkevm-rpc.com',
|
|
56
|
+
metis: 'https://andromeda.metis.io/?owner=1088',
|
|
57
|
+
zora: 'https://rpc.zora.energy',
|
|
58
|
+
sei: 'https://evm-rpc.sei-apis.com',
|
|
59
|
+
boba: 'https://mainnet.boba.network',
|
|
60
|
+
taiko: 'https://rpc.mainnet.taiko.xyz',
|
|
61
|
+
opbnb: 'https://opbnb-mainnet-rpc.bnbchain.org',
|
|
62
|
+
fraxtal: 'https://rpc.frax.com',
|
|
63
|
+
worldchain: 'https://worldchain-mainnet.g.alchemy.com/public',
|
|
64
|
+
lisk: 'https://rpc.api.lisk.com',
|
|
65
|
+
redstone: 'https://rpc.redstonechain.com',
|
|
66
|
+
cyber: 'https://cyber.alt.technology',
|
|
67
|
+
mint: 'https://rpc.mintchain.io',
|
|
68
|
+
bob: 'https://rpc.gobob.xyz',
|
|
69
|
+
xai: 'https://xai-chain.net/rpc',
|
|
70
|
+
morph: 'https://rpc.morphl2.io',
|
|
71
|
+
'astar-zkevm': 'https://rpc.startale.com/astar-zkevm',
|
|
26
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Chains that do NOT support EIP-1559 (type 2) transactions.
|
|
75
|
+
* These chains require legacy (type 0) transactions with gasPrice.
|
|
76
|
+
*/
|
|
77
|
+
const LEGACY_ONLY_CHAINS = new Set([
|
|
78
|
+
'bsc', // BNB Chain — uses legacy gas model
|
|
79
|
+
'rootstock', // RSK — Bitcoin sidechain, no EIP-1559
|
|
80
|
+
'harmony', // Harmony — does not support EIP-1559
|
|
81
|
+
'klaytn', // Klaytn — uses own gas model
|
|
82
|
+
'okc', // OKX Chain — legacy only
|
|
83
|
+
'canto', // Canto — no EIP-1559 support
|
|
84
|
+
'metis', // Metis — custom gas model
|
|
85
|
+
'cronos', // Cronos — legacy preferred
|
|
86
|
+
'moonriver', // Moonriver — legacy often required
|
|
87
|
+
'fuse', // Fuse — legacy only
|
|
88
|
+
'thundercore', // ThunderCore — legacy only
|
|
89
|
+
'telos', // Telos EVM — legacy only
|
|
90
|
+
'zksync', // zkSync Era — uses own tx type (EIP-712 native)
|
|
91
|
+
'opbnb', // opBNB — legacy preferred
|
|
92
|
+
]);
|
|
27
93
|
/** Default chain IDs */
|
|
28
94
|
const CHAIN_IDS = {
|
|
95
|
+
// Layer 1s
|
|
29
96
|
ethereum: 1,
|
|
30
97
|
polygon: 137,
|
|
98
|
+
bsc: 56,
|
|
99
|
+
avalanche: 43114,
|
|
100
|
+
fantom: 250,
|
|
101
|
+
gnosis: 100,
|
|
102
|
+
celo: 42220,
|
|
103
|
+
cronos: 25,
|
|
104
|
+
moonbeam: 1284,
|
|
105
|
+
moonriver: 1285,
|
|
106
|
+
harmony: 1666600000,
|
|
107
|
+
kava: 2222,
|
|
108
|
+
canto: 7700,
|
|
109
|
+
aurora: 1313161554,
|
|
110
|
+
klaytn: 8217,
|
|
111
|
+
okc: 66,
|
|
112
|
+
fuse: 122,
|
|
113
|
+
evmos: 9001,
|
|
114
|
+
core: 1116,
|
|
115
|
+
flare: 14,
|
|
116
|
+
iotex: 4689,
|
|
117
|
+
rootstock: 30,
|
|
118
|
+
telos: 40,
|
|
119
|
+
thundercore: 108,
|
|
120
|
+
// Layer 2s
|
|
31
121
|
arbitrum: 42161,
|
|
32
122
|
optimism: 10,
|
|
33
123
|
base: 8453,
|
|
34
|
-
|
|
35
|
-
|
|
124
|
+
zksync: 324,
|
|
125
|
+
scroll: 534352,
|
|
126
|
+
linea: 59144,
|
|
127
|
+
mantle: 5000,
|
|
128
|
+
blast: 81457,
|
|
129
|
+
mode: 34443,
|
|
130
|
+
manta: 169,
|
|
131
|
+
'polygon-zkevm': 1101,
|
|
132
|
+
metis: 1088,
|
|
133
|
+
zora: 7777777,
|
|
134
|
+
sei: 1329,
|
|
135
|
+
boba: 288,
|
|
136
|
+
taiko: 167000,
|
|
137
|
+
opbnb: 204,
|
|
138
|
+
fraxtal: 252,
|
|
139
|
+
worldchain: 480,
|
|
140
|
+
lisk: 1135,
|
|
141
|
+
redstone: 690,
|
|
142
|
+
cyber: 7560,
|
|
143
|
+
mint: 185,
|
|
144
|
+
bob: 60808,
|
|
145
|
+
xai: 660279,
|
|
146
|
+
morph: 2818,
|
|
147
|
+
'astar-zkevm': 3776,
|
|
36
148
|
};
|
|
37
149
|
class EthereumAdapter {
|
|
38
150
|
constructor(chain = 'ethereum', rpcUrl) {
|
|
@@ -64,22 +176,41 @@ class EthereumAdapter {
|
|
|
64
176
|
value: tx.value ? BigInt(tx.value) : 0n,
|
|
65
177
|
data: tx.data || '0x',
|
|
66
178
|
}).catch(() => 21000n);
|
|
67
|
-
// Build the transaction object
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
179
|
+
// Build the transaction object — legacy (type 0) or EIP-1559 (type 2)
|
|
180
|
+
const useLegacy = LEGACY_ONLY_CHAINS.has(this.chainName)
|
|
181
|
+
|| tx.gasPrice !== undefined;
|
|
182
|
+
let txObj;
|
|
183
|
+
if (useLegacy) {
|
|
184
|
+
txObj = {
|
|
185
|
+
to: tx.to,
|
|
186
|
+
value: tx.value ? BigInt(tx.value) : 0n,
|
|
187
|
+
data: tx.data || '0x',
|
|
188
|
+
nonce,
|
|
189
|
+
gasLimit,
|
|
190
|
+
chainId: tx.chainId || this.chainId,
|
|
191
|
+
type: 0,
|
|
192
|
+
gasPrice: tx.gasPrice
|
|
193
|
+
? BigInt(tx.gasPrice)
|
|
194
|
+
: (feeData.gasPrice || 5000000000n),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
txObj = {
|
|
199
|
+
to: tx.to,
|
|
200
|
+
value: tx.value ? BigInt(tx.value) : 0n,
|
|
201
|
+
data: tx.data || '0x',
|
|
202
|
+
nonce,
|
|
203
|
+
gasLimit,
|
|
204
|
+
chainId: tx.chainId || this.chainId,
|
|
205
|
+
type: 2,
|
|
206
|
+
maxFeePerGas: tx.maxFeePerGas
|
|
207
|
+
? BigInt(tx.maxFeePerGas)
|
|
208
|
+
: (feeData.maxFeePerGas || 30000000000n),
|
|
209
|
+
maxPriorityFeePerGas: tx.maxPriorityFeePerGas
|
|
210
|
+
? BigInt(tx.maxPriorityFeePerGas)
|
|
211
|
+
: (feeData.maxPriorityFeePerGas || 1500000000n),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
83
214
|
// Serialize unsigned TX and return the hash for signing
|
|
84
215
|
const unsignedTx = ethers_1.Transaction.from(txObj);
|
|
85
216
|
return unsignedTx.unsignedSerialized;
|
|
@@ -145,10 +276,15 @@ class EthereumAdapter {
|
|
|
145
276
|
async getGasPrice() {
|
|
146
277
|
const feeData = await this.provider.getFeeData();
|
|
147
278
|
return {
|
|
279
|
+
gasPrice: feeData.gasPrice || 5000000000n,
|
|
148
280
|
maxFeePerGas: feeData.maxFeePerGas || 30000000000n,
|
|
149
281
|
maxPriorityFeePerGas: feeData.maxPriorityFeePerGas || 1500000000n,
|
|
150
282
|
};
|
|
151
283
|
}
|
|
284
|
+
/** Check if this chain uses legacy (type 0) transactions */
|
|
285
|
+
isLegacyChain() {
|
|
286
|
+
return LEGACY_ONLY_CHAINS.has(this.chainName);
|
|
287
|
+
}
|
|
152
288
|
/** Get current block number */
|
|
153
289
|
async getBlockNumber() {
|
|
154
290
|
return this.provider.getBlockNumber();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.js","sourceRoot":"","sources":["../../src/chains/ethereum.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"ethereum.js","sourceRoot":"","sources":["../../src/chains/ethereum.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAmUH,sDAEC;AAED,oDAEC;AAED,sDAEC;AAED,8CAEC;AA/UD,mCAAiE;AAEjE,4CAA6C;AAE7C,qCAAqC;AACrC,MAAM,WAAW,GAA2B;IACxC,WAAW;IACX,QAAQ,EAAE,0BAA0B;IACpC,OAAO,EAAE,yBAAyB;IAClC,GAAG,EAAE,kCAAkC;IACvC,SAAS,EAAE,uCAAuC;IAClD,MAAM,EAAE,uBAAuB;IAC/B,MAAM,EAAE,6BAA6B;IACrC,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE,wBAAwB;IAChC,QAAQ,EAAE,kCAAkC;IAC5C,SAAS,EAAE,4CAA4C;IACvD,OAAO,EAAE,yBAAyB;IAClC,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,iCAAiC;IACxC,MAAM,EAAE,4BAA4B;IACpC,MAAM,EAAE,sCAAsC;IAC9C,GAAG,EAAE,6BAA6B;IAClC,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,sCAAsC;IAC7C,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,2CAA2C;IAClD,KAAK,EAAE,oCAAoC;IAC3C,SAAS,EA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