@avalabs/bridge-unified 0.0.0-hello-world-20230824162438 → 0.0.0-project-fusion-pr-20260112192135

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/package.json CHANGED
@@ -1,22 +1,38 @@
1
1
  {
2
2
  "name": "@avalabs/bridge-unified",
3
- "version": "0.0.0-hello-world-20230824162438",
4
- "main": "dist/index.js",
3
+ "license": "Limited Ecosystem License",
4
+ "version": "0.0.0-project-fusion-pr-20260112192135",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "typings": "dist/index.d.ts",
5
8
  "type": "module",
9
+ "files": [
10
+ "dist"
11
+ ],
6
12
  "dependencies": {
7
- "aptos": "1.17.0",
8
- "lodash-es": "4.17.21",
9
- "viem": "1.6.0"
13
+ "@noble/hashes": "1.5.0",
14
+ "@scure/base": "1.1.9",
15
+ "abitype": "0.9.3",
16
+ "lodash": "4.17.21",
17
+ "viem": "2.11.1",
18
+ "zod": "3.23.8",
19
+ "@scure/btc-signer": "1.3.2",
20
+ "coinselect": "3.1.13"
10
21
  },
11
22
  "devDependencies": {
23
+ "@types/jest": "29.5.7",
24
+ "@types/lodash": "4.14.201",
25
+ "jest": "29.7.0",
26
+ "ts-jest": "29.1.1",
12
27
  "tsup": "7.2.0",
13
- "type-fest": "4.2.0",
14
- "eslint-config-custom": "0.0.0-hello-world-20230824162438",
15
- "@internal/bridge-shared": "0.0.0-hello-world-20230824162438",
16
- "@internal/tsup-config": "0.0.0-hello-world-20230824162438"
28
+ "@internal/tsup-config": "0.0.1",
29
+ "eslint-config-custom": "0.1.0"
17
30
  },
18
31
  "scripts": {
19
32
  "build": "tsup",
20
- "lint": "eslint \"src/**/*.ts\""
33
+ "build:watch": "tsup --watch",
34
+ "lint": "eslint \"src/**/*.ts\"",
35
+ "test": "jest",
36
+ "test:watch": "jest --watch"
21
37
  }
22
38
  }
