@cryptorubic/web3 0.8.6-alpha-relay-solana.0 → 0.8.6-alpha-relay-solana.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/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptorubic/web3",
|
|
3
|
-
"version": "0.8.6-alpha-relay-solana.
|
|
3
|
+
"version": "0.8.6-alpha-relay-solana.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.0",
|
|
6
6
|
"bignumber.js": "9.1.2",
|
|
7
|
-
"@cryptorubic/core": "0.8.6-alpha-relay-solana.
|
|
7
|
+
"@cryptorubic/core": "0.8.6-alpha-relay-solana.1",
|
|
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.8.6-alpha-relay-solana.
|
|
14
|
+
"@cryptorubic/tron-types": "0.8.6-alpha-relay-solana.1",
|
|
15
15
|
"bitcoin-address-validation": "^2.2.3",
|
|
16
16
|
"axios": "0.27.2",
|
|
17
17
|
"crc-32": "^1.2.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Abi, MulticallResponse, MulticallParameters } from 'viem';
|
|
2
2
|
import { AbstractAdapter } from './abstract-adapter';
|
|
3
|
-
import { Connection, TransactionInstruction, VersionedTransaction } from '@solana/web3.js';
|
|
3
|
+
import { AddressLookupTableAccount, Connection, TransactionInstruction, VersionedTransaction } from '@solana/web3.js';
|
|
4
4
|
import { HttpClient, ICustomLogger, PriceTokenAmount, SolanaBlockchainName, Token, TokenAmount } from '@cryptorubic/core';
|
|
5
5
|
import { EvmTransactionConfig } from '../../utils/models/evm-transaction-config';
|
|
6
6
|
import BigNumber from 'bignumber.js';
|
|
@@ -25,5 +25,6 @@ export declare class SolanaAdapter extends AbstractAdapter<Connection, Connectio
|
|
|
25
25
|
getTokensBalances(address: string, tokensAddresses: string[]): Promise<BigNumber[]>;
|
|
26
26
|
callForTokensInfo(tokenAddresses: string[] | ReadonlyArray<string>): Promise<Token<SolanaBlockchainName>[]>;
|
|
27
27
|
parseRawInstruction(rawInstruction: SolanaRawInstruction[], dataFormat: BufferEncoding): TransactionInstruction[];
|
|
28
|
-
|
|
28
|
+
parseLUTAddresses(lookupTableAddresses: string[]): Promise<AddressLookupTableAccount[]>;
|
|
29
|
+
createVersionedTransaction(instructions: TransactionInstruction[], walletAddress: string, addressLookupTableAccounts?: AddressLookupTableAccount[]): Promise<VersionedTransaction>;
|
|
29
30
|
}
|
|
@@ -108,13 +108,12 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
async
|
|
111
|
+
async parseLUTAddresses(lookupTableAddresses) {
|
|
112
|
+
const accounts = await Promise.all(lookupTableAddresses.map((address) => this.public.getAddressLookupTable(new web3_js_1.PublicKey(address)).then((v) => v.value)));
|
|
113
|
+
return accounts.filter((v) => !!v);
|
|
114
|
+
}
|
|
115
|
+
async createVersionedTransaction(instructions, walletAddress, addressLookupTableAccounts = []) {
|
|
112
116
|
const { blockhash } = await this.public.getLatestBlockhash();
|
|
113
|
-
let addressLookupTableAccounts = [];
|
|
114
|
-
if (addressLookupTableAddresses) {
|
|
115
|
-
const res = await Promise.all(addressLookupTableAddresses.map((address) => this.public.getAddressLookupTable(new web3_js_1.PublicKey(address)).then((v) => v.value)));
|
|
116
|
-
addressLookupTableAccounts = res.filter((v) => !!v);
|
|
117
|
-
}
|
|
118
117
|
const message = new web3_js_1.TransactionMessage({
|
|
119
118
|
instructions,
|
|
120
119
|
payerKey: new web3_js_1.PublicKey(walletAddress),
|