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

suave default transport #5

Merged
merged 62 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
61c540e
remove CHANGELOG.md symlink
zeroXbrock Oct 23, 2023
9b816dc
add transactionRequest test, update SuaveTransactionRequest definition
zeroXbrock Oct 23, 2023
671a79a
add tx formatter
zeroXbrock Oct 24, 2023
17b0fde
disable anvil calls in vitest setup (run with SKIP_GLOBAL_SETUP=true)
zeroXbrock Oct 25, 2023
1e7a94b
add test:e2e in playgrounds/bun/
zeroXbrock Oct 25, 2023
6f693e3
update chain id, add local devnet config
zeroXbrock Oct 25, 2023
97c36e1
working SuaveTransactionRequest impl
zeroXbrock Oct 25, 2023
71a6576
infer isConfidential from confidentialInputs
zeroXbrock Oct 25, 2023
7b61d6d
infer tx type in SuaveTransactionRequest
zeroXbrock Oct 25, 2023
92fa84b
add getTransaction[Receipt] to playground test
zeroXbrock Oct 26, 2023
af71ab8
revise SuaveTransaction formatter/type
zeroXbrock Oct 26, 2023
9c0d032
harden SuaveTransaction[Request] formatter/type
zeroXbrock Oct 27, 2023
b5cfd0e
add SuaveTransaction serialization constructs
zeroXbrock Oct 28, 2023
0de1318
refactor type defs; make rpc types generic, deserialized types restri…
zeroXbrock Oct 30, 2023
84c8072
experimental serializer
zeroXbrock Oct 31, 2023
51f382e
fix rlp signature bugs; working CCR transactionRequests
zeroXbrock Oct 31, 2023
7e51c28
push lint fixes
zeroXbrock Oct 31, 2023
b2238c3
cleanup, remove debug console logs
zeroXbrock Oct 31, 2023
bff6fbd
compartmentalize wallet action overrides with new fn: getSuaveWallet
zeroXbrock Oct 31, 2023
4f1c223
support all tx types
zeroXbrock Oct 31, 2023
951d93c
remove bad 'from' addrs
zeroXbrock Oct 31, 2023
b6f70bc
lint
zeroXbrock Oct 31, 2023
e762187
fix bad imports
zeroXbrock Oct 31, 2023
ac62568
make privatekey optional in getSuaveWallet
zeroXbrock Oct 31, 2023
39bfd43
lint
zeroXbrock Oct 31, 2023
91655de
fix some type-related bugs + formatter tests
zeroXbrock Nov 1, 2023
e259e77
remove junk comments
zeroXbrock Nov 3, 2023
0198218
add block formatter tests
zeroXbrock Nov 3, 2023
eb893b2
remove unused fields in block formatter
zeroXbrock Nov 3, 2023
d54b843
add tx receipt formatter test
zeroXbrock Nov 3, 2023
5de428b
clean up duplicate logic in sendTransaction override, add examples in…
zeroXbrock Nov 4, 2023
85b287d
wait for fund tx to land in playground example
zeroXbrock Nov 4, 2023
b0fb4a4
lint
zeroXbrock Nov 4, 2023
d94a0f4
re-enable anvil backend for tests
zeroXbrock Nov 7, 2023
1aafb9c
cleanup junk comments, remove unused arg
zeroXbrock Nov 8, 2023
5bed2ca
stricter input requirement for serializeConfidentialComputeRequest
zeroXbrock Nov 8, 2023
a9ef4c8
add links to spec in doc-comments
zeroXbrock Nov 8, 2023
62a37ec
use idiomatic errors in tx serializers
zeroXbrock Nov 8, 2023
e8324ca
add parsers in parsers.ts, tests
zeroXbrock Nov 8, 2023
ee6fa6f
add parseTransactionSuave; covers all supported tx types; +test
zeroXbrock Nov 9, 2023
1a901a5
chore: forge init
zeroXbrock Nov 9, 2023
4ca1588
forge install: forge-std
zeroXbrock Nov 9, 2023
5eb8ff4
fix pre-signature ccRecord serialization scheme
zeroXbrock Nov 10, 2023
a581074
replace 'executionNode' with 'kettleAddress', remove invalid instance…
zeroXbrock Nov 10, 2023
552c92d
add deployment example in playground
zeroXbrock Nov 10, 2023
eeebe95
clean up & fix bugs in serializer/signer
zeroXbrock Nov 21, 2023
c79a4f0
cleanup
zeroXbrock Nov 21, 2023
830fbe4
add deploy script for mev-share contract, clean up
zeroXbrock Nov 21, 2023
18a21a0
tighten up types
zeroXbrock Nov 21, 2023
7fa521e
clean up deploy script
zeroXbrock Nov 21, 2023
1b2c842
add working mev-share bid example in playgrounds/bun
zeroXbrock Nov 22, 2023
f16e50b
comment out old examples; saving for later isolated examples
zeroXbrock Nov 22, 2023
c83812f
make chainId optional in TransactionRequestSuave
zeroXbrock Nov 22, 2023
c29aec0
move getSuaveWallet to suaveRigil.newWallet
zeroXbrock Nov 22, 2023
ce252fb
move playground code to examples/suave/
zeroXbrock Nov 22, 2023
e2eab53
lint
zeroXbrock Nov 22, 2023
899a5dc
delete old code comments
zeroXbrock Nov 22, 2023
d4236bc
insert suave chainId if missing
zeroXbrock Nov 22, 2023
06362b5
add 'suaveRigil.newPublicClient'
zeroXbrock Nov 22, 2023
0b94b18
add default transport in client instantiation
zeroXbrock Nov 22, 2023
34f3503
Merge remote-tracking branch 'origin/main' into suave-default-transport
zeroXbrock Nov 22, 2023
85618af
chore: format
zeroXbrock Nov 22, 2023
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
4 changes: 2 additions & 2 deletions examples/suave/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const goerliProvider = createPublicClient({
chain: goerli,
transport: http(GOERLI_RPC_URL_HTTP),
})
const adminWallet = suaveRigil.newWallet(http(SUAVE_RPC_URL_HTTP), PRIVATE_KEY)
const adminWallet = suaveRigil.newWallet(PRIVATE_KEY, http(SUAVE_RPC_URL_HTTP))
const wallet = suaveRigil.newWallet(
http(SUAVE_RPC_URL_HTTP),
'0x01000070530220062104600650003002001814120800043ff33603df10300012',
http(SUAVE_RPC_URL_HTTP),
)
console.log('admin', adminWallet.account.address)
console.log('wallet', wallet.account.address)
Expand Down
37 changes: 27 additions & 10 deletions src/chains/definitions/suaveRigil.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { createPublicClient } from '../../clients/createPublicClient.js'
import { type Transport } from '../../clients/transports/createTransport.js'
import { http } from '../../clients/transports/http.js'
import { type Hex } from '../../types/misc.js'
import { defineChain } from '../../utils/chain.js'
import { formattersSuave } from '../suave/formatters.js'
import { getSuaveWallet } from '../suave/wallet.js'