@@ -1,22 +0,0 @@
1
-
2
- > @avalabs/bridge-unified@1.0.1 build /home/runner/work/consumer-sdks/consumer-sdks/packages/bridge-unified
3
- > tsup
4
-
5
- CLI Building entry: ./src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v7.2.0
8
- CLI Using tsup config: /home/runner/work/consumer-sdks/consumer-sdks/packages/bridge-unified/tsup.config.ts
9
- CLI Target: es2021
10
- CLI Cleaning output folder
11
- CJS Build start
12
- ESM Build start
13
- CJS dist/index.cjs 496.00 B
14
- CJS dist/index.cjs.map 4.71 KB
15
- CJS ⚡️ Build success in 613ms
16
- ESM dist/index.js 484.00 B
17
- ESM dist/index.js.map 4.71 KB
18
- ESM ⚡️ Build success in 613ms
19
- DTS Build start
20
- DTS ⚡️ Build success in 7120ms
21
- DTS dist/index.d.cts 1.25 KB
22
- DTS dist/index.d.ts 1.25 KB
@@ -1,4 +0,0 @@
1
-
2
- > @avalabs/bridge-unified@1.0.1 lint /home/runner/work/consumer-sdks/consumer-sdks/packages/bridge-unified
3
- > eslint "src/**/*.ts"
4
-
package/CHANGELOG.md DELETED
@@ -1,13 +0,0 @@
1
- # @avalabs/unified-bridge
2
-
3
- ## 0.0.0-hello-world-20230824162438
4
-
5
- ### Patch Changes
6
-
7
- - f99298c: hello world
8
-
9
- ## 1.0.1
10
-
11
- ### Patch Changes
12
-
13
- - a397015: Shared tsup config
@@ -1,20 +0,0 @@
1
- export enum ErrorCode {
2
- NOT_IMPLEMENTED = 5001,
3
- }
4
-
5
- class BridgeError extends Error {
6
- constructor(
7
- message: string,
8
- public code: ErrorCode,
9
- ) {
10
- super(message);
11
- this.code = code;
12
- }
13
- }
14
-
15
- export class NotImplementedError extends BridgeError {
16
- constructor(message = 'Not implemented') {
17
- super(message, ErrorCode.NOT_IMPLEMENTED);
18
- this.name = 'NotImplementedError';
19
- }
20
- }
@@ -1,20 +0,0 @@
1
- import type { Address } from 'viem';
2
- import { NotImplementedError } from '../errors';
3
-
4
- /**
5
- * Checks for any currently pending bridge transactions. Useful for dApps that want
6
- * to display the current tx's status after a page refresh.
7
- */
8
- export const checkForPendingBridgeJourney = async ({
9
- address: _address,
10
- chainIds: _chainIds,
11
- }: {
12
- address: Address;
13
- chainIds: string[];
14
- }) => {
15
- /**
16
- * 1. If wallet is Core, request current bridge journey. Otherwise, check glacier to see if the provided wallet has bridge tx in the past 100 transactions on the provided chains.
17
- * 3. Returns an array of txIds for all pending transactions
18
- */
19
- throw new NotImplementedError();
20
- };
@@ -1,20 +0,0 @@
1
- import { NotImplementedError } from '../errors';
2
-
3
- type ExecuteBridgeJourneyStepParams = {
4
- stepIndex: number;
5
- journey: unknown;
6
- };
7
-
8
- export const executeBridgeJourneyStep = async (_params: ExecuteBridgeJourneyStepParams) => {
9
- /**
10
- * 1. Validate the journey
11
- * 3. Forward request along to the right bridge platform's package.
12
- * 4. Return an observable that emits events when:
13
- * - User signs the transaction (returns the fromChain txId)
14
- * - Every block confirmation on fromChain
15
- * - fromChain tx completed, starting the toChain tx (returns the toChainTxId)
16
- * - Every block confirmation on toChain
17
- * - toChain tx completed
18
- */
19
- throw new NotImplementedError();
20
- };
@@ -1,25 +0,0 @@
1
- import { NotImplementedError } from '../errors';
2
- import { BridgePlatform, type Token } from '@internal/bridge-shared';
3
-
4
- type GetBridgeRouterParams = {
5
- fromChainId: string;
6
- toChainId: string;
7
- fromToken: Token;
8
- };
9
-
10
- type BridgeTransactionStep = {
11
- fromChainId: string;
12
- toChainId: string;
13
- bridgePlatform: BridgePlatform;
14
- fromToken: Token;
15
- toToken: Token;
16
- };
17
-
18
- /**
19
- * Returns a list of transaction steps needed to complete a bridge from chain A to B.
20
- * The response may include multiple steps if the bridge requires multiple hops.
21
- */
22
- export const planBridgeJourney = (_params: GetBridgeRouterParams): BridgeTransactionStep[] => {
23
- // Implement smart logic for determining how to get the token from chain A to B
24
- throw new NotImplementedError();
25
- };
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './unified-bridge-service';
2
- // Hello world!
@@ -1,19 +0,0 @@
1
- import { executeBridgeJourneyStep } from './handlers/execute-bridge-journey-step';
2
- import { planBridgeJourney } from './handlers/plan-bridge-journey';
3
-
4
- import type { Environment, MaybePromise, NativeToken } from '@internal/bridge-shared';
5
- import { checkForPendingBridgeJourney } from './handlers/check-for-pending-bridge-journey';
6
-
7
- export type BridgeServiceConfig = {
8
- environment: `${Environment}`;
9
- getChainNativeAsset: ({ evmChainId }: { evmChainId: string }) => MaybePromise<NativeToken>;
10
- getChainErc20Asset: ({ evmChainId, address }: { evmChainId: string; address: string }) => MaybePromise<NativeToken>;
11
- };
12
-
13
- export const createUnifiedBridgeService = (_options: BridgeServiceConfig) => {
14
- return {
15
- planBridgeJourney,
16
- executeBridgeJourneyStep,
17
- checkForPendingBridgeJourney,
18
- };
19
- };
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@internal/tsconfig/tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "incremental": false // Need to turn off because of tsup dts
6
- },
7
- "include": ["src", "../shared/src/types"]
8
- }
package/tsup.config.ts DELETED
@@ -1,4 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
- import { baseConfig } from '@internal/tsup-config';
3
-
4
- export default defineConfig(baseConfig);