Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp #4413

Closed
wants to merge 32 commits into from
Closed

temp #4413

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
36490cf
temp
AntonioVentilii Jan 22, 2025
8f6b4eb
temp
AntonioVentilii Jan 22, 2025
b915495
temp
AntonioVentilii Jan 22, 2025
0d8b09a
🤖 Apply formatting changes
github-actions[bot] Jan 22, 2025
eda3b1d
temp
AntonioVentilii Jan 22, 2025
77fd784
temp
AntonioVentilii Jan 22, 2025
19af8ff
🤖 Apply formatting changes
github-actions[bot] Jan 22, 2025
2250981
temp
AntonioVentilii Jan 22, 2025
657a5d9
temp
AntonioVentilii Jan 22, 2025
954378a
temp
AntonioVentilii Jan 22, 2025
2bf90ee
temp
AntonioVentilii Jan 22, 2025
f3ccb3e
temp
AntonioVentilii Jan 22, 2025
86dfc43
temp
AntonioVentilii Jan 22, 2025
f6b995e
temp
AntonioVentilii Jan 22, 2025
46b4b16
temp
AntonioVentilii Jan 22, 2025
c1ebe82
temp
AntonioVentilii Jan 22, 2025
4daa676
temp
AntonioVentilii Jan 23, 2025
869f080
temp
AntonioVentilii Jan 23, 2025
41a41b5
temp
AntonioVentilii Jan 23, 2025
04878e0
temp
AntonioVentilii Jan 23, 2025
9b89420
temp
AntonioVentilii Jan 23, 2025
358b210
temp
AntonioVentilii Jan 23, 2025
3c84140
temp
AntonioVentilii Jan 23, 2025
af0879b
Merge branch 'main' into temp/temp
AntonioVentilii Jan 23, 2025
f453d7b
temp back to helius
AntonioVentilii Jan 23, 2025
77ba1d3
temp
AntonioVentilii Jan 23, 2025
6cb4dcf
temp
AntonioVentilii Jan 23, 2025
f5db514
Merge branch 'main' into temp/temp
AntonioVentilii Jan 23, 2025
4aaa19e
Merge branch 'main' into temp/temp
AntonioVentilii Jan 23, 2025
769f15b
temp
AntonioVentilii Jan 23, 2025
728f33e
temp
AntonioVentilii Jan 23, 2025
d5171b2
temp
AntonioVentilii Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build.csp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const updateCSP = (indexHtml) => {
const onramperConnectFrameSrc = 'https://buy.onramper.dev https://buy.onramper.com';

const solanaRpcApiConnectSrc =
'https://api.mainnet-beta.solana.com wss://api.mainnet-beta.solana.com https://api.testnet.solana.com wss://api.testnet.solana.com https://api.devnet.solana.com wss://api.devnet.solana.com';
'https://api.mainnet-beta.solana.com wss://burned-little-dinghy.solana-mainnet.quiknode.pro ws://api.mainnet-beta.solana.com wss://mainnet.helius-rpc.com/ https://api.testnet.solana.com wss://api.testnet.solana.com https://api.devnet.solana.com wss://api.devnet.solana.com';
const solanaAlchemyApiConnectSrc =
'https://solana-mainnet.g.alchemy.com wss://solana-mainnet.g.alchemy.com https://solana-testnet.g.alchemy.com wss://solana-testnet.g.alchemy.com https://solana-devnet.g.alchemy.com wss://solana-devnet.g.alchemy.com';
const solanaQuicknodeApiConnectSrc =
Expand Down
33 changes: 25 additions & 8 deletions src/frontend/src/sol/services/sol-send.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import { getTransferSolInstruction } from '@solana-program/system';
import { getTransferInstruction } from '@solana-program/token';
import { address as solAddress } from '@solana/addresses';
import { getBase64Decoder } from '@solana/codecs';
import { pipe } from '@solana/functional';
import type { Signature } from '@solana/keys';
import type { Rpc, SolanaRpcApi } from '@solana/rpc';
Expand All @@ -37,8 +38,11 @@
type TransactionMessage,
type TransactionVersion
} from '@solana/transaction-messages';
import { assertTransactionIsFullySigned } from '@solana/transactions';
import { sendAndConfirmTransactionFactory } from '@solana/web3.js';
import {
assertTransactionIsFullySigned,
type Base64EncodedWireTransaction
} from '@solana/transactions';
import { getTransactionEncoder, sendAndConfirmTransactionFactory } from '@solana/web3.js';
import { get } from 'svelte/store';

const setFeePayerToTransaction = ({
Expand All @@ -65,7 +69,11 @@
return pipe(
transactionMessage,
(tx) => setFeePayerToTransaction({ transactionMessage: tx, feePayer }),
(tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx)
(tx) =>
setTransactionMessageLifetimeUsingBlockhash(
{ ...latestBlockhash, lastValidBlockHeight: latestBlockhash.lastValidBlockHeight + 100n },
tx
)
);
};

Expand Down Expand Up @@ -259,12 +267,21 @@

const { signedTransaction, signature } = await signTransaction(transactionMessage);

const { simulateTransaction } = rpc;

const enc = getBase64Decoder().decode(getTransactionEncoder().encode(signedTransaction));

const simulation = await simulateTransaction(enc as Base64EncodedWireTransaction, {
commitment: 'confirmed',
encoding: 'base64'
}).send();

console.log('simulation', simulation);

Check failure on line 279 in src/frontend/src/sol/services/sol-send.services.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

// Explicitly do not await to proceed in the background and allow the UI to continue
sendSignedTransaction({
rpc,
rpcSubscriptions,
signedTransaction
});
sendSignedTransaction({ rpc, rpcSubscriptions, signedTransaction });

console.log(111111111);

Check failure on line 284 in src/frontend/src/sol/services/sol-send.services.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

onProgress?.();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
const WalletWorker = await import('$lib/workers/workers?worker');
const worker: Worker = new WalletWorker.default();

const isMainnetNetwork = isNetworkIdSOLMainnet(networkId);

Check warning on line 36 in src/frontend/src/sol/services/worker.sol-wallet.services.ts

View workflow job for this annotation

GitHub Actions / lint

'isMainnetNetwork' is assigned a value but never used. Allowed unused vars must match /^_/u
const isTestnetNetwork = isNetworkIdSOLTestnet(networkId);
const isDevnetNetwork = isNetworkIdSOLDevnet(networkId);
const isLocalNetwork = isNetworkIdSOLLocal(networkId);
Expand All @@ -54,7 +54,7 @@
tokenId,
error: (data.data as PostMessageDataResponseError).error,
// TODO: Remove "isMainnetNetwork" after the issue with SOL wallet is investigated and fixed
hideToast: isTestnetNetwork || isDevnetNetwork || isLocalNetwork || isMainnetNetwork
hideToast: isTestnetNetwork || isDevnetNetwork || isLocalNetwork
});
return;
}
Expand Down
Loading