@cryptorubic/web3 0.7.12-alpha-morph-api.1 → 0.7.12
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,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptorubic/web3",
|
|
3
|
-
"version": "0.7.12
|
|
3
|
+
"version": "0.7.12",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.0",
|
|
6
6
|
"bignumber.js": "9.1.2",
|
|
7
|
-
"@cryptorubic/core": "0.7.12
|
|
7
|
+
"@cryptorubic/core": "0.7.12",
|
|
8
8
|
"viem": "^2.19.1",
|
|
9
9
|
"web3-utils": "^4.3.1",
|
|
10
10
|
"@ton/ton": "^15.1.0",
|
|
11
11
|
"@solana/web3.js": "1.95.3",
|
|
12
12
|
"@solflare-wallet/utl-sdk": "^1.4.0",
|
|
13
13
|
"@ethersproject/bignumber": "^5.7.0",
|
|
14
|
-
"@cryptorubic/tron-types": "0.7.12
|
|
14
|
+
"@cryptorubic/tron-types": "0.7.12",
|
|
15
15
|
"bitcoin-address-validation": "^2.2.3",
|
|
16
16
|
"axios": "0.27.2",
|
|
17
17
|
"crc-32": "^1.2.2",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { TokenAmount } from '@cryptorubic/core';
|
|
1
|
+
import { BlockchainName, TokenAmount } from '@cryptorubic/core';
|
|
2
2
|
import { AllowanceInfo } from './common-types';
|
|
3
|
-
|
|
3
|
+
import { AbstractAdapter } from '../abstract-adapter';
|
|
4
|
+
import { EvmTransactionConfig } from '../../../utils/models/evm-transaction-config';
|
|
5
|
+
import { TronTransactionConfig } from '@cryptorubic/tron-types';
|
|
6
|
+
export interface ApproveAdapter<T> extends AbstractAdapter<any, any, BlockchainName> {
|
|
4
7
|
/**
|
|
5
8
|
* @param fromTokenAddress erc20 address of checked token
|
|
6
9
|
* @param walletAddress owner wallet address
|
|
@@ -31,3 +34,4 @@ export interface ApproveAdapter<T> {
|
|
|
31
34
|
*/
|
|
32
35
|
approve(walletAddress: string, tokenAddress: string, spenderAddress: string, amount?: string): Promise<string>;
|
|
33
36
|
}
|
|
37
|
+
export declare function isApprovableAdapter(adapter: AbstractAdapter<any, any, BlockchainName>): adapter is ApproveAdapter<EvmTransactionConfig | TronTransactionConfig>;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isApprovableAdapter = isApprovableAdapter;
|
|
4
|
+
function isApprovableAdapter(adapter) {
|
|
5
|
+
return 'needApprove' in adapter && 'approve' in adapter && 'getAllowance' in adapter && 'encodeApprove' in adapter;
|
|
6
|
+
}
|
|
@@ -1390,24 +1390,20 @@ exports.viemConfig = {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
}),
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
name: 'Morph',
|
|
1396
|
-
nativeCurrency: {
|
|
1397
|
-
decimals: 18,
|
|
1398
|
-
name: 'Ether',
|
|
1399
|
-
symbol: 'ETH'
|
|
1400
|
-
},
|
|
1401
|
-
rpcUrls: {
|
|
1393
|
+
UNICHAIN: (0, viem_1.defineChain)({
|
|
1394
|
+
blockExplorers: {
|
|
1402
1395
|
default: {
|
|
1403
|
-
|
|
1404
|
-
|
|
1396
|
+
apiUrl: 'https://uniscan.xyz/',
|
|
1397
|
+
name: 'Unichain Explorer',
|
|
1398
|
+
url: 'https://uniscan.xyz/'
|
|
1405
1399
|
}
|
|
1406
1400
|
},
|
|
1407
|
-
|
|
1401
|
+
id: 130,
|
|
1402
|
+
name: 'Unichain',
|
|
1403
|
+
nativeCurrency: { decimals: 18, name: 'Ethereum', symbol: 'ETH' },
|
|
1404
|
+
rpcUrls: {
|
|
1408
1405
|
default: {
|
|
1409
|
-
|
|
1410
|
-
url: 'https://explorer.morphl2.io'
|
|
1406
|
+
http: ['https://mainnet.unichain.org/']
|
|
1411
1407
|
}
|
|
1412
1408
|
},
|
|
1413
1409
|
testnet: false,
|
|
@@ -75,5 +75,5 @@ exports.viemBlockchainMapping = {
|
|
|
75
75
|
[core_1.BLOCKCHAIN_NAME.CORE]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.CORE],
|
|
76
76
|
[core_1.BLOCKCHAIN_NAME.BERACHAIN]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.BERACHAIN],
|
|
77
77
|
[core_1.BLOCKCHAIN_NAME.SONEIUM]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.SONEIUM],
|
|
78
|
-
[core_1.BLOCKCHAIN_NAME.
|
|
78
|
+
[core_1.BLOCKCHAIN_NAME.UNICHAIN]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.UNICHAIN]
|
|
79
79
|
};
|