@fastxyz/allset-sdk 0.1.12 → 1.0.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/README.md +339 -266
- package/dist/index.d.ts +658 -5
- package/dist/index.js +927 -7
- package/package.json +21 -47
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -1
- package/dist/core/address.d.ts +0 -5
- package/dist/core/address.d.ts.map +0 -1
- package/dist/core/address.js +0 -29
- package/dist/core/deposit.d.ts +0 -59
- package/dist/core/deposit.d.ts.map +0 -1
- package/dist/core/deposit.js +0 -92
- package/dist/core/index.d.ts +0 -6
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -3
- package/dist/default-config.d.ts +0 -78
- package/dist/default-config.d.ts.map +0 -1
- package/dist/default-config.js +0 -78
- package/dist/index.d.ts.map +0 -1
- package/dist/intents.d.ts +0 -94
- package/dist/intents.d.ts.map +0 -1
- package/dist/intents.js +0 -119
- package/dist/node/bridge.d.ts +0 -38
- package/dist/node/bridge.d.ts.map +0 -1
- package/dist/node/bridge.js +0 -519
- package/dist/node/config.d.ts +0 -45
- package/dist/node/config.d.ts.map +0 -1
- package/dist/node/config.js +0 -48
- package/dist/node/eip7702.d.ts +0 -54
- package/dist/node/eip7702.d.ts.map +0 -1
- package/dist/node/eip7702.js +0 -275
- package/dist/node/evm-executor.d.ts +0 -130
- package/dist/node/evm-executor.d.ts.map +0 -1
- package/dist/node/evm-executor.js +0 -160
- package/dist/node/index.d.ts +0 -15
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js +0 -17
- package/dist/node/provider.d.ts +0 -162
- package/dist/node/provider.d.ts.map +0 -1
- package/dist/node/provider.js +0 -272
- package/dist/node/types.d.ts +0 -110
- package/dist/node/types.d.ts.map +0 -1
- package/dist/node/types.js +0 -4
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastxyz/allset-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "AllSet SDK for AllSet bridge flows between Fast and EVM testnets",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/fastxyz/fast-sdk",
|
|
8
|
+
"directory": "packages/allset-sdk"
|
|
9
|
+
},
|
|
5
10
|
"keywords": [
|
|
6
11
|
"allset",
|
|
7
12
|
"sdk",
|
|
@@ -16,68 +21,37 @@
|
|
|
16
21
|
".": {
|
|
17
22
|
"import": "./dist/index.js",
|
|
18
23
|
"types": "./dist/index.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"./core": {
|
|
21
|
-
"import": "./dist/core/index.js",
|
|
22
|
-
"types": "./dist/core/index.d.ts"
|
|
23
|
-
},
|
|
24
|
-
"./browser": {
|
|
25
|
-
"import": "./dist/browser/index.js",
|
|
26
|
-
"types": "./dist/browser/index.d.ts"
|
|
27
|
-
},
|
|
28
|
-
"./node": {
|
|
29
|
-
"import": "./dist/node/index.js",
|
|
30
|
-
"types": "./dist/node/index.d.ts"
|
|
31
24
|
}
|
|
32
25
|
},
|
|
33
26
|
"files": [
|
|
34
27
|
"dist"
|
|
35
28
|
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "npm run clean && tsc",
|
|
38
|
-
"clean": "rm -rf dist",
|
|
39
|
-
"test": "node --import tsx --test tests/*.test.ts",
|
|
40
|
-
"pack:dry-run": "node ./scripts/pack-dry-run.mjs",
|
|
41
|
-
"pack:smoke": "node ./scripts/pack-smoke.mjs",
|
|
42
|
-
"release:verify-tag": "node ./scripts/verify-tag-version.mjs",
|
|
43
|
-
"prepublishOnly": "npm run build && npm test"
|
|
44
|
-
},
|
|
45
29
|
"engines": {
|
|
46
30
|
"node": ">=20"
|
|
47
31
|
},
|
|
48
32
|
"author": "Fast.xyz",
|
|
49
33
|
"license": "MIT",
|
|
50
34
|
"publishConfig": {
|
|
51
|
-
"access": "public"
|
|
52
|
-
|
|
53
|
-
"repository": {
|
|
54
|
-
"type": "git",
|
|
55
|
-
"url": "git+https://github.com/fastxyz/allset-sdk.git"
|
|
56
|
-
},
|
|
57
|
-
"bugs": {
|
|
58
|
-
"url": "https://github.com/fastxyz/allset-sdk/issues"
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
59
37
|
},
|
|
60
|
-
"homepage": "https://github.com/fastxyz/allset-sdk#readme",
|
|
61
38
|
"dependencies": {
|
|
62
|
-
"@mysten/bcs": "^2.0.
|
|
63
|
-
"@noble/ed25519": "^3.0.
|
|
39
|
+
"@mysten/bcs": "^2.0.3",
|
|
40
|
+
"@noble/ed25519": "^3.0.1",
|
|
64
41
|
"@noble/hashes": "^2.0.1",
|
|
65
42
|
"bech32": "^2.0.0",
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"@fastxyz/sdk": "
|
|
70
|
-
},
|
|
71
|
-
"peerDependenciesMeta": {
|
|
72
|
-
"@fastxyz/sdk": {
|
|
73
|
-
"optional": true
|
|
74
|
-
}
|
|
43
|
+
"effect": "^3.21.0",
|
|
44
|
+
"viem": "^2.46.2",
|
|
45
|
+
"@fastxyz/schema": "1.0.0",
|
|
46
|
+
"@fastxyz/sdk": "1.0.0"
|
|
75
47
|
},
|
|
76
48
|
"devDependencies": {
|
|
77
|
-
"@
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
"
|
|
49
|
+
"@types/node": "^25.5.0"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsup src/index.ts --format esm --dts --out-dir dist",
|
|
53
|
+
"clean": "rm -rf dist",
|
|
54
|
+
"test": "vitest run",
|
|
55
|
+
"dev": "tsup src/index.ts --format esm --dts --watch --out-dir dist"
|
|
82
56
|
}
|
|
83
57
|
}
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
package/dist/browser/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../core/index.js';
|
package/dist/core/address.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Hex } from 'viem';
|
|
2
|
-
export declare function bytesToHex(bytes: Uint8Array): Hex;
|
|
3
|
-
export declare function fastAddressToBytes(address: string): Uint8Array;
|
|
4
|
-
export declare function fastAddressToBytes32(address: string): Hex;
|
|
5
|
-
//# sourceMappingURL=address.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/core/address.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAMjD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAoB9D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAEzD"}
|
package/dist/core/address.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { bech32m } from 'bech32';
|
|
2
|
-
export function bytesToHex(bytes) {
|
|
3
|
-
let hex = '';
|
|
4
|
-
for (const byte of bytes) {
|
|
5
|
-
hex += byte.toString(16).padStart(2, '0');
|
|
6
|
-
}
|
|
7
|
-
return `0x${hex}`;
|
|
8
|
-
}
|
|
9
|
-
export function fastAddressToBytes(address) {
|
|
10
|
-
let decoded;
|
|
11
|
-
try {
|
|
12
|
-
decoded = bech32m.decode(address, 90);
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
throw new Error(`Invalid Fast address "${address}": ${error.message}`);
|
|
16
|
-
}
|
|
17
|
-
const { prefix, words } = decoded;
|
|
18
|
-
if (prefix !== 'fast') {
|
|
19
|
-
throw new Error(`Fast address must use the "fast" prefix. Got: "${prefix}"`);
|
|
20
|
-
}
|
|
21
|
-
const bytes = new Uint8Array(bech32m.fromWords(words));
|
|
22
|
-
if (bytes.length !== 32) {
|
|
23
|
-
throw new Error(`Fast address must decode to 32 bytes. Got: ${bytes.length}`);
|
|
24
|
-
}
|
|
25
|
-
return bytes;
|
|
26
|
-
}
|
|
27
|
-
export function fastAddressToBytes32(address) {
|
|
28
|
-
return bytesToHex(fastAddressToBytes(address));
|
|
29
|
-
}
|
package/dist/core/deposit.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export interface DepositPlanningTokenConfig {
|
|
2
|
-
evmAddress: string;
|
|
3
|
-
decimals: number;
|
|
4
|
-
isNative?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface DepositPlanningChainConfig {
|
|
7
|
-
chainId: number;
|
|
8
|
-
bridgeContract: string;
|
|
9
|
-
tokens: Record<string, DepositPlanningTokenConfig>;
|
|
10
|
-
}
|
|
11
|
-
export interface DepositPlanningNetworkConfig {
|
|
12
|
-
chains: Record<string, DepositPlanningChainConfig>;
|
|
13
|
-
}
|
|
14
|
-
export interface DepositRouteOverrides {
|
|
15
|
-
bridgeAddress?: string;
|
|
16
|
-
tokenAddress?: string;
|
|
17
|
-
chainId?: number;
|
|
18
|
-
decimals?: number;
|
|
19
|
-
isNative?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface ResolveDepositRouteParams {
|
|
22
|
-
network?: 'testnet' | 'mainnet';
|
|
23
|
-
chain: string;
|
|
24
|
-
token: string;
|
|
25
|
-
overrides?: DepositRouteOverrides;
|
|
26
|
-
networkConfig?: DepositPlanningNetworkConfig;
|
|
27
|
-
}
|
|
28
|
-
export interface DepositRoute {
|
|
29
|
-
network: 'testnet' | 'mainnet';
|
|
30
|
-
chain: string;
|
|
31
|
-
token: string;
|
|
32
|
-
chainId: number;
|
|
33
|
-
bridgeAddress: `0x${string}`;
|
|
34
|
-
tokenAddress: `0x${string}`;
|
|
35
|
-
decimals: number;
|
|
36
|
-
isNative: boolean;
|
|
37
|
-
}
|
|
38
|
-
export interface EncodeDepositCalldataParams {
|
|
39
|
-
tokenAddress: string;
|
|
40
|
-
amount: bigint;
|
|
41
|
-
receiverBytes32: `0x${string}`;
|
|
42
|
-
}
|
|
43
|
-
export interface BuildDepositTransactionParams extends ResolveDepositRouteParams {
|
|
44
|
-
amount: bigint;
|
|
45
|
-
receiver: string;
|
|
46
|
-
}
|
|
47
|
-
export interface DepositTransactionPlan {
|
|
48
|
-
chainId: number;
|
|
49
|
-
to: `0x${string}`;
|
|
50
|
-
data: `0x${string}`;
|
|
51
|
-
value: bigint;
|
|
52
|
-
receiverBytes32: `0x${string}`;
|
|
53
|
-
route: DepositRoute;
|
|
54
|
-
}
|
|
55
|
-
export declare function resolveDepositRoute(params: ResolveDepositRouteParams): DepositRoute;
|
|
56
|
-
export declare function encodeDepositCalldata(params: EncodeDepositCalldataParams): `0x${string}`;
|
|
57
|
-
export declare function buildDepositTransactionFromRoute(route: DepositRoute, amount: bigint, receiver: string): DepositTransactionPlan;
|
|
58
|
-
export declare function buildDepositTransaction(params: BuildDepositTransactionParams): DepositTransactionPlan;
|
|
59
|
-
//# sourceMappingURL=deposit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../src/core/deposit.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,aAAa,CAAC,EAAE,4BAA4B,CAAC;CAC9C;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,KAAK,MAAM,EAAE,CAAC;IAC7B,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,KAAK,EAAE,YAAY,CAAC;CACrB;AAiDD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,YAAY,CA6BnF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,KAAK,MAAM,EAAE,CAUxF;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,sBAAsB,CAcxB;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,6BAA6B,GACpC,sBAAsB,CAGxB"}
|
package/dist/core/deposit.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { encodeFunctionData } from 'viem';
|
|
2
|
-
import { DEFAULT_NETWORKS_CONFIG } from '../default-config.js';
|
|
3
|
-
import { fastAddressToBytes32 } from './address.js';
|
|
4
|
-
const BRIDGE_DEPOSIT_ABI = [{
|
|
5
|
-
type: 'function',
|
|
6
|
-
name: 'deposit',
|
|
7
|
-
inputs: [
|
|
8
|
-
{ name: 'token', type: 'address' },
|
|
9
|
-
{ name: 'amount', type: 'uint256' },
|
|
10
|
-
{ name: 'receiver', type: 'bytes32' },
|
|
11
|
-
],
|
|
12
|
-
outputs: [],
|
|
13
|
-
stateMutability: 'payable',
|
|
14
|
-
}];
|
|
15
|
-
function normalizeDepositToken(token) {
|
|
16
|
-
const lowerToken = token.toLowerCase();
|
|
17
|
-
if (lowerToken === 'fastusdc' || lowerToken === 'testusdc') {
|
|
18
|
-
return 'USDC';
|
|
19
|
-
}
|
|
20
|
-
return token;
|
|
21
|
-
}
|
|
22
|
-
function resolveTokenEntry(chainConfig, token) {
|
|
23
|
-
const normalizedToken = normalizeDepositToken(token);
|
|
24
|
-
const exactConfig = chainConfig.tokens[normalizedToken];
|
|
25
|
-
if (exactConfig) {
|
|
26
|
-
return { tokenKey: normalizedToken, tokenConfig: exactConfig };
|
|
27
|
-
}
|
|
28
|
-
const upperToken = normalizedToken.toUpperCase();
|
|
29
|
-
const upperConfig = chainConfig.tokens[upperToken];
|
|
30
|
-
if (upperConfig) {
|
|
31
|
-
return { tokenKey: upperToken, tokenConfig: upperConfig };
|
|
32
|
-
}
|
|
33
|
-
const loweredAddress = token.toLowerCase();
|
|
34
|
-
for (const [tokenKey, tokenConfig] of Object.entries(chainConfig.tokens)) {
|
|
35
|
-
if (tokenConfig.evmAddress.toLowerCase() === loweredAddress) {
|
|
36
|
-
return { tokenKey, tokenConfig };
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
export function resolveDepositRoute(params) {
|
|
42
|
-
const network = params.network ?? 'testnet';
|
|
43
|
-
const networkConfig = params.networkConfig ?? DEFAULT_NETWORKS_CONFIG[network];
|
|
44
|
-
const chainConfig = networkConfig.chains[params.chain];
|
|
45
|
-
if (!chainConfig) {
|
|
46
|
-
throw new Error(`AllSet does not support EVM chain "${params.chain}" on ${network}. Supported: ${Object.keys(networkConfig.chains).join(', ') || 'none'}`);
|
|
47
|
-
}
|
|
48
|
-
const tokenEntry = resolveTokenEntry(chainConfig, params.token);
|
|
49
|
-
if (!tokenEntry) {
|
|
50
|
-
throw new Error(`Cannot resolve token "${params.token}" on AllSet for chain "${params.chain}".`);
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
network,
|
|
54
|
-
chain: params.chain,
|
|
55
|
-
token: tokenEntry.tokenKey,
|
|
56
|
-
chainId: params.overrides?.chainId ?? chainConfig.chainId,
|
|
57
|
-
bridgeAddress: (params.overrides?.bridgeAddress ?? chainConfig.bridgeContract),
|
|
58
|
-
tokenAddress: (params.overrides?.tokenAddress ?? tokenEntry.tokenConfig.evmAddress),
|
|
59
|
-
decimals: params.overrides?.decimals ?? tokenEntry.tokenConfig.decimals,
|
|
60
|
-
isNative: params.overrides?.isNative ?? tokenEntry.tokenConfig.isNative ?? false,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export function encodeDepositCalldata(params) {
|
|
64
|
-
return encodeFunctionData({
|
|
65
|
-
abi: BRIDGE_DEPOSIT_ABI,
|
|
66
|
-
functionName: 'deposit',
|
|
67
|
-
args: [
|
|
68
|
-
params.tokenAddress,
|
|
69
|
-
params.amount,
|
|
70
|
-
params.receiverBytes32,
|
|
71
|
-
],
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
export function buildDepositTransactionFromRoute(route, amount, receiver) {
|
|
75
|
-
const receiverBytes32 = fastAddressToBytes32(receiver);
|
|
76
|
-
return {
|
|
77
|
-
chainId: route.chainId,
|
|
78
|
-
to: route.bridgeAddress,
|
|
79
|
-
data: encodeDepositCalldata({
|
|
80
|
-
tokenAddress: route.tokenAddress,
|
|
81
|
-
amount,
|
|
82
|
-
receiverBytes32,
|
|
83
|
-
}),
|
|
84
|
-
value: route.isNative ? amount : 0n,
|
|
85
|
-
receiverBytes32,
|
|
86
|
-
route,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
export function buildDepositTransaction(params) {
|
|
90
|
-
const route = resolveDepositRoute(params);
|
|
91
|
-
return buildDepositTransactionFromRoute(route, params.amount, params.receiver);
|
|
92
|
-
}
|
package/dist/core/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { buildDepositTransaction, encodeDepositCalldata, resolveDepositRoute, } from './deposit.js';
|
|
2
|
-
export { fastAddressToBytes32 } from './address.js';
|
|
3
|
-
export { IntentAction, buildTransferIntent, buildExecuteIntent, buildDepositBackIntent, buildRevokeIntent, } from '../intents.js';
|
|
4
|
-
export type { Intent } from '../intents.js';
|
|
5
|
-
export type { BuildDepositTransactionParams, DepositPlanningChainConfig, DepositPlanningNetworkConfig, DepositPlanningTokenConfig, DepositRoute, DepositRouteOverrides, DepositTransactionPlan, EncodeDepositCalldataParams, ResolveDepositRouteParams, } from './deposit.js';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,cAAc,CAAC"}
|
package/dist/core/index.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { buildDepositTransaction, encodeDepositCalldata, resolveDepositRoute, } from './deposit.js';
|
|
2
|
-
export { fastAddressToBytes32 } from './address.js';
|
|
3
|
-
export { IntentAction, buildTransferIntent, buildExecuteIntent, buildDepositBackIntent, buildRevokeIntent, } from '../intents.js';
|
package/dist/default-config.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_NETWORKS_CONFIG: {
|
|
2
|
-
testnet: {
|
|
3
|
-
crossSignUrl: string;
|
|
4
|
-
chains: {
|
|
5
|
-
'ethereum-sepolia': {
|
|
6
|
-
chainId: number;
|
|
7
|
-
bridgeContract: string;
|
|
8
|
-
fastBridgeAddress: string;
|
|
9
|
-
relayerUrl: string;
|
|
10
|
-
tokens: {
|
|
11
|
-
USDC: {
|
|
12
|
-
evmAddress: string;
|
|
13
|
-
fastTokenId: string;
|
|
14
|
-
decimals: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
'arbitrum-sepolia': {
|
|
19
|
-
chainId: number;
|
|
20
|
-
bridgeContract: string;
|
|
21
|
-
fastBridgeAddress: string;
|
|
22
|
-
relayerUrl: string;
|
|
23
|
-
tokens: {
|
|
24
|
-
USDC: {
|
|
25
|
-
evmAddress: string;
|
|
26
|
-
fastTokenId: string;
|
|
27
|
-
decimals: number;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
mainnet: {
|
|
34
|
-
crossSignUrl: string;
|
|
35
|
-
chains: {
|
|
36
|
-
ethereum: {
|
|
37
|
-
chainId: number;
|
|
38
|
-
bridgeContract: string;
|
|
39
|
-
fastBridgeAddress: string;
|
|
40
|
-
relayerUrl: string;
|
|
41
|
-
tokens: {
|
|
42
|
-
USDC: {
|
|
43
|
-
evmAddress: string;
|
|
44
|
-
fastTokenId: string;
|
|
45
|
-
decimals: number;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
base: {
|
|
50
|
-
chainId: number;
|
|
51
|
-
bridgeContract: string;
|
|
52
|
-
fastBridgeAddress: string;
|
|
53
|
-
relayerUrl: string;
|
|
54
|
-
tokens: {
|
|
55
|
-
USDC: {
|
|
56
|
-
evmAddress: string;
|
|
57
|
-
fastTokenId: string;
|
|
58
|
-
decimals: number;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
arbitrum: {
|
|
63
|
-
chainId: number;
|
|
64
|
-
bridgeContract: string;
|
|
65
|
-
fastBridgeAddress: string;
|
|
66
|
-
relayerUrl: string;
|
|
67
|
-
tokens: {
|
|
68
|
-
USDC: {
|
|
69
|
-
evmAddress: string;
|
|
70
|
-
fastTokenId: string;
|
|
71
|
-
decimals: number;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=default-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-config.d.ts","sourceRoot":"","sources":["../src/default-config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4EP,CAAC"}
|
package/dist/default-config.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// Single source of truth for the SDK's bundled default network support matrix.
|
|
2
|
-
export const DEFAULT_NETWORKS_CONFIG = {
|
|
3
|
-
testnet: {
|
|
4
|
-
crossSignUrl: 'https://testnet.cross-sign.allset.fast.xyz',
|
|
5
|
-
chains: {
|
|
6
|
-
'ethereum-sepolia': {
|
|
7
|
-
chainId: 11155111,
|
|
8
|
-
bridgeContract: '0xb53600976275D6f541a3B929328d07714EFA581F',
|
|
9
|
-
fastBridgeAddress: 'fast1fxtkgpwcy7hnakw96gg7relph4wxx7ghrukm723p3l9adxuxljzsc6f958',
|
|
10
|
-
relayerUrl: 'https://testnet.allset.fast.xyz/ethereum-sepolia/relayer',
|
|
11
|
-
tokens: {
|
|
12
|
-
USDC: {
|
|
13
|
-
evmAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',
|
|
14
|
-
fastTokenId: 'd73a0679a2be46981e2a8aedecd951c8b6690e7d5f8502b34ed3ff4cc2163b46',
|
|
15
|
-
decimals: 6,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
'arbitrum-sepolia': {
|
|
20
|
-
chainId: 421614,
|
|
21
|
-
bridgeContract: '0xb53600976275D6f541a3B929328d07714EFA581F',
|
|
22
|
-
fastBridgeAddress: 'fast1tkmtqxulhnzeeg9zhuwxy3x95wr7waytm9cq40ndf7tkuwwcc6jseg24j8',
|
|
23
|
-
relayerUrl: 'https://testnet.allset.fast.xyz/arbitrum-sepolia/relayer',
|
|
24
|
-
tokens: {
|
|
25
|
-
USDC: {
|
|
26
|
-
evmAddress: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
|
|
27
|
-
fastTokenId: 'd73a0679a2be46981e2a8aedecd951c8b6690e7d5f8502b34ed3ff4cc2163b46',
|
|
28
|
-
decimals: 6,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
mainnet: {
|
|
35
|
-
crossSignUrl: 'https://cross-sign.allset.fast.xyz',
|
|
36
|
-
chains: {
|
|
37
|
-
ethereum: {
|
|
38
|
-
chainId: 1,
|
|
39
|
-
bridgeContract: '0x8677EdAA374b7A47ff0093947AABE4aCbB2D4538',
|
|
40
|
-
fastBridgeAddress: 'fast1x8xphxc78pdaljjs0reh7xpp8xv6pnhyq2pmnmumne49axtjwm4seau7c8',
|
|
41
|
-
relayerUrl: 'https://allset.fast.xyz/ethereum/relayer',
|
|
42
|
-
tokens: {
|
|
43
|
-
USDC: {
|
|
44
|
-
evmAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
45
|
-
fastTokenId: 'c655a12330da6af361d281b197996d2bc135aaed3b66278e729c2222291e9130',
|
|
46
|
-
decimals: 6,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
base: {
|
|
51
|
-
chainId: 8453,
|
|
52
|
-
bridgeContract: '0x8677EdAA374b7A47ff0093947AABE4aCbB2D4538',
|
|
53
|
-
fastBridgeAddress: 'fast1aq2hlz8t3ex0vke7056zraxzetmxmpaw84ws9lljdhpqtqkctu4spty8l6',
|
|
54
|
-
relayerUrl: 'https://allset.fast.xyz/base/relayer',
|
|
55
|
-
tokens: {
|
|
56
|
-
USDC: {
|
|
57
|
-
evmAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
58
|
-
fastTokenId: 'c655a12330da6af361d281b197996d2bc135aaed3b66278e729c2222291e9130',
|
|
59
|
-
decimals: 6,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
arbitrum: {
|
|
64
|
-
chainId: 42161,
|
|
65
|
-
bridgeContract: '0x8677EdAA374b7A47ff0093947AABE4aCbB2D4538',
|
|
66
|
-
fastBridgeAddress: 'fast1xzuzv3p3zl8pljk5cyq3xn0vpjj9jmhk53zlcv56mu04gwkg256s6ewung',
|
|
67
|
-
relayerUrl: 'https://allset.fast.xyz/arbitrum/relayer',
|
|
68
|
-
tokens: {
|
|
69
|
-
USDC: {
|
|
70
|
-
evmAddress: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
71
|
-
fastTokenId: 'c655a12330da6af361d281b197996d2bc135aaed3b66278e729c2222291e9130',
|
|
72
|
-
decimals: 6,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
};
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,iBAAiB,CAAC"}
|
package/dist/intents.d.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* intents.ts — Intent builders for AllSet external execution
|
|
3
|
-
*
|
|
4
|
-
* Intents define what actions to perform on EVM chains after
|
|
5
|
-
* transferring tokens from Fast network.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Intent action types supported by AllSet bridge.
|
|
9
|
-
*/
|
|
10
|
-
export declare enum IntentAction {
|
|
11
|
-
/** Generic contract call */
|
|
12
|
-
Execute = 0,
|
|
13
|
-
/** ERC-20 transfer to address */
|
|
14
|
-
DynamicTransfer = 1,
|
|
15
|
-
/** Deposit tokens back to Fast network */
|
|
16
|
-
DynamicDeposit = 2,
|
|
17
|
-
/** Cancel/revoke pending intent */
|
|
18
|
-
Revoke = 3
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* An intent to execute on an EVM chain.
|
|
22
|
-
*/
|
|
23
|
-
export interface Intent {
|
|
24
|
-
/** The action type */
|
|
25
|
-
action: IntentAction;
|
|
26
|
-
/** ABI-encoded payload for the action */
|
|
27
|
-
payload: `0x${string}`;
|
|
28
|
-
/** Native token value (ETH) to send, 0 for ERC-20 operations */
|
|
29
|
-
value: bigint;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Build a transfer intent to send ERC-20 tokens to an address.
|
|
33
|
-
*
|
|
34
|
-
* @param token - ERC-20 token contract address
|
|
35
|
-
* @param receiver - Recipient EVM address
|
|
36
|
-
* @returns Intent for DynamicTransfer action
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* const intent = buildTransferIntent(
|
|
41
|
-
* '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // USDC
|
|
42
|
-
* '0xRecipientAddress'
|
|
43
|
-
* );
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function buildTransferIntent(token: string, receiver: string): Intent;
|
|
47
|
-
/**
|
|
48
|
-
* Build a generic execute intent for arbitrary contract calls.
|
|
49
|
-
*
|
|
50
|
-
* @param target - Target contract address
|
|
51
|
-
* @param calldata - ABI-encoded function call data
|
|
52
|
-
* @param value - Native token value to send (default: 0)
|
|
53
|
-
* @returns Intent for Execute action
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* // Call a contract function
|
|
58
|
-
* const calldata = encodeFunctionData({
|
|
59
|
-
* abi: contractAbi,
|
|
60
|
-
* functionName: 'someFunction',
|
|
61
|
-
* args: [arg1, arg2],
|
|
62
|
-
* });
|
|
63
|
-
* const intent = buildExecuteIntent('0xContractAddress', calldata);
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare function buildExecuteIntent(target: string, calldata: string, value?: bigint): Intent;
|
|
67
|
-
/**
|
|
68
|
-
* Build an intent to deposit tokens back to Fast network.
|
|
69
|
-
*
|
|
70
|
-
* @param token - ERC-20 token contract address on EVM
|
|
71
|
-
* @param fastReceiver - Fast network recipient address (fast1...)
|
|
72
|
-
* @returns Intent for DynamicDeposit action
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* const intent = buildDepositBackIntent(
|
|
77
|
-
* '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // USDC
|
|
78
|
-
* 'fast1recipientaddress...'
|
|
79
|
-
* );
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
export declare function buildDepositBackIntent(token: string, fastReceiver: string): Intent;
|
|
83
|
-
/**
|
|
84
|
-
* Build a revoke intent to cancel pending operations.
|
|
85
|
-
*
|
|
86
|
-
* @returns Intent for Revoke action
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```ts
|
|
90
|
-
* const intent = buildRevokeIntent();
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
export declare function buildRevokeIntent(): Intent;
|
|
94
|
-
//# sourceMappingURL=intents.d.ts.map
|
package/dist/intents.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../src/intents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH;;GAEG;AACH,oBAAY,YAAY;IACtB,4BAA4B;IAC5B,OAAO,IAAI;IACX,iCAAiC;IACjC,eAAe,IAAI;IACnB,0CAA0C;IAC1C,cAAc,IAAI;IAClB,mCAAmC;IACnC,MAAM,IAAI;CACX;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,sBAAsB;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,yCAAyC;IACzC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;CACf;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAU3E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAAW,GACjB,MAAM,CAUR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,GACnB,MAAM,CAWR;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C"}
|