@fastxyz/allset-sdk 0.1.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/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/bridge.d.ts +12 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +299 -0
- package/dist/bridge.js.map +1 -0
- package/dist/evm-executor.d.ts +8 -0
- package/dist/evm-executor.d.ts.map +1 -0
- package/dist/evm-executor.js +68 -0
- package/dist/evm-executor.js.map +1 -0
- package/dist/fast-compat.d.ts +13 -0
- package/dist/fast-compat.d.ts.map +1 -0
- package/dist/fast-compat.js +22 -0
- package/dist/fast-compat.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +68 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pi2Labs
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# AllSet SDK
|
|
2
|
+
|
|
3
|
+
Standalone AllSet SDK extracted from `/Users/chris/Documents/Workspace/money`.
|
|
4
|
+
|
|
5
|
+
This repo contains only `@fastxyz/allset-sdk`. It does not include the Fast SDK package or the old workspace wiring from the `money` monorepo.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @fastxyz/allset-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Development
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Scripts
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm run build
|
|
23
|
+
npm test
|
|
24
|
+
npm run pack:dry-run
|
|
25
|
+
npm run pack:smoke
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { createEvmExecutor, omnisetProvider } from '@fastxyz/allset-sdk';
|
|
32
|
+
|
|
33
|
+
const evmExecutor = createEvmExecutor(
|
|
34
|
+
process.env.EVM_PRIVATE_KEY!,
|
|
35
|
+
process.env.ARBITRUM_SEPOLIA_RPC_URL!,
|
|
36
|
+
421614,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const result = await omnisetProvider.bridge({
|
|
40
|
+
fromChain: 'arbitrum',
|
|
41
|
+
toChain: 'fast',
|
|
42
|
+
fromToken: 'USDC',
|
|
43
|
+
toToken: 'fastUSDC',
|
|
44
|
+
fromDecimals: 6,
|
|
45
|
+
amount: '1000000',
|
|
46
|
+
senderAddress: '0xYourEvmAddress',
|
|
47
|
+
receiverAddress: 'fast1yourfastaddress',
|
|
48
|
+
evmExecutor,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
console.log(result);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Current Scope
|
|
55
|
+
|
|
56
|
+
- Testnet only
|
|
57
|
+
- Fast to EVM and EVM to Fast flows only
|
|
58
|
+
- EVM executor support for Ethereum Sepolia (`11155111`) and Arbitrum Sepolia (`421614`)
|
|
59
|
+
- Current token registry maps Arbitrum Sepolia `USDC` and `fastUSDC`
|
|
60
|
+
|
|
61
|
+
For Fast to EVM withdrawals, provide a compatible Fast client. In most integrations that will come from `@fastxyz/sdk`, but this package does not bundle it.
|
|
62
|
+
|
|
63
|
+
## Releasing
|
|
64
|
+
|
|
65
|
+
See `RELEASING.md` for the tag-driven npm release flow and the npm trusted publishing setup this repo expects.
|
package/dist/bridge.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bridge.ts — OmniSet bridge provider
|
|
3
|
+
*
|
|
4
|
+
* Bridges between Fast chain and EVM chains (Ethereum Sepolia, Arbitrum Sepolia).
|
|
5
|
+
*
|
|
6
|
+
* Two directions:
|
|
7
|
+
* Deposit (EVM → Fast): call bridge.deposit(token, amount, receiver) on the EVM bridge contract
|
|
8
|
+
* Withdraw (Fast → EVM): transfer on Fast chain + submit ExternalClaim intent + POST to relayer
|
|
9
|
+
*/
|
|
10
|
+
import type { BridgeProvider } from './types.js';
|
|
11
|
+
export declare const omnisetProvider: BridgeProvider;
|
|
12
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAwC,MAAM,YAAY,CAAC;AAuFvF,eAAO,MAAM,eAAe,EAAE,cAqS7B,CAAC"}
|
package/dist/bridge.js
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bridge.ts — OmniSet bridge provider
|
|
3
|
+
*
|
|
4
|
+
* Bridges between Fast chain and EVM chains (Ethereum Sepolia, Arbitrum Sepolia).
|
|
5
|
+
*
|
|
6
|
+
* Two directions:
|
|
7
|
+
* Deposit (EVM → Fast): call bridge.deposit(token, amount, receiver) on the EVM bridge contract
|
|
8
|
+
* Withdraw (Fast → EVM): transfer on Fast chain + submit ExternalClaim intent + POST to relayer
|
|
9
|
+
*/
|
|
10
|
+
import { bech32m } from 'bech32';
|
|
11
|
+
import { encodeAbiParameters, encodeFunctionData, hashMessage } from 'viem';
|
|
12
|
+
import { FastError } from './fast-compat.js';
|
|
13
|
+
function base64ToBytes(b64) {
|
|
14
|
+
return new Uint8Array(Buffer.from(b64, 'base64'));
|
|
15
|
+
}
|
|
16
|
+
const FAST_USDC_TOKEN_ID = base64ToBytes('HnRJAAIRgrKTU4u2aFt33wleNRNk1VACFhTOkMirngo=');
|
|
17
|
+
const FAST_USDC_TOKEN_HEX = '1e744900021182b29352cbb6685b77df095e35136cd550021614ce928daae782';
|
|
18
|
+
const CHAIN_CONFIGS = {
|
|
19
|
+
ethereum: {
|
|
20
|
+
chainId: 11155111,
|
|
21
|
+
bridgeContract: '0x38b48764f6B12e1Dd5e4f8391d06d34Ba3920201',
|
|
22
|
+
fastsetBridgeAddress: 'fast19cjwajufyuqv883ydlvrp8xrhxejuvfe40pxq5dsrv675zgh89sqg9txs8',
|
|
23
|
+
relayerUrl: 'https://staging.omniset.fastset.xyz/ethereum-sepolia-relayer',
|
|
24
|
+
},
|
|
25
|
+
arbitrum: {
|
|
26
|
+
chainId: 421614,
|
|
27
|
+
bridgeContract: '0xBb9111E62c9EE364cF6dc676d754602a2E259bd3',
|
|
28
|
+
fastsetBridgeAddress: 'fast1pz07pdlspsydyt2g79yeshunhfyjsr5j4ahuyfv8hpdn00ks8u6q8axf9t',
|
|
29
|
+
relayerUrl: 'https://staging.omniset.fastset.xyz/arbitrum-sepolia-relayer',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const CHAIN_TOKENS = {
|
|
33
|
+
arbitrum: {
|
|
34
|
+
USDC: {
|
|
35
|
+
evmAddress: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
|
|
36
|
+
fastsetTokenId: FAST_USDC_TOKEN_ID,
|
|
37
|
+
decimals: 6,
|
|
38
|
+
isNative: false,
|
|
39
|
+
},
|
|
40
|
+
fastUSDC: {
|
|
41
|
+
evmAddress: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
|
|
42
|
+
fastsetTokenId: FAST_USDC_TOKEN_ID,
|
|
43
|
+
decimals: 6,
|
|
44
|
+
isNative: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
function resolveOmnisetToken(token, evmChain) {
|
|
49
|
+
const chainTokens = CHAIN_TOKENS[evmChain];
|
|
50
|
+
if (!chainTokens)
|
|
51
|
+
return null;
|
|
52
|
+
const upper = token.toUpperCase();
|
|
53
|
+
if (chainTokens[upper])
|
|
54
|
+
return chainTokens[upper];
|
|
55
|
+
if (chainTokens[token])
|
|
56
|
+
return chainTokens[token];
|
|
57
|
+
const clean = token.startsWith('0x') ? token.slice(2).toLowerCase() : token.toLowerCase();
|
|
58
|
+
if (clean === FAST_USDC_TOKEN_HEX)
|
|
59
|
+
return chainTokens.USDC ?? null;
|
|
60
|
+
for (const info of Object.values(chainTokens)) {
|
|
61
|
+
if (info.evmAddress.toLowerCase() === token.toLowerCase())
|
|
62
|
+
return info;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
function fastAddressToBytes32(address) {
|
|
67
|
+
const { words } = bech32m.decode(address, 90);
|
|
68
|
+
const bytes = new Uint8Array(bech32m.fromWords(words));
|
|
69
|
+
return `0x${Buffer.from(bytes).toString('hex')}`;
|
|
70
|
+
}
|
|
71
|
+
function hexToUint8Array(hex) {
|
|
72
|
+
const clean = hex.startsWith('0x') ? hex.slice(2) : hex;
|
|
73
|
+
const bytes = new Uint8Array(clean.length / 2);
|
|
74
|
+
for (let i = 0; i < bytes.length; i += 1) {
|
|
75
|
+
bytes[i] = parseInt(clean.slice(i * 2, i * 2 + 2), 16);
|
|
76
|
+
}
|
|
77
|
+
return bytes;
|
|
78
|
+
}
|
|
79
|
+
const BRIDGE_DEPOSIT_ABI = [{
|
|
80
|
+
type: 'function',
|
|
81
|
+
name: 'deposit',
|
|
82
|
+
inputs: [
|
|
83
|
+
{ name: 'token', type: 'address' },
|
|
84
|
+
{ name: 'amount', type: 'uint256' },
|
|
85
|
+
{ name: 'receiver', type: 'bytes32' },
|
|
86
|
+
],
|
|
87
|
+
outputs: [],
|
|
88
|
+
stateMutability: 'payable',
|
|
89
|
+
}];
|
|
90
|
+
export const omnisetProvider = {
|
|
91
|
+
name: 'omniset',
|
|
92
|
+
chains: ['fast', 'ethereum', 'arbitrum'],
|
|
93
|
+
networks: ['testnet'],
|
|
94
|
+
async bridge(params) {
|
|
95
|
+
try {
|
|
96
|
+
const isDeposit = params.fromChain !== 'fast' && params.toChain === 'fast';
|
|
97
|
+
const isWithdraw = params.fromChain === 'fast';
|
|
98
|
+
if (!isDeposit && !isWithdraw) {
|
|
99
|
+
throw new FastError('UNSUPPORTED_OPERATION', `OmniSet only supports bridging between Fast chain and EVM chains (ethereum, arbitrum). Got: ${params.fromChain} → ${params.toChain}`, {
|
|
100
|
+
note: 'Use fromChain: "fast" for withdrawals, or toChain: "fast" for deposits.\n Example: await allset.bridge({ fromChain: "ethereum", toChain: "fast", fromToken: "USDC", toToken: "fastUSDC", amount: "1000000", senderAddress: "0x...", receiverAddress: "fast1..." })',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (isDeposit) {
|
|
104
|
+
if (!params.evmExecutor) {
|
|
105
|
+
throw new FastError('INVALID_PARAMS', 'OmniSet deposit (EVM → Fast) requires evmExecutor', {
|
|
106
|
+
note: 'Provide an evmExecutor created with createEvmExecutor().\n Example: const executor = createEvmExecutor(privateKey, rpcUrl, chainId)',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const chainConfig = CHAIN_CONFIGS[params.fromChain];
|
|
110
|
+
if (!chainConfig) {
|
|
111
|
+
throw new FastError('UNSUPPORTED_OPERATION', `OmniSet does not support EVM chain "${params.fromChain}". Supported: ${Object.keys(CHAIN_CONFIGS).join(', ')}`, {
|
|
112
|
+
note: 'Use "ethereum" or "arbitrum" as the source chain for OmniSet deposits.',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
let tokenInfo = resolveOmnisetToken(params.fromToken, params.fromChain);
|
|
116
|
+
if (!tokenInfo) {
|
|
117
|
+
tokenInfo = resolveOmnisetToken(params.toToken, params.fromChain);
|
|
118
|
+
}
|
|
119
|
+
if (!tokenInfo) {
|
|
120
|
+
throw new FastError('TOKEN_NOT_FOUND', `Cannot resolve token "${params.fromToken}" on OmniSet for chain "${params.fromChain}".`, {
|
|
121
|
+
note: 'Supported tokens: USDC, fastUSDC.\n Example: await allset.bridge({ fromChain: "arbitrum", toChain: "fast", fromToken: "USDC", toToken: "fastUSDC", amount: "1000000", senderAddress: "0x...", receiverAddress: "fast1..." })',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
let receiverBytes32;
|
|
125
|
+
try {
|
|
126
|
+
receiverBytes32 = fastAddressToBytes32(params.receiverAddress);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
130
|
+
throw new FastError('INVALID_ADDRESS', `Failed to decode Fast chain receiver address "${params.receiverAddress}": ${msg}`, {
|
|
131
|
+
note: 'The receiver address must be a valid Fast chain bech32m address (fast1...).\n Example: fast1abc...',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
const calldata = encodeFunctionData({
|
|
135
|
+
abi: BRIDGE_DEPOSIT_ABI,
|
|
136
|
+
functionName: 'deposit',
|
|
137
|
+
args: [
|
|
138
|
+
tokenInfo.evmAddress,
|
|
139
|
+
BigInt(params.amount),
|
|
140
|
+
receiverBytes32,
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
let txHash;
|
|
144
|
+
if (tokenInfo.isNative) {
|
|
145
|
+
const receipt = await params.evmExecutor.sendTx({
|
|
146
|
+
to: chainConfig.bridgeContract,
|
|
147
|
+
data: calldata,
|
|
148
|
+
value: params.amount,
|
|
149
|
+
});
|
|
150
|
+
if (receipt.status === 'reverted') {
|
|
151
|
+
throw new FastError('TX_FAILED', `OmniSet deposit transaction reverted: ${receipt.txHash}`, {
|
|
152
|
+
note: 'The deposit transaction was reverted. Check that you have sufficient ETH balance.',
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
txHash = receipt.txHash;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
const requiredAmount = BigInt(params.amount);
|
|
159
|
+
const currentAllowance = await params.evmExecutor.checkAllowance(tokenInfo.evmAddress, chainConfig.bridgeContract, params.senderAddress);
|
|
160
|
+
if (currentAllowance < requiredAmount) {
|
|
161
|
+
await params.evmExecutor.approveErc20(tokenInfo.evmAddress, chainConfig.bridgeContract, params.amount);
|
|
162
|
+
}
|
|
163
|
+
const receipt = await params.evmExecutor.sendTx({
|
|
164
|
+
to: chainConfig.bridgeContract,
|
|
165
|
+
data: calldata,
|
|
166
|
+
value: '0',
|
|
167
|
+
});
|
|
168
|
+
if (receipt.status === 'reverted') {
|
|
169
|
+
throw new FastError('TX_FAILED', `OmniSet deposit transaction reverted: ${receipt.txHash}`, {
|
|
170
|
+
note: 'The deposit transaction was reverted. Check that you have sufficient token balance and the approval succeeded.',
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
txHash = receipt.txHash;
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
txHash,
|
|
177
|
+
orderId: txHash,
|
|
178
|
+
estimatedTime: '1-5 minutes',
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
if (!params.fastClient) {
|
|
182
|
+
throw new FastError('INVALID_PARAMS', 'OmniSet withdrawal (Fast → EVM) requires fastClient', {
|
|
183
|
+
note: 'Provide a compatible FastClient implementation with submit() and evmSign().',
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
const chainConfig = CHAIN_CONFIGS[params.toChain];
|
|
187
|
+
if (!chainConfig) {
|
|
188
|
+
throw new FastError('UNSUPPORTED_OPERATION', `OmniSet does not support EVM destination chain "${params.toChain}". Supported: ${Object.keys(CHAIN_CONFIGS).join(', ')}`, {
|
|
189
|
+
note: 'Use "ethereum" or "arbitrum" as the destination chain for OmniSet withdrawals.',
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
let tokenInfo = resolveOmnisetToken(params.fromToken, params.toChain);
|
|
193
|
+
if (!tokenInfo) {
|
|
194
|
+
tokenInfo = resolveOmnisetToken(params.toToken, params.toChain);
|
|
195
|
+
}
|
|
196
|
+
if (!tokenInfo) {
|
|
197
|
+
throw new FastError('TOKEN_NOT_FOUND', `Cannot resolve token "${params.fromToken}" on OmniSet for destination chain "${params.toChain}".`, {
|
|
198
|
+
note: 'Supported tokens: USDC, fastUSDC.\n Example: await allset.bridge({ fromChain: "fast", toChain: "arbitrum", fromToken: "fastUSDC", toToken: "USDC", amount: "1000000", senderAddress: "fast1...", receiverAddress: "0x..." })',
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
const evmTokenAddress = tokenInfo.evmAddress;
|
|
202
|
+
const transferResult = await params.fastClient.submit({
|
|
203
|
+
recipient: chainConfig.fastsetBridgeAddress,
|
|
204
|
+
claim: {
|
|
205
|
+
TokenTransfer: {
|
|
206
|
+
token_id: tokenInfo.fastsetTokenId,
|
|
207
|
+
amount: params.amount,
|
|
208
|
+
user_data: null,
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
const transferCrossSign = await params.fastClient.evmSign({
|
|
213
|
+
certificate: transferResult.certificate,
|
|
214
|
+
});
|
|
215
|
+
const transferClaimHash = hashMessage({
|
|
216
|
+
raw: new Uint8Array(transferCrossSign.transaction),
|
|
217
|
+
});
|
|
218
|
+
const dynamicTransferPayload = encodeAbiParameters([{ type: 'address' }, { type: 'address' }], [
|
|
219
|
+
evmTokenAddress,
|
|
220
|
+
params.receiverAddress,
|
|
221
|
+
]);
|
|
222
|
+
const intentClaimEncoded = encodeAbiParameters([{
|
|
223
|
+
type: 'tuple',
|
|
224
|
+
components: [
|
|
225
|
+
{ name: 'transferClaimHash', type: 'bytes32' },
|
|
226
|
+
{
|
|
227
|
+
name: 'intents',
|
|
228
|
+
type: 'tuple[]',
|
|
229
|
+
components: [
|
|
230
|
+
{ name: 'action', type: 'uint8' },
|
|
231
|
+
{ name: 'payload', type: 'bytes' },
|
|
232
|
+
{ name: 'value', type: 'uint256' },
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
}], [{
|
|
237
|
+
transferClaimHash: transferClaimHash,
|
|
238
|
+
intents: [{
|
|
239
|
+
action: 1,
|
|
240
|
+
payload: dynamicTransferPayload,
|
|
241
|
+
value: 0n,
|
|
242
|
+
}],
|
|
243
|
+
}]);
|
|
244
|
+
const intentBytes = hexToUint8Array(intentClaimEncoded);
|
|
245
|
+
const intentResult = await params.fastClient.submit({
|
|
246
|
+
recipient: params.fastClient.address,
|
|
247
|
+
claim: {
|
|
248
|
+
ExternalClaim: {
|
|
249
|
+
claim: {
|
|
250
|
+
verifier_committee: [],
|
|
251
|
+
verifier_quorum: 0,
|
|
252
|
+
claim_data: Array.from(intentBytes),
|
|
253
|
+
},
|
|
254
|
+
signatures: [],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
const intentCrossSign = await params.fastClient.evmSign({
|
|
259
|
+
certificate: intentResult.certificate,
|
|
260
|
+
});
|
|
261
|
+
const relayerBody = {
|
|
262
|
+
encoded_transfer_claim: Array.from(new Uint8Array(transferCrossSign.transaction.map(Number))),
|
|
263
|
+
transfer_proof: transferCrossSign.signature,
|
|
264
|
+
transfer_claim_id: transferResult.txHash,
|
|
265
|
+
fastset_address: params.senderAddress,
|
|
266
|
+
external_address: params.receiverAddress,
|
|
267
|
+
encoded_intent_claim: Array.from(new Uint8Array(intentCrossSign.transaction.map(Number))),
|
|
268
|
+
intent_proof: intentCrossSign.signature,
|
|
269
|
+
intent_claim_id: intentResult.txHash,
|
|
270
|
+
external_token_address: evmTokenAddress,
|
|
271
|
+
};
|
|
272
|
+
const relayRes = await fetch(chainConfig.relayerUrl, {
|
|
273
|
+
method: 'POST',
|
|
274
|
+
headers: { 'Content-Type': 'application/json' },
|
|
275
|
+
body: JSON.stringify(relayerBody),
|
|
276
|
+
});
|
|
277
|
+
if (!relayRes.ok) {
|
|
278
|
+
const text = await relayRes.text();
|
|
279
|
+
throw new FastError('TX_FAILED', `OmniSet relayer request failed (${relayRes.status}): ${text}`, {
|
|
280
|
+
note: 'The withdrawal was submitted to Fast chain but the relayer rejected it. Try again.',
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
txHash: transferResult.txHash,
|
|
285
|
+
orderId: transferClaimHash,
|
|
286
|
+
estimatedTime: '1-5 minutes',
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
catch (err) {
|
|
290
|
+
if (err instanceof FastError)
|
|
291
|
+
throw err;
|
|
292
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
293
|
+
throw new FastError('TX_FAILED', `OmniSet bridge failed: ${msg}`, {
|
|
294
|
+
note: 'Check that both chains are configured and have sufficient balance.',
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
};
|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G,CAAC,CAAC;YAC7D,MAAM,IAAI,SAAS,CACjB,WAAW,EACX,0BAA0B,GAAG,EAAE,EAC/B;gBACE,IAAI,EAAE,oEAAoE;aAC3E,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* evm-executor.ts — Minimal EVM transaction executor using viem
|
|
3
|
+
*
|
|
4
|
+
* Provides sendTx, checkAllowance, and approveErc20 for bridge operations.
|
|
5
|
+
*/
|
|
6
|
+
import type { EvmTxExecutor } from './types.js';
|
|
7
|
+
export declare function createEvmExecutor(privateKey: string, rpcUrl: string, chainId: number): EvmTxExecutor;
|
|
8
|
+
//# sourceMappingURL=evm-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evm-executor.d.ts","sourceRoot":"","sources":["../src/evm-executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,aAAa,CAyDf"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* evm-executor.ts — Minimal EVM transaction executor using viem
|
|
3
|
+
*
|
|
4
|
+
* Provides sendTx, checkAllowance, and approveErc20 for bridge operations.
|
|
5
|
+
*/
|
|
6
|
+
import { createPublicClient, createWalletClient, http, parseAbi, } from 'viem';
|
|
7
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
8
|
+
import { arbitrumSepolia, sepolia } from 'viem/chains';
|
|
9
|
+
const ERC20_ABI = parseAbi([
|
|
10
|
+
'function approve(address spender, uint256 amount) returns (bool)',
|
|
11
|
+
'function allowance(address owner, address spender) view returns (uint256)',
|
|
12
|
+
]);
|
|
13
|
+
const CHAIN_MAP = {
|
|
14
|
+
11155111: sepolia,
|
|
15
|
+
421614: arbitrumSepolia,
|
|
16
|
+
};
|
|
17
|
+
export function createEvmExecutor(privateKey, rpcUrl, chainId) {
|
|
18
|
+
const key = (privateKey.startsWith('0x') ? privateKey : `0x${privateKey}`);
|
|
19
|
+
const account = privateKeyToAccount(key);
|
|
20
|
+
const chain = CHAIN_MAP[chainId];
|
|
21
|
+
if (!chain) {
|
|
22
|
+
throw new Error(`Unsupported EVM chain ID: ${chainId}. Supported: ${Object.keys(CHAIN_MAP).join(', ')}`);
|
|
23
|
+
}
|
|
24
|
+
const walletClient = createWalletClient({
|
|
25
|
+
account,
|
|
26
|
+
chain,
|
|
27
|
+
transport: http(rpcUrl),
|
|
28
|
+
});
|
|
29
|
+
const publicClient = createPublicClient({
|
|
30
|
+
chain,
|
|
31
|
+
transport: http(rpcUrl),
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
async sendTx(tx) {
|
|
35
|
+
const hash = await walletClient.sendTransaction({
|
|
36
|
+
to: tx.to,
|
|
37
|
+
data: tx.data,
|
|
38
|
+
value: BigInt(tx.value),
|
|
39
|
+
gas: tx.gas ? BigInt(tx.gas) : undefined,
|
|
40
|
+
});
|
|
41
|
+
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
42
|
+
return {
|
|
43
|
+
txHash: hash,
|
|
44
|
+
status: receipt.status === 'success' ? 'success' : 'reverted',
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
async checkAllowance(token, spender, owner) {
|
|
48
|
+
const allowance = await publicClient.readContract({
|
|
49
|
+
address: token,
|
|
50
|
+
abi: ERC20_ABI,
|
|
51
|
+
functionName: 'allowance',
|
|
52
|
+
args: [owner, spender],
|
|
53
|
+
});
|
|
54
|
+
return allowance;
|
|
55
|
+
},
|
|
56
|
+
async approveErc20(token, spender, amount) {
|
|
57
|
+
const hash = await walletClient.writeContract({
|
|
58
|
+
address: token,
|
|
59
|
+
abi: ERC20_ABI,
|
|
60
|
+
functionName: 'approve',
|
|
61
|
+
args: [spender, BigInt(amount)],
|
|
62
|
+
});
|
|
63
|
+
await publicClient.waitForTransactionReceipt({ hash });
|
|
64
|
+
return hash;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=evm-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evm-executor.js","sourceRoot":"","sources":["../src/evm-executor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,IAAI,EACJ,QAAQ,GAGT,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM,SAAS,GAAG,QAAQ,CAAC;IACzB,kEAAkE;IAClE,2EAA2E;CAC5E,CAAC,CAAC;AAEH,MAAM,SAAS,GAA0B;IACvC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAC/B,UAAkB,EAClB,MAAc,EACd,OAAe;IAEf,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAkB,CAAC;IAC5F,MAAM,OAAO,GAAY,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,6BAA6B,OAAO,gBAAgB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxF,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,kBAAkB,CAAC;QACtC,OAAO;QACP,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GAAG,EAAE,SAAS;gBACd,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,CAAC,OAAwB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;aACjD,CAAC,CAAC;YACH,MAAM,YAAY,CAAC,yBAAyB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Fast SDK compatibility surface used by the standalone AllSet package.
|
|
3
|
+
*/
|
|
4
|
+
export type FastErrorCode = 'INSUFFICIENT_BALANCE' | 'CHAIN_NOT_CONFIGURED' | 'TX_FAILED' | 'INVALID_ADDRESS' | 'TOKEN_NOT_FOUND' | 'INVALID_PARAMS' | 'UNSUPPORTED_OPERATION';
|
|
5
|
+
export declare class FastError extends Error {
|
|
6
|
+
readonly code: FastErrorCode;
|
|
7
|
+
readonly note: string;
|
|
8
|
+
constructor(code: FastErrorCode, message: string, opts?: {
|
|
9
|
+
note?: string;
|
|
10
|
+
});
|
|
11
|
+
toJSON(): Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=fast-compat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-compat.d.ts","sourceRoot":"","sources":["../src/fast-compat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,aAAa,GACrB,sBAAsB,GACtB,sBAAsB,GACtB,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,uBAAuB,CAAC;AAE5B,qBAAa,SAAU,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAGpB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAQ1B,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Fast SDK compatibility surface used by the standalone AllSet package.
|
|
3
|
+
*/
|
|
4
|
+
export class FastError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
note;
|
|
7
|
+
constructor(code, message, opts) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = 'FastError';
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.note = opts?.note ?? '';
|
|
12
|
+
}
|
|
13
|
+
toJSON() {
|
|
14
|
+
return {
|
|
15
|
+
error: true,
|
|
16
|
+
code: this.code,
|
|
17
|
+
message: this.message,
|
|
18
|
+
note: this.note,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=fast-compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-compat.js","sourceRoot":"","sources":["../src/fast-compat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACzB,IAAI,CAAgB;IACpB,IAAI,CAAS;IAEtB,YACE,IAAmB,EACnB,OAAe,EACf,IAAwB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fastxyz/allset-sdk — OmniSet bridge SDK
|
|
3
|
+
*
|
|
4
|
+
* Bridges assets between Fast chain and EVM chains (Arbitrum Sepolia, Ethereum Sepolia).
|
|
5
|
+
*/
|
|
6
|
+
export { omnisetProvider } from './bridge.js';
|
|
7
|
+
export { createEvmExecutor } from './evm-executor.js';
|
|
8
|
+
export type { BridgeProvider, EvmTxExecutor, FastClient, OmnisetChainConfig, OmnisetTokenInfo, } from './types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,YAAY,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fastxyz/allset-sdk — OmniSet bridge SDK
|
|
3
|
+
*
|
|
4
|
+
* Bridges assets between Fast chain and EVM chains (Arbitrum Sepolia, Ethereum Sepolia).
|
|
5
|
+
*/
|
|
6
|
+
export { omnisetProvider } from './bridge.js';
|
|
7
|
+
export { createEvmExecutor } from './evm-executor.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* types.ts — AllSet SDK types
|
|
3
|
+
*/
|
|
4
|
+
export interface FastClient {
|
|
5
|
+
submit(params: {
|
|
6
|
+
recipient: string;
|
|
7
|
+
claim: Record<string, unknown>;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
txHash: string;
|
|
10
|
+
certificate: unknown;
|
|
11
|
+
}>;
|
|
12
|
+
evmSign(params: {
|
|
13
|
+
certificate: unknown;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
transaction: number[];
|
|
16
|
+
signature: string;
|
|
17
|
+
}>;
|
|
18
|
+
readonly address: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface EvmTxExecutor {
|
|
21
|
+
sendTx(tx: {
|
|
22
|
+
to: string;
|
|
23
|
+
data: string;
|
|
24
|
+
value: string;
|
|
25
|
+
gas?: string;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
txHash: string;
|
|
28
|
+
status: 'success' | 'reverted';
|
|
29
|
+
}>;
|
|
30
|
+
checkAllowance(token: string, spender: string, owner: string): Promise<bigint>;
|
|
31
|
+
approveErc20(token: string, spender: string, amount: string): Promise<string>;
|
|
32
|
+
}
|
|
33
|
+
export interface BridgeProvider {
|
|
34
|
+
name: string;
|
|
35
|
+
chains: string[];
|
|
36
|
+
networks?: Array<'testnet' | 'mainnet'>;
|
|
37
|
+
bridge(params: {
|
|
38
|
+
fromChain: string;
|
|
39
|
+
fromChainId?: number;
|
|
40
|
+
toChain: string;
|
|
41
|
+
toChainId?: number;
|
|
42
|
+
fromToken: string;
|
|
43
|
+
toToken: string;
|
|
44
|
+
fromDecimals: number;
|
|
45
|
+
amount: string;
|
|
46
|
+
senderAddress: string;
|
|
47
|
+
receiverAddress: string;
|
|
48
|
+
evmExecutor?: EvmTxExecutor;
|
|
49
|
+
fastClient?: FastClient;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
txHash: string;
|
|
52
|
+
orderId: string;
|
|
53
|
+
estimatedTime?: string;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
export interface OmnisetChainConfig {
|
|
57
|
+
chainId: number;
|
|
58
|
+
bridgeContract: string;
|
|
59
|
+
fastsetBridgeAddress: string;
|
|
60
|
+
relayerUrl: string;
|
|
61
|
+
}
|
|
62
|
+
export interface OmnisetTokenInfo {
|
|
63
|
+
evmAddress: string;
|
|
64
|
+
fastsetTokenId: Uint8Array;
|
|
65
|
+
decimals: number;
|
|
66
|
+
isNative: boolean;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,MAAM,EAAE;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACtD,OAAO,CAAC,MAAM,EAAE;QACd,WAAW,EAAE,OAAO,CAAC;KACtB,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAAA;KAAE,CAAC,CAAC;IAChE,cAAc,C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Q,EAAE,OAAO,CAAC;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fastxyz/allset-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AllSet SDK for OmniSet bridge flows between Fast and EVM testnets",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"allset",
|
|
7
|
+
"sdk",
|
|
8
|
+
"bridge",
|
|
9
|
+
"fast",
|
|
10
|
+
"blockchain"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"test": "node --import tsx --test tests/*.test.ts",
|
|
28
|
+
"pack:dry-run": "node ./scripts/pack-dry-run.mjs",
|
|
29
|
+
"pack:smoke": "node ./scripts/pack-smoke.mjs",
|
|
30
|
+
"release:verify-tag": "node ./scripts/verify-tag-version.mjs",
|
|
31
|
+
"prepublishOnly": "npm run build && npm test"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=20"
|
|
35
|
+
},
|
|
36
|
+
"author": "Pi2Labs",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/fastxyz/allset-sdk.git"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/fastxyz/allset-sdk/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/fastxyz/allset-sdk#readme",
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"bech32": "^2.0.0",
|
|
51
|
+
"viem": "^2.46.2"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^22.19.11",
|
|
55
|
+
"tsx": "^4.21.0",
|
|
56
|
+
"typescript": "^5.9.3"
|
|
57
|
+
}
|
|
58
|
+
}
|