Skip to content

Commit

Permalink
Katana and ArgentX wallet (dojoengine#1958)
Browse files Browse the repository at this point in the history
* fix: path to Argent account compiled contracts in declare script

* fix: allow some headers in CORS layer of Katana to work with ArgentX wallet

* refactor: clean forgotten logs in declare-argent-account.sh script and remove unnecessary var

* fix: remove vec in favor of array

---------

Co-authored-by: glihm <[email protected]>
  • Loading branch information
Matth26 and glihm authored May 24, 2024
1 parent 43edfa8 commit 35ca974
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/katana/rpc/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub async fn spawn<EF: ExecutorFactory>(
let cors = CorsLayer::new()
// Allow `POST` when accessing the resource
.allow_methods([Method::POST, Method::GET])
.allow_headers([hyper::header::CONTENT_TYPE]);
.allow_headers([hyper::header::CONTENT_TYPE, "argent-client".parse().unwrap(), "argent-version".parse().unwrap()]);

let cors =
config.allowed_origins.clone().map(|allowed_origins| match allowed_origins.as_slice() {
Expand Down
8 changes: 3 additions & 5 deletions crates/katana/scripts/declare-argent-account.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#! /bin/bash

STD_ARGENT_ACCOUNT_0_3_0_CLASS_HASH="0x01a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003"
STD_ARGENT_ACCOUNT_0_3_0_COMPILED_FILE="../primitives/contracts/compiled/argent_ArgentAccount_0.3.0.json"
STD_ARGENT_ACCOUNT_0_3_0_COMPILED_FILE="../contracts/compiled/argent_ArgentAccount_0.3.0.json"

STD_ARGENT_ACCOUNT_0_3_1_CLASS_HASH="0x29927c8af6bccf3f6fda035981e765a7bdbf18a2dc0d630494f8758aa908e2b"
STD_ARGENT_ACCOUNT_0_3_1_COMPILED_FILE="../primitives/contracts/compiled/argent_ArgentAccount_0.3.1.json"
STD_ARGENT_ACCOUNT_0_3_1_COMPILED_FILE="../contracts/compiled/argent_ArgentAccount_0.3.1.json"

TEMP_ACCOUNT_FILE="temp-account.json"
TEMP_KEYSTORE_FILE="temp-keystore.json"

trap "rm -f $TEMP_ACCOUNT_FILE $TEMP_KEYSTORE_FILE" EXIT
trap "rm -f $TEMP_ACCOUNT_FILE" EXIT

# This is helper script is for declaring the standard Argent account to Katana as it doesn't come as a default.
# Argent account contract source code: https://github.com/argentlabs/argent-contracts-starknet/blob/53d01c0d6dce4fd30db955c3d698f658cdda1796/contracts/account/src/argent_account.cairo
Expand Down Expand Up @@ -57,7 +56,6 @@ else
exit 1
fi


starkli account fetch $ACCOUNT_ADDRESS --rpc $RPC_URL --output $TEMP_ACCOUNT_FILE &> /dev/null

for file in "${CLASS_TO_DECLARE[@]}"; do
Expand Down

0 comments on commit 35ca974

Please sign in to comment.