@pioneer-platform/across-client 0.1.0 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @pioneer-platform/across-client
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Automated patch version bump for all packages
8
+ - Updated dependencies
9
+ - @pioneer-platform/loggerdog@8.4.1
10
+ - @pioneer-platform/pioneer-coins@9.4.1
11
+ - @pioneer-platform/pioneer-caip@9.3.1
12
+
3
13
  ## 0.1.0
4
14
 
5
15
  ### Minor Changes
package/package.json CHANGED
@@ -1,19 +1,23 @@
1
1
  {
2
2
  "name": "@pioneer-platform/across-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {
7
- "@across-protocol/constants-v2": "^1.0.14",
8
- "@across-protocol/contracts-v2": "2.5.4",
9
- "@across-protocol/sdk-v2": "^0.22.18",
10
- "@pioneer-platform/loggerdog": "^8.4.0",
11
- "@pioneer-platform/pioneer-caip": "^9.3.0",
12
- "@pioneer-platform/pioneer-coins": "^9.4.0",
7
+ "@pioneer-platform/loggerdog": "^8.4.1",
8
+ "@pioneer-platform/pioneer-caip": "^9.3.1",
9
+ "@pioneer-platform/pioneer-coins": "^9.4.1",
13
10
  "axios": "^1.6.0",
14
11
  "dotenv": "^8.2.0",
15
12
  "uuidv4": "^6.2.13"
16
13
  },
14
+ "scripts": {
15
+ "npm": "pnpm i",
16
+ "test": "pnpm run build && node __tests__/test-module.js",
17
+ "build": "tsc -p .",
18
+ "prepublish": "pnpm run build",
19
+ "refresh": "rm -rf ./node_modules ./package-lock.json && pnpm install"
20
+ },
17
21
  "devDependencies": {
18
22
  "@types/async-retry": "^1.4.8",
19
23
  "@types/bunyan": "^1.8.11",
@@ -27,12 +31,5 @@
27
31
  "ts-jest": "^29.0.5",
28
32
  "typescript": "^5.0.4"
29
33
  },
30
- "gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3",
31
- "scripts": {
32
- "npm": "pnpm i",
33
- "test": "pnpm run build && node __tests__/test-module.js",
34
- "build": "tsc -p .",
35
- "prepublish": "pnpm run build",
36
- "refresh": "rm -rf ./node_modules ./package-lock.json && pnpm install"
37
- }
34
+ "gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3"
38
35
  }
package/lib/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- declare const TAG = " | Across | ";
2
- type BaseDecimal = string | number;
3
- declare const uuid: any;
4
- declare const log: any;
5
- declare let caipToNetworkId: any, shortListSymbolToCaip: any, ChainToNetworkId: any;
6
- declare const axios: any;
7
- declare const EIP155_MAINNET_CHAINS: any;
8
- declare let networkSupport: any[];
9
- declare const get_quote: (quote: any) => Promise<any>;
package/lib/index.js DELETED
@@ -1,101 +0,0 @@
1
- "use strict";
2
- /*
3
- Across Integration
4
- - Highlander
5
- */
6
- const TAG = " | Across | ";
7
- const { uuid } = require('uuidv4');
8
- const log = require('@pioneer-platform/loggerdog')();
9
- let { caipToNetworkId, shortListSymbolToCaip, ChainToNetworkId } = require("@pioneer-platform/pioneer-caip");
10
- const axios = require('axios');
11
- const EIP155_MAINNET_CHAINS = {
12
- 'eip155:1': {
13
- chainId: 1,
14
- WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
15
- name: 'Ethereum',
16
- logo: '/chain-logos/eip155-1.png',
17
- rgb: '99, 125, 234',
18
- rpc: 'https://eth.llamarpc.com',
19
- defaultGasLimit: 250000,
20
- namespace: 'eip155'
21
- },
22
- 'eip155:8453': {
23
- chainId: 8453,
24
- WETH: '0x4200000000000000000000000000000000000006',
25
- name: 'Base',
26
- logo: '/chain-logos/base.png',
27
- rgb: '242, 242, 242',
28
- rpc: 'https://mainnet.base.org',
29
- defaultGasLimit: 135120,
30
- namespace: 'eip155'
31
- }
32
- };
33
- let networkSupport = [
34
- ChainToNetworkId["ETH"],
35
- ChainToNetworkId["BASE"],
36
- ];
37
- module.exports = {
38
- init: function (settings) {
39
- return true;
40
- },
41
- networkSupport: function () {
42
- return networkSupport;
43
- },
44
- getQuote: function (quote) {
45
- return get_quote(quote);
46
- },
47
- };
48
- // Simplified version that just returns mock data
49
- const get_quote = async function (quote) {
50
- let tag = TAG + " | get_quote | ";
51
- try {
52
- let output = {};
53
- if (!quote.sellAsset)
54
- throw new Error("missing sellAsset");
55
- if (!quote.buyAsset)
56
- throw new Error("missing buyAsset");
57
- if (!quote.sellAmount)
58
- throw new Error("missing sellAmount");
59
- if (!quote.senderAddress)
60
- throw new Error("missing senderAddress");
61
- if (!quote.recipientAddress)
62
- throw new Error("missing recipientAddress");
63
- if (!quote.slippage)
64
- throw new Error("missing slippage");
65
- if (!networkSupport.includes(caipToNetworkId(quote.buyAsset))) {
66
- throw new Error("unsupported buyAsset");
67
- }
68
- if (!networkSupport.includes(caipToNetworkId(quote.sellAsset))) {
69
- throw new Error("unsupported sellAsset");
70
- }
71
- // Mock output data instead of making actual API calls
72
- output.txs = [];
73
- output.meta = {
74
- quoteMode: "ERC20-ERC20"
75
- };
76
- output.steps = 1;
77
- output.complete = true;
78
- output.type = 'EVM';
79
- output.id = uuid();
80
- // Return a dummy transaction
81
- output.txs.push({
82
- type: "evm",
83
- description: 'swap tokens',
84
- chain: caipToNetworkId(quote.sellAsset),
85
- txParams: {
86
- to: '0x1234567890123456789012345678901234567890', // Mock address
87
- from: quote.senderAddress,
88
- data: '0x', // Mock data
89
- value: '0x0',
90
- gas: '0x1',
91
- gasPrice: '0x1',
92
- nonce: 0
93
- }
94
- });
95
- return output;
96
- }
97
- catch (e) {
98
- console.error(tag, "e: ", e);
99
- throw e;
100
- }
101
- };