const testnetUrlHttp = 'https://testnet.rpc.flashbots.net'
const testnetUrlWs = 'wss://testnet.rpc.flashbots.net'
const testnetExplorerUrl = 'https://testnet.explorer.flashbots.net'

const defaultTransport = http(testnetUrlHttp)

export const suaveRigil = /*#__PURE__*/ defineChain(
{
id: 16813125,
Expand All @@ -16,26 +24,35 @@ export const suaveRigil = /*#__PURE__*/ defineChain(
},
rpcUrls: {
default: {
http: ['https://testnet.rpc.flashbots.net'],
webSocket: ['wss://testnet.rpc.flashbots.net'],
http: [testnetUrlHttp],
webSocket: [testnetUrlWs],
},
public: {
http: ['https://testnet.rpc.flashbots.net'],
webSocket: ['wss://testnet.rpc.flashbots.net'],
http: [testnetUrlHttp],
webSocket: [testnetUrlWs],
},
},
blockExplorers: {
default: {
name: 'Explorer',
url: 'https://testnet.explorer.flashbots.net',
name: 'SUAVE Rigil Explorer',
url: testnetExplorerUrl,
},
},
contracts: {},
testnet: true,
newWallet: (transport: any, privateKey: Hex) =>
getSuaveWallet({ transport, chain: suaveRigil }, privateKey),
newPublicClient: (transport: any) =>
createPublicClient({ transport, chain: suaveRigil }),
newWallet: (privateKey: Hex, transport?: Transport) =>
getSuaveWallet(
{
transport: transport ?? defaultTransport,
chain: suaveRigil,
},
privateKey,
),
newPublicClient: (transport?: any) =>
createPublicClient({
transport: transport ?? defaultTransport,
chain: suaveRigil,
}),
},
{
formatters: formattersSuave,
Expand Down