diff --git a/README.md b/README.md index 3e06d7da3..4a35e464f 100644 --- a/README.md +++ b/README.md @@ -16,22 +16,31 @@ Install the latest Dojo toolchain from [releases](https://github.com/dojoengine/ ```bash # Start Katana -katana --seed 0 --block-time 1 +katana --block-time 200 # Build the game sozo build -# Migrate the world, this will declare/deploy contracts to katana -sozo migrate --name ryo +# Migrate the world, this will declare/deploy contracts to katana and take note of the world address +sozo migrate # Start indexer, graphql endpoint at http://localhost:8080 -torii --manifest target/dev/manifest.json --world-address 0x788f5fd335d29ed5f8686982079cc3aa9c82aa41968f759b2c3d0be8d5fa0c4 +torii --world {world_address} + +# Setup default authorization +./scripts/default_auth.sh # Start frontend, located at http://localhost:3000 cd web yarn install && yarn dev ``` +Note: If the world address your game is deployed to is different, you'll need to update it in three places currently + +- Scarb.toml +- script/default_auth.sh +- web/src/constants.ts + ### With Madara TBD diff --git a/Scarb.toml b/Scarb.toml index 4bcd0d5b5..484c564ec 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -1,7 +1,7 @@ [package] name = "rollyourown" version = "0.1.0" -cairo-version = "2.0.0-rc4" +cairo-version = "2.2.0" [cairo] sierra-replace-ids = true @@ -16,12 +16,12 @@ dojo = { git = "https://github.com/dojoengine/dojo.git" } # Katana rpc_url = "http://localhost:5050" -account_address = "0x03ee9e18edc71a6df30ac3aca2e0b02a198fbce19b7480a63a0d71cbd76652e0" -private_key = "0x0300001800000000300000180000000000030000000000003006001800006600" +account_address = "0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973" +private_key = "0x1800000000300000180000000000030000000000003006001800006600" # Madara -#rpc_url = "https://rinnegan.madara.zone" +#rpc_url = "https://api.cartridge.gg/x/shinai/madara" #account_address = "0x2" #private_key = "0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" -#world_address = "0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d201" +#world_address = "0x3c3dfeb374720dfd73554dc2b9e0583cb9668efb3055d07d1533afa5d219fd5" diff --git a/scripts/default_auth.sh b/scripts/default_auth.sh index fa8efe405..277c7552b 100755 --- a/scripts/default_auth.sh +++ b/scripts/default_auth.sh @@ -2,11 +2,11 @@ set -euo pipefail pushd $(dirname "$0")/.. -export WORLD_ADDRESS="0x49eea56f14aebfad0a3f73c530f0673084cc9c4b352965e685e52939221c389"; +export WORLD_ADDRESS="0x3c3dfeb374720dfd73554dc2b9e0583cb9668efb3055d07d1533afa5d219fd5"; # make sure all components/systems are deployed COMPONENTS=("Game" "Market" "Name" "Player" "Risks") -SYSTEMS=("create_game" "join_game" "set_name" "travel" "buy" "sell") +SYSTEMS=("create_game" "join_game" "set_name" "travel" "buy" "sell" "decide") # check components for component in ${COMPONENTS[@]}; do @@ -29,6 +29,7 @@ SET_NAME_COMPONENTS=("Name") BUY_COMPONENTS=("Drug" "Market" "Name" "Player") SELL_COMPONENTS=("Drug" "Market" "Name" "Player") TRAVEL_COMPONENTS=("Player") +DECIDE_COMPONENTS=("Player" "Drug") for component in ${CREATE_GAME_COMPONENTS[@]}; do sozo auth writer $component create_game --world $WORLD_ADDRESS @@ -54,4 +55,12 @@ for component in ${TRAVEL_COMPONENTS[@]}; do sozo auth writer $component travel --world $WORLD_ADDRESS done +for component in ${TRAVEL_COMPONENTS[@]}; do + sozo auth writer $component decide --world $WORLD_ADDRESS +done + +for component in ${DECIDE_COMPONENTS[@]}; do + sozo auth writer $component decide --world $WORLD_ADDRESS +done + echo "Default authorizations have been successfully set." \ No newline at end of file diff --git a/src/components/drug.cairo b/src/components/drug.cairo index 503ed6575..678d547f7 100644 --- a/src/components/drug.cairo +++ b/src/components/drug.cairo @@ -13,10 +13,7 @@ struct Drug { quantity: usize, } -trait DrugTrait { - fn all() -> Span; -} - +#[generate_trait] impl DrugImpl of DrugTrait { fn all() -> Span { let mut drugs = array::ArrayTrait::new(); diff --git a/src/components/game.cairo b/src/components/game.cairo index 92cb00325..b13222e8d 100644 --- a/src/components/game.cairo +++ b/src/components/game.cairo @@ -2,7 +2,7 @@ use box::BoxTrait; use traits::Into; use starknet::ContractAddress; -#[derive(Component, Copy, Drop, Serde, SerdeLen)] +#[derive(Component, Copy, Drop, Serde)] struct Game { #[key] game_id: u32, @@ -14,19 +14,16 @@ struct Game { creator: ContractAddress, } - -trait GameTrait { - fn tick(self: @Game) -> bool; -} - +#[generate_trait] impl GameImpl of GameTrait { - fn tick(self: @Game) -> bool { + #[inline(always)] + fn tick(self: Game) -> bool { let info = starknet::get_block_info().unbox(); - if info.block_timestamp < *self.start_time { + if info.block_timestamp < self.start_time { return false; } - if *self.is_finished { + if self.is_finished { return false; } diff --git a/src/components/location.cairo b/src/components/location.cairo index c4d956b0a..dd6937ead 100644 --- a/src/components/location.cairo +++ b/src/components/location.cairo @@ -5,11 +5,7 @@ use starknet::ContractAddress; struct Location {} -trait LocationTrait { - fn all() -> Span; - fn random(seed: felt252) -> felt252; -} - +#[generate_trait] impl LocationImpl of LocationTrait { fn all() -> Span { let mut locations = array::ArrayTrait::new(); diff --git a/src/components/market.cairo b/src/components/market.cairo index 8dec1e0c4..4e436180b 100644 --- a/src/components/market.cairo +++ b/src/components/market.cairo @@ -4,7 +4,7 @@ use debug::PrintTrait; use rollyourown::constants::SCALING_FACTOR; -#[derive(Component, Copy, Drop, Serde, SerdeLen)] +#[derive(Component, Copy, Drop, Serde)] struct Market { #[key] game_id: u32, @@ -16,21 +16,19 @@ struct Market { quantity: usize, } -trait MarketTrait { - fn buy(self: @Market, quantity: usize) -> u128; - fn sell(self: @Market, quantity: usize) -> u128; -} - +#[generate_trait] impl MarketImpl of MarketTrait { - fn buy(self: @Market, quantity: usize) -> u128 { - assert(quantity < *self.quantity, 'not enough liquidity'); + #[inline(always)] + fn buy(ref self: Market, quantity: usize) -> u128 { + assert(quantity < self.quantity, 'not enough liquidity'); let (amount, available, cash) = normalize(quantity, self); let k = cash * available; let cost = (k / (available - amount)) - cash; cost } - fn sell(self: @Market, quantity: usize) -> u128 { + #[inline(always)] + fn sell(ref self: Market, quantity: usize) -> u128 { let (amount, available, cash) = normalize(quantity, self); let k = cash * available; let payout = cash - (k / (available + amount)); @@ -38,17 +36,17 @@ impl MarketImpl of MarketTrait { } } -fn normalize(amount: usize, market: @Market) -> (u128, u128, u128) { +fn normalize(amount: usize, market: Market) -> (u128, u128, u128) { let amount: u128 = amount.into() * SCALING_FACTOR; - let available: u128 = (*market.quantity).into() * SCALING_FACTOR; - (amount, available, *market.cash) + let available: u128 = (market.quantity).into() * SCALING_FACTOR; + (amount, available, market.cash) } #[test] #[should_panic(expected: ('not enough liquidity', ))] fn test_not_enough_quantity() { - let market = Market { + let mut market = Market { game_id: 0, location_id: 0, drug_id: 0, cash: SCALING_FACTOR * 1, quantity: 1 }; // pool 1:1 let cost = market.buy(10); @@ -57,7 +55,7 @@ fn test_not_enough_quantity() { #[test] #[available_gas(100000)] fn test_market_buy() { - let market = Market { + let mut market = Market { game_id: 0, location_id: 0, drug_id: 0, cash: SCALING_FACTOR * 1, quantity: 10 }; // pool 1:10 let cost = market.buy(5); @@ -67,7 +65,7 @@ fn test_market_buy() { #[test] #[available_gas(100000)] fn test_market_sell() { - let market = Market { + let mut market = Market { game_id: 0, location_id: 0, drug_id: 0, cash: SCALING_FACTOR * 1, quantity: 10 }; // pool 1:10 let payout = market.sell(5); diff --git a/src/components/name.cairo b/src/components/name.cairo index 505d12b49..213a87c9f 100644 --- a/src/components/name.cairo +++ b/src/components/name.cairo @@ -1,6 +1,6 @@ use starknet::ContractAddress; -#[derive(Component, Copy, Drop, Serde, SerdeLen)] +#[derive(Component, Copy, Drop, Serde)] struct Name { #[key] game_id: u32, diff --git a/src/components/player.cairo b/src/components/player.cairo index 037133a65..df06edc4a 100644 --- a/src/components/player.cairo +++ b/src/components/player.cairo @@ -1,27 +1,32 @@ use starknet::ContractAddress; +use rollyourown::PlayerStatus; -#[derive(Component, Copy, Drop, Serde, SerdeLen)] +#[derive(Component, Copy, Drop, Serde)] struct Player { #[key] game_id: u32, #[key] player_id: ContractAddress, + status: PlayerStatus, location_id: felt252, cash: u128, health: u8, + drug_count: usize, + bag_limit: usize, turns_remaining: usize, } -trait PlayerTrait { - fn can_continue(self: @Player) -> bool; -} - +#[generate_trait] impl PlayerImpl of PlayerTrait { - fn can_continue(self: @Player) -> bool { - if *self.health == 0 { + #[inline(always)] + fn can_continue(ref self: Player) -> bool { + if self.health == 0 { + return false; + } + if self.turns_remaining == 0 { return false; } - if *self.turns_remaining == 0 { + if self.status != PlayerStatus::Normal { return false; } diff --git a/src/components/risks.cairo b/src/components/risks.cairo index 54530a313..87a3f8f26 100644 --- a/src/components/risks.cairo +++ b/src/components/risks.cairo @@ -4,107 +4,64 @@ use debug::PrintTrait; use rollyourown::constants::SCALING_FACTOR; -#[derive(Drop, Copy)] -struct TravelResult { - arrested: bool, - mugged: bool, - health_loss: u8, -} - -#[derive(Drop, Copy)] -struct TradeResult { - money_loss: u128, - drug_loss: usize, -} - -#[derive(Component, Copy, Drop, Serde, SerdeLen)] +#[derive(Component, Copy, Drop, Serde)] struct Risks { #[key] game_id: u32, #[key] location_id: felt252, - // travel risk probabilities travel: u8, - hurt: u8, - mugged: u8, - arrested: u8, -// trade risk probabilities -// trade_occurance_rate: u8, -// hacked: u8, -// rugged: u8, -// slippage: u8, -// chain_halted: u8, -} - -trait RisksTrait { - fn travel(self: @Risks, seed: felt252) -> (bool, TravelResult); - fn trade(self: @Risks, seed: felt252) -> (bool, TradeResult); + run: u8, } +#[generate_trait] impl RisksImpl of RisksTrait { - fn travel(self: @Risks, seed: felt252) -> (bool, TravelResult) { - let mut seed = seed; - let mut health_loss = 0; - let mut arrested = false; - let mut mugged = false; - let mut event_occured = false; - - if occurs(seed, *self.travel) { - seed = pedersen(seed, seed); - event_occured = true; - - // TEMP: for testing, mugging is only risk - mugged = true; - } - - (event_occured, TravelResult { arrested, mugged, health_loss }) + #[inline(always)] + fn travel(ref self: Risks, seed: felt252) -> bool { + occurs(seed, self.travel) } - fn trade(self: @Risks, seed: felt252) -> (bool, TradeResult) { - let mut money_loss = 0; - let mut drug_loss = 0; - - // TODO: trade risk effects - - (false, TradeResult { money_loss, drug_loss }) + #[inline(always)] + fn run(ref self: Risks, seed: felt252) -> bool { + occurs(seed, self.run) } } fn occurs(seed: felt252, likelihood: u8) -> bool { + if likelihood == 0 { + return false; + } + let seed: u256 = seed.into(); let result: u128 = seed.low % 100; + (result <= likelihood.into()) } #[test] #[available_gas(1000000)] fn test_never_occurs() { - let seed = pedersen(1, 1); - let risks = Risks { game_id: 0, location_id: 0, travel: 0, hurt: 0, mugged: 0, arrested: 0, }; - let (event_occured, result) = risks.travel(seed); + let seed = pedersen::pedersen(1, 1); + let mut risks = Risks { game_id: 0, location_id: 0, travel: 0, run: 0 }; + let event = risks.travel(seed); - assert(!event_occured, 'event occured'); - assert(result.health_loss == 0, 'health_loss occured'); - assert(!result.mugged, 'was mugged'); - assert(!result.arrested, 'was arrested'); + assert(event == bool::False, 'event occured'); } #[test] #[available_gas(1000000)] fn test_always_occurs() { - let seed = pedersen(1, 1); - let risks = Risks { - game_id: 0, location_id: 0, travel: 100, hurt: 100, mugged: 100, arrested: 100, - }; - let (event_occured, result) = risks.travel(seed); + let seed = pedersen::pedersen(1, 1); + let mut risks = Risks { game_id: 0, location_id: 0, travel: 100, run: 0 }; + let event = risks.travel(seed); - assert(event_occured, 'event did not occur'); + assert(event == bool::True, 'event did not occur'); } #[test] #[available_gas(1000000)] fn test_occurs() { - let seed = pedersen(1, 1); + let seed = pedersen::pedersen(1, 1); let event = occurs(seed, 10); assert(!event, 'should not occur'); } @@ -112,7 +69,7 @@ fn test_occurs() { #[test] #[available_gas(1000000)] fn test_not_occurs() { - let seed = pedersen(1, 1); + let seed = pedersen::pedersen(1, 1); let event = occurs(seed, 28); assert(event, 'should occur'); } diff --git a/src/constants.cairo b/src/constants.cairo index 8b1ed7aee..ce0d28225 100644 --- a/src/constants.cairo +++ b/src/constants.cairo @@ -1,16 +1,18 @@ const SCALING_FACTOR: u128 = 10_000; -const TRAVEL_RISK: u8 = 30; -const HURT_RISK: u8 = 0; -const MUGGED_RISK: u8 = 0; -const ARRESTED_RISK: u8 = 50; +const TRAVEL_RISK: u8 = 30; // 30% chance of mugged +const RUN_CHANCE: u8 = 50; // 50% chance of successfully getting away -// max drug price is $300 -// min drug price is $2 -const MAX_QUANTITY: usize = 50_000; -const MIN_QUANITTY: usize = 20_000; -const MAX_CASH: u128 = 60_000_000_000; // $6Mil -const MIN_CASH: u128 = 1_000_000_000; // $100k +const BASE_PAYMENT: u128 = 400_0000; // base payment is $400 -// cash players start with -const STARTING_CASH: u128 = 20_000_000; // $2000 +// max drug price is $300 = MAX_CASH / MIN_QUANTITY +// min drug price is $50 = MIN_CASH / MAX_QUANTITY +const MAX_QUANTITY: usize = 500; +const MIN_QUANITTY: usize = 200; +const MAX_CASH: u128 = 100_000_0000; // $100k +const MIN_CASH: u128 = 25_000_0000; // $25k + +// starting stats +const STARTING_CASH: u128 = 2000_0000; // $2000 +const STARTING_BAG_LIMIT: usize = 100; // inventory size +const STARTING_HEALTH: u8 = 100; diff --git a/src/events.cairo b/src/events.cairo deleted file mode 100644 index b83834b88..000000000 --- a/src/events.cairo +++ /dev/null @@ -1,69 +0,0 @@ -use dojo::world::{Context, IWorldDispatcherTrait}; -use serde::Serde; -use array::{ArrayTrait, SpanTrait}; -use starknet::ContractAddress; - -// helper function to emit events, eventually dojo will -// have framework level event/logging -fn emit(ctx: Context, name: felt252, values: Span) { - let mut keys = array::ArrayTrait::new(); - keys.append(name); - ctx.world.emit(keys, values); -} - -#[derive(Drop, Serde)] -struct LocationCreated { - game_id: u32, - location_id: u32, -} - -#[derive(Drop, Serde)] -struct GameCreated { - game_id: u32, - creator: ContractAddress, - start_time: u64, - max_turns: usize, - max_players: usize, -} - -#[derive(Drop, Serde)] -struct PlayerJoined { - game_id: u32, - player_id: ContractAddress, - location_id: felt252, -} - -#[derive(Drop, starknet::Event)] -struct Bought { - game_id: u32, - player_id: ContractAddress, - drug_id: felt252, - quantity: usize, - cost: u128 -} - -#[derive(Drop, starknet::Event)] -struct Sold { - game_id: u32, - player_id: ContractAddress, - drug_id: felt252, - quantity: usize, - payout: u128 -} - -#[derive(Drop, Serde)] -struct Traveled { - game_id: u32, - player_id: ContractAddress, - from_location: felt252, - to_location: felt252, -} - -#[derive(Drop, Serde)] -struct RandomEvent { - game_id: u32, - player_id: ContractAddress, - health_loss: u8, - mugged: bool, - arrested: bool -} diff --git a/src/lib.cairo b/src/lib.cairo index 77ed33837..f5aa843e8 100644 --- a/src/lib.cairo +++ b/src/lib.cairo @@ -1,9 +1,36 @@ mod components; mod systems; mod constants; -mod events; mod utils; #[cfg(test)] mod tests; +#[derive(Copy, Drop, Serde, PartialEq)] +enum PlayerStatus { + Normal: (), + BeingMugged: (), + BeingArrested: (), +} + +impl StorageSizePlayerStatus of dojo::StorageSize { + #[inline(always)] + fn unpacked_size() -> usize { + 1 + } + + #[inline(always)] + fn packed_size() -> usize { + 2 + } +} + +impl PlayerStatusPrintImpl of core::debug::PrintTrait { + fn print(self: PlayerStatus) { + match self { + PlayerStatus::Normal(()) => 0.print(), + PlayerStatus::BeingMugged(()) => 1.print(), + PlayerStatus::BeingArrested(()) => 2.print(), + } + } +} diff --git a/src/systems.cairo b/src/systems.cairo index 02d2bdf30..ce14a12b4 100644 --- a/src/systems.cairo +++ b/src/systems.cairo @@ -2,4 +2,5 @@ mod create; mod join; mod trade; mod travel; -mod player; +mod set_name; +mod decide; diff --git a/src/systems/create.cairo b/src/systems/create.cairo index 926ca366f..8b9721415 100644 --- a/src/systems/create.cairo +++ b/src/systems/create.cairo @@ -9,7 +9,7 @@ mod create_game { use dojo::world::Context; - use rollyourown::events::{emit, GameCreated, PlayerJoined}; + use rollyourown::PlayerStatus; use rollyourown::components::name::Name; use rollyourown::components::game::Game; use rollyourown::components::player::Player; @@ -18,81 +18,91 @@ mod create_game { use rollyourown::components::drug::{Drug, DrugTrait}; use rollyourown::components::location::{Location, LocationTrait}; use rollyourown::constants::{ - SCALING_FACTOR, TRAVEL_RISK, HURT_RISK, MUGGED_RISK, ARRESTED_RISK, MIN_CASH, MAX_CASH, - MIN_QUANITTY, MAX_QUANTITY, STARTING_CASH + SCALING_FACTOR, TRAVEL_RISK, RUN_CHANCE, MIN_CASH, MAX_CASH, MIN_QUANITTY, MAX_QUANTITY, + STARTING_CASH, STARTING_HEALTH, STARTING_BAG_LIMIT }; use rollyourown::utils::random; + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + GameCreated: GameCreated, + PlayerJoined: PlayerJoined + } + + #[derive(Drop, starknet::Event)] + struct GameCreated { + game_id: u32, + creator: ContractAddress, + start_time: u64, + max_turns: usize, + max_players: usize, + } + + #[derive(Drop, starknet::Event)] + struct PlayerJoined { + game_id: u32, + player_id: ContractAddress, + location_id: felt252, + } + fn execute( ctx: Context, start_time: u64, max_players: usize, max_turns: usize ) -> (u32, ContractAddress) { let game_id = ctx.world.uuid(); - - // game entity - set!( - ctx.world, - (Game { - game_id, - start_time, - max_players, - num_players: 1, // caller auto joins - max_turns, - is_finished: false, - creator: ctx.origin, - }) - ); - let seed = starknet::get_tx_info().unbox().transaction_hash; let location_id = LocationTrait::random(seed); - // player entity - set!( - ctx.world, - ( - Player { - game_id, - player_id: ctx.origin, - location_id, - cash: STARTING_CASH, - health: 100, - turns_remaining: max_turns - }, - ) - ); - // TODO: spawn locations with risk profiles balanced - // with market pricing + let player = Player { + game_id, + player_id: ctx.origin, + location_id, + cash: STARTING_CASH, + health: STARTING_HEALTH, + drug_count: 0, + bag_limit: STARTING_BAG_LIMIT, + turns_remaining: max_turns, + status: PlayerStatus::Normal(()), + }; + + let game = Game { + game_id, + start_time, + max_players, + num_players: 1, // caller auto joins + max_turns, + is_finished: false, + creator: ctx.origin, + }; + + set !(ctx.world, (game, player)); + let mut locations = LocationTrait::all(); loop { match locations.pop_front() { Option::Some(location_id) => { //set location entity - set!( + set !( ctx.world, (Risks { - game_id, - location_id: *location_id, - travel: TRAVEL_RISK, - hurt: HURT_RISK, - mugged: MUGGED_RISK, - arrested: ARRESTED_RISK + game_id, location_id: *location_id, travel: TRAVEL_RISK, run: RUN_CHANCE }) ); let mut seed = starknet::get_tx_info().unbox().transaction_hash; - seed = pedersen(seed, *location_id); + seed = pedersen::pedersen(seed, *location_id); let mut drugs = DrugTrait::all(); loop { match drugs.pop_front() { Option::Some(drug_id) => { - // HACK: temp hack to get some randomness - seed = pedersen(seed, *drug_id); + seed = pedersen::pedersen(seed, *drug_id); let market_cash = random(seed, MIN_CASH, MAX_CASH); let rand = random(seed, MIN_QUANITTY.into(), MAX_QUANTITY.into()); let market_quantity: usize = rand.try_into().unwrap(); //set market entity - set!( + set !( ctx.world, (Market { game_id, @@ -116,19 +126,15 @@ mod create_game { }; // emit player joined - let mut values = array::ArrayTrait::new(); - serde::Serde::serialize( - @PlayerJoined { game_id, player_id: ctx.origin, location_id: location_id }, ref values + emit !( + ctx.world, PlayerJoined { game_id, player_id: ctx.origin, location_id: location_id } ); - emit(ctx, 'PlayerJoined', values.span()); // emit game created - let mut values = array::ArrayTrait::new(); - serde::Serde::serialize( - @GameCreated { game_id, creator: ctx.origin, start_time, max_players, max_turns }, - ref values + emit !( + ctx.world, + GameCreated { game_id, creator: ctx.origin, start_time, max_players, max_turns } ); - emit(ctx, 'GameCreated', values.span()); (game_id, ctx.origin) } diff --git a/src/systems/decide.cairo b/src/systems/decide.cairo new file mode 100644 index 000000000..93b19a044 --- /dev/null +++ b/src/systems/decide.cairo @@ -0,0 +1,151 @@ +#[system] +mod decide { + use array::ArrayTrait; + use box::BoxTrait; + use traits::Into; + use starknet::ContractAddress; + + use dojo::world::Context; + + use rollyourown::PlayerStatus; + use rollyourown::constants::BASE_PAYMENT; + use rollyourown::components::game::{Game, GameTrait}; + use rollyourown::components::risks::{Risks, RisksTrait}; + use rollyourown::components::player::{Player, PlayerTrait}; + use rollyourown::components::drug::{Drug, DrugTrait}; + + #[derive(Copy, Drop, Serde, PartialEq)] + enum Action { + Pay: (), + Run: (), + } + + #[derive(Copy, Drop, Serde, PartialEq)] + enum Outcome { + Paid: (), + Escaped: (), + Captured: (), + } + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + Decision: Decision, + Consequence: Consequence, + CashLoss: CashLoss, + DrugLoss: DrugLoss, + } + + #[derive(Drop, starknet::Event)] + struct Decision { + game_id: u32, + player_id: ContractAddress, + action: Action, + } + + #[derive(Drop, starknet::Event)] + struct Consequence { + game_id: u32, + player_id: ContractAddress, + outcome: Outcome, + } + + #[derive(Drop, starknet::Event)] + struct CashLoss { + game_id: u32, + player_id: ContractAddress, + amount: u128 + } + + #[derive(Drop, starknet::Event)] + struct DrugLoss { + game_id: u32, + player_id: ContractAddress, + drug_id: felt252, + quantity: usize + } + + fn execute(ctx: Context, game_id: u32, action: Action, next_location_id: felt252) { + let player_id = ctx.origin; + let mut player = get !(ctx.world, (game_id, player_id).into(), Player); + assert(player.status != PlayerStatus::Normal(()), 'player response not needed'); + + let (outcome, cash_loss) = match action { + Action::Pay => pay(ctx, game_id, player_id, player.cash), + Action::Run => run(ctx, game_id, player_id, player.location_id, player.cash), + }; + + player.cash -= cash_loss; + player.status = PlayerStatus::Normal(()); + player.location_id = next_location_id; + player.turns_remaining -= 1; + + set !(ctx.world, (player)); + emit !(ctx.world, Consequence { game_id, player_id, outcome }); + } + + // Player will hand over either 20% of their cash or $400, which ever is more + fn pay( + ctx: Context, game_id: u32, player_id: ContractAddress, player_cash: u128 + ) -> (Outcome, u128) { + assert(player_cash >= BASE_PAYMENT, 'not enough cash kid'); + let cash_loss = cmp::max(player_cash / 5, BASE_PAYMENT); + + emit !(ctx.world, Decision { game_id, player_id, action: Action::Pay }); + emit !(ctx.world, CashLoss { game_id, player_id, amount: cash_loss }); + (Outcome::Paid(()), cash_loss) + } + + // Player will try to run and can escape. However, if they are captured they lose 50% of everything + fn run( + ctx: Context, + game_id: u32, + player_id: ContractAddress, + location_id: felt252, + player_cash: u128 + ) -> (Outcome, u128) { + let mut risks = get !(ctx.world, (game_id, location_id).into(), Risks); + let seed = starknet::get_tx_info().unbox().transaction_hash; + let got_away = risks.run(seed); + + emit !(ctx.world, Decision { game_id, player_id, action: Action::Run }); + match got_away { + bool::False => { + let cash_loss = player_cash / 2; + halve_drugs(ctx, game_id, player_id); + + emit !(ctx.world, CashLoss { game_id, player_id, amount: cash_loss }); + (Outcome::Captured(()), cash_loss) + }, + bool::True => { + (Outcome::Escaped(()), 0) + } + } + } + + // sorry fren, u jus lost half ur stash, ngmi + fn halve_drugs(ctx: Context, game_id: u32, player_id: ContractAddress) { + let mut drugs = DrugTrait::all(); + loop { + match drugs.pop_front() { + Option::Some(drug_id) => { + let mut drug = get !(ctx.world, (game_id, player_id, *drug_id).into(), Drug); + if (drug.quantity != 0) { + drug.quantity /= 2; + + emit !( + ctx.world, + DrugLoss { + game_id, player_id, drug_id: *drug_id, quantity: drug.quantity + } + ); + set !(ctx.world, (drug)); + } + }, + Option::None(()) => { + break (); + } + }; + }; + } +} diff --git a/src/systems/join.cairo b/src/systems/join.cairo index 0cb34a5a9..ebf7bc215 100644 --- a/src/systems/join.cairo +++ b/src/systems/join.cairo @@ -7,56 +7,56 @@ mod join_game { use dojo::world::Context; - use rollyourown::events::{emit, PlayerJoined}; + use rollyourown::PlayerStatus; use rollyourown::components::game::Game; use rollyourown::components::player::Player; use rollyourown::components::location::{Location, LocationTrait}; - use rollyourown::constants::{SCALING_FACTOR, STARTING_CASH}; + use rollyourown::constants::{ + SCALING_FACTOR, STARTING_CASH, STARTING_HEALTH, STARTING_BAG_LIMIT + }; + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + PlayerJoined: PlayerJoined + } + + #[derive(Drop, starknet::Event)] + struct PlayerJoined { + game_id: u32, + player_id: ContractAddress, + location_id: felt252, + } fn execute(ctx: Context, game_id: u32) -> ContractAddress { + let player_id = ctx.origin; let block_info = starknet::get_block_info().unbox(); - let game = get!(ctx.world, game_id, (Game)); + let mut game = get !(ctx.world, game_id, (Game)); assert(!game.is_finished, 'game is finished'); assert(game.max_players > game.num_players, 'game is full'); assert(game.start_time >= block_info.block_timestamp, 'already started'); + game.num_players += 1; + let seed = starknet::get_tx_info().unbox().transaction_hash; let location_id = LocationTrait::random(seed); - // spawn player into game - set!( - ctx.world, - (Player { - game_id, - player_id: ctx.origin, - location_id, - cash: STARTING_CASH, - health: 100, - turns_remaining: game.max_turns - }) - ); - - // update num players joined - set!( - ctx.world, - (Game { - game_id, - start_time: game.start_time, - max_players: game.max_players, - num_players: game.num_players + 1, - max_turns: game.max_turns, - is_finished: false, - creator: game.creator, - }) - ); - - // emit player joined - let mut values = array::ArrayTrait::new(); - serde::Serde::serialize( - @PlayerJoined { game_id, player_id: ctx.origin, location_id: location_id }, ref values - ); - emit(ctx, 'PlayerJoined', values.span()); - - ctx.origin + + let player = Player { + game_id, + player_id, + location_id, + cash: STARTING_CASH, + health: STARTING_HEALTH, + drug_count: 0, + bag_limit: STARTING_BAG_LIMIT, + turns_remaining: game.max_turns, + status: PlayerStatus::Normal(()), + }; + + set !(ctx.world, (game, player)); + emit !(ctx.world, PlayerJoined { game_id, player_id, location_id }); + + player_id } } diff --git a/src/systems/player.cairo b/src/systems/set_name.cairo similarity index 73% rename from src/systems/player.cairo rename to src/systems/set_name.cairo index 1bf91d1b6..dc47276dd 100644 --- a/src/systems/player.cairo +++ b/src/systems/set_name.cairo @@ -8,6 +8,6 @@ mod set_name { use rollyourown::components::name::Name; fn execute(ctx: Context, game_id: u32, player_name: felt252) { - set!(ctx.world, (Name { game_id, player_id: ctx.origin, short_string: player_name, })) + set !(ctx.world, (Name { game_id, player_id: ctx.origin, short_string: player_name, })) } } diff --git a/src/systems/trade.cairo b/src/systems/trade.cairo index 71e92cb51..29d574e0c 100644 --- a/src/systems/trade.cairo +++ b/src/systems/trade.cairo @@ -3,18 +3,33 @@ mod buy { use traits::Into; use array::ArrayTrait; use debug::PrintTrait; + use starknet::ContractAddress; use dojo::world::Context; - use rollyourown::events::Bought; use rollyourown::components::name::Name; use rollyourown::components::drug::Drug; - use rollyourown::components::player::Player; + use rollyourown::components::player::{Player, PlayerTrait}; use rollyourown::components::location::Location; use rollyourown::components::game::{Game, GameTrait}; use rollyourown::components::risks::{Risks, RisksTrait}; use rollyourown::components::market::{Market, MarketTrait}; + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + Bought: Bought + } + + #[derive(Drop, starknet::Event)] + struct Bought { + game_id: u32, + player_id: ContractAddress, + drug_id: felt252, + quantity: usize, + cost: u128 + } + // 1. Verify the caller owns the player. // 2. Get current price for location for quantity. // 3. Ensure user can afford it. @@ -25,34 +40,37 @@ mod buy { ctx: Context, game_id: u32, location_id: felt252, drug_id: felt252, quantity: usize ) { let player_id = ctx.origin; - let game = get!(ctx.world, game_id, (Game)); + let game = get !(ctx.world, game_id, (Game)); assert(game.tick(), 'cannot progress'); - let mut player = get!(ctx.world, (game_id, player_id).into(), Player); + let mut player = get !(ctx.world, (game_id, player_id).into(), Player); assert(player.location_id == location_id, 'player is not at location'); + assert(player.can_continue(), 'player cannot trade'); + assert(player.drug_count + quantity <= player.bag_limit, 'no bag space'); - let mut market = get!(ctx.world, (game_id, location_id, drug_id).into(), Market); + let mut market = get !(ctx.world, (game_id, location_id, drug_id).into(), Market); let cost = market.buy(quantity); assert(cost < player.cash, 'not enough cash'); + let mut drug = get !(ctx.world, (game_id, player_id, drug_id).into(), Drug); + // update market market.cash += cost; market.quantity -= quantity; - set!(ctx.world, (market)); // update player player.cash -= cost; - set!(ctx.world, (player)); + player.drug_count += quantity; - let mut player_drug = get!(ctx.world, (game_id, player_id, drug_id).into(), Drug); - player_drug.game_id = game_id; - player_drug.player_id = player_id; - player_drug.drug_id = drug_id; - player_drug.quantity += quantity; - set!(ctx.world, (player_drug)); + // update drug + drug.game_id = game_id; + drug.player_id = player_id; + drug.drug_id = drug_id; + drug.quantity += quantity; - emit!(ctx.world, Bought { game_id, player_id, drug_id, quantity, cost }); + set !(ctx.world, (market, player, drug)); + emit !(ctx.world, Bought { game_id, player_id, drug_id, quantity, cost }); } } @@ -60,10 +78,10 @@ mod buy { mod sell { use traits::Into; use array::ArrayTrait; + use starknet::ContractAddress; use dojo::world::Context; - use rollyourown::events::Sold; use rollyourown::components::name::Name; use rollyourown::components::drug::Drug; use rollyourown::components::player::Player; @@ -72,35 +90,50 @@ mod sell { use rollyourown::components::risks::{Risks, RisksTrait}; use rollyourown::components::market::{Market, MarketTrait}; + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + Sold: Sold + } + + #[derive(Drop, starknet::Event)] + struct Sold { + game_id: u32, + player_id: ContractAddress, + drug_id: felt252, + quantity: usize, + payout: u128 + } + fn execute( ctx: Context, game_id: u32, location_id: felt252, drug_id: felt252, quantity: usize ) { let player_id = ctx.origin; - let game = get!(ctx.world, game_id, Game); + let game = get !(ctx.world, game_id, Game); assert(game.tick(), 'cannot progress'); - let mut player = get!(ctx.world, (game_id, player_id).into(), Player); + let mut player = get !(ctx.world, (game_id, player_id).into(), Player); assert(player.location_id == location_id, 'player is not at location'); - let mut drug = get!(ctx.world, (game_id, player_id, drug_id).into(), Drug); + let mut drug = get !(ctx.world, (game_id, player_id, drug_id).into(), Drug); assert(drug.quantity >= quantity, 'not enough drugs to sell'); - let mut market = get!(ctx.world, (game_id, location_id, drug_id).into(), Market); + let mut market = get !(ctx.world, (game_id, location_id, drug_id).into(), Market); let payout = market.sell(quantity); // update market market.quantity += quantity; market.cash -= payout; - set!(ctx.world, (market)); // update player player.cash += payout; - set!(ctx.world, (player)); + player.drug_count -= quantity; + // update drug drug.quantity -= quantity; - set!(ctx.world, (drug)); - emit!(ctx.world, Sold { game_id, player_id, drug_id, quantity, payout }); + set !(ctx.world, (market, player, drug)); + emit !(ctx.world, Sold { game_id, player_id, drug_id, quantity, payout }); } } diff --git a/src/systems/travel.cairo b/src/systems/travel.cairo index 13786fd56..e3587f298 100644 --- a/src/systems/travel.cairo +++ b/src/systems/travel.cairo @@ -3,71 +3,78 @@ mod travel { use traits::Into; use box::BoxTrait; use array::ArrayTrait; + use starknet::ContractAddress; use dojo::world::Context; - use rollyourown::events::{emit, Traveled, RandomEvent}; + use rollyourown::PlayerStatus; use rollyourown::components::{game::{Game, GameTrait}, location::Location}; use rollyourown::components::player::{Player, PlayerTrait}; - use rollyourown::components::risks::{Risks, RisksTrait, TravelResult}; + use rollyourown::components::risks::{Risks, RisksTrait}; + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + Traveled: Traveled, + AdverseEvent: AdverseEvent, + } + + #[derive(Drop, starknet::Event)] + struct Traveled { + game_id: u32, + player_id: ContractAddress, + from_location: felt252, + to_location: felt252, + } + + #[derive(Drop, starknet::Event)] + struct AdverseEvent { + game_id: u32, + player_id: ContractAddress, + player_status: PlayerStatus, + } + // 1. Verify the caller owns the player. // 2. Determine if a random travel event occurs and apply it if necessary. // 3. Update the players location to the next_location_id. // 4. Update the new locations supply based on random events. fn execute(ctx: Context, game_id: u32, next_location_id: felt252) -> bool { - let game = get!(ctx.world, game_id, Game); + let game = get !(ctx.world, game_id, Game); assert(game.tick(), 'game cannot progress'); let player_id = ctx.origin; - let mut player = get!(ctx.world, (game_id, player_id).into(), Player); - assert(player.can_continue(), 'player cannot continue'); + let mut player = get !(ctx.world, (game_id, player_id).into(), Player); + assert(player.can_continue(), 'player cannot travel'); assert(player.location_id != next_location_id, 'already at location'); - let risks = get!(ctx.world, (game_id, next_location_id).into(), Risks); + let mut risks = get !(ctx.world, (game_id, next_location_id).into(), Risks); let seed = starknet::get_tx_info().unbox().transaction_hash; - let (event_occured, result) = risks.travel(seed); - if event_occured { - let mut values = array::ArrayTrait::new(); - serde::Serde::serialize( - @RandomEvent { - game_id, - player_id, - health_loss: result.health_loss, - mugged: result.mugged, - arrested: result.arrested, - }, - ref values - ); - emit(ctx, 'RandomEvent', values.span()); - } + // only mugging for now + if risks.travel(seed) { + player.status = PlayerStatus::BeingMugged(()); + set !(ctx.world, (player)); - // If arrested, player loses a turn and stays at same location - if result.arrested { - player.turns_remaining - 1; - set!(ctx.world, (player)); - return (true); - } + emit !( + ctx.world, + AdverseEvent { game_id, player_id, player_status: PlayerStatus::BeingMugged(()) } + ); - // If mugged, player loses half their cash - if result.mugged { - player.cash /= 2; + return true; } - // update player player.location_id = next_location_id; - set!(ctx.world, (player)); + player.turns_remaining -= 1; + set !(ctx.world, (player)); - let mut values = array::ArrayTrait::new(); - serde::Serde::serialize( - @Traveled { + emit !( + ctx.world, + Traveled { game_id, player_id, from_location: player.location_id, to_location: next_location_id - }, - ref values + } ); - emit(ctx, 'Traveled', values.span()); - event_occured + false } } diff --git a/src/tests.cairo b/src/tests.cairo index aa7107fb0..56f7c05d6 100644 --- a/src/tests.cairo +++ b/src/tests.cairo @@ -1,6 +1,5 @@ mod create; mod travel; mod player; -//mod trade; - +mod trade; diff --git a/src/tests/create.cairo b/src/tests/create.cairo index f26380896..8daf2fd9c 100644 --- a/src/tests/create.cairo +++ b/src/tests/create.cairo @@ -23,11 +23,12 @@ use rollyourown::components::drug::{drug, Drug}; use rollyourown::components::location::Location; use rollyourown::components::risks::{risks, Risks}; use rollyourown::components::name::{name, Name}; +use rollyourown::systems::decide::decide; use rollyourown::systems::travel::travel; use rollyourown::systems::trade::{buy, sell}; use rollyourown::systems::join::join_game; use rollyourown::systems::create::create_game; -use rollyourown::systems::player::set_name; +use rollyourown::systems::set_name::set_name; use rollyourown::constants::SCALING_FACTOR; const START_TIME: u64 = 0; @@ -54,6 +55,7 @@ fn spawn_game() -> (ContractAddress, u32, felt252) { systems.append(buy::TEST_CLASS_HASH); systems.append(sell::TEST_CLASS_HASH); systems.append(set_name::TEST_CLASS_HASH); + systems.append(decide::TEST_CLASS_HASH); let world = spawn_test_world(components, systems); @@ -67,7 +69,7 @@ fn spawn_game() -> (ContractAddress, u32, felt252) { let (game_id, player_id) = serde::Serde::<(u32, felt252)>::deserialize(ref res) .expect('spawn deserialization failed'); - let game = get!(world, game_id, (Game)); + let game = get !(world, game_id, (Game)); assert(game.start_time == START_TIME, 'start time mismatch'); assert(game.max_players == MAX_PLAYERS, 'max players mismatch'); assert(game.max_turns == MAX_TURNS, 'max turns mismatch'); @@ -88,7 +90,7 @@ fn spawn_player(world_address: ContractAddress, game_id: felt252) -> felt252 { let player_id = serde::Serde::::deserialize(ref res) .expect('spawn deserialization failed'); - let player = get!(world, (game_id, player_id).into(), (Player)); + let player = get !(world, (game_id, player_id).into(), (Player)); assert(player.health == 100, 'health mismatch'); assert(player.cash == 100 * SCALING_FACTOR, 'cash mismatch'); @@ -102,13 +104,13 @@ fn test_create_game() { let (world_address, game_id, player_id) = spawn_game(); let world = IWorldDispatcher { contract_address: world_address }; - let brooklyn_risks = get!(world, (game_id, 'Brooklyn').into(), (Risks)); + let brooklyn_risks = get !(world, (game_id, 'Brooklyn').into(), (Risks)); assert(brooklyn_risks.location_id == 'Brooklyn', 'not Brooklyn location'); - let queens_risks = get!(world, (game_id, 'Queens').into(), (Risks)); + let queens_risks = get !(world, (game_id, 'Queens').into(), (Risks)); assert(queens_risks.location_id == 'Queens', 'not Queens location'); - let player = get!(world, (game_id, player_id).into(), (Player)); + let player = get !(world, (game_id, player_id).into(), (Player)); assert(player.turns_remaining == 10, 'wrong Player turns remaining'); } diff --git a/src/tests/player.cairo b/src/tests/player.cairo index d48d2a62c..99eba9769 100644 --- a/src/tests/player.cairo +++ b/src/tests/player.cairo @@ -26,7 +26,7 @@ fn test_set_name() { world.execute('set_name', set_name_calldata); - let name = get!(world, (game_id, player_id), (Name)); + let name = get !(world, (game_id, player_id), (Name)); assert(name.short_string == 'Rambo', 'incorrect name'); } @@ -48,9 +48,9 @@ fn test_join_game() { let player_id = serde::Serde::::deserialize(ref res) .expect('spawn deserialization failed'); - let game = get!(world, game_id, (Game)); + let game = get !(world, game_id, (Game)); assert(game.num_players == 2, 'incorrect num players'); - let player = get!(world, (game_id, alice).into(), (Player)); + let player = get !(world, (game_id, alice).into(), (Player)); assert(player.turns_remaining == 10, 'player did not join'); } diff --git a/src/tests/trade.cairo b/src/tests/trade.cairo index 7b5619ccf..97987859c 100644 --- a/src/tests/trade.cairo +++ b/src/tests/trade.cairo @@ -7,119 +7,48 @@ use debug::PrintTrait; use starknet::{ContractAddress, syscalls::deploy_syscall}; use starknet::class_hash::{ClassHash, Felt252TryIntoClassHash}; -use starknet::contract_address_const; -use dojo::database::query::{IntoPartitioned, IntoPartitionedQuery}; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; -use dojo::world::Context; -use dojo::string::ShortStringTrait; -use dojo::integer::u250Trait; -use rollyourown::components::{ - player::Cash, drug::Drug, location::Location, market::{Market, MarketTrait} -}; -use rollyourown::tests::spawn::{spawn_game, spawn_location, spawn_player}; +use dojo::test_utils::spawn_test_world; + +use rollyourown::PlayerStatus; +use rollyourown::components::drug::Drug; +use rollyourown::components::player::Player; +use rollyourown::tests::create::{spawn_game, spawn_player}; use rollyourown::constants::SCALING_FACTOR; -const DRUG_ID: felt252 = 0; -const QUANTITY: usize = 50; +const DRUG_ID: felt252 = 0x57656564; // weed +const QUANTITY: usize = 3; #[test] #[available_gas(100000000)] -fn test_player_buy() { - let (world_address, game_id, player_id) = spawn_game(); - let location_id = spawn_location(world_address, game_id); - +fn test_trade() { + let (world_address, game_id, player_id) = spawn_game(); // creator auto joins let world = IWorldDispatcher { contract_address: world_address }; - // travel to location - let mut player_travel_calldata = array::ArrayTrait::::new(); - player_travel_calldata.append(game_id); - player_travel_calldata.append(location_id); - world.execute('Travel'.into(), player_travel_calldata.span()); + let player = get !(world, (game_id, player_id).into(), (Player)); - // buy from market + // market buy 3 weed let mut buy_calldata = array::ArrayTrait::::new(); - buy_calldata.append(game_id); - buy_calldata.append(location_id); + buy_calldata.append(game_id.into()); + buy_calldata.append(player.location_id); buy_calldata.append(DRUG_ID); buy_calldata.append(QUANTITY.into()); - world.execute('Buy'.into(), buy_calldata.span()); - - // verify player has drug in inventory - let mut res = world - .entity('Drug'.into(), (game_id, (player_id, DRUG_ID)).into_partitioned(), 0, 0); - assert(res.len() > 0, 'no drug'); - let drug = serde::Serde::::deserialize(ref res).expect('deserialization failed'); - assert(drug.quantity == QUANTITY, 'incorrect quantity'); - - // calc market cost - let market = Market { cash: 100 * SCALING_FACTOR, quantity: 1000 }; - let cost = market.buy(QUANTITY); - - // verify player has cash - cost - let mut res = world.entity('Cash'.into(), (game_id, (player_id)).into_partitioned(), 0, 0); - assert(res.len() > 0, 'no cash'); - let cash = serde::Serde::::deserialize(ref res).expect('deserialization failed'); - assert(cash.amount == (100 * SCALING_FACTOR - cost), 'incorrect cash'); + world.execute('buy'.into(), buy_calldata); + + let player = get !(world, (game_id, player_id).into(), (Player)); + let player_drug = get !(world, (game_id, player_id, DRUG_ID).into(), (Drug)); + assert(player.drug_count == QUANTITY, 'wrong drug count'); + assert(player_drug.quantity == QUANTITY, 'wrong purchase amount'); + + // market sell 1 weed + let mut sell_calldata = array::ArrayTrait::::new(); + sell_calldata.append(game_id.into()); + sell_calldata.append(player.location_id); + sell_calldata.append(DRUG_ID); + sell_calldata.append(1); + world.execute('sell'.into(), sell_calldata); + + let player = get !(world, (game_id, player_id).into(), (Player)); + assert(player.drug_count == QUANTITY - 1, 'wrong sell amount'); } -// FIXME -// #[test] -// #[available_gas(100000000)] -// fn test_player_sell() { -// let (world_address, game_id, player_id) = spawn_game(); -// let location_id = spawn_location(world_address, game_id); - -// let world = IWorldDispatcher { contract_address: world_address }; - -// let ctx = Context { -// world, -// caller_account: world.contract_address, -// caller_system: 'Sell'.into(), -// execution_role: AuthRole { -// id: 'DrugWriter'.into() -// }, -// }; -// // give player drug -// let mut calldata = array::ArrayTrait::new(); -// serde::Serde::serialize(@Drug { id: 0.into(), quantity: QUANTITY }, ref calldata); -// World::set_entity( -// ctx, -// 'Drug'.into(), -// (game_id, (player_id, DRUG_ID)).into_partitioned(), -// 0, -// ArrayTrait::span(@calldata) -// ); - -// // travel to location -// let mut player_travel_calldata = array::ArrayTrait::::new(); -// player_travel_calldata.append(game_id); -// player_travel_calldata.append(location_id); -// world.execute('Travel'.into(), player_travel_calldata.span()); - -// // sell to market -// let mut sell_calldata = array::ArrayTrait::::new(); -// sell_calldata.append(game_id); -// sell_calldata.append(location_id); -// sell_calldata.append(DRUG_ID); -// sell_calldata.append(QUANTITY.into()); -// world.execute('Sell'.into(), sell_calldata.span()); - -// // verify player has no drug -// let mut res = world -// .entity('Drug'.into(), (game_id, (player_id, DRUG_ID)).into_partitioned(), 0, 0); -// assert(res.len() > 0, 'no drug'); -// let drug = serde::Serde::::deserialize(ref res).expect('deserialization failed'); -// assert(drug.quantity == 0, 'incorrect quantity'); -// // FIXME: keep getting gas withdraw errors -// // // calc market cost -// // let market = Market { cash: 100 * SCALING_FACTOR, quantity: 1000}; -// // let payout = market.sell(QUANTITY); - -// // // verify player has cash + payout -// // let mut res = world.entity('Cash'.into(), (game_id, (player_id)).into_partitioned(), 0, 0); -// // assert(res.len() > 0, 'no cash'); -// // let cash = serde::Serde::::deserialize(ref res).expect('deserialization failed'); -// // assert(cash.amount == (100 * SCALING_FACTOR + payout), 'incorrect cash'); -// } - - diff --git a/src/tests/travel.cairo b/src/tests/travel.cairo index 308dd8a8c..85d28e756 100644 --- a/src/tests/travel.cairo +++ b/src/tests/travel.cairo @@ -11,12 +11,13 @@ use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; use dojo::test_utils::spawn_test_world; +use rollyourown::PlayerStatus; use rollyourown::components::player::Player; use rollyourown::tests::create::{spawn_game, spawn_player}; #[test] #[available_gas(110000000)] -fn test_travel() { +fn test_travel_and_decision() { let (world_address, game_id, player_id) = spawn_game(); // creator auto joins let world = IWorldDispatcher { contract_address: world_address }; @@ -27,16 +28,17 @@ fn test_travel() { world.execute('travel', travel_calldata); - let player = get!(world, (game_id, player_id).into(), (Player)); - assert(player.location_id == brooklyn_id, 'incorrect travel'); + let player = get !(world, (game_id, player_id).into(), (Player)); + assert(player.status == PlayerStatus::BeingMugged(()), 'incorrect status'); + assert(player.location_id != brooklyn_id, 'should not have traveled'); - let queens_id = 'Queens'; - let mut travel_calldata = array::ArrayTrait::::new(); - travel_calldata.append(game_id.into()); - travel_calldata.append(queens_id); + let mut decision_calldata = array::ArrayTrait::::new(); + decision_calldata.append(game_id.into()); + decision_calldata.append(0.into()); // 0 = pay + decision_calldata.append(brooklyn_id); - world.execute('travel', travel_calldata); + world.execute('decide', decision_calldata); - let player = get!(world, (game_id, player_id).into(), (Player)); - assert(player.location_id == queens_id, 'incorrect travel'); + let player = get !(world, (game_id, player_id).into(), (Player)); + assert(player.location_id == brooklyn_id, 'should have traveled'); } diff --git a/web/.env.development b/web/.env.development index 9b332f195..127a60088 100644 --- a/web/.env.development +++ b/web/.env.development @@ -1,6 +1,14 @@ NEXT_PUBLIC_DISABLE_MEDIAPLAYER_AUTOPLAY="true" NEXT_PUBLIC_RPC_ENDPOINT="http://localhost:5050" NEXT_PUBLIC_GRAPHQL_ENDPOINT="http://localhost:8080" -NEXT_PUBLIC_ADMIN_ADDRESS="0x3ee9e18edc71a6df30ac3aca2e0b02a198fbce19b7480a63a0d71cbd76652e0" -NEXT_PUBLIC_ADMIN_PRIVATE_KEY="0x300001800000000300000180000000000030000000000003006001800006600" +NEXT_PUBLIC_ADMIN_ADDRESS="0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973" +NEXT_PUBLIC_ADMIN_PRIVATE_KEY="0x1800000000300000180000000000030000000000003006001800006600" NEXT_PUBLIC_ACCOUNT_CLASS_HASH="0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f" + + +# NEXT_PUBLIC_DISABLE_MEDIAPLAYER_AUTOPLAY="true" +# NEXT_PUBLIC_RPC_ENDPOINT="https://api.cartridge.gg/x/shinai/madara" +# NEXT_PUBLIC_GRAPHQL_ENDPOINT="http://localhost:8080" +# NEXT_PUBLIC_ADMIN_ADDRESS="0x2" +# NEXT_PUBLIC_ADMIN_PRIVATE_KEY="0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" +# NEXT_PUBLIC_ACCOUNT_CLASS_HASH="0x006280083f8c2a2db9f737320d5e3029b380e0e820fe24b8d312a6a34fdba0cd" \ No newline at end of file diff --git a/web/.env.production b/web/.env.production index 5e178579b..56aa4a30b 100644 --- a/web/.env.production +++ b/web/.env.production @@ -1,6 +1,6 @@ -NEXT_PUBLIC_DISABLE_MEDIAPLAYER_AUTOPLAY="false" -NEXT_PUBLIC_RPC_ENDPOINT="https://rinnegan.madara.zone" -NEXT_PUBLIC_GRAPHQL_ENDPOINT="https://torii.cartridge.gg" +NEXT_PUBLIC_DISABLE_MEDIAPLAYER_AUTOPLAY="true" +NEXT_PUBLIC_RPC_ENDPOINT="https://api.cartridge.gg/x/shinai/madara" +NEXT_PUBLIC_GRAPHQL_ENDPOINT="http://localhost:8080" NEXT_PUBLIC_ADMIN_ADDRESS="0x2" -NEXT_PUBLIC_ADMIN_PRIVATE_KEY="0x00c1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" +NEXT_PUBLIC_ADMIN_PRIVATE_KEY="0xc1cf1490de1352865301bb8705143f3ef938f97fdf892f1090dcb5ac7bcd1d" NEXT_PUBLIC_ACCOUNT_CLASS_HASH="0x006280083f8c2a2db9f737320d5e3029b380e0e820fe24b8d312a6a34fdba0cd" \ No newline at end of file diff --git a/web/.eslintignore b/web/.eslintignore new file mode 100644 index 000000000..b94707787 --- /dev/null +++ b/web/.eslintignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ diff --git a/web/lib/starknet-estfee-tx-ver/dist/index.d.ts b/web/lib/starknet-estfee-tx-ver/dist/index.d.ts new file mode 100644 index 000000000..b24f628c0 --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/dist/index.d.ts @@ -0,0 +1,4109 @@ +import * as weierstrass from '@noble/curves/abstract/weierstrass'; +import * as poseidon from '@noble/curves/abstract/poseidon'; +import * as json$1 from 'lossless-json'; +import * as microStarknet from 'micro-starknet'; + +declare const IS_BROWSER: boolean; +declare function arrayBufferToString(array: ArrayBuffer): string; +declare function stringToArrayBuffer(s: string): Uint8Array; +declare function atobUniversal(a: string): Uint8Array; +declare function btoaUniversal(b: ArrayBuffer): string; +declare function buf2hex(buffer: Uint8Array): string; +/** + * Some function imported from https://github.com/pedrouid/enc-utils/blob/master/src/index.ts + * enc-utils is no dependency to avoid using `Buffer` which just works in node and no browsers + */ +declare function removeHexPrefix(hex: string): string; +declare function addHexPrefix(hex: string): string; +declare function padLeft(str: string, length: number, padding?: string): string; +declare function calcByteLength(length: number, byteSize?: number): number; +declare function sanitizeBytes(str: string, byteSize?: number, padding?: string): string; +declare function sanitizeHex(hex: string): string; +declare function utf8ToArray(str: string): Uint8Array; + +declare const encode_IS_BROWSER: typeof IS_BROWSER; +declare const encode_addHexPrefix: typeof addHexPrefix; +declare const encode_arrayBufferToString: typeof arrayBufferToString; +declare const encode_atobUniversal: typeof atobUniversal; +declare const encode_btoaUniversal: typeof btoaUniversal; +declare const encode_buf2hex: typeof buf2hex; +declare const encode_calcByteLength: typeof calcByteLength; +declare const encode_padLeft: typeof padLeft; +declare const encode_removeHexPrefix: typeof removeHexPrefix; +declare const encode_sanitizeBytes: typeof sanitizeBytes; +declare const encode_sanitizeHex: typeof sanitizeHex; +declare const encode_stringToArrayBuffer: typeof stringToArrayBuffer; +declare const encode_utf8ToArray: typeof utf8ToArray; +declare namespace encode { + export { + encode_IS_BROWSER as IS_BROWSER, + encode_addHexPrefix as addHexPrefix, + encode_arrayBufferToString as arrayBufferToString, + encode_atobUniversal as atobUniversal, + encode_btoaUniversal as btoaUniversal, + encode_buf2hex as buf2hex, + encode_calcByteLength as calcByteLength, + encode_padLeft as padLeft, + encode_removeHexPrefix as removeHexPrefix, + encode_sanitizeBytes as sanitizeBytes, + encode_sanitizeHex as sanitizeHex, + encode_stringToArrayBuffer as stringToArrayBuffer, + encode_utf8ToArray as utf8ToArray, + }; +} + +declare const ZERO = 0n; +declare const MASK_250: bigint; +declare const MASK_251: bigint; +declare const API_VERSION = 0n; +declare enum BaseUrl { + SN_MAIN = "https://alpha-mainnet.starknet.io", + SN_GOERLI = "https://alpha4.starknet.io", + SN_GOERLI2 = "https://alpha4-2.starknet.io" +} +declare enum NetworkName { + SN_MAIN = "SN_MAIN", + SN_GOERLI = "SN_GOERLI", + SN_GOERLI2 = "SN_GOERLI2" +} +declare enum StarknetChainId { + SN_MAIN = "0x534e5f4d41494e", + SN_GOERLI = "0x534e5f474f45524c49", + SN_GOERLI2 = "0x534e5f474f45524c4932" +} +declare enum TransactionHashPrefix { + DECLARE = "0x6465636c617265", + DEPLOY = "0x6465706c6f79", + DEPLOY_ACCOUNT = "0x6465706c6f795f6163636f756e74", + INVOKE = "0x696e766f6b65", + L1_HANDLER = "0x6c315f68616e646c6572" +} +declare const UDC: { + ADDRESS: string; + ENTRYPOINT: string; +}; +/** + * The following is taken from https://github.com/starkware-libs/starkex-resources/blob/master/crypto/starkware/crypto/signature/pedersen_params.json but converted to hex, because JS is very bad handling big integers by default + * Please do not edit until the JSON changes. + */ +declare const FIELD_PRIME = "800000000000011000000000000000000000000000000000000000000000001"; +declare const FIELD_GEN = "3"; +declare const FIELD_SIZE = 251; +declare const EC_ORDER = "800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F"; +declare const ALPHA = "1"; +declare const BETA = "6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89"; +declare const MAX_ECDSA_VAL = "800000000000000000000000000000000000000000000000000000000000000"; +declare const CONSTANT_POINTS: string[][]; + +declare const constants_ALPHA: typeof ALPHA; +declare const constants_API_VERSION: typeof API_VERSION; +declare const constants_BETA: typeof BETA; +type constants_BaseUrl = BaseUrl; +declare const constants_BaseUrl: typeof BaseUrl; +declare const constants_CONSTANT_POINTS: typeof CONSTANT_POINTS; +declare const constants_EC_ORDER: typeof EC_ORDER; +declare const constants_FIELD_GEN: typeof FIELD_GEN; +declare const constants_FIELD_PRIME: typeof FIELD_PRIME; +declare const constants_FIELD_SIZE: typeof FIELD_SIZE; +declare const constants_IS_BROWSER: typeof IS_BROWSER; +declare const constants_MASK_250: typeof MASK_250; +declare const constants_MASK_251: typeof MASK_251; +declare const constants_MAX_ECDSA_VAL: typeof MAX_ECDSA_VAL; +type constants_NetworkName = NetworkName; +declare const constants_NetworkName: typeof NetworkName; +type constants_StarknetChainId = StarknetChainId; +declare const constants_StarknetChainId: typeof StarknetChainId; +type constants_TransactionHashPrefix = TransactionHashPrefix; +declare const constants_TransactionHashPrefix: typeof TransactionHashPrefix; +declare const constants_UDC: typeof UDC; +declare const constants_ZERO: typeof ZERO; +declare namespace constants { + export { + constants_ALPHA as ALPHA, + constants_API_VERSION as API_VERSION, + constants_BETA as BETA, + constants_BaseUrl as BaseUrl, + constants_CONSTANT_POINTS as CONSTANT_POINTS, + constants_EC_ORDER as EC_ORDER, + constants_FIELD_GEN as FIELD_GEN, + constants_FIELD_PRIME as FIELD_PRIME, + constants_FIELD_SIZE as FIELD_SIZE, + constants_IS_BROWSER as IS_BROWSER, + constants_MASK_250 as MASK_250, + constants_MASK_251 as MASK_251, + constants_MAX_ECDSA_VAL as MAX_ECDSA_VAL, + constants_NetworkName as NetworkName, + constants_StarknetChainId as StarknetChainId, + constants_TransactionHashPrefix as TransactionHashPrefix, + constants_UDC as UDC, + constants_ZERO as ZERO, + }; +} + +declare const ec_weierstrass: typeof weierstrass; +declare namespace ec { + export { + microStarknet as starkCurve, + ec_weierstrass as weierstrass, + }; +} + +/** ABI */ +type Abi = Array; +type AbiEntry = { + name: string; + type: 'felt' | 'felt*' | string; +}; +declare enum FunctionAbiType { + 'function' = 0, + 'l1_handler' = 1, + 'constructor' = 2 +} +type FunctionAbi = { + inputs: AbiEntry[]; + name: string; + outputs: AbiEntry[]; + stateMutability?: 'view'; + state_mutability?: string; + type: FunctionAbiType; +}; +type AbiStructs = { + [name: string]: StructAbi; +}; +type StructAbi = { + members: (AbiEntry & { + offset: number; + })[]; + name: string; + size: number; + type: 'struct'; +}; +type EventAbi = any; + +/** LEGACY CONTRACT */ +/** + * format produced after compressing 'program' property + */ +type LegacyContractClass = { + program: CompressedProgram; + entry_points_by_type: EntryPointsByType; + abi: Abi; +}; +/** + * format produced after compile .cairo to .json + */ +type LegacyCompiledContract = Omit & { + program: Program; +}; +/** SUBTYPES */ +type Builtins = string[]; +type CompressedProgram = string; +type EntryPointsByType = { + CONSTRUCTOR: ContractEntryPointFields[]; + EXTERNAL: ContractEntryPointFields[]; + L1_HANDLER: ContractEntryPointFields[]; +}; +type ContractEntryPointFields = { + selector: string; + offset: string; + builtins?: Builtins; +}; +interface Program extends Record { + builtins: string[]; + data: string[]; +} + +/** SYSTEM TYPES */ +type CairoAssembly = { + prime: string; + compiler_version: string; + bytecode: ByteCode; + hints: any[]; + pythonic_hints: PythonicHints; + entry_points_by_type: EntryPointsByType; +}; +/** COMPILED CONTRACT */ +/** + * format produced after starknet-compile .cairo to .json + * sierra_program is hex array + */ +type CompiledSierra = { + sierra_program: ByteCode; + sierra_program_debug_info?: SierraProgramDebugInfo; + contract_class_version: string; + entry_points_by_type: SierraEntryPointsByType; + abi: Abi; +}; +/** + * format produced after compressing 'sierra_program', stringifies 'abi' property and omit sierra_program_debug_info + * CompressedCompiledSierra + */ +type SierraContractClass = Omit & { + sierra_program: string; + abi: string; +}; +type CompiledSierraCasm = CairoAssembly; +/** SUBTYPES */ +type ByteCode = string[]; +type PythonicHints = [number, string[]][]; +type SierraProgramDebugInfo = { + type_names: [number, string][]; + libfunc_names: [number, string][]; + user_func_names: [number, string][]; +}; +type SierraEntryPointsByType = { + CONSTRUCTOR: SierraContractEntryPointFields[]; + EXTERNAL: SierraContractEntryPointFields[]; + L1_HANDLER: SierraContractEntryPointFields[]; +}; +type SierraContractEntryPointFields = { + selector: string; + function_idx: number; +}; + +/** + * format produced after compressing compiled contract + * CompressedCompiledContract + */ +type ContractClass$1 = LegacyContractClass | SierraContractClass; +/** + * format produced after compile .cairo to .json + */ +type CompiledContract = LegacyCompiledContract | CompiledSierra; +/** + * Compressed or decompressed Cairo0 or Cairo1 Contract + */ +type CairoContract = ContractClass$1 | CompiledContract; +declare enum EntryPointType { + EXTERNAL = "EXTERNAL", + L1_HANDLER = "L1_HANDLER", + CONSTRUCTOR = "CONSTRUCTOR" +} + +type WeierstrassSignatureType = weierstrass.SignatureType; +type ArraySignatureType = string[]; +type Signature = ArraySignatureType | WeierstrassSignatureType; +type BigNumberish = string | number | bigint; +/** + * Compiled calldata ready to be sent + * decimal-string array + */ +type Calldata = string[] & { + readonly __compiled__?: boolean; +}; +/** + * Represents an integer in the range [0, 2^256) + */ +interface Uint256 { + low: BigNumberish; + high: BigNumberish; +} +/** + * BigNumberish array + * use CallData.compile() to convert to Calldata + */ +type RawCalldata = BigNumberish[]; +/** + * Hexadecimal-string array + */ +type HexCalldata = string[]; +type AllowArray = T | T[]; +type OptionalPayload = { + payload: T; +} | T; +type RawArgs = RawArgsObject | RawArgsArray; +type RawArgsObject = { + [inputName: string]: MultiType | MultiType[] | RawArgs; +}; +type RawArgsArray = Array; +type MultiType = BigNumberish | Uint256 | object | boolean; +type UniversalDeployerContractPayload = { + classHash: BigNumberish; + salt?: string; + unique?: boolean; + constructorCalldata?: RawArgs; +}; +type DeployAccountContractPayload = { + classHash: string; + constructorCalldata?: RawArgs; + addressSalt?: BigNumberish; + contractAddress?: string; +}; +type DeployAccountContractTransaction = Omit & { + signature?: Signature; +}; +type DeclareContractPayload = { + contract: CompiledContract | string; + classHash?: string; + casm?: CompiledSierraCasm; + compiledClassHash?: string; +}; +type CompleteDeclareContractPayload = { + contract: CompiledContract | string; + classHash: string; + casm?: CompiledSierraCasm; + compiledClassHash?: string; +}; +type DeclareAndDeployContractPayload = Omit & DeclareContractPayload; +type DeclareContractTransaction = { + contract: ContractClass$1; + senderAddress: string; + signature?: Signature; + compiledClassHash?: string; +}; +type CallDetails = { + contractAddress: string; + calldata?: RawArgs | Calldata; + entrypoint?: string; +}; +type Invocation = CallDetails & { + signature?: Signature; +}; +type Call = CallDetails & { + entrypoint: string; +}; +type CairoVersion = '0' | '1'; +type InvocationsDetails = { + nonce?: BigNumberish; + maxFee?: BigNumberish; + version?: BigNumberish; +}; +/** + * Contain all additional details params + */ +type Details = { + nonce: BigNumberish; + maxFee: BigNumberish; + version: BigNumberish; + chainId: StarknetChainId; +}; +type InvocationsDetailsWithNonce = InvocationsDetails & { + nonce: BigNumberish; +}; +declare enum TransactionType$1 { + DECLARE = "DECLARE", + DEPLOY = "DEPLOY", + DEPLOY_ACCOUNT = "DEPLOY_ACCOUNT", + INVOKE = "INVOKE_FUNCTION" +} +declare enum TransactionStatus { + NOT_RECEIVED = "NOT_RECEIVED", + RECEIVED = "RECEIVED", + ACCEPTED_ON_L2 = "ACCEPTED_ON_L2", + ACCEPTED_ON_L1 = "ACCEPTED_ON_L1", + REJECTED = "REJECTED" +} +declare enum BlockStatus { + PENDING = "PENDING", + ACCEPTED_ON_L1 = "ACCEPTED_ON_L1", + ACCEPTED_ON_L2 = "ACCEPTED_ON_L2", + REJECTED = "REJECTED" +} +declare enum BlockTag { + pending = "pending", + latest = "latest" +} +type BlockNumber = BlockTag | null | number; +/** + * hex string and BN are detected as block hashes + * decimal string and number are detected as block numbers + * null appends nothing to the request url + */ +type BlockIdentifier = BlockNumber | BigNumberish; +/** + * items used by AccountInvocations + */ +type AccountInvocationItem = (({ + type: TransactionType$1.DECLARE; +} & DeclareContractTransaction) | ({ + type: TransactionType$1.DEPLOY_ACCOUNT; +} & DeployAccountContractTransaction) | ({ + type: TransactionType$1.INVOKE; +} & Invocation)) & InvocationsDetailsWithNonce; +/** + * Complete invocations array with account details (internal type from account -> provider) + */ +type AccountInvocations = AccountInvocationItem[]; +/** + * Invocations array user provide to bulk method (simulate) + */ +type Invocations = Array<({ + type: TransactionType$1.DECLARE; +} & OptionalPayload) | ({ + type: TransactionType$1.DEPLOY; +} & OptionalPayload>) | ({ + type: TransactionType$1.DEPLOY_ACCOUNT; +} & OptionalPayload) | ({ + type: TransactionType$1.INVOKE; +} & OptionalPayload>)>; +type Tupled = { + element: any; + type: string; +}; +type Args = { + [inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[]; +}; +type ParsedStruct = { + [key: string]: BigNumberish | ParsedStruct; +}; +type waitForTransactionOptions = { + retryInterval?: number; + successStates?: Array; +}; +type getSimulateTransactionOptions = { + blockIdentifier?: BlockIdentifier; + skipValidate?: boolean; + skipExecute?: boolean; +}; +type getEstimateFeeBulkOptions = { + blockIdentifier?: BlockIdentifier; + skipValidate?: boolean; +}; +interface CallStruct { + to: string; + selector: string; + calldata: string[]; +} + +interface ProviderOptions { + sequencer?: SequencerProviderOptions; + rpc?: RpcProviderOptions; +} +type RpcProviderOptions = { + nodeUrl: string; + retries?: number; + headers?: object; + blockIdentifier?: BlockIdentifier; + chainId?: StarknetChainId; +}; +type SequencerHttpMethod = 'POST' | 'GET'; +type SequencerProviderOptions = { + headers?: Record; + blockIdentifier?: BlockIdentifier; + chainId?: StarknetChainId; +} & ({ + network: NetworkName | StarknetChainId; +} | { + baseUrl: string; + feederGatewayUrl?: string; + gatewayUrl?: string; +}); + +/** + * Starknet RPC version 0.3.0 + * + * Starknet Node API 0.50.0 - rpc 0.3.0 + * Starknet Node Write API 0.4.0 - rpc 0.3.0 + * Starknet Trace API 0.4.0 - rpc 0.3.0 + * + * TypeScript Representation of OpenRpc protocol types + */ +type FELT = string; +type ADDRESS = FELT; +type NUM_AS_HEX = string; +type SIGNATURE = Array; +type BLOCK_NUMBER = number; +type BLOCK_HASH = FELT; +type TXN_HASH = FELT; +type TXN_STATUS = 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED'; +type TXN_TYPE = 'DECLARE' | 'DEPLOY' | 'DEPLOY_ACCOUNT' | 'INVOKE' | 'L1_HANDLER'; +type BLOCK_STATUS = 'PENDING' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED'; +declare enum BLOCK_TAG { + latest = "latest", + pending = "pending" +} +type BLOCK_ID = { + block_hash: BLOCK_HASH; +} | { + block_number: BLOCK_NUMBER; +} | BLOCK_TAG; +type MSG_TO_L1 = { + to_address: FELT; + payload: Array; +}; +type EVENT = { + from_address: FELT; + keys: Array; + data: Array; +}; +type COMMON_RECEIPT_PROPERTIES = { + transaction_hash: TXN_HASH; + actual_fee: FELT; + status: TXN_STATUS; + block_hash?: BLOCK_HASH; + block_number?: BLOCK_NUMBER; + messages_sent: Array; + events: Array; +}; +type PENDING_COMMON_RECEIPT_PROPERTIES = { + transaction_hash: TXN_HASH; + actual_fee: FELT; + type?: TXN_TYPE; + messages_sent: Array; + events: Array; +}; +type INVOKE_TXN_RECEIPT = { + type: 'INVOKE'; +} & COMMON_RECEIPT_PROPERTIES; +type DECLARE_TXN_RECEIPT = { + type: 'DECLARE'; +} & COMMON_RECEIPT_PROPERTIES; +type DEPLOY_TXN_RECEIPT = { + type: 'DEPLOY'; + contract_address: FELT; +} & COMMON_RECEIPT_PROPERTIES; +type L1_HANDLER_TXN_RECEIPT = { + type: 'L1_HANDLER'; +} & COMMON_RECEIPT_PROPERTIES; +type PENDING_DEPLOY_TXN_RECEIPT = { + contract_address: FELT; +} & PENDING_COMMON_RECEIPT_PROPERTIES; +type PENDING_TXN_RECEIPT = PENDING_DEPLOY_TXN_RECEIPT | PENDING_COMMON_RECEIPT_PROPERTIES; +type TXN_RECEIPT = INVOKE_TXN_RECEIPT | L1_HANDLER_TXN_RECEIPT | DECLARE_TXN_RECEIPT | DEPLOY_TXN_RECEIPT | DEPLOY_ACCOUNT_TXN_RECEIPT | PENDING_TXN_RECEIPT; +type BLOCK_HEADER = { + block_hash: BLOCK_HASH; + parent_hash: BLOCK_HASH; + block_number: BLOCK_NUMBER; + new_root: FELT; + timestamp: number; + sequencer_address: FELT; +}; +type BLOCK_BODY_WITH_TX_HASHES = { + transactions: Array; +}; +type BLOCK_WITH_TX_HASHES = { + status: BLOCK_STATUS; +} & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES; +type PENDING_BLOCK_WITH_TX_HASHES = BLOCK_BODY_WITH_TX_HASHES & { + timestamp: number; + sequencer_address: FELT; + parent_hash: BLOCK_HASH; +}; +type COMMON_TXN_PROPERTIES = { + transaction_hash: TXN_HASH; +} & BROADCASTED_TXN_COMMON_PROPERTIES; +type FUNCTION_CALL = { + contract_address: ADDRESS; + entry_point_selector: FELT; + calldata: Array; +}; +type INVOKE_TXN = { + type: 'INVOKE'; +} & COMMON_TXN_PROPERTIES & (INVOKE_TXN_V0 | INVOKE_TXN_V1); +type DECLARE_TXN = DECLARE_TXN_V1 | DECLARE_TXN_V2; +type DECLARE_TXN_V1 = COMMON_TXN_PROPERTIES & { + type: 'DECLARE'; + class_hash: FELT; + sender_address: ADDRESS; +}; +type DECLARE_TXN_V2 = DECLARE_TXN_V1 & { + compiled_class_hash: FELT; +}; +type DEPLOY_TXN = { + transaction_hash: TXN_HASH; + class_hash: FELT; +} & DEPLOY_TXN_PROPERTIES; +type DEPLOY_ACCOUNT_TXN = COMMON_TXN_PROPERTIES & DEPLOY_ACCOUNT_TXN_PROPERTIES; +type DEPLOY_ACCOUNT_TXN_PROPERTIES = { + type: 'DEPLOY_ACCOUNT'; + contract_address_salt: FELT; + constructor_calldata: Array; + class_hash: FELT; +}; +type DEPLOY_ACCOUNT_TXN_RECEIPT = COMMON_RECEIPT_PROPERTIES & { + type: 'DEPLOY_ACCOUNT'; + contract_address: FELT; +}; +type TXN = INVOKE_TXN | L1_HANDLER_TXN | DECLARE_TXN | DEPLOY_TXN | DEPLOY_ACCOUNT_TXN; +declare enum L1_HANDLER { + 'L1_HANDLER' = 0 +} +type L1_HANDLER_TXN = { + transaction_hash: TXN_HASH; + version: NUM_AS_HEX; + type: L1_HANDLER; + nonce: NUM_AS_HEX; +} & FUNCTION_CALL; +type BROADCASTED_DEPLOY_ACCOUNT_TXN = BROADCASTED_TXN_COMMON_PROPERTIES & DEPLOY_ACCOUNT_TXN_PROPERTIES; +type BROADCASTED_TXN = BROADCASTED_INVOKE_TXN | BROADCASTED_DECLARE_TXN | BROADCASTED_DEPLOY_ACCOUNT_TXN; +type BROADCASTED_INVOKE_TXN = BROADCASTED_TXN_COMMON_PROPERTIES & { + type: 'INVOKE'; +} & (INVOKE_TXN_V0 | INVOKE_TXN_V1); +type BROADCASTED_TXN_COMMON_PROPERTIES = { + max_fee: FELT; + version: NUM_AS_HEX; + signature: SIGNATURE; + nonce: FELT; +}; +type BROADCASTED_DECLARE_TXN = BROADCASTED_DECLARE_TXN_V1 | BROADCASTED_DECLARE_TXN_V2; +type BROADCASTED_DECLARE_TXN_V1 = { + type: 'DECLARE'; + contract_class: DEPRECATED_CONTRACT_CLASS; + sender_address: ADDRESS; +} & BROADCASTED_TXN_COMMON_PROPERTIES; +type BROADCASTED_DECLARE_TXN_V2 = { + type: 'DECLARE'; + contract_class: CONTRACT_CLASS; + sender_address: ADDRESS; + compiled_class_hash: FELT; +} & BROADCASTED_TXN_COMMON_PROPERTIES; +type DEPLOY_TXN_PROPERTIES = { + type: 'DEPLOY'; + version: NUM_AS_HEX; + contract_address_salt: FELT; + constructor_calldata: Array; +}; +type INVOKE_TXN_V0 = FUNCTION_CALL; +type INVOKE_TXN_V1 = { + sender_address: ADDRESS; + calldata: Array; +}; +type BLOCK_BODY_WITH_TXS = { + transactions: Array; +}; +type BLOCK_WITH_TXS = { + status: BLOCK_STATUS; +} & BLOCK_HEADER & BLOCK_BODY_WITH_TXS; +type PENDING_BLOCK_WITH_TXS = BLOCK_BODY_WITH_TXS & { + timestamp: number; + sequencer_address: FELT; + parent_hash: BLOCK_HASH; +}; +type CONTRACT_CLASS = { + sierra_program: Array; + contract_class_version: string; + entry_points_by_type: { + CONSTRUCTOR: Array; + EXTERNAL: Array; + L1_HANDLER: Array; + }; + abi?: string; +}; +type DEPRECATED_CONTRACT_CLASS = { + program: string; + entry_points_by_type: { + CONSTRUCTOR: Array; + EXTERNAL: Array; + L1_HANDLER: Array; + }; + abi?: CONTRACT_ABI; +}; +type CONTRACT_ABI = Array; +type CONTRACT_ABI_ENTRY = FUNCTION_ABI_ENTRY | EVENT_ABI_ENTRY | STRUCT_ABI_ENTRY; +declare enum STRUCT_ABI_TYPE { + 'struct' = 0 +} +declare enum EVENT_ABI_TYPE { + 'event' = 0 +} +declare enum FUNCTION_ABI_TYPE { + 'function' = 0, + 'l1_handler' = 1, + 'constructor' = 2 +} +type STRUCT_ABI_ENTRY = STRUCT_ABI_TYPE & { + name: string; + size: number; + members: Array; +}; +type STRUCT_MEMBER = { + offset: number; +} & TYPED_PARAMETER; +type EVENT_ABI_ENTRY = { + name: string; + keys: Array; + data: Array; +} & EVENT_ABI_TYPE; +type FUNCTION_ABI_ENTRY = { + type: FUNCTION_ABI_TYPE; + name: string; + inputs: Array; + outputs: Array; +}; +type TYPED_PARAMETER = { + name: string; + type: string; +}; +type DEPRECATED_CAIRO_ENTRY_POINT = { + offset: NUM_AS_HEX; + selector: FELT; +}; +type SIERRA_ENTRY_POINT = { + selector: FELT; + function_idx: number; +}; +type CONTRACT_STORAGE_DIFF_ITEM = { + address: FELT; + storage_entries: { + key: FELT; + value: FELT; + }[]; +}; +type DEPLOYED_CONTRACT_ITEM = { + address: FELT; + class_hash: FELT; +}; +type STATE_UPDATE = { + block_hash: BLOCK_HASH; + new_root: FELT; +} & PENDING_STATE_UPDATE; +type PENDING_STATE_UPDATE = { + old_root: FELT; + state_diff: { + storage_diffs: Array; + deprecated_declared_classes: Array; + declared_classes: Array<{ + class_hash: FELT; + compiled_class_hash: FELT; + }>; + deployed_contracts: Array; + replaced_classes: Array<{ + contract_address: ADDRESS; + class_hash: FELT; + }>; + nonces: Array<{ + contract_address: ADDRESS; + nonce: FELT; + }>; + }; +}; +type STORAGE_KEY = string; +type EVENT_FILTER = { + from_block: BLOCK_ID; + to_block: BLOCK_ID; + address: ADDRESS; + keys: Array>; +}; +type EVENTS_CHUNK = { + events: Array; + continuation_token?: string; +}; +type RESULT_PAGE_REQUEST = { + continuation_token?: string; + chunk_size: number; +}; +type EMITTED_EVENT = EVENT & { + block_hash: BLOCK_HASH; + block_number: BLOCK_NUMBER; + transaction_hash: TXN_HASH; +}; +type SYNC_STATUS = { + starting_block_hash: BLOCK_HASH; + starting_block_num: NUM_AS_HEX; + current_block_hash: BLOCK_HASH; + current_block_num: NUM_AS_HEX; + highest_block_hash: BLOCK_HASH; + highest_block_num: NUM_AS_HEX; +}; +type FEE_ESTIMATE = { + gas_consumed: NUM_AS_HEX; + gas_price: NUM_AS_HEX; + overall_fee: NUM_AS_HEX; +}; +declare enum CALL_TYPE { + 'LIBRARY_CALL' = 0, + 'CALL' = 1 +} +declare enum ENTRY_POINT_TYPE { + 'EXTERNAL' = 0, + 'L1_HANDLER' = 1, + 'CONSTRUCTOR' = 2 +} +type FUNCTION_INVOCATION = FUNCTION_CALL & { + caller_address: FELT; + code_address: FELT; + entry_point_type: ENTRY_POINT_TYPE; + call_type: CALL_TYPE; + result: FELT; + calls: NESTED_CALL; + events: Array; + messages: MSG_TO_L1; +}; +type NESTED_CALL = FUNCTION_INVOCATION; +type INVOKE_TXN_TRACE = { + validate_invocation: FUNCTION_INVOCATION; + execute_invocation: FUNCTION_INVOCATION; + fee_transfer_invocation: FUNCTION_INVOCATION; +}; +type DECLARE_TXN_TRACE = { + validate_invocation: FUNCTION_INVOCATION; + fee_transfer_invocation: FUNCTION_INVOCATION; +}; +type DEPLOY_ACCOUNT_TXN_TRACE = { + validate_invocation: FUNCTION_INVOCATION; + constructor_invocation: FUNCTION_INVOCATION; + fee_transfer_invocation: FUNCTION_INVOCATION; +}; +type L1_HANDLER_TXN_TRACE = { + function_invocation: FUNCTION_INVOCATION; +}; +type TRANSACTION_TRACE = INVOKE_TXN_TRACE | DECLARE_TXN_TRACE | DEPLOY_ACCOUNT_TXN_TRACE | L1_HANDLER_TXN_TRACE; +declare enum SIMULATION_FLAG$1 { + SKIP_VALIDATE = 0, + SKIP_EXECUTE = 1 +} +declare namespace OPENRPC { + type Nonce = FELT; + type BlockWithTxHashes = BLOCK_WITH_TX_HASHES | PENDING_BLOCK_WITH_TX_HASHES; + type BlockWithTxs = BLOCK_WITH_TXS | PENDING_BLOCK_WITH_TXS; + type StateUpdate = STATE_UPDATE | PENDING_STATE_UPDATE; + type Storage = FELT; + type Transaction = TXN; + type TransactionReceipt = TXN_RECEIPT; + type ContractClass = CONTRACT_CLASS; + type DeprecatedContractClass = DEPRECATED_CONTRACT_CLASS; + type CallResponse = Array; + type EstimatedFee = FEE_ESTIMATE; + type BlockNumber = BLOCK_NUMBER; + type BlockHashAndNumber = { + block_hash: BLOCK_HASH; + block_number: BLOCK_NUMBER; + }; + type CHAIN_ID = string; + type PendingTransactions = Array; + type SyncingStatus = false | SYNC_STATUS; + type Events = EVENTS_CHUNK; + type Trace = TRANSACTION_TRACE; + type Traces = Array<{ + transaction_hash: FELT; + trace_root: TRANSACTION_TRACE; + }>; + type TransactionHash = TXN_HASH; + type BlockHash = BLOCK_HASH; + type EventFilter = EVENT_FILTER & RESULT_PAGE_REQUEST; + type InvokedTransaction = { + transaction_hash: TXN_HASH; + }; + type DeclaredTransaction = { + transaction_hash: TXN_HASH; + class_hash: FELT; + }; + type DeployedTransaction = { + transaction_hash: TXN_HASH; + contract_address: FELT; + }; + type BroadcastedTransaction = BROADCASTED_TXN; + type SimulationFlags = Array; + type SimulatedTransaction = { + transaction_trace: Trace; + fee_estimation: EstimatedFee; + }; + type SimulatedTransactions = SimulatedTransaction[]; + type Methods = { + starknet_getBlockWithTxHashes: { + params: { + block_id: BLOCK_ID; + }; + result: BlockWithTxHashes; + errors: Errors.BLOCK_NOT_FOUND; + }; + starknet_getBlockWithTxs: { + params: { + block_id: BLOCK_ID; + }; + result: BlockWithTxs; + errors: Errors.BLOCK_NOT_FOUND; + }; + starknet_getStateUpdate: { + params: { + block_id: BLOCK_ID; + }; + result: StateUpdate; + errors: Errors.BLOCK_NOT_FOUND; + }; + starknet_getStorageAt: { + params: { + contract_address: ADDRESS; + key: STORAGE_KEY; + block_id: BLOCK_ID; + }; + result: Storage; + errors: Errors.CONTRACT_NOT_FOUND | Errors.BLOCK_NOT_FOUND; + }; + starknet_getTransactionByHash: { + params: { + transaction_hash: TXN_HASH; + }; + result: Transaction; + errors: Errors.TXN_HASH_NOT_FOUND; + }; + starknet_getTransactionByBlockIdAndIndex: { + params: { + block_id: BLOCK_ID; + index: number; + }; + result: Transaction; + errors: Errors.BLOCK_NOT_FOUND | Errors.INVALID_TXN_INDEX; + }; + starknet_getTransactionReceipt: { + params: { + transaction_hash: TXN_HASH; + }; + result: TransactionReceipt; + errors: Errors.TXN_HASH_NOT_FOUND; + }; + starknet_getClass: { + params: { + block_id: BLOCK_ID; + class_hash: FELT; + }; + result: ContractClass | DeprecatedContractClass; + errors: Errors.BLOCK_NOT_FOUND | Errors.CLASS_HASH_NOT_FOUND; + }; + starknet_getClassHashAt: { + params: { + block_id: BLOCK_ID; + contract_address: ADDRESS; + }; + result: FELT; + errors: Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND; + }; + starknet_getClassAt: { + params: { + block_id: BLOCK_ID; + contract_address: ADDRESS; + }; + result: ContractClass | DeprecatedContractClass; + errors: Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND; + }; + starknet_getBlockTransactionCount: { + params: { + block_id: BLOCK_ID; + }; + result: number; + errors: Errors.BLOCK_NOT_FOUND; + }; + starknet_call: { + params: { + request: FUNCTION_CALL; + block_id: BLOCK_ID; + }; + result: Array; + errors: Errors.CONTRACT_NOT_FOUND | Errors.INVALID_MESSAGE_SELECTOR | Errors.INVALID_CALL_DATA | Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND; + }; + starknet_estimateFee: { + params: { + request: Array; + block_id: BLOCK_ID; + }; + result: Array; + errors: Errors.CONTRACT_NOT_FOUND | Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND; + }; + starknet_blockNumber: { + params: {}; + result: BLOCK_NUMBER; + errors: Errors.NO_BLOCKS; + }; + starknet_blockHashAndNumber: { + params: {}; + result: BLOCK_HASH & BLOCK_NUMBER; + errors: Errors.NO_BLOCKS; + }; + starknet_chainId: { + params: {}; + result: CHAIN_ID; + }; + starknet_pendingTransactions: { + params: {}; + result: PendingTransactions; + }; + starknet_syncing: { + params: {}; + result: SyncingStatus; + }; + starknet_getEvents: { + params: { + filter: EVENT_FILTER & RESULT_PAGE_REQUEST; + }; + result: Events; + errors: Errors.PAGE_SIZE_TOO_BIG | Errors.INVALID_CONTINUATION_TOKEN | Errors.BLOCK_NOT_FOUND | Errors.TOO_MANY_KEYS_IN_FILTER; + }; + starknet_getNonce: { + params: { + block_id: BLOCK_ID; + contract_address: ADDRESS; + }; + result: FELT; + errors: Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND; + }; + starknet_addInvokeTransaction: { + params: { + invoke_transaction: BROADCASTED_INVOKE_TXN; + }; + result: InvokedTransaction; + }; + starknet_addDeclareTransaction: { + params: { + declare_transaction: BROADCASTED_DECLARE_TXN; + }; + result: DeclaredTransaction; + errors: Errors.INVALID_CONTRACT_CLASS | Errors.CLASS_ALREADY_DECLARED; + }; + starknet_addDeployAccountTransaction: { + params: { + deploy_account_transaction: BROADCASTED_DEPLOY_ACCOUNT_TXN; + }; + result: { + transaction_hash: TXN_HASH; + contract_address: FELT; + }; + errors: Errors.CLASS_HASH_NOT_FOUND; + }; + starknet_traceTransaction: { + params: { + transaction_hash: TXN_HASH; + }; + result: Trace; + errors: Errors.TXN_HASH_NOT_FOUND | Errors.NO_TRACE_AVAILABLE | Errors.INVALID_BLOCK_HASH | Errors.TXN_HASH_NOT_FOUND; + }; + starknet_traceBlockTransactions: { + params: { + block_hash: BLOCK_HASH; + }; + result: Traces; + errors: Errors.INVALID_BLOCK_HASH; + }; + starknet_simulateTransaction: { + params: { + block_id: BLOCK_ID; + transactions: Array; + simulation_flags: Array; + }; + result: SimulatedTransactions; + errors: Errors.CONTRACT_NOT_FOUND | Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND; + }; + }; +} +declare namespace Errors { + interface FAILED_TO_RECEIVE_TXN { + code: 1; + message: 'Failed to write transaction'; + } + interface CONTRACT_NOT_FOUND { + code: 20; + message: 'Contract not found'; + } + interface INVALID_MESSAGE_SELECTOR { + code: 21; + message: 'Invalid message selector'; + } + interface INVALID_CALL_DATA { + code: 22; + message: 'Invalid call data'; + } + interface BLOCK_NOT_FOUND { + code: 24; + message: 'Block not found'; + } + interface INVALID_TXN_INDEX { + code: 27; + message: 'Invalid transaction index in a block'; + } + interface CLASS_HASH_NOT_FOUND { + code: 28; + message: 'Class hash not found'; + } + interface PAGE_SIZE_TOO_BIG { + code: 31; + message: 'Requested page size is too big'; + } + interface NO_BLOCKS { + code: 32; + message: 'There are no blocks'; + } + interface INVALID_CONTINUATION_TOKEN { + code: 33; + message: 'The supplied continuation token is invalid or unknown'; + } + interface TOO_MANY_KEYS_IN_FILTER { + code: 34; + message: 'Too many keys provided in a filter'; + } + interface CONTRACT_ERROR { + code: 40; + message: 'Contract error'; + } + interface INVALID_CONTRACT_CLASS { + code: 50; + message: 'Invalid contract class'; + } + interface CLASS_ALREADY_DECLARED { + code: 51; + message: 'Class already declared'; + } + interface NO_TRACE_AVAILABLE { + code: 10; + message: 'No trace available for transaction'; + data: { + status: 'RECEIVED' | 'REJECTED'; + }; + } + interface INVALID_BLOCK_HASH { + code: 24; + message: 'Invalid block hash'; + } + interface TXN_HASH_NOT_FOUND { + code: 25; + message: 'Transaction hash not found'; + } +} + +type Response = { + id: number; + jsonrpc: string; + result?: any; + error?: { + code: string; + message: string; + }; +}; +type ChainId = OPENRPC.CHAIN_ID; +type CallResponse = OPENRPC.CallResponse; +type ContractAddress = ADDRESS; +type Felt = FELT; +type Nonce$2 = OPENRPC.Nonce; +type ContractClass = OPENRPC.ContractClass | OPENRPC.DeprecatedContractClass; +type StateUpdate = OPENRPC.StateUpdate; +type Transaction$1 = OPENRPC.Transaction; +type PendingTransactions = OPENRPC.PendingTransactions; +type TransactionHash = OPENRPC.TransactionHash; +type Trace = OPENRPC.Trace; +type Traces = OPENRPC.Traces; +type BlockHash = OPENRPC.BlockHash; +type BlockHashAndNumber = OPENRPC.BlockHashAndNumber; +type EstimateFeeResponse$2 = OPENRPC.EstimatedFee; +type GetBlockWithTxHashesResponse = OPENRPC.BlockWithTxHashes; +type GetBlockWithTxs = OPENRPC.BlockWithTxs; +type GetStorageAtResponse = OPENRPC.Storage; +type TransactionReceipt = OPENRPC.TransactionReceipt; +type GetTransactionByHashResponse = OPENRPC.Transaction; +type GetTransactionByBlockIdAndIndex = OPENRPC.Transaction; +type GetTransactionCountResponse = number; +type GetBlockNumberResponse = OPENRPC.BlockNumber; +type GetSyncingStatsResponse = OPENRPC.SyncingStatus; +type EventFilter = OPENRPC.EventFilter; +type GetEventsResponse = OPENRPC.Events; +type InvokedTransaction = OPENRPC.InvokedTransaction; +type DeclaredTransaction = OPENRPC.DeclaredTransaction; +type DeployedTransaction = OPENRPC.DeployedTransaction; +type SimulationFlags$1 = OPENRPC.SimulationFlags; +type BroadcastedTransaction = OPENRPC.BroadcastedTransaction; +type EstimatedFee = OPENRPC.EstimatedFee; +type Methods = OPENRPC.Methods; +type Storage$2 = OPENRPC.Storage; +type SimulateTransactionResponse$2 = OPENRPC.SimulatedTransactions; +declare enum TransactionType { + DECLARE = "DECLARE", + DEPLOY = "DEPLOY", + DEPLOY_ACCOUNT = "DEPLOY_ACCOUNT", + INVOKE = "INVOKE", + L1_HANDLER = "L1_HANDLER" +} +type StorageDiffs$1 = Array; +type DeprecatedDeclaredClasses = Array; +type Nonces$1 = Array<{ + contract_address: ADDRESS; + nonce: FELT; +}>; +type ReplacedClasses$1 = Array<{ + contract_address: ADDRESS; + class_hash: FELT; +}>; + +type rpc_BlockHash = BlockHash; +type rpc_BlockHashAndNumber = BlockHashAndNumber; +type rpc_BroadcastedTransaction = BroadcastedTransaction; +type rpc_CallResponse = CallResponse; +type rpc_ChainId = ChainId; +type rpc_ContractAddress = ContractAddress; +type rpc_ContractClass = ContractClass; +type rpc_DeclaredTransaction = DeclaredTransaction; +type rpc_DeployedTransaction = DeployedTransaction; +type rpc_DeprecatedDeclaredClasses = DeprecatedDeclaredClasses; +type rpc_EstimatedFee = EstimatedFee; +type rpc_EventFilter = EventFilter; +type rpc_Felt = Felt; +type rpc_GetBlockNumberResponse = GetBlockNumberResponse; +type rpc_GetBlockWithTxHashesResponse = GetBlockWithTxHashesResponse; +type rpc_GetBlockWithTxs = GetBlockWithTxs; +type rpc_GetEventsResponse = GetEventsResponse; +type rpc_GetStorageAtResponse = GetStorageAtResponse; +type rpc_GetSyncingStatsResponse = GetSyncingStatsResponse; +type rpc_GetTransactionByBlockIdAndIndex = GetTransactionByBlockIdAndIndex; +type rpc_GetTransactionByHashResponse = GetTransactionByHashResponse; +type rpc_GetTransactionCountResponse = GetTransactionCountResponse; +type rpc_InvokedTransaction = InvokedTransaction; +type rpc_Methods = Methods; +type rpc_PendingTransactions = PendingTransactions; +type rpc_Response = Response; +type rpc_StateUpdate = StateUpdate; +type rpc_Trace = Trace; +type rpc_Traces = Traces; +type rpc_TransactionHash = TransactionHash; +type rpc_TransactionReceipt = TransactionReceipt; +type rpc_TransactionType = TransactionType; +declare const rpc_TransactionType: typeof TransactionType; +declare namespace rpc { + export { + rpc_BlockHash as BlockHash, + rpc_BlockHashAndNumber as BlockHashAndNumber, + rpc_BroadcastedTransaction as BroadcastedTransaction, + rpc_CallResponse as CallResponse, + rpc_ChainId as ChainId, + rpc_ContractAddress as ContractAddress, + rpc_ContractClass as ContractClass, + rpc_DeclaredTransaction as DeclaredTransaction, + rpc_DeployedTransaction as DeployedTransaction, + rpc_DeprecatedDeclaredClasses as DeprecatedDeclaredClasses, + EstimateFeeResponse$2 as EstimateFeeResponse, + rpc_EstimatedFee as EstimatedFee, + rpc_EventFilter as EventFilter, + rpc_Felt as Felt, + rpc_GetBlockNumberResponse as GetBlockNumberResponse, + rpc_GetBlockWithTxHashesResponse as GetBlockWithTxHashesResponse, + rpc_GetBlockWithTxs as GetBlockWithTxs, + rpc_GetEventsResponse as GetEventsResponse, + rpc_GetStorageAtResponse as GetStorageAtResponse, + rpc_GetSyncingStatsResponse as GetSyncingStatsResponse, + rpc_GetTransactionByBlockIdAndIndex as GetTransactionByBlockIdAndIndex, + rpc_GetTransactionByHashResponse as GetTransactionByHashResponse, + rpc_GetTransactionCountResponse as GetTransactionCountResponse, + rpc_InvokedTransaction as InvokedTransaction, + rpc_Methods as Methods, + Nonce$2 as Nonce, + Nonces$1 as Nonces, + rpc_PendingTransactions as PendingTransactions, + ReplacedClasses$1 as ReplacedClasses, + rpc_Response as Response, + SimulateTransactionResponse$2 as SimulateTransactionResponse, + SimulationFlags$1 as SimulationFlags, + rpc_StateUpdate as StateUpdate, + Storage$2 as Storage, + StorageDiffs$1 as StorageDiffs, + rpc_Trace as Trace, + rpc_Traces as Traces, + Transaction$1 as Transaction, + rpc_TransactionHash as TransactionHash, + rpc_TransactionReceipt as TransactionReceipt, + rpc_TransactionType as TransactionType, + }; +} + +type GetTransactionStatusResponse = { + tx_status: TransactionStatus; + block_hash?: string; + tx_failure_reason?: { + code: string; + error_message: string; + }; +}; +type GetContractAddressesResponse = { + Starknet: string; + GpsStatementVerifier: string; +}; +type FunctionInvocation = { + caller_address: string; + contract_address: string; + calldata: RawCalldata; + call_type?: string; + class_hash?: string; + selector?: string; + entry_point_type?: EntryPointType.EXTERNAL; + result: Array; + execution_resources: ExecutionResources; + internal_calls: Array; + events: Array; + messages: Array; +}; +type ExecutionResources = { + n_steps: number; + builtin_instance_counter: { + pedersen_builtin: number; + range_check_builtin: number; + bitwise_builtin: number; + output_builtin: number; + ecdsa_builtin: number; + ec_op_builtin?: number; + }; + n_memory_holes: number; +}; +type CallL1Handler = { + from_address: string; + to_address: string; + entry_point_selector: string; + payload: Array; +}; +type DeployedContractItem = { + address: string; + class_hash: string; +}; +type SequencerIdentifier = { + blockHash: string; +} | { + blockNumber: BlockNumber; +}; +type TransactionTraceResponse = { + validate_invocation?: FunctionInvocation; + function_invocation?: FunctionInvocation; + fee_transfer_invocation?: FunctionInvocation; + constructor_invocation?: FunctionInvocation; + signature: string[]; +}; +type DeclareTransaction = { + type: TransactionType$1.DECLARE; + sender_address: string; + contract_class: ContractClass$1; + signature?: string[]; + nonce: BigNumberish; + max_fee?: BigNumberish; + version?: BigNumberish; + compiled_class_hash?: string; +}; +type DeployTransaction = { + type: TransactionType$1.DEPLOY; + contract_definition: ContractClass$1; + contract_address_salt: BigNumberish; + constructor_calldata: string[]; + nonce?: BigNumberish; +}; +type DeployAccountTransaction = { + type: TransactionType$1.DEPLOY_ACCOUNT; + class_hash: string; + contract_address_salt: BigNumberish; + constructor_calldata: string[]; + signature?: string[]; + max_fee?: BigNumberish; + version?: BigNumberish; + nonce?: BigNumberish; +}; +type InvokeFunctionTransaction = { + type: TransactionType$1.INVOKE; + sender_address: string; + signature?: string[]; + entry_point_type?: EntryPointType.EXTERNAL; + calldata?: RawCalldata; + nonce: BigNumberish; + max_fee?: BigNumberish; + version?: BigNumberish; +}; +type Transaction = DeclareTransaction | DeployTransaction | InvokeFunctionTransaction | DeployAccountTransaction; +type AddTransactionResponse = { + transaction_hash: string; + code?: 'TRANSACTION_RECEIVED'; + address?: string; + class_hash?: string; +}; +type GetCodeResponse$1 = { + bytecode: ByteCode; + abi: Abi; +}; +interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction { + transaction_hash: string; + entry_point_selector: string; +} +type TransactionResponse = DeclareTransaction | DeployTransaction | InvokeFunctionTransactionResponse; +type SuccessfulTransactionResponse = { + status: TransactionStatus; + transaction: TransactionResponse; + block_hash: string; + block_number: BlockNumber; + transaction_index: number; +}; +type FailedTransactionResponse = { + status: TransactionStatus.REJECTED; + transaction_failure_reason: { + code: string; + error_message: string; + }; + transaction: TransactionResponse; +}; +type GetTransactionResponse$1 = SuccessfulTransactionResponse | FailedTransactionResponse; +type TransactionReceiptResponse = SuccessfulTransactionReceiptResponse | FailedTransactionReceiptResponse; +type SuccessfulTransactionReceiptResponse = { + status: TransactionStatus; + transaction_hash: string; + transaction_index: number; + block_hash: string; + block_number: BlockNumber; + l2_to_l1_messages: string[]; + events: string[]; + actual_fee: string; + execution_resources: ExecutionResources; +}; +type FailedTransactionReceiptResponse = { + status: TransactionStatus.REJECTED; + transaction_failure_reason: { + code: string; + error_message: string; + }; + transaction_hash: string; + l2_to_l1_messages: string[]; + events: string[]; +}; +type GetBlockResponse$1 = { + block_number: number; + state_root: string; + block_hash: string; + transactions: { + [txHash: string]: TransactionResponse; + }; + timestamp: number; + transaction_receipts: { + [txHash: string]: { + block_hash: string; + transaction_hash: string; + l2_to_l1_messages: { + to_address: string; + payload: string[]; + from_address: string; + }[]; + block_number: BlockNumber; + status: TransactionStatus; + transaction_index: number; + }; + }; + parent_block_hash: string; + status: BlockStatus; + gas_price: string; + sequencer_address: string; + starknet_version: string; +}; +type CallContractTransaction = { + calldata?: RawCalldata; + max_fee?: BigNumberish; + version?: BigNumberish; + entry_point_selector: string; +} & ({ + sender_address: string; + signature: string[]; +} | { + contract_address: string; + signature?: never; +}); +type CallContractResponse$1 = { + result: string[]; +}; +type InvokeEstimateFee = Omit; +type DeclareEstimateFee = Omit; +type DeployAccountEstimateFee = Omit; +type DeployEstimateFee = DeployTransaction; +type SimulateTransactionResponse$1 = { + trace: TransactionTraceResponse; + fee_estimation: EstimateFeeResponse$1; +}; +type AccountTransactionItem = InvokeEstimateFee | DeclareEstimateFee | DeployEstimateFee | DeployAccountEstimateFee; +/** + * Transaction filled with account data + */ +type AccountTransaction = AllowArray; +type EstimateFeeResponse$1 = { + overall_fee: number; + gas_price: number; + gas_usage: number; + uint: string; +} | { + amount: bigint; + unit: string; +}; +type EstimateFeeResponseBulk$1 = AllowArray; +type BlockTransactionTracesResponse = { + traces: Array; +}; +type Storage$1 = string; +type StateUpdateResponse$1 = { + block_hash: string; + new_root: string; + old_root: string; + state_diff: { + storage_diffs: StorageDiffs; + nonces: Nonces; + deployed_contracts: Array; + old_declared_contracts: OldDeclaredContracts; + declared_classes: DeclaredClasses; + replaced_classes: ReplacedClasses; + }; +}; +type StorageDiffs = { + [address: string]: Array; +}; +type StateDiffItem = { + key: string; + value: string; +}; +type Nonces = { + [address: string]: Nonce$1; +}; +type Nonce$1 = string; +type DeployedContracts = DeployedContractItem[]; +type OldDeclaredContracts = string[]; +type DeclaredClasses = DeclaredClass[]; +type DeclaredClass = { + class_hash: string; + compiled_class_hash: string; +}; +type ReplacedClasses = string[]; +type Endpoints = { + get_contract_addresses: { + QUERY: never; + REQUEST: never; + RESPONSE: GetContractAddressesResponse; + }; + add_transaction: { + QUERY: never; + REQUEST: Transaction; + RESPONSE: AddTransactionResponse; + }; + get_transaction: { + QUERY: { + transactionHash: string; + }; + REQUEST: never; + RESPONSE: GetTransactionResponse$1; + }; + get_transaction_status: { + QUERY: { + transactionHash: string; + }; + REQUEST: never; + RESPONSE: GetTransactionStatusResponse; + }; + get_transaction_trace: { + QUERY: { + transactionHash: string; + }; + REQUEST: never; + RESPONSE: TransactionTraceResponse; + }; + get_transaction_receipt: { + QUERY: { + transactionHash: string; + }; + REQUEST: never; + RESPONSE: TransactionReceiptResponse; + }; + get_nonce: { + QUERY: { + contractAddress: string; + blockIdentifier: BlockIdentifier; + }; + REQUEST: never; + RESPONSE: Nonce$1; + }; + get_storage_at: { + QUERY: { + contractAddress: string; + key: BigNumberish; + blockIdentifier: BlockIdentifier; + }; + REQUEST: never; + RESPONSE: Storage$1; + }; + get_code: { + QUERY: { + contractAddress: string; + blockIdentifier: BlockIdentifier; + }; + REQUEST: never; + RESPONSE: GetCodeResponse$1; + }; + get_block: { + QUERY: { + blockIdentifier: BlockIdentifier; + }; + REQUEST: never; + RESPONSE: GetBlockResponse$1; + }; + call_contract: { + QUERY: { + blockIdentifier: BlockIdentifier; + }; + REQUEST: CallContractTransaction; + RESPONSE: CallContractResponse$1; + }; + estimate_fee: { + QUERY: { + blockIdentifier: BlockIdentifier; + skipValidate: boolean; + }; + REQUEST: AccountTransactionItem; + RESPONSE: EstimateFeeResponse$1; + }; + get_class_by_hash: { + QUERY: { + classHash: string; + blockIdentifier?: BlockIdentifier; + }; + REQUEST: never; + RESPONSE: CompiledContract; + }; + get_class_hash_at: { + QUERY: { + contractAddress: string; + blockIdentifier?: BlockIdentifier; + }; + REQUEST: never; + RESPONSE: string; + }; + get_state_update: { + QUERY: { + blockHash?: string; + blockNumber?: BlockNumber; + }; + REQUEST: never; + RESPONSE: StateUpdateResponse$1; + }; + get_full_contract: { + QUERY: { + contractAddress: string; + blockIdentifier?: BlockIdentifier; + }; + REQUEST: never; + RESPONSE: CompiledContract; + }; + estimate_message_fee: { + QUERY: any; + REQUEST: any; + RESPONSE: EstimateFeeResponse$1; + }; + simulate_transaction: { + QUERY: { + blockIdentifier: BlockIdentifier; + skipValidate: boolean; + }; + REQUEST: AccountTransaction; + RESPONSE: SimulateTransactionResponse$1; + }; + estimate_fee_bulk: { + QUERY: { + blockIdentifier: BlockIdentifier; + skipValidate: boolean; + }; + REQUEST: AccountTransaction; + RESPONSE: EstimateFeeResponseBulk$1; + }; + get_block_traces: { + QUERY: { + blockHash?: string; + blockNumber?: BlockNumber; + }; + REQUEST: never; + RESPONSE: BlockTransactionTracesResponse; + }; + get_compiled_class_by_class_hash: { + QUERY: { + classHash: string; + blockIdentifier?: BlockIdentifier; + }; + REQUEST: any; + RESPONSE: CairoAssembly; + }; +}; + +type sequencer_AccountTransaction = AccountTransaction; +type sequencer_AccountTransactionItem = AccountTransactionItem; +type sequencer_AddTransactionResponse = AddTransactionResponse; +type sequencer_BlockTransactionTracesResponse = BlockTransactionTracesResponse; +type sequencer_CallContractTransaction = CallContractTransaction; +type sequencer_CallL1Handler = CallL1Handler; +type sequencer_DeclareEstimateFee = DeclareEstimateFee; +type sequencer_DeclareTransaction = DeclareTransaction; +type sequencer_DeclaredClass = DeclaredClass; +type sequencer_DeclaredClasses = DeclaredClasses; +type sequencer_DeployAccountEstimateFee = DeployAccountEstimateFee; +type sequencer_DeployAccountTransaction = DeployAccountTransaction; +type sequencer_DeployEstimateFee = DeployEstimateFee; +type sequencer_DeployTransaction = DeployTransaction; +type sequencer_DeployedContractItem = DeployedContractItem; +type sequencer_DeployedContracts = DeployedContracts; +type sequencer_Endpoints = Endpoints; +type sequencer_ExecutionResources = ExecutionResources; +type sequencer_FailedTransactionReceiptResponse = FailedTransactionReceiptResponse; +type sequencer_FailedTransactionResponse = FailedTransactionResponse; +type sequencer_FunctionInvocation = FunctionInvocation; +type sequencer_GetContractAddressesResponse = GetContractAddressesResponse; +type sequencer_GetTransactionStatusResponse = GetTransactionStatusResponse; +type sequencer_InvokeEstimateFee = InvokeEstimateFee; +type sequencer_InvokeFunctionTransaction = InvokeFunctionTransaction; +type sequencer_InvokeFunctionTransactionResponse = InvokeFunctionTransactionResponse; +type sequencer_Nonces = Nonces; +type sequencer_OldDeclaredContracts = OldDeclaredContracts; +type sequencer_ReplacedClasses = ReplacedClasses; +type sequencer_SequencerIdentifier = SequencerIdentifier; +type sequencer_StateDiffItem = StateDiffItem; +type sequencer_StorageDiffs = StorageDiffs; +type sequencer_SuccessfulTransactionReceiptResponse = SuccessfulTransactionReceiptResponse; +type sequencer_SuccessfulTransactionResponse = SuccessfulTransactionResponse; +type sequencer_Transaction = Transaction; +type sequencer_TransactionReceiptResponse = TransactionReceiptResponse; +type sequencer_TransactionResponse = TransactionResponse; +type sequencer_TransactionTraceResponse = TransactionTraceResponse; +declare namespace sequencer { + export { + sequencer_AccountTransaction as AccountTransaction, + sequencer_AccountTransactionItem as AccountTransactionItem, + sequencer_AddTransactionResponse as AddTransactionResponse, + sequencer_BlockTransactionTracesResponse as BlockTransactionTracesResponse, + CallContractResponse$1 as CallContractResponse, + sequencer_CallContractTransaction as CallContractTransaction, + sequencer_CallL1Handler as CallL1Handler, + sequencer_DeclareEstimateFee as DeclareEstimateFee, + sequencer_DeclareTransaction as DeclareTransaction, + sequencer_DeclaredClass as DeclaredClass, + sequencer_DeclaredClasses as DeclaredClasses, + sequencer_DeployAccountEstimateFee as DeployAccountEstimateFee, + sequencer_DeployAccountTransaction as DeployAccountTransaction, + sequencer_DeployEstimateFee as DeployEstimateFee, + sequencer_DeployTransaction as DeployTransaction, + sequencer_DeployedContractItem as DeployedContractItem, + sequencer_DeployedContracts as DeployedContracts, + sequencer_Endpoints as Endpoints, + EstimateFeeResponse$1 as EstimateFeeResponse, + EstimateFeeResponseBulk$1 as EstimateFeeResponseBulk, + sequencer_ExecutionResources as ExecutionResources, + sequencer_FailedTransactionReceiptResponse as FailedTransactionReceiptResponse, + sequencer_FailedTransactionResponse as FailedTransactionResponse, + sequencer_FunctionInvocation as FunctionInvocation, + GetBlockResponse$1 as GetBlockResponse, + GetCodeResponse$1 as GetCodeResponse, + sequencer_GetContractAddressesResponse as GetContractAddressesResponse, + GetTransactionResponse$1 as GetTransactionResponse, + sequencer_GetTransactionStatusResponse as GetTransactionStatusResponse, + sequencer_InvokeEstimateFee as InvokeEstimateFee, + sequencer_InvokeFunctionTransaction as InvokeFunctionTransaction, + sequencer_InvokeFunctionTransactionResponse as InvokeFunctionTransactionResponse, + Nonce$1 as Nonce, + sequencer_Nonces as Nonces, + sequencer_OldDeclaredContracts as OldDeclaredContracts, + sequencer_ReplacedClasses as ReplacedClasses, + sequencer_SequencerIdentifier as SequencerIdentifier, + SimulateTransactionResponse$1 as SimulateTransactionResponse, + sequencer_StateDiffItem as StateDiffItem, + StateUpdateResponse$1 as StateUpdateResponse, + Storage$1 as Storage, + sequencer_StorageDiffs as StorageDiffs, + sequencer_SuccessfulTransactionReceiptResponse as SuccessfulTransactionReceiptResponse, + sequencer_SuccessfulTransactionResponse as SuccessfulTransactionResponse, + sequencer_Transaction as Transaction, + sequencer_TransactionReceiptResponse as TransactionReceiptResponse, + sequencer_TransactionResponse as TransactionResponse, + sequencer_TransactionTraceResponse as TransactionTraceResponse, + }; +} + +/** + * Common interface response + * Intersection (sequencer response ∩ (∪ rpc responses)) + */ + +interface GetBlockResponse { + timestamp: number; + block_hash: string; + block_number: number; + new_root: string; + parent_hash: string; + status: BlockStatus; + transactions: Array; + gas_price?: string; + sequencer_address?: string; + starknet_version?: string; + transaction_receipts?: any; +} +interface GetCodeResponse { + bytecode: ByteCode; +} +type RejectedTransactionResponse = { + status: `${TransactionStatus.REJECTED}`; + transaction_failure_reason: { + code: string; + error_message: string; + }; +}; +type GetTransactionResponse = InvokeTransactionResponse | DeclareTransactionResponse | RejectedTransactionResponse; +interface CommonTransactionResponse { + transaction_hash?: string; + version?: string; + signature?: Signature; + max_fee?: string; + nonce?: string; +} +interface InvokeTransactionResponse extends CommonTransactionResponse { + contract_address?: string; + sender_address?: string; + entry_point_selector?: string; + calldata: RawCalldata; +} +interface ContractEntryPoint { + offset: string; + selector: string; +} +interface DeclareTransactionResponse extends CommonTransactionResponse { + contract_class?: any; + sender_address?: string; +} +type RejectedTransactionReceiptResponse = RejectedTransactionResponse & (InvokeTransactionReceiptResponse | DeclareTransactionReceiptResponse); +type GetTransactionReceiptResponse = InvokeTransactionReceiptResponse | DeclareTransactionReceiptResponse | RejectedTransactionReceiptResponse; +interface CommonTransactionReceiptResponse { + transaction_hash: string; + status?: `${TransactionStatus}`; + actual_fee?: string; + status_data?: string; +} +interface MessageToL1 { + to_address: string; + payload: Array; +} +interface Event { + from_address: string; + keys: Array; + data: Array; +} +interface MessageToL2 { + from_address: string; + payload: Array; +} +interface InvokeTransactionReceiptResponse extends CommonTransactionReceiptResponse { + /** @deprecated Use l2_to_l1_messages */ + messages_sent?: Array; + events?: Array; + l1_origin_message?: MessageToL2; +} +type DeclareTransactionReceiptResponse = CommonTransactionReceiptResponse; +interface EstimateFeeResponse { + overall_fee: bigint; + gas_consumed?: bigint; + gas_price?: bigint; + suggestedMaxFee?: bigint; +} +interface InvokeFunctionResponse { + transaction_hash: string; +} +interface DeclareContractResponse { + transaction_hash: string; + class_hash: string; +} +type CallContractResponse = { + result: Array; +}; +type EstimateFeeAction = { + type: TransactionType$1.INVOKE; + payload: AllowArray; +} | { + type: TransactionType$1.DECLARE; + payload: DeclareContractPayload; +} | { + type: TransactionType$1.DEPLOY_ACCOUNT; + payload: DeployAccountContractPayload; +} | { + type: TransactionType$1.DEPLOY; + payload: UniversalDeployerContractPayload; +}; +type EstimateFeeResponseBulk = Array; +type Storage = Storage$1; +type Nonce = Nonce$1; +type SimulationFlags = SimulationFlags$1; +type SimulatedTransaction = { + transaction_trace: Trace | TransactionTraceResponse; + fee_estimation: EstimateFeeResponse$2 | EstimateFeeResponse$1; + suggestedMaxFee?: string | bigint; +}; +type SimulateTransactionResponse = SimulatedTransaction[]; +interface StateUpdateResponse { + block_hash?: string; + new_root?: string; + old_root: string; + state_diff: { + storage_diffs: StorageDiffs$1; + deployed_contracts: DeployedContracts; + nonces: Nonces$1; + old_declared_contracts?: OldDeclaredContracts; + declared_classes?: DeclaredClasses; + replaced_classes?: ReplacedClasses | ReplacedClasses$1; + deprecated_declared_classes?: DeprecatedDeclaredClasses; + }; +} +/** + * Standardized type + * Cairo0 program compressed and Cairo1 sierra_program decompressed + * abi Abi + * CompiledSierra without '.sierra_program_debug_info' + */ +type ContractClassResponse = LegacyContractClass | Omit; + +interface EstimateFee extends EstimateFeeResponse { + suggestedMaxFee: bigint; +} +type EstimateFeeBulk = Array; +type AccountInvocationsFactoryDetails = { + versions: bigint[]; + nonce?: BigNumberish; + blockIdentifier?: BlockIdentifier; +}; +interface EstimateFeeDetails { + nonce?: BigNumberish; + blockIdentifier?: BlockIdentifier; + skipValidate?: boolean; +} +interface DeployContractResponse { + contract_address: string; + transaction_hash: string; +} +type MultiDeployContractResponse = { + contract_address: Array; + transaction_hash: string; +}; +type DeployContractUDCResponse = { + contract_address: string; + transaction_hash: string; + address: string; + deployer: string; + unique: string; + classHash: string; + calldata_len: string; + calldata: Array; + salt: string; +}; +type DeclareDeployUDCResponse = { + declare: { + class_hash: BigNumberish; + } & Partial; + deploy: DeployContractUDCResponse; +}; +type SimulateTransactionDetails = { + nonce?: BigNumberish; + blockIdentifier?: BlockIdentifier; + skipValidate?: boolean; + skipExecute?: boolean; +}; +declare enum SIMULATION_FLAG { + SKIP_VALIDATE = 0, + SKIP_EXECUTE = 1 +} + +declare enum ValidateType { + DEPLOY = "DEPLOY", + CALL = "CALL", + INVOKE = "INVOKE" +} +declare enum Uint { + u8 = "core::integer::u8", + u16 = "core::integer::u16", + u32 = "core::integer::u32", + u64 = "core::integer::u64", + u128 = "core::integer::u128", + u256 = "core::integer::u256" +} + +type AsyncContractFunction = (...args: ArgsOrCalldataWithOptions) => Promise; +type ContractFunction = (...args: ArgsOrCalldataWithOptions) => any; +type Result = { + [key: string]: any; +} | Result[] | bigint | string | boolean; +type ArgsOrCalldata = RawArgsArray | [Calldata] | Calldata; +type ArgsOrCalldataWithOptions = ArgsOrCalldata & ContractOptions; +type ContractOptions = { + blockIdentifier?: BlockIdentifier; + parseRequest?: boolean; + parseResponse?: boolean; + formatResponse?: { + [key: string]: any; + }; + maxFee?: BigNumberish; + nonce?: BigNumberish; + signature?: Signature; + addressSalt?: string; +}; +type CallOptions = Pick; +type InvokeOptions = Pick; + +interface InvocationsSignerDetails extends Required { + walletAddress: string; + chainId: StarknetChainId; + cairoVersion: CairoVersion; +} +interface DeclareSignerDetails { + classHash: string; + senderAddress: string; + chainId: StarknetChainId; + maxFee: BigNumberish; + version: BigNumberish; + nonce: BigNumberish; + compiledClassHash?: string; +} +type DeployAccountSignerDetails = Required & Required & { + contractAddress: BigNumberish; + chainId: StarknetChainId; +}; + +type StarkNetMerkleType = { + name: string; + type: 'merkletree'; + contains: string; +}; +/** + * A single type, as part of a struct. The `type` field can be any of the EIP-712 supported types. + * + * Note that the `uint` and `int` aliases like in Solidity, and fixed point numbers are not supported by the EIP-712 + * standard. + */ +type StarkNetType = { + name: string; + type: string; +} | StarkNetMerkleType; +/** + * The EIP712 domain struct. Any of these fields are optional, but it must contain at least one field. + */ +interface StarkNetDomain extends Record { + name?: string; + version?: string; + chainId?: string | number; +} +/** + * The complete typed data, with all the structs, domain data, primary type of the message, and the message itself. + */ +interface TypedData { + types: Record; + primaryType: string; + domain: StarkNetDomain; + message: Record; +} + +type index_Abi = Abi; +type index_AbiEntry = AbiEntry; +type index_AbiStructs = AbiStructs; +type index_AccountInvocationItem = AccountInvocationItem; +type index_AccountInvocations = AccountInvocations; +type index_AccountInvocationsFactoryDetails = AccountInvocationsFactoryDetails; +type index_AllowArray = AllowArray; +type index_Args = Args; +type index_ArgsOrCalldata = ArgsOrCalldata; +type index_ArgsOrCalldataWithOptions = ArgsOrCalldataWithOptions; +type index_ArraySignatureType = ArraySignatureType; +type index_AsyncContractFunction = AsyncContractFunction; +type index_BigNumberish = BigNumberish; +type index_BlockIdentifier = BlockIdentifier; +type index_BlockNumber = BlockNumber; +type index_BlockStatus = BlockStatus; +declare const index_BlockStatus: typeof BlockStatus; +type index_BlockTag = BlockTag; +declare const index_BlockTag: typeof BlockTag; +type index_Builtins = Builtins; +type index_ByteCode = ByteCode; +type index_CairoAssembly = CairoAssembly; +type index_CairoContract = CairoContract; +type index_CairoVersion = CairoVersion; +type index_Call = Call; +type index_CallContractResponse = CallContractResponse; +type index_CallDetails = CallDetails; +type index_CallL1Handler = CallL1Handler; +type index_CallOptions = CallOptions; +type index_CallStruct = CallStruct; +type index_Calldata = Calldata; +type index_CommonTransactionReceiptResponse = CommonTransactionReceiptResponse; +type index_CommonTransactionResponse = CommonTransactionResponse; +type index_CompiledContract = CompiledContract; +type index_CompiledSierra = CompiledSierra; +type index_CompiledSierraCasm = CompiledSierraCasm; +type index_CompleteDeclareContractPayload = CompleteDeclareContractPayload; +type index_CompressedProgram = CompressedProgram; +type index_ContractClassResponse = ContractClassResponse; +type index_ContractEntryPoint = ContractEntryPoint; +type index_ContractEntryPointFields = ContractEntryPointFields; +type index_ContractFunction = ContractFunction; +type index_ContractOptions = ContractOptions; +type index_DeclareAndDeployContractPayload = DeclareAndDeployContractPayload; +type index_DeclareContractPayload = DeclareContractPayload; +type index_DeclareContractResponse = DeclareContractResponse; +type index_DeclareContractTransaction = DeclareContractTransaction; +type index_DeclareDeployUDCResponse = DeclareDeployUDCResponse; +type index_DeclareSignerDetails = DeclareSignerDetails; +type index_DeclareTransactionReceiptResponse = DeclareTransactionReceiptResponse; +type index_DeclareTransactionResponse = DeclareTransactionResponse; +type index_DeployAccountContractPayload = DeployAccountContractPayload; +type index_DeployAccountContractTransaction = DeployAccountContractTransaction; +type index_DeployAccountSignerDetails = DeployAccountSignerDetails; +type index_DeployContractResponse = DeployContractResponse; +type index_DeployContractUDCResponse = DeployContractUDCResponse; +type index_DeployedContractItem = DeployedContractItem; +type index_Details = Details; +type index_EntryPointType = EntryPointType; +declare const index_EntryPointType: typeof EntryPointType; +type index_EntryPointsByType = EntryPointsByType; +type index_EstimateFee = EstimateFee; +type index_EstimateFeeAction = EstimateFeeAction; +type index_EstimateFeeBulk = EstimateFeeBulk; +type index_EstimateFeeDetails = EstimateFeeDetails; +type index_EstimateFeeResponse = EstimateFeeResponse; +type index_EstimateFeeResponseBulk = EstimateFeeResponseBulk; +type index_Event = Event; +type index_ExecutionResources = ExecutionResources; +type index_FunctionAbi = FunctionAbi; +type index_FunctionInvocation = FunctionInvocation; +type index_GetBlockResponse = GetBlockResponse; +type index_GetCodeResponse = GetCodeResponse; +type index_GetContractAddressesResponse = GetContractAddressesResponse; +type index_GetTransactionReceiptResponse = GetTransactionReceiptResponse; +type index_GetTransactionResponse = GetTransactionResponse; +type index_GetTransactionStatusResponse = GetTransactionStatusResponse; +type index_HexCalldata = HexCalldata; +type index_Invocation = Invocation; +type index_Invocations = Invocations; +type index_InvocationsDetails = InvocationsDetails; +type index_InvocationsDetailsWithNonce = InvocationsDetailsWithNonce; +type index_InvocationsSignerDetails = InvocationsSignerDetails; +type index_InvokeFunctionResponse = InvokeFunctionResponse; +type index_InvokeOptions = InvokeOptions; +type index_InvokeTransactionReceiptResponse = InvokeTransactionReceiptResponse; +type index_InvokeTransactionResponse = InvokeTransactionResponse; +type index_LegacyCompiledContract = LegacyCompiledContract; +type index_LegacyContractClass = LegacyContractClass; +type index_MessageToL1 = MessageToL1; +type index_MessageToL2 = MessageToL2; +type index_MultiDeployContractResponse = MultiDeployContractResponse; +type index_MultiType = MultiType; +type index_Nonce = Nonce; +type index_OptionalPayload = OptionalPayload; +type index_ParsedStruct = ParsedStruct; +type index_Program = Program; +type index_ProviderOptions = ProviderOptions; +type index_PythonicHints = PythonicHints; +type index_RawArgs = RawArgs; +type index_RawArgsArray = RawArgsArray; +type index_RawArgsObject = RawArgsObject; +type index_RawCalldata = RawCalldata; +type index_RejectedTransactionReceiptResponse = RejectedTransactionReceiptResponse; +type index_RejectedTransactionResponse = RejectedTransactionResponse; +type index_Result = Result; +type index_RpcProviderOptions = RpcProviderOptions; +type index_SIMULATION_FLAG = SIMULATION_FLAG; +declare const index_SIMULATION_FLAG: typeof SIMULATION_FLAG; +type index_SequencerHttpMethod = SequencerHttpMethod; +type index_SequencerIdentifier = SequencerIdentifier; +type index_SequencerProviderOptions = SequencerProviderOptions; +type index_SierraContractClass = SierraContractClass; +type index_SierraContractEntryPointFields = SierraContractEntryPointFields; +type index_SierraEntryPointsByType = SierraEntryPointsByType; +type index_SierraProgramDebugInfo = SierraProgramDebugInfo; +type index_Signature = Signature; +type index_SimulateTransactionDetails = SimulateTransactionDetails; +type index_SimulateTransactionResponse = SimulateTransactionResponse; +type index_SimulatedTransaction = SimulatedTransaction; +type index_SimulationFlags = SimulationFlags; +type index_StarkNetDomain = StarkNetDomain; +type index_StarkNetMerkleType = StarkNetMerkleType; +type index_StarkNetType = StarkNetType; +type index_StateUpdateResponse = StateUpdateResponse; +type index_Storage = Storage; +type index_StructAbi = StructAbi; +type index_TransactionStatus = TransactionStatus; +declare const index_TransactionStatus: typeof TransactionStatus; +type index_Tupled = Tupled; +type index_TypedData = TypedData; +type index_Uint = Uint; +declare const index_Uint: typeof Uint; +type index_Uint256 = Uint256; +type index_UniversalDeployerContractPayload = UniversalDeployerContractPayload; +type index_ValidateType = ValidateType; +declare const index_ValidateType: typeof ValidateType; +type index_WeierstrassSignatureType = WeierstrassSignatureType; +type index_getEstimateFeeBulkOptions = getEstimateFeeBulkOptions; +type index_getSimulateTransactionOptions = getSimulateTransactionOptions; +type index_waitForTransactionOptions = waitForTransactionOptions; +declare namespace index { + export { + index_Abi as Abi, + index_AbiEntry as AbiEntry, + index_AbiStructs as AbiStructs, + index_AccountInvocationItem as AccountInvocationItem, + index_AccountInvocations as AccountInvocations, + index_AccountInvocationsFactoryDetails as AccountInvocationsFactoryDetails, + index_AllowArray as AllowArray, + index_Args as Args, + index_ArgsOrCalldata as ArgsOrCalldata, + index_ArgsOrCalldataWithOptions as ArgsOrCalldataWithOptions, + index_ArraySignatureType as ArraySignatureType, + index_AsyncContractFunction as AsyncContractFunction, + index_BigNumberish as BigNumberish, + index_BlockIdentifier as BlockIdentifier, + index_BlockNumber as BlockNumber, + index_BlockStatus as BlockStatus, + index_BlockTag as BlockTag, + index_Builtins as Builtins, + index_ByteCode as ByteCode, + index_CairoAssembly as CairoAssembly, + index_CairoContract as CairoContract, + index_CairoVersion as CairoVersion, + index_Call as Call, + index_CallContractResponse as CallContractResponse, + index_CallDetails as CallDetails, + index_CallL1Handler as CallL1Handler, + index_CallOptions as CallOptions, + index_CallStruct as CallStruct, + index_Calldata as Calldata, + index_CommonTransactionReceiptResponse as CommonTransactionReceiptResponse, + index_CommonTransactionResponse as CommonTransactionResponse, + index_CompiledContract as CompiledContract, + index_CompiledSierra as CompiledSierra, + index_CompiledSierraCasm as CompiledSierraCasm, + index_CompleteDeclareContractPayload as CompleteDeclareContractPayload, + index_CompressedProgram as CompressedProgram, + ContractClass$1 as ContractClass, + index_ContractClassResponse as ContractClassResponse, + index_ContractEntryPoint as ContractEntryPoint, + index_ContractEntryPointFields as ContractEntryPointFields, + index_ContractFunction as ContractFunction, + index_ContractOptions as ContractOptions, + index_DeclareAndDeployContractPayload as DeclareAndDeployContractPayload, + index_DeclareContractPayload as DeclareContractPayload, + index_DeclareContractResponse as DeclareContractResponse, + index_DeclareContractTransaction as DeclareContractTransaction, + index_DeclareDeployUDCResponse as DeclareDeployUDCResponse, + index_DeclareSignerDetails as DeclareSignerDetails, + index_DeclareTransactionReceiptResponse as DeclareTransactionReceiptResponse, + index_DeclareTransactionResponse as DeclareTransactionResponse, + index_DeployAccountContractPayload as DeployAccountContractPayload, + index_DeployAccountContractTransaction as DeployAccountContractTransaction, + index_DeployAccountSignerDetails as DeployAccountSignerDetails, + index_DeployContractResponse as DeployContractResponse, + index_DeployContractUDCResponse as DeployContractUDCResponse, + index_DeployedContractItem as DeployedContractItem, + index_Details as Details, + index_EntryPointType as EntryPointType, + index_EntryPointsByType as EntryPointsByType, + index_EstimateFee as EstimateFee, + index_EstimateFeeAction as EstimateFeeAction, + index_EstimateFeeBulk as EstimateFeeBulk, + index_EstimateFeeDetails as EstimateFeeDetails, + index_EstimateFeeResponse as EstimateFeeResponse, + index_EstimateFeeResponseBulk as EstimateFeeResponseBulk, + index_Event as Event, + index_ExecutionResources as ExecutionResources, + index_FunctionAbi as FunctionAbi, + index_FunctionInvocation as FunctionInvocation, + index_GetBlockResponse as GetBlockResponse, + index_GetCodeResponse as GetCodeResponse, + index_GetContractAddressesResponse as GetContractAddressesResponse, + index_GetTransactionReceiptResponse as GetTransactionReceiptResponse, + index_GetTransactionResponse as GetTransactionResponse, + index_GetTransactionStatusResponse as GetTransactionStatusResponse, + index_HexCalldata as HexCalldata, + index_Invocation as Invocation, + index_Invocations as Invocations, + index_InvocationsDetails as InvocationsDetails, + index_InvocationsDetailsWithNonce as InvocationsDetailsWithNonce, + index_InvocationsSignerDetails as InvocationsSignerDetails, + index_InvokeFunctionResponse as InvokeFunctionResponse, + index_InvokeOptions as InvokeOptions, + index_InvokeTransactionReceiptResponse as InvokeTransactionReceiptResponse, + index_InvokeTransactionResponse as InvokeTransactionResponse, + index_LegacyCompiledContract as LegacyCompiledContract, + index_LegacyContractClass as LegacyContractClass, + index_MessageToL1 as MessageToL1, + index_MessageToL2 as MessageToL2, + index_MultiDeployContractResponse as MultiDeployContractResponse, + index_MultiType as MultiType, + index_Nonce as Nonce, + index_OptionalPayload as OptionalPayload, + index_ParsedStruct as ParsedStruct, + index_Program as Program, + index_ProviderOptions as ProviderOptions, + index_PythonicHints as PythonicHints, + rpc as RPC, + index_RawArgs as RawArgs, + index_RawArgsArray as RawArgsArray, + index_RawArgsObject as RawArgsObject, + index_RawCalldata as RawCalldata, + index_RejectedTransactionReceiptResponse as RejectedTransactionReceiptResponse, + index_RejectedTransactionResponse as RejectedTransactionResponse, + index_Result as Result, + index_RpcProviderOptions as RpcProviderOptions, + index_SIMULATION_FLAG as SIMULATION_FLAG, + sequencer as Sequencer, + index_SequencerHttpMethod as SequencerHttpMethod, + index_SequencerIdentifier as SequencerIdentifier, + index_SequencerProviderOptions as SequencerProviderOptions, + index_SierraContractClass as SierraContractClass, + index_SierraContractEntryPointFields as SierraContractEntryPointFields, + index_SierraEntryPointsByType as SierraEntryPointsByType, + index_SierraProgramDebugInfo as SierraProgramDebugInfo, + index_Signature as Signature, + index_SimulateTransactionDetails as SimulateTransactionDetails, + index_SimulateTransactionResponse as SimulateTransactionResponse, + index_SimulatedTransaction as SimulatedTransaction, + index_SimulationFlags as SimulationFlags, + index_StarkNetDomain as StarkNetDomain, + index_StarkNetMerkleType as StarkNetMerkleType, + index_StarkNetType as StarkNetType, + index_StateUpdateResponse as StateUpdateResponse, + index_Storage as Storage, + index_StructAbi as StructAbi, + index_TransactionStatus as TransactionStatus, + TransactionType$1 as TransactionType, + index_Tupled as Tupled, + index_TypedData as TypedData, + index_Uint as Uint, + index_Uint256 as Uint256, + index_UniversalDeployerContractPayload as UniversalDeployerContractPayload, + index_ValidateType as ValidateType, + index_WeierstrassSignatureType as WeierstrassSignatureType, + index_getEstimateFeeBulkOptions as getEstimateFeeBulkOptions, + index_getSimulateTransactionOptions as getSimulateTransactionOptions, + index_waitForTransactionOptions as waitForTransactionOptions, + }; +} + +declare abstract class ProviderInterface { + /** + * Gets the Starknet chain Id + * + * @returns the chain Id + */ + abstract getChainId(): Promise; + /** + * Calls a function on the Starknet contract. + * + * @param call transaction to be called + * @param blockIdentifier block identifier + * @returns the result of the function on the smart contract. + */ + abstract callContract(call: Call, blockIdentifier?: BlockIdentifier): Promise; + /** + * Gets the block information + * + * @param blockIdentifier block identifier + * @returns the block object + */ + abstract getBlock(blockIdentifier: BlockIdentifier): Promise; + /** + * @deprecated The method should not be used + */ + abstract getCode(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + /** + * Gets the contract class of the deployed contract. + * + * @param contractAddress - contract address + * @param blockIdentifier - block identifier + * @returns Contract class of compiled contract + */ + abstract getClassAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + /** + * Returns the class hash deployed under the given address. + * + * @param contractAddress - contract address + * @param blockIdentifier - block identifier + * @returns Class hash + */ + abstract getClassHashAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + /** + * Returns the contract class deployed under the given class hash. + * + * @param classHash - class hash + * @returns Contract class of compiled contract + */ + abstract getClassByHash(classHash: string): Promise; + /** + * Gets the nonce of a contract with respect to a specific block + * + * @param contractAddress - contract address + * @returns the hex nonce + */ + abstract getNonceForAddress(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + /** + * Gets the contract's storage variable at a specific key. + * + * @param contractAddress + * @param key - from getStorageVarAddress('') (WIP) + * @param blockIdentifier - block identifier + * @returns the value of the storage variable + */ + abstract getStorageAt(contractAddress: string, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise; + /** + * Gets the transaction information from a tx id. + * + * @param txHash + * @returns the transaction object \{ transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? \} + */ + abstract getTransaction(transactionHash: BigNumberish): Promise; + /** + * Gets the transaction receipt from a tx hash. + * + * @param txHash + * @returns the transaction receipt object + */ + abstract getTransactionReceipt(transactionHash: BigNumberish): Promise; + /** + * Deploys a given compiled Account contract (json) to starknet + * + * @param payload payload to be deployed containing: + * - compiled contract code + * - constructor calldata + * - address salt + * @returns a confirmation of sending a transaction on the starknet contract + */ + abstract deployAccountContract(payload: DeployAccountContractPayload, details: InvocationsDetailsWithNonce): Promise; + /** + * Invokes a function on starknet + * @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class + * + * @param invocation the invocation object containing: + * - contractAddress - the address of the contract + * - entrypoint - the entrypoint of the contract + * - calldata - (defaults to []) the calldata + * - signature - (defaults to []) the signature + * @param details - optional details containing: + * - nonce - optional nonce + * - version - optional version + * - maxFee - optional maxFee + * @returns response from addTransaction + */ + abstract invokeFunction(invocation: Invocation, details: InvocationsDetailsWithNonce): Promise; + /** + * Declares a given compiled contract (json) to starknet + * @param transaction transaction payload to be deployed containing: + * - compiled contract code + * - sender address + * - signature + * @param details Invocation Details containing: + * - nonce + * - optional version + * - optional maxFee + * @returns a confirmation of sending a transaction on the starknet contract + */ + abstract declareContract(transaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise; + /** + * Estimates the fee for a given INVOKE transaction + * @deprecated Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class + * + * @param invocation the invocation object containing: + * - contractAddress - the address of the contract + * - entrypoint - the entrypoint of the contract + * - calldata - (defaults to []) the calldata + * - signature - (defaults to []) the signature + * @param details - optional details containing: + * - nonce - optional nonce + * - version - optional version + * @param blockIdentifier - (optional) block identifier + * @param skipValidate - (optional) skip cairo __validate__ method + * @returns the estimated fee + */ + abstract getEstimateFee(invocation: Invocation, details: InvocationsDetailsWithNonce, blockIdentifier: BlockIdentifier, skipValidate?: boolean): Promise; + /** + * Estimates the fee for a given INVOKE transaction + * + * @param invocation the invocation object containing: + * - contractAddress - the address of the contract + * - entrypoint - the entrypoint of the contract + * - calldata - (defaults to []) the calldata + * - signature - (defaults to []) the signature + * @param details - optional details containing: + * - nonce - optional nonce + * - version - optional version + * @param blockIdentifier - (optional) block identifier + * @param skipValidate - (optional) skip cairo __validate__ method + * @returns the estimated fee + */ + abstract getInvokeEstimateFee(invocation: Invocation, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + /** + * Estimates the fee for a given DECLARE transaction + * + * @param transaction transaction payload to be declared containing: + * - compiled contract code + * - sender address + * - signature - (defaults to []) the signature + * @param details - optional details containing: + * - nonce + * - version - optional version + * - optional maxFee + * @param blockIdentifier - (optional) block identifier + * @param skipValidate - (optional) skip cairo __validate__ method + * @returns the estimated fee + */ + abstract getDeclareEstimateFee(transaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + /** + * Estimates the fee for a given DEPLOY_ACCOUNT transaction + * + * @param transaction transaction payload to be deployed containing: + * - classHash + * - constructorCalldata + * - addressSalt + * - signature - (defaults to []) the signature + * @param details - optional details containing: + * - nonce + * - version - optional version + * - optional maxFee + * @param blockIdentifier - (optional) block identifier + * @param skipValidate - (optional) skip cairo __validate__ method + * @returns the estimated fee + */ + abstract getDeployAccountEstimateFee(transaction: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + /** + * Estimates the fee for a list of INVOKE transaction + * + * @param invocations AccountInvocations - Complete invocations array with account details + * @param options getEstimateFeeBulkOptions + * - (optional) blockIdentifier - BlockIdentifier + * - (optional) skipValidate - boolean (default false) + * @returns the estimated fee + */ + abstract getEstimateFeeBulk(invocations: AccountInvocations, options?: getEstimateFeeBulkOptions): Promise; + /** + * Wait for the transaction to be accepted + * @param txHash - transaction hash + * @param options waitForTransactionOptions + * - (optional) retryInterval: number | undefined; + * - (optional) successStates: TransactionStatus[] | undefined; + * @return GetTransactionReceiptResponse + */ + abstract waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise; + /** + * Simulates the transaction and returns the transaction trace and estimated fee. + * + * @param invocations AccountInvocations - Complete invocations array with account details + * @param options - getSimulateTransactionOptions + * - (optional) blockIdentifier - block identifier + * - (optional) skipValidate - skip cairo __validate__ method + * - (optional) skipExecute - skip cairo __execute__ method + * @returns an array of transaction trace and estimated fee + */ + abstract getSimulateTransaction(invocations: AccountInvocations, options?: getSimulateTransactionOptions): Promise; + /** + * Gets the state changes in a specific block + * + * @param blockIdentifier - block identifier + * @returns StateUpdateResponse + */ + abstract getStateUpdate(blockIdentifier?: BlockIdentifier): Promise; +} + +declare class Provider implements ProviderInterface { + private provider; + constructor(providerOrOptions?: ProviderOptions | ProviderInterface); + getChainId(): Promise; + getBlock(blockIdentifier: BlockIdentifier): Promise; + getClassAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getClassHashAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getClassByHash(classHash: string): Promise; + getEstimateFee(invocationWithTxType: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier: BlockIdentifier): Promise; + getInvokeEstimateFee(invocationWithTxType: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + getEstimateFeeBulk(invocations: AccountInvocations, options: getEstimateFeeBulkOptions): Promise; + getNonceForAddress(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getStorageAt(contractAddress: string, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise; + getTransaction(txHash: BigNumberish): Promise; + getTransactionReceipt(txHash: BigNumberish): Promise; + callContract(request: Call, blockIdentifier?: BlockIdentifier): Promise; + invokeFunction(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise; + deployAccountContract(payload: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise; + declareContract(transaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise; + getDeclareEstimateFee(transaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + getDeployAccountEstimateFee(transaction: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + getCode(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise; + getSimulateTransaction(invocations: AccountInvocations, options?: getSimulateTransactionOptions): Promise; + getStateUpdate(blockIdentifier?: BlockIdentifier): Promise; + getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise; + getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise; +} + +declare function fixStack(target: Error, fn?: Function): void; +declare function fixProto(target: Error, prototype: {}): void; +declare class CustomError extends Error { + name: string; + constructor(message?: string); +} +declare class LibraryError extends CustomError { +} +declare class GatewayError extends LibraryError { + errorCode: string; + constructor(message: string, errorCode: string); +} +declare class HttpError extends LibraryError { + errorCode: number; + constructor(message: string, errorCode: number); +} + +declare class SequencerProvider implements ProviderInterface { + baseUrl: string; + feederGatewayUrl: string; + gatewayUrl: string; + headers?: Record; + private blockIdentifier; + private chainId; + private responseParser; + constructor(optionsOrProvider?: SequencerProviderOptions); + protected static getNetworkFromName(name: NetworkName | StarknetChainId): BaseUrl; + protected static getChainIdFromBaseUrl(baseUrl: string): StarknetChainId; + private getFetchUrl; + private getFetchMethod; + private getQueryString; + private getHeaders; + protected fetchEndpoint(endpoint: T, ...[query, request]: Endpoints[T]['QUERY'] extends never ? Endpoints[T]['REQUEST'] extends never ? [] : [undefined, Endpoints[T]['REQUEST']] : Endpoints[T]['REQUEST'] extends never ? [Endpoints[T]['QUERY']] : [Endpoints[T]['QUERY'], Endpoints[T]['REQUEST']]): Promise; + fetch(endpoint: string, options?: { + method?: SequencerHttpMethod; + body?: any; + parseAlwaysAsBigInt?: boolean; + }): Promise; + getChainId(): Promise; + callContract({ contractAddress, entrypoint: entryPointSelector, calldata }: Call, blockIdentifier?: BlockIdentifier): Promise; + getBlock(blockIdentifier?: BlockIdentifier): Promise; + getNonceForAddress(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getStorageAt(contractAddress: string, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise; + getTransaction(txHash: BigNumberish): Promise; + getTransactionReceipt(txHash: BigNumberish): Promise; + getClassAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getClassHashAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getClassByHash(classHash: string, blockIdentifier?: BlockIdentifier): Promise; + getCompiledClassByClassHash(classHash: string, blockIdentifier?: BlockIdentifier): Promise; + invokeFunction(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise; + deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise; + declareContract({ senderAddress, contract, signature, compiledClassHash }: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise; + getEstimateFee(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + getInvokeEstimateFee(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + getDeclareEstimateFee(invocation: DeclareContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + getDeployAccountEstimateFee(invocation: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier, skipValidate?: boolean): Promise; + getEstimateFeeBulk(invocations: AccountInvocations, { blockIdentifier, skipValidate }: getEstimateFeeBulkOptions): Promise; + getCode(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise; + /** + * Gets the status of a transaction. + * @param txHash BigNumberish + * @returns GetTransactionStatusResponse - the transaction status object + */ + getTransactionStatus(txHash: BigNumberish): Promise; + /** + * Gets the smart contract address on the goerli testnet. + * @returns GetContractAddressesResponse - starknet smart contract addresses + */ + getContractAddresses(): Promise; + /** + * Gets the transaction trace from a tx id. + * @param txHash BigNumberish + * @returns TransactionTraceResponse - the transaction trace + */ + getTransactionTrace(txHash: BigNumberish): Promise; + estimateMessageFee({ from_address, to_address, entry_point_selector, payload }: CallL1Handler, blockIdentifier?: BlockIdentifier): Promise; + /** + * Simulate transaction using Sequencer provider + * WARNING!: Sequencer will process only first element from invocations array + * + * @param invocations Array of invocations, but only first invocation will be processed + * @param blockIdentifier block identifier, default 'latest' + * @param skipValidate Skip Account __validate__ method + * @returns + */ + getSimulateTransaction(invocations: AccountInvocations, { blockIdentifier, skipValidate, skipExecute, }: getSimulateTransactionOptions): Promise; + getStateUpdate(blockIdentifier?: BlockIdentifier): Promise; + getBlockTraces(blockIdentifier?: BlockIdentifier): Promise; + getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise; + getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise; + /** + * Build Single AccountTransaction from Single AccountInvocation + * @param invocation AccountInvocationItem + * @param versionType 'fee' | 'transaction' - used to determine default versions + * @returns AccountTransactionItem + */ + buildTransaction(invocation: AccountInvocationItem, versionType?: 'fee' | 'transaction'): AccountTransactionItem; +} + +declare class RpcProvider implements ProviderInterface { + nodeUrl: string; + headers: object; + private responseParser; + private retries; + private blockIdentifier; + private chainId?; + constructor(optionsOrProvider: RpcProviderOptions); + fetch(method: any, params: any): Promise; + protected errorHandler(error: any): void; + protected fetchEndpoint(method: T, params?: Methods[T]['params']): Promise; + getChainId(): Promise; + getBlock(blockIdentifier?: BlockIdentifier): Promise; + getBlockHashAndNumber(): Promise; + getBlockWithTxHashes(blockIdentifier?: BlockIdentifier): Promise; + getBlockWithTxs(blockIdentifier?: BlockIdentifier): Promise; + getClassHashAt(contractAddress: ContractAddress, blockIdentifier?: BlockIdentifier): Promise; + getNonceForAddress(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getPendingTransactions(): Promise; + getProtocolVersion(): Promise; + getStateUpdate(blockIdentifier?: BlockIdentifier): Promise; + getStorageAt(contractAddress: string, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise; + getTransaction(txHash: string): Promise; + getTransactionByHash(txHash: string): Promise; + getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise; + getTransactionReceipt(txHash: string): Promise; + getClassByHash(classHash: Felt): Promise; + getClass(classHash: Felt, blockIdentifier?: BlockIdentifier): Promise; + getClassAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise; + getCode(_contractAddress: string, _blockIdentifier?: BlockIdentifier): Promise; + getEstimateFee(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise; + getInvokeEstimateFee(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise; + getDeclareEstimateFee(invocation: DeclareContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise; + getDeployAccountEstimateFee(invocation: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise; + getEstimateFeeBulk(invocations: AccountInvocations, { blockIdentifier, skipValidate }: getEstimateFeeBulkOptions): Promise; + declareContract({ contract, signature, senderAddress, compiledClassHash }: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise; + deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise; + invokeFunction(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise; + callContract(call: Call, blockIdentifier?: BlockIdentifier): Promise; + traceTransaction(transactionHash: TransactionHash): Promise; + traceBlockTransactions(blockHash: BlockHash): Promise; + waitForTransaction(txHash: string, options?: waitForTransactionOptions): Promise; + /** + * Gets the transaction count from a block. + * + * + * @param blockIdentifier + * @returns Number of transactions + */ + getTransactionCount(blockIdentifier?: BlockIdentifier): Promise; + /** + * Gets the latest block number + * + * + * @returns Number of the latest block + */ + getBlockNumber(): Promise; + /** + * Gets syncing status of the node + * + * + * @returns Object with the stats data + */ + getSyncingStats(): Promise; + /** + * Gets all the events filtered + * + * + * @returns events and the pagination of the events + */ + getEvents(eventFilter: EventFilter): Promise; + getSimulateTransaction(invocations: AccountInvocations, { blockIdentifier, skipValidate, skipExecute, }: getSimulateTransactionOptions): Promise; + getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise; + getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise; + buildTransaction(invocation: AccountInvocationItem, versionType?: 'fee' | 'transaction'): BroadcastedTransaction; +} + +declare const defaultProvider: Provider; + +declare abstract class SignerInterface { + /** + * Method to get the public key of the signer + * + * @returns public key of signer as hex string with 0x prefix + */ + abstract getPubKey(): Promise; + /** + * Sign an JSON object for off-chain usage with the starknet private key and return the signature + * This adds a message prefix so it cant be interchanged with transactions + * + * @param typedData - JSON object to be signed + * @param accountAddress - account + * @returns the signature of the JSON object + * @throws {Error} if the JSON object is not a valid JSON + */ + abstract signMessage(typedData: TypedData, accountAddress: string): Promise; + /** + * Signs a transaction with the starknet private key and returns the signature + * + * @param invocation the invocation object containing: + * - contractAddress - the address of the contract + * - entrypoint - the entrypoint of the contract + * - calldata - (defaults to []) the calldata + * @param abi (optional) the abi of the contract for better displaying + * + * @returns signature + */ + abstract signTransaction(transactions: Call[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise; + /** + * Signs a DEPLOY_ACCOUNT transaction with the starknet private key and returns the signature + * + * @param transaction + * - contractAddress - the computed address of the contract + * - constructorCalldata - calldata to be passed in deploy constructor + * - addressSalt - contract address salt + * - chainId - the chainId to declare contract on + * - maxFee - maxFee for the declare transaction + * - version - transaction version + * - nonce - Nonce of the declare transaction + * @returns signature + */ + abstract signDeployAccountTransaction(transaction: DeployAccountSignerDetails): Promise; + /** + * Signs a DECLARE transaction with the starknet private key and returns the signature + * + * @param transaction + * - classHash - computed class hash. Will be replaced by ContractClass in future once class hash is present in CompiledContract + * - senderAddress - the address of the sender + * - chainId - the chainId to declare contract on + * - maxFee - maxFee for the declare transaction + * - version - transaction version + * - nonce - Nonce of the declare transaction + * @returns signature + */ + abstract signDeclareTransaction(transaction: DeclareSignerDetails): Promise; +} + +declare class Signer implements SignerInterface { + protected pk: Uint8Array | string; + constructor(pk?: Uint8Array | string); + getPubKey(): Promise; + signMessage(typedData: TypedData, accountAddress: string): Promise; + signTransaction(transactions: Call[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise; + signDeployAccountTransaction({ classHash, contractAddress, constructorCalldata, addressSalt, maxFee, version, chainId, nonce, }: DeployAccountSignerDetails): Promise; + signDeclareTransaction({ classHash, senderAddress, chainId, maxFee, version, nonce, compiledClassHash, }: DeclareSignerDetails): Promise; +} + +declare abstract class AccountInterface extends ProviderInterface { + abstract address: string; + abstract signer: SignerInterface; + abstract cairoVersion: CairoVersion; + /** + * Estimate Fee for executing an INVOKE transaction on starknet + * + * @param calls the invocation object containing: + * - contractAddress - the address of the contract + * - entrypoint - the entrypoint of the contract + * - calldata - (defaults to []) the calldata + * + * @returns response from estimate_fee + */ + abstract estimateInvokeFee(calls: AllowArray, estimateFeeDetails?: EstimateFeeDetails): Promise; + /** + * Estimate Fee for executing a DECLARE transaction on starknet + * + * @param contractPayload the payload object containing: + * - contract - the compiled contract to be declared + * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli. + * + * @returns response from estimate_fee + */ + abstract estimateDeclareFee(contractPayload: DeclareContractPayload, estimateFeeDetails?: EstimateFeeDetails): Promise; + /** + * Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet + * + * @param contractPayload - + * - contract - the compiled contract to be deployed + * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli. + * @param estimateFeeDetails - + * - optional blockIdentifier + * - constant nonce = 0 + * @returns response from estimate_fee + */ + abstract estimateAccountDeployFee(contractPayload: DeployAccountContractPayload, estimateFeeDetails?: EstimateFeeDetails): Promise; + /** + * Estimate Fee for executing a UDC DEPLOY transaction on starknet + * This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC) + + * @param deployContractPayload containing + * - classHash: computed class hash of compiled contract + * - salt: address salt + * - unique: bool if true ensure unique salt + * - calldata: constructor calldata + * + * @param transactionsDetail Invocation Details containing: + * - optional nonce + * - optional version + * - optional maxFee + */ + abstract estimateDeployFee(deployContractPayload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], transactionsDetail?: InvocationsDetails): Promise; + /** + * Estimate Fee for executing a list of transactions on starknet + * Contract must be deployed for fee estimation to be possible + * + * @param transactions array of transaction object containing : + * - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT' + * - payload - the payload of the transaction + * + * @returns response from estimate_fee + */ + abstract estimateFeeBulk(invocations: Invocations, details?: EstimateFeeDetails): Promise; + /** + * Invoke execute function in account contract + * + * @param transactions the invocation object or an array of them, containing: + * - contractAddress - the address of the contract + * - entrypoint - the entrypoint of the contract + * - calldata - (defaults to []) the calldata + * - signature - (defaults to []) the signature + * @param abi (optional) the abi of the contract for better displaying + * + * @returns response from addTransaction + */ + abstract execute(transactions: AllowArray, abis?: Abi[], transactionsDetail?: InvocationsDetails): Promise; + /** + * Declares a given compiled contract (json) to starknet + * + * @param contractPayload transaction payload to be deployed containing: + - contract: compiled contract code + - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution. + - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string; + - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution. + * @param transactionsDetail Invocation Details containing: + - optional nonce + - optional version + - optional maxFee + * @returns a confirmation of sending a transaction on the starknet contract + */ + abstract declare(contractPayload: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise; + /** + * Deploys a declared contract to starknet - using Universal Deployer Contract (UDC) + * support multicall + * + * @param payload - + * - classHash: computed class hash of compiled contract + * - [constructorCalldata] contract constructor calldata + * - [salt=pseudorandom] deploy address salt + * - [unique=true] ensure unique salt + * @param details - + * - [nonce=getNonce] + * - [version=transactionVersion] + * - [maxFee=getSuggestedMaxFee] + * @returns + * - contract_address[] + * - transaction_hash + */ + abstract deploy(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details?: InvocationsDetails | undefined): Promise; + /** + * Simplify deploy simulating old DeployContract with same response + UDC specific response + * Internal wait for L2 transaction, support multicall + * + * @param payload - + * - classHash: computed class hash of compiled contract + * - [constructorCalldata] contract constructor calldata + * - [salt=pseudorandom] deploy address salt + * - [unique=true] ensure unique salt + * @param details - + * - [nonce=getNonce] + * - [version=transactionVersion] + * - [maxFee=getSuggestedMaxFee] + * @returns + * - contract_address + * - transaction_hash + * - address + * - deployer + * - unique + * - classHash + * - calldata_len + * - calldata + * - salt + */ + abstract deployContract(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details?: InvocationsDetails | undefined): Promise; + /** + * Declares and Deploy a given compiled contract (json) to starknet using UDC + * Internal wait for L2 transaction, do not support multicall + * Method will pass even if contract is already declared (internal using DeclareIfNot) + * + * @param payload + * - contract: compiled contract code + * - [casm=cairo1]: CairoAssembly | undefined; + * - [compiledClassHash]: string | undefined; + * - [classHash]: computed class hash of compiled contract + * - [constructorCalldata] contract constructor calldata + * - [salt=pseudorandom] deploy address salt + * - [unique=true] ensure unique salt + * @param details + * - [nonce=getNonce] + * - [version=transactionVersion] + * - [maxFee=getSuggestedMaxFee] + * @returns + * - declare + * - transaction_hash + * - deploy + * - contract_address + * - transaction_hash + * - address + * - deployer + * - unique + * - classHash + * - calldata_len + * - calldata + * - salt + */ + abstract declareAndDeploy(payload: DeclareAndDeployContractPayload, details?: InvocationsDetails | undefined): Promise; + /** + * Deploy the account on Starknet + * + * @param contractPayload transaction payload to be deployed containing: + - classHash: computed class hash of compiled contract + - optional constructor calldata + - optional address salt + - optional contractAddress + * @param transactionsDetail Invocation Details containing: + - constant nonce = 0 + - optional version + - optional maxFee + * @returns a confirmation of sending a transaction on the starknet contract + */ + abstract deployAccount(contractPayload: DeployAccountContractPayload, transactionsDetail?: InvocationsDetails): Promise; + /** + * Sign an JSON object for off-chain usage with the starknet private key and return the signature + * This adds a message prefix so it cant be interchanged with transactions + * + * @param json - JSON object to be signed + * @returns the signature of the JSON object + * @throws {Error} if the JSON object is not a valid JSON + */ + abstract signMessage(typedData: TypedData): Promise; + /** + * Hash a JSON object with pederson hash and return the hash + * This adds a message prefix so it cant be interchanged with transactions + * + * @param json - JSON object to be hashed + * @returns the hash of the JSON object + * @throws {Error} if the JSON object is not a valid JSON + */ + abstract hashMessage(typedData: TypedData): Promise; + /** + * Verify a signature of a JSON object + * + * @param typedData - JSON object to be verified + * @param signature - signature of the JSON object + * @returns true if the signature is valid, false otherwise + * @throws {Error} if the JSON object is not a valid JSON or the signature is not a valid signature + */ + abstract verifyMessage(typedData: TypedData, signature: Signature): Promise; + /** + * Verify a signature of a given hash + * @warning This method is not recommended, use verifyMessage instead + * + * @param hash - hash to be verified + * @param signature - signature of the hash + * @returns true if the signature is valid, false otherwise + * @throws {Error} if the signature is not a valid signature + */ + abstract verifyMessageHash(hash: BigNumberish, signature: Signature): Promise; + /** + * Gets the nonce of the account with respect to a specific block + * + * @param {BlockIdentifier} blockIdentifier - optional blockIdentifier. Defaults to 'pending' + * @returns nonce of the account + */ + abstract getNonce(blockIdentifier?: BlockIdentifier): Promise; + /** + * Gets Suggested Max Fee based on the transaction type + * + * @param {EstimateFeeAction} estimateFeeAction + * @param {EstimateFeeDetails} details + * @returns suggestedMaxFee + */ + abstract getSuggestedMaxFee(estimateFeeAction: EstimateFeeAction, details: EstimateFeeDetails): Promise; + /** + * Simulates an array of transaction and returns an array of transaction trace and estimated fee. + * + * @param invocations Invocations containing: + * - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION + * @param details SimulateTransactionDetails + * + * @returns response from simulate_transaction + */ + abstract simulateTransaction(invocations: Invocations, details?: SimulateTransactionDetails): Promise; +} + +declare class Account extends Provider implements AccountInterface { + signer: SignerInterface; + address: string; + cairoVersion: CairoVersion; + constructor(providerOrOptions: ProviderOptions | ProviderInterface, address: string, pkOrSigner: Uint8Array | string | SignerInterface, cairoVersion?: CairoVersion); + getNonce(blockIdentifier?: BlockIdentifier): Promise; + private getNonceSafe; + estimateFee(calls: AllowArray, estimateFeeDetails?: EstimateFeeDetails | undefined): Promise; + estimateInvokeFee(calls: AllowArray, { nonce: providedNonce, blockIdentifier, skipValidate }?: EstimateFeeDetails): Promise; + estimateDeclareFee({ contract, classHash: providedClassHash, casm, compiledClassHash }: DeclareContractPayload, { blockIdentifier, nonce: providedNonce, skipValidate }?: EstimateFeeDetails): Promise; + estimateAccountDeployFee({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { blockIdentifier, skipValidate }?: EstimateFeeDetails): Promise; + estimateDeployFee(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], transactionsDetail?: InvocationsDetails | undefined): Promise; + estimateFeeBulk(invocations: Invocations, { nonce, blockIdentifier, skipValidate }?: EstimateFeeDetails): Promise; + buildInvocation(call: Array, signerDetails: InvocationsSignerDetails): Promise; + execute(calls: AllowArray, abis?: Abi[] | undefined, transactionsDetail?: InvocationsDetails): Promise; + /** + * First check if contract is already declared, if not declare it + * If contract already declared returned transaction_hash is ''. + * Method will pass even if contract is already declared + * @param payload DeclareContractPayload + * @param transactionsDetail (optional) InvocationsDetails = \{\} + * @returns DeclareContractResponse + */ + declareIfNot(payload: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise; + declare(payload: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise; + deploy(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details?: InvocationsDetails | undefined): Promise; + deployContract(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details?: InvocationsDetails | undefined): Promise; + declareAndDeploy(payload: DeclareAndDeployContractPayload, details?: InvocationsDetails | undefined): Promise; + deploySelf: ({ classHash, constructorCalldata, addressSalt, contractAddress: providedContractAddress, }: DeployAccountContractPayload, transactionsDetail?: InvocationsDetails) => Promise; + deployAccount({ classHash, constructorCalldata, addressSalt, contractAddress: providedContractAddress, }: DeployAccountContractPayload, transactionsDetail?: InvocationsDetails): Promise; + signMessage(typedData: TypedData): Promise; + hashMessage(typedData: TypedData): Promise; + verifyMessageHash(hash: BigNumberish, signature: Signature): Promise; + verifyMessage(typedData: TypedData, signature: Signature): Promise; + getSuggestedMaxFee({ type, payload }: EstimateFeeAction, details: EstimateFeeDetails): Promise; + /** + * will be renamed to buildDeclareContractTransaction + */ + buildDeclarePayload(payload: DeclareContractPayload, { nonce, chainId, version, walletAddress, maxFee }: InvocationsSignerDetails): Promise; + buildAccountDeployPayload({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { nonce, chainId, version, maxFee }: InvocationsSignerDetails): Promise; + buildUDCContractPayload(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]): Call[]; + simulateTransaction(invocations: Invocations, { nonce, blockIdentifier, skipValidate, skipExecute }?: SimulateTransactionDetails): Promise; + accountInvocationsFactory(invocations: Invocations, { versions, nonce, blockIdentifier }: AccountInvocationsFactoryDetails): Promise; + getStarkName(address?: BigNumberish, // default to the wallet address + StarknetIdContract?: string): Promise; +} + +declare abstract class ContractInterface { + abstract abi: Abi; + abstract address: string; + abstract providerOrAccount: ProviderInterface | AccountInterface; + abstract deployTransactionHash?: string; + readonly functions: { + [name: string]: AsyncContractFunction; + }; + readonly callStatic: { + [name: string]: AsyncContractFunction; + }; + readonly populateTransaction: { + [name: string]: ContractFunction; + }; + readonly estimateFee: { + [name: string]: ContractFunction; + }; + readonly [key: string]: AsyncContractFunction | any; + /** + * Saves the address of the contract deployed on network that will be used for interaction + * + * @param address - address of the contract + */ + abstract attach(address: string): void; + /** + * Attaches to new Provider or Account + * + * @param providerOrAccount - new Provider or Account to attach to + */ + abstract connect(providerOrAccount: ProviderInterface | AccountInterface): void; + /** + * Resolves when contract is deployed on the network or when no deployment transaction is found + * + * @returns Promise that resolves when contract is deployed on the network or when no deployment transaction is found + * @throws When deployment fails + */ + abstract deployed(): Promise; + /** + * Calls a method on a contract + * + * @param method name of the method + * @param args Array of the arguments for the call + * @param options optional blockIdentifier + * @returns Result of the call as an array with key value pars + */ + abstract call(method: string, args?: ArgsOrCalldata, options?: CallOptions): Promise; + /** + * Invokes a method on a contract + * + * @param method name of the method + * @param args Array of the arguments for the invoke or Calldata + * @param options + * @returns Add Transaction Response + */ + abstract invoke(method: string, args?: ArgsOrCalldata, options?: InvokeOptions): Promise; + /** + * Estimates a method on a contract + * + * @param method name of the method + * @param args Array of the arguments for the call or Calldata + * @param options optional blockIdentifier + */ + abstract estimate(method: string, args?: ArgsOrCalldata, options?: { + blockIdentifier?: BlockIdentifier; + }): Promise; + /** + * Calls a method on a contract + * + * @param method name of the method + * @param args Array of the arguments for the call or Calldata + * @returns Invocation object + */ + abstract populate(method: string, args?: ArgsOrCalldata): Invocation; + /** + * tells if the contract comes from a Cairo 1 contract + * + * @returns TRUE if the contract comes from a Cairo1 contract + * @example + * ```typescript + * const isCairo1: boolean = myContract.isCairo1(); + * ``` + */ + abstract isCairo1(): boolean; +} + +declare const splitArgsAndOptions: (args: ArgsOrCalldataWithOptions) => { + args: ArgsOrCalldata; + options: ContractOptions; +} | { + args: ArgsOrCalldata; + options?: undefined; +}; +declare function getCalldata(args: RawArgs, callback: Function): Calldata; +/** + * Not used at the moment + */ +declare class Contract implements ContractInterface { + abi: Abi; + address: string; + providerOrAccount: ProviderInterface | AccountInterface; + deployTransactionHash?: string; + protected readonly structs: { + [name: string]: StructAbi; + }; + readonly functions: { + [name: string]: AsyncContractFunction; + }; + readonly callStatic: { + [name: string]: AsyncContractFunction; + }; + readonly populateTransaction: { + [name: string]: ContractFunction; + }; + readonly estimateFee: { + [name: string]: ContractFunction; + }; + readonly [key: string]: AsyncContractFunction | any; + private callData; + /** + * Contract class to handle contract methods + * + * @param abi - Abi of the contract object + * @param address (optional) - address to connect to + * @param providerOrAccount (optional) - Provider or Account to attach to + */ + constructor(abi: Abi, address: string, providerOrAccount?: ProviderInterface | AccountInterface); + attach(address: string): void; + connect(providerOrAccount: ProviderInterface | AccountInterface): void; + deployed(): Promise; + call(method: string, args?: ArgsOrCalldata, { parseRequest, parseResponse, formatResponse, blockIdentifier, }?: CallOptions): Promise; + invoke(method: string, args?: ArgsOrCalldata, { parseRequest, maxFee, nonce, signature }?: InvokeOptions): Promise; + estimate(method: string, args?: ArgsOrCalldata): Promise; + populate(method: string, args?: RawArgs): Call; + isCairo1(): boolean; +} + +type ContractFactoryParams = { + compiledContract: CompiledContract; + account: any; + casm?: CairoAssembly; + classHash?: string; + compiledClassHash?: string; + abi?: Abi; +}; +declare class ContractFactory { + compiledContract: CompiledContract; + account: AccountInterface; + abi: Abi; + classHash?: string; + casm?: CairoAssembly; + compiledClassHash?: string; + private CallData; + /** + * @param params CFParams + * - compiledContract: CompiledContract; + * - account: AccountInterface; + * - casm?: CairoAssembly; + * - classHash?: string; + * - compiledClassHash?: string; + * - abi?: Abi; + */ + constructor(params: ContractFactoryParams); + /** + * Deploys contract and returns new instance of the Contract + * If contract is not declared it will first declare it, and then deploy + * + * @param args - Array of the constructor arguments for deployment + * @param options (optional) Object - parseRequest, parseResponse, addressSalt + * @returns deployed Contract + */ + deploy(...args: ArgsOrCalldataWithOptions): Promise; + /** + * Attaches to new Account + * + * @param account - new Provider or Account to attach to + * @returns ContractFactory + */ + connect(account: AccountInterface): ContractFactory; + /** + * Attaches current abi and account to the new address + * + * @param address - Contract address + * @returns Contract + */ + attach(address: string): Contract; +} + +/** + * Keccak hash BigNumberish value + * @param value BigNumberish + * @returns string - hexadecimal string + */ +declare function keccakBn(value: BigNumberish): string; +/** + * Function to get the starknet keccak hash from a string + * + * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L17-L22) + * @param value - string you want to get the starknetKeccak hash from + * @returns starknet keccak hash as BigNumber + */ +declare function starknetKeccak(value: string): bigint; +/** + * Function to get the hex selector from a given function name + * + * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L25-L26) + * @param funcName - selectors abi function name + * @returns hex selector of given abi function name + */ +declare function getSelectorFromName(funcName: string): string; +/** + * Function to get hex selector from function name, decimal string or hex string + * @param value hex string | decimal string | string + * @returns Hex selector + */ +declare function getSelector(value: string): string; + +declare const selector_getSelector: typeof getSelector; +declare const selector_getSelectorFromName: typeof getSelectorFromName; +declare const selector_keccakBn: typeof keccakBn; +declare const selector_starknetKeccak: typeof starknetKeccak; +declare namespace selector { + export { + selector_getSelector as getSelector, + selector_getSelectorFromName as getSelectorFromName, + selector_keccakBn as keccakBn, + selector_starknetKeccak as starknetKeccak, + }; +} + +declare const transactionVersion = 1n; +declare const transactionVersion_2 = 2n; +declare const feeTransactionVersion = 1n; +declare const feeTransactionVersion_2 = 2n; +/** + * Return versions based on version type, default transaction versions + * @param versionType 'fee' | 'transaction' + * @returns versions { v1: bigint; v2: bigint; } + */ +declare function getVersionsByType(versionType?: 'fee' | 'transaction'): { + v1: bigint; + v2: bigint; +}; +declare function computeHashOnElements(data: BigNumberish[]): string; +declare function calculateTransactionHashCommon(txHashPrefix: TransactionHashPrefix, version: BigNumberish, contractAddress: BigNumberish, entryPointSelector: BigNumberish, calldata: RawCalldata, maxFee: BigNumberish, chainId: StarknetChainId, additionalData?: BigNumberish[]): string; +declare function calculateDeployTransactionHash(contractAddress: BigNumberish, constructorCalldata: RawCalldata, version: BigNumberish, chainId: StarknetChainId, constructorName?: string): string; +declare function calculateDeclareTransactionHash(classHash: string, senderAddress: BigNumberish, version: BigNumberish, maxFee: BigNumberish, chainId: StarknetChainId, nonce: BigNumberish, compiledClassHash?: string): string; +declare function calculateDeployAccountTransactionHash(contractAddress: BigNumberish, classHash: BigNumberish, constructorCalldata: RawCalldata, salt: BigNumberish, version: BigNumberish, maxFee: BigNumberish, chainId: StarknetChainId, nonce: BigNumberish): string; +declare function calculateTransactionHash(contractAddress: BigNumberish, version: BigNumberish, calldata: RawCalldata, maxFee: BigNumberish, chainId: StarknetChainId, nonce: BigNumberish): string; +declare function calculateContractAddressFromHash(salt: BigNumberish, classHash: BigNumberish, constructorCalldata: RawArgs, deployerAddress: BigNumberish): string; +declare function formatSpaces(json: string): string; +declare function computeHintedClassHash(compiledContract: LegacyCompiledContract): string; +declare function computeLegacyContractClassHash(contract: LegacyCompiledContract | string): string; +declare function computeCompiledClassHash(casm: CompiledSierraCasm): string; +declare function computeSierraContractClassHash(sierra: CompiledSierra): string; +/** + * Compute ClassHash (sierra or legacy) based on provided contract + * @param contract CompiledContract | CompiledSierra | string + * @returns HexString ClassHash + */ +declare function computeContractClassHash(contract: CompiledContract | string): string; + +declare const hash_calculateContractAddressFromHash: typeof calculateContractAddressFromHash; +declare const hash_calculateDeclareTransactionHash: typeof calculateDeclareTransactionHash; +declare const hash_calculateDeployAccountTransactionHash: typeof calculateDeployAccountTransactionHash; +declare const hash_calculateDeployTransactionHash: typeof calculateDeployTransactionHash; +declare const hash_calculateTransactionHash: typeof calculateTransactionHash; +declare const hash_calculateTransactionHashCommon: typeof calculateTransactionHashCommon; +declare const hash_computeCompiledClassHash: typeof computeCompiledClassHash; +declare const hash_computeContractClassHash: typeof computeContractClassHash; +declare const hash_computeHashOnElements: typeof computeHashOnElements; +declare const hash_computeLegacyContractClassHash: typeof computeLegacyContractClassHash; +declare const hash_computeSierraContractClassHash: typeof computeSierraContractClassHash; +declare const hash_feeTransactionVersion: typeof feeTransactionVersion; +declare const hash_feeTransactionVersion_2: typeof feeTransactionVersion_2; +declare const hash_formatSpaces: typeof formatSpaces; +declare const hash_getSelector: typeof getSelector; +declare const hash_getSelectorFromName: typeof getSelectorFromName; +declare const hash_getVersionsByType: typeof getVersionsByType; +declare const hash_keccakBn: typeof keccakBn; +declare const hash_poseidon: typeof poseidon; +declare const hash_starknetKeccak: typeof starknetKeccak; +declare const hash_transactionVersion: typeof transactionVersion; +declare const hash_transactionVersion_2: typeof transactionVersion_2; +declare namespace hash { + export { + hash_calculateContractAddressFromHash as calculateContractAddressFromHash, + hash_calculateDeclareTransactionHash as calculateDeclareTransactionHash, + hash_calculateDeployAccountTransactionHash as calculateDeployAccountTransactionHash, + hash_calculateDeployTransactionHash as calculateDeployTransactionHash, + hash_calculateTransactionHash as calculateTransactionHash, + hash_calculateTransactionHashCommon as calculateTransactionHashCommon, + hash_computeCompiledClassHash as computeCompiledClassHash, + hash_computeContractClassHash as computeContractClassHash, + hash_computeHashOnElements as computeHashOnElements, + hash_computeLegacyContractClassHash as computeLegacyContractClassHash, + hash_computeSierraContractClassHash as computeSierraContractClassHash, + computeHintedClassHash as default, + hash_feeTransactionVersion as feeTransactionVersion, + hash_feeTransactionVersion_2 as feeTransactionVersion_2, + hash_formatSpaces as formatSpaces, + hash_getSelector as getSelector, + hash_getSelectorFromName as getSelectorFromName, + hash_getVersionsByType as getVersionsByType, + hash_keccakBn as keccakBn, + hash_poseidon as poseidon, + hash_starknetKeccak as starknetKeccak, + hash_transactionVersion as transactionVersion, + hash_transactionVersion_2 as transactionVersion_2, + }; +} + +declare const parse: (x: string) => any; +declare const parseAlwaysAsBig: (x: string) => any; +declare const stringify: (value: json$1.JavaScriptValue, replacer?: any, space?: string | number | undefined, numberStringifiers?: json$1.NumberStringifier[] | undefined) => string; +/** @deprecated equivalent to 'stringify', alias will be removed */ +declare const stringifyAlwaysAsBig: (value: json$1.JavaScriptValue, replacer?: any, space?: string | number | undefined, numberStringifiers?: json$1.NumberStringifier[] | undefined) => string; + +declare const json_parse: typeof parse; +declare const json_parseAlwaysAsBig: typeof parseAlwaysAsBig; +declare const json_stringify: typeof stringify; +declare const json_stringifyAlwaysAsBig: typeof stringifyAlwaysAsBig; +declare namespace json { + export { + json_parse as parse, + json_parseAlwaysAsBig as parseAlwaysAsBig, + json_stringify as stringify, + json_stringifyAlwaysAsBig as stringifyAlwaysAsBig, + }; +} + +declare function isHex(hex: string): boolean; +declare function toBigInt(value: BigNumberish): bigint; +declare function isBigInt(value: any): value is bigint; +declare function toHex(number: BigNumberish): string; +/** + * Convert BigNumberish to STORAGE_KEY + * Same as toHex but conforming pattern STORAGE_KEY pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$ + * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes. + * 0x0 + [0-7] + 62 hex = 0x + 64 hex + * @param number BigNumberish + */ +declare function toStorageKey(number: BigNumberish): string; +declare function hexToDecimalString(hex: string): string; +/** + * Remove hex string leading zero and lower case '0x01A'.. -> '0x1a..' + * @param hex string + */ +declare const cleanHex: (hex: string) => string; +declare function assertInRange(input: BigNumberish, lowerBound: BigNumberish, upperBound: BigNumberish, inputName?: string): void; +declare function bigNumberishArrayToDecimalStringArray(rawCalldata: BigNumberish[]): string[]; +declare function bigNumberishArrayToHexadecimalStringArray(rawCalldata: BigNumberish[]): string[]; +declare const isStringWholeNumber: (value: string) => boolean; +declare const toHexString: (value: string) => string; +declare function getDecimalString(value: string): string; +declare function getHexString(value: string): string; +declare function getHexStringArray(value: Array): string[]; +declare const toCairoBool: (value: boolean) => string; +/** + * Convert a hex string to an array of Bytes (Uint8Array) + * @param value hex string + * @returns an array of Bytes + */ +declare function hexToBytes(value: string): Uint8Array; + +type num_BigNumberish = BigNumberish; +declare const num_assertInRange: typeof assertInRange; +declare const num_bigNumberishArrayToDecimalStringArray: typeof bigNumberishArrayToDecimalStringArray; +declare const num_bigNumberishArrayToHexadecimalStringArray: typeof bigNumberishArrayToHexadecimalStringArray; +declare const num_cleanHex: typeof cleanHex; +declare const num_getDecimalString: typeof getDecimalString; +declare const num_getHexString: typeof getHexString; +declare const num_getHexStringArray: typeof getHexStringArray; +declare const num_hexToBytes: typeof hexToBytes; +declare const num_hexToDecimalString: typeof hexToDecimalString; +declare const num_isBigInt: typeof isBigInt; +declare const num_isHex: typeof isHex; +declare const num_isStringWholeNumber: typeof isStringWholeNumber; +declare const num_toBigInt: typeof toBigInt; +declare const num_toCairoBool: typeof toCairoBool; +declare const num_toHex: typeof toHex; +declare const num_toHexString: typeof toHexString; +declare const num_toStorageKey: typeof toStorageKey; +declare namespace num { + export { + num_BigNumberish as BigNumberish, + num_assertInRange as assertInRange, + num_bigNumberishArrayToDecimalStringArray as bigNumberishArrayToDecimalStringArray, + num_bigNumberishArrayToHexadecimalStringArray as bigNumberishArrayToHexadecimalStringArray, + num_cleanHex as cleanHex, + num_getDecimalString as getDecimalString, + num_getHexString as getHexString, + num_getHexStringArray as getHexStringArray, + num_hexToBytes as hexToBytes, + num_hexToDecimalString as hexToDecimalString, + num_isBigInt as isBigInt, + num_isHex as isHex, + num_isStringWholeNumber as isStringWholeNumber, + num_toBigInt as toBigInt, + num_toCairoBool as toCairoBool, + num_toHex as toHex, + num_toHexString as toHexString, + num_toStorageKey as toStorageKey, + }; +} + +/** + * Transforms a list of Calls, each with their own calldata, into + * two arrays: one with the entrypoints, and one with the concatenated calldata. + * @param calls + * @returns + */ +declare const transformCallsToMulticallArrays: (calls: Call[]) => { + callArray: ParsedStruct[]; + calldata: Calldata; +}; +/** + * Transforms a list of calls in the full flattened calldata expected + * by the __execute__ protocol. + * @param calls + * @returns + */ +declare const fromCallsToExecuteCalldata: (calls: Call[]) => Calldata; +declare const fromCallsToExecuteCalldataWithNonce: (calls: Call[], nonce: BigNumberish) => Calldata; +/** + * Format Data inside Calls + * @param calls Call[] + * @returns CallStruct + */ +declare const transformCallsToMulticallArrays_cairo1: (calls: Call[]) => CallStruct[]; +/** + * Transforms a list of calls in the full flattened calldata expected + * by the __execute__ protocol. + * @param calls + * @returns Calldata + */ +declare const fromCallsToExecuteCalldata_cairo1: (calls: Call[]) => Calldata; +/** + * + * @param calls Call array + * @param cairoVersion Defaults to 0 + * @returns string[] of calldata + */ +declare const getExecuteCalldata: (calls: Call[], cairoVersion?: CairoVersion) => Calldata; + +declare const transaction_fromCallsToExecuteCalldata: typeof fromCallsToExecuteCalldata; +declare const transaction_fromCallsToExecuteCalldataWithNonce: typeof fromCallsToExecuteCalldataWithNonce; +declare const transaction_fromCallsToExecuteCalldata_cairo1: typeof fromCallsToExecuteCalldata_cairo1; +declare const transaction_getExecuteCalldata: typeof getExecuteCalldata; +declare const transaction_transformCallsToMulticallArrays: typeof transformCallsToMulticallArrays; +declare const transaction_transformCallsToMulticallArrays_cairo1: typeof transformCallsToMulticallArrays_cairo1; +declare namespace transaction { + export { + transaction_fromCallsToExecuteCalldata as fromCallsToExecuteCalldata, + transaction_fromCallsToExecuteCalldataWithNonce as fromCallsToExecuteCalldataWithNonce, + transaction_fromCallsToExecuteCalldata_cairo1 as fromCallsToExecuteCalldata_cairo1, + transaction_getExecuteCalldata as getExecuteCalldata, + transaction_transformCallsToMulticallArrays as transformCallsToMulticallArrays, + transaction_transformCallsToMulticallArrays_cairo1 as transformCallsToMulticallArrays_cairo1, + }; +} + +/** + * Function to compress compiled cairo program + * + * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/services/api/gateway/transaction.py#L54-L58) + * @param jsonProgram - json file representing the compiled cairo program + * @returns Compressed cairo program + */ +declare function compressProgram(jsonProgram: Program | string): CompressedProgram; +/** + * Function to decompress compressed compiled cairo program + * + * @param base64 CompressedProgram + * @returns parsed decompressed compiled cairo program + */ +declare function decompressProgram(base64: CompressedProgram): any; +declare function randomAddress(): string; +declare function makeAddress(input: string): string; +declare function formatSignature(sig?: Signature): ArraySignatureType; +declare function signatureToDecimalArray(sig?: Signature): ArraySignatureType; +declare function signatureToHexArray(sig?: Signature): ArraySignatureType; +declare function estimatedFeeToMaxFee(estimatedFee: BigNumberish, overhead?: number): bigint; + +declare const stark_compressProgram: typeof compressProgram; +declare const stark_decompressProgram: typeof decompressProgram; +declare const stark_estimatedFeeToMaxFee: typeof estimatedFeeToMaxFee; +declare const stark_formatSignature: typeof formatSignature; +declare const stark_makeAddress: typeof makeAddress; +declare const stark_randomAddress: typeof randomAddress; +declare const stark_signatureToDecimalArray: typeof signatureToDecimalArray; +declare const stark_signatureToHexArray: typeof signatureToHexArray; +declare namespace stark { + export { + stark_compressProgram as compressProgram, + stark_decompressProgram as decompressProgram, + stark_estimatedFeeToMaxFee as estimatedFeeToMaxFee, + stark_formatSignature as formatSignature, + stark_makeAddress as makeAddress, + stark_randomAddress as randomAddress, + stark_signatureToDecimalArray as signatureToDecimalArray, + stark_signatureToHexArray as signatureToHexArray, + }; +} + +declare class MerkleTree { + leaves: string[]; + branches: string[][]; + root: string; + constructor(leafHashes: string[]); + private build; + static hash(a: string, b: string): string; + getProof(leaf: string, branch?: string[], hashPath?: string[]): string[]; +} +declare function proofMerklePath(root: string, leaf: string, path: string[]): boolean; + +type merkle_MerkleTree = MerkleTree; +declare const merkle_MerkleTree: typeof MerkleTree; +declare const merkle_proofMerklePath: typeof proofMerklePath; +declare namespace merkle { + export { + merkle_MerkleTree as MerkleTree, + merkle_proofMerklePath as proofMerklePath, + }; +} + +declare function uint256ToBN(uint256: Uint256): bigint; +declare const UINT_128_MAX: bigint; +declare const UINT_256_MAX: bigint; +declare function isUint256(bn: BigNumberish): boolean; +declare function bnToUint256(bignumber: BigNumberish): Uint256; + +declare const uint256$1_UINT_128_MAX: typeof UINT_128_MAX; +declare const uint256$1_UINT_256_MAX: typeof UINT_256_MAX; +type uint256$1_Uint256 = Uint256; +declare const uint256$1_bnToUint256: typeof bnToUint256; +declare const uint256$1_isUint256: typeof isUint256; +declare const uint256$1_uint256ToBN: typeof uint256ToBN; +declare namespace uint256$1 { + export { + uint256$1_UINT_128_MAX as UINT_128_MAX, + uint256$1_UINT_256_MAX as UINT_256_MAX, + uint256$1_Uint256 as Uint256, + uint256$1_bnToUint256 as bnToUint256, + uint256$1_isUint256 as isUint256, + uint256$1_uint256ToBN as uint256ToBN, + }; +} + +declare function isASCII(str: string): boolean; +declare function isShortString(str: string): boolean; +declare function isDecimalString(decim: string): boolean; +/** + * check if value is string text, and not string-hex, string-number + * @param val any + * @returns boolean + */ +declare function isText(val: any): boolean; +declare const isShortText: (val: any) => boolean; +declare const isLongText: (val: any) => boolean; +declare function splitLongString(longStr: string): string[]; +/** + * Convert an ASCII string to an hexadecimal string. + * @param str - ASCII string - + * 31 characters maxi. Ex : "uri/item23.jpg" + * @returns a string representing an Hex number 248 bits max. + * @Example + * ```typescript + * const myEncodedString: string = encodeShortString("uri/pict/t38.jpg"); + * ``` + * returns : string : "0x7572692f706963742f7433382e6a7067" + */ +declare function encodeShortString(str: string): string; +/** + * Convert an hexadecimal or decimal string to an ASCII string. + * @param str - string - representing a 248 bits max number. + * + * Ex : hex : "0x1A4F64EA56" or decimal : "236942575435676423" + * @returns a string with 31 characters max. + * @Example + * ```typescript + * const myDecodedString: string = decodeShortString("0x7572692f706963742f7433382e6a7067"); + * ``` + * return : string : "uri/pict/t38.jpg" + */ +declare function decodeShortString(str: string): string; + +declare const shortString_decodeShortString: typeof decodeShortString; +declare const shortString_encodeShortString: typeof encodeShortString; +declare const shortString_isASCII: typeof isASCII; +declare const shortString_isDecimalString: typeof isDecimalString; +declare const shortString_isLongText: typeof isLongText; +declare const shortString_isShortString: typeof isShortString; +declare const shortString_isShortText: typeof isShortText; +declare const shortString_isText: typeof isText; +declare const shortString_splitLongString: typeof splitLongString; +declare namespace shortString { + export { + shortString_decodeShortString as decodeShortString, + shortString_encodeShortString as encodeShortString, + shortString_isASCII as isASCII, + shortString_isDecimalString as isDecimalString, + shortString_isLongText as isLongText, + shortString_isShortString as isShortString, + shortString_isShortText as isShortText, + shortString_isText as isText, + shortString_splitLongString as splitLongString, + }; +} + +declare function prepareSelector(selector: string): string; +declare function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType; +interface Context { + parent?: string; + key?: string; +} +/** + * Get the dependencies of a struct type. If a struct has the same dependency multiple times, it's only included once + * in the resulting array. + * + * @param {TypedData} typedData + * @param {string} type + * @param {string[]} [dependencies] + * @return {string[]} + */ +declare const getDependencies: (types: TypedData['types'], type: string, dependencies?: string[]) => string[]; +/** + * Encode a type to a string. All dependant types are alphabetically sorted. + * + * @param {TypedData} typedData + * @param {string} type + * @return {string} + */ +declare const encodeType: (types: TypedData['types'], type: string) => string; +/** + * Get a type string as hash. + * + * @param {TypedData} typedData + * @param {string} type + * @return {string} + */ +declare const getTypeHash: (types: TypedData['types'], type: string) => string; +/** + * Encodes a single value to an ABI serialisable string, number or Buffer. Returns the data as tuple, which consists of + * an array of ABI compatible types, and an array of corresponding values. + * + * @param {TypedData} typedData + * @param {string} type + * @param {any} data + * @returns {[string, string]} + */ +declare const encodeValue: (types: TypedData['types'], type: string, data: unknown, ctx?: Context) => [string, string]; +/** + * Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values. All + * dependant types are automatically encoded. + * + * @param {TypedData} typedData + * @param {string} type + * @param {Record} data + */ +declare const encodeData: (types: T["types"], type: string, data: T["message"]) => string[][]; +/** + * Get encoded data as a hash. The data should be a key -> value object with all the required values. All dependant + * types are automatically encoded. + * + * @param {TypedData} typedData + * @param {string} type + * @param {Record} data + * @return {Buffer} + */ +declare const getStructHash: (types: T["types"], type: string, data: T["message"]) => string; +/** + * Get the EIP-191 encoded message to sign, from the typedData object. + * + * @param {TypedData} typedData + * @param {BigNumberish} account + * @return {string} + */ +declare const getMessageHash: (typedData: TypedData, account: BigNumberish) => string; + +type typedData_StarkNetDomain = StarkNetDomain; +type typedData_StarkNetMerkleType = StarkNetMerkleType; +type typedData_StarkNetType = StarkNetType; +type typedData_TypedData = TypedData; +declare const typedData_encodeData: typeof encodeData; +declare const typedData_encodeType: typeof encodeType; +declare const typedData_encodeValue: typeof encodeValue; +declare const typedData_getDependencies: typeof getDependencies; +declare const typedData_getMessageHash: typeof getMessageHash; +declare const typedData_getStructHash: typeof getStructHash; +declare const typedData_getTypeHash: typeof getTypeHash; +declare const typedData_isMerkleTreeType: typeof isMerkleTreeType; +declare const typedData_prepareSelector: typeof prepareSelector; +declare namespace typedData { + export { + typedData_StarkNetDomain as StarkNetDomain, + typedData_StarkNetMerkleType as StarkNetMerkleType, + typedData_StarkNetType as StarkNetType, + typedData_TypedData as TypedData, + typedData_encodeData as encodeData, + typedData_encodeType as encodeType, + typedData_encodeValue as encodeValue, + typedData_getDependencies as getDependencies, + typedData_getMessageHash as getMessageHash, + typedData_getStructHash as getStructHash, + typedData_getTypeHash as getTypeHash, + typedData_isMerkleTreeType as isMerkleTreeType, + typedData_prepareSelector as prepareSelector, + }; +} + +declare function useDecoded(encoded: bigint[]): string; +declare function useEncoded(decoded: string): bigint; +declare const enum StarknetIdContract { + MAINNET = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678", + TESTNET = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce" +} +declare function getStarknetIdContract(chainId: StarknetChainId): string; + +type starknetId_StarknetIdContract = StarknetIdContract; +declare const starknetId_StarknetIdContract: typeof StarknetIdContract; +declare const starknetId_getStarknetIdContract: typeof getStarknetIdContract; +declare const starknetId_useDecoded: typeof useDecoded; +declare const starknetId_useEncoded: typeof useEncoded; +declare namespace starknetId { + export { + starknetId_StarknetIdContract as StarknetIdContract, + starknetId_getStarknetIdContract as getStarknetIdContract, + starknetId_useDecoded as useDecoded, + starknetId_useEncoded as useEncoded, + }; +} + +declare function wait(delay: number): Promise; +declare function createSierraContractClass(contract: CompiledSierra): SierraContractClass; +declare function parseContract(contract: CompiledContract | string): ContractClass$1; + +declare const provider_createSierraContractClass: typeof createSierraContractClass; +declare const provider_parseContract: typeof parseContract; +declare const provider_wait: typeof wait; +declare namespace provider { + export { + provider_createSierraContractClass as createSierraContractClass, + provider_parseContract as parseContract, + provider_wait as wait, + }; +} + +declare function addAddressPadding(address: BigNumberish): string; +declare function validateAndParseAddress(address: BigNumberish): string; +declare function getChecksumAddress(address: BigNumberish): string; +declare function validateChecksumAddress(address: string): boolean; + +/** + * Loosely validate a URL `string`. + * @param {String} s + * @return {Boolean} + */ +declare function isUrl(s?: string): boolean; +declare function buildUrl(baseUrl: string, defaultPath: string, urlOrPath?: string): string; + +declare abstract class AbiParserInterface { + /** + * Helper to calculate inputs length from abi + * @param abiMethod FunctionAbi + * @return number + */ + abstract methodInputsLength(abiMethod: FunctionAbi): number; + /** + * + * @param name string + * @return FunctionAbi | undefined + */ + abstract getMethod(name: string): FunctionAbi | undefined; + /** + * Return Abi in legacy format + * @return Abi + */ + abstract getLegacyFormat(): Abi; +} + +declare const isLen: (name: string) => boolean; +declare const isTypeFelt: (type: string) => boolean; +declare const isTypeArray: (type: string) => boolean; +declare const isTypeTuple: (type: string) => boolean; +declare const isTypeNamedTuple: (type: string) => boolean; +declare const isTypeStruct: (type: string, structs: AbiStructs) => boolean; +declare const isTypeUint: (type: string) => boolean; +declare const isTypeUint256: (type: string) => boolean; +declare const isTypeBool: (type: string) => boolean; +declare const isTypeContractAddress: (type: string) => boolean; +declare const isCairo1Type: (type: string) => boolean; +declare const getArrayType: (type: string) => string; +/** + * tells if an ABI comes from a Cairo 1 contract + * + * @param abi representing the interface of a Cairo contract + * @returns TRUE if it is an ABI from a Cairo1 contract + * @example + * ```typescript + * const isCairo1: boolean = isCairo1Abi(myAbi: Abi); + * ``` + */ +declare function isCairo1Abi(abi: Abi): boolean; +/** + * named tuple are described as js object {} + * struct types are described as js object {} + * array types are described as js array [] + */ +/** + * Uint256 cairo type (helper for common struct type) + */ +declare const uint256: (it: BigNumberish) => Uint256; +/** + * unnamed tuple cairo type (helper same as common struct type) + */ +declare const tuple: (...args: (BigNumberish | object | boolean)[]) => Record; +/** + * felt cairo type + */ +declare function felt(it: BigNumberish): string; + +declare const cairo_felt: typeof felt; +declare const cairo_getArrayType: typeof getArrayType; +declare const cairo_isCairo1Abi: typeof isCairo1Abi; +declare const cairo_isCairo1Type: typeof isCairo1Type; +declare const cairo_isLen: typeof isLen; +declare const cairo_isTypeArray: typeof isTypeArray; +declare const cairo_isTypeBool: typeof isTypeBool; +declare const cairo_isTypeContractAddress: typeof isTypeContractAddress; +declare const cairo_isTypeFelt: typeof isTypeFelt; +declare const cairo_isTypeNamedTuple: typeof isTypeNamedTuple; +declare const cairo_isTypeStruct: typeof isTypeStruct; +declare const cairo_isTypeTuple: typeof isTypeTuple; +declare const cairo_isTypeUint: typeof isTypeUint; +declare const cairo_isTypeUint256: typeof isTypeUint256; +declare const cairo_tuple: typeof tuple; +declare const cairo_uint256: typeof uint256; +declare namespace cairo { + export { + cairo_felt as felt, + cairo_getArrayType as getArrayType, + cairo_isCairo1Abi as isCairo1Abi, + cairo_isCairo1Type as isCairo1Type, + cairo_isLen as isLen, + cairo_isTypeArray as isTypeArray, + cairo_isTypeBool as isTypeBool, + cairo_isTypeContractAddress as isTypeContractAddress, + cairo_isTypeFelt as isTypeFelt, + cairo_isTypeNamedTuple as isTypeNamedTuple, + cairo_isTypeStruct as isTypeStruct, + cairo_isTypeTuple as isTypeTuple, + cairo_isTypeUint as isTypeUint, + cairo_isTypeUint256 as isTypeUint256, + cairo_tuple as tuple, + cairo_uint256 as uint256, + }; +} + +declare class CallData { + abi: Abi; + parser: AbiParserInterface; + protected readonly structs: AbiStructs; + constructor(abi: Abi); + /** + * Validate arguments passed to the method as corresponding to the ones in the abi + * @param type ValidateType - type of the method + * @param method string - name of the method + * @param args ArgsOrCalldata - arguments that are passed to the method + */ + validate(type: ValidateType, method: string, args?: ArgsOrCalldata): void; + /** + * Compile contract callData with abi + * Parse the calldata by using input fields from the abi for that method + * @param method string - method name + * @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order). + * @return Calldata - parsed arguments in format that contract is expecting + * @example + * ```typescript + * const calldata = myCallData.compile("constructor",["0x34a",[1,3n]]); + * ``` + * ```typescript + * const calldata2 = myCallData.compile("constructor",{list:[1,3n],balance:"0x34"}); // wrong order is valid + * ``` + */ + compile(method: string, argsCalldata: RawArgs): Calldata; + /** + * Compile contract callData without abi + * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data + * @returns Calldata + */ + static compile(rawArgs: RawArgs): Calldata; + /** + * Parse elements of the response array and structuring them into response object + * @param method string - method name + * @param response string[] - response from the method + * @return Result - parsed response corresponding to the abi + */ + parse(method: string, response: string[]): Result; + /** + * Format cairo method response data to native js values based on provided format schema + * @param method string - cairo method name + * @param response string[] - cairo method response + * @param format object - formatter object schema + * @returns Result - parsed and formatted response object + */ + format(method: string, response: string[], format: object): Result; + /** + * Helper to extract structs from abi + * @param abi Abi + * @returns AbiStructs - structs from abi + */ + static getAbiStruct(abi: Abi): AbiStructs; + /** + * Helper: Compile HexCalldata | RawCalldata | RawArgs + * @param rawCalldata HexCalldata | RawCalldata | RawArgs + * @returns Calldata + */ + static toCalldata(rawCalldata?: RawArgs): Calldata; + /** + * Helper: Convert raw to HexCalldata + * @param raw HexCalldata | RawCalldata | RawArgs + * @returns HexCalldata + */ + static toHex(raw?: RawArgs): HexCalldata; +} + +declare function isSierra(contract: CairoContract | string): contract is SierraContractClass | CompiledSierra; +declare function extractContractHashes(payload: DeclareContractPayload): CompleteDeclareContractPayload; +/** + * Helper to redeclare response Cairo0 contract + * @param ccr ContractClassResponse + * @returns LegacyCompiledContract + */ +declare function contractClassResponseToLegacyCompiledContract(ccr: ContractClassResponse): LegacyCompiledContract; + +/** + * Parse Transaction Receipt Event from UDC invoke transaction and + * create DeployContractResponse compatibile response with adition of UDC Event data + * + * @param txReceipt + * @returns DeployContractResponse | UDC Event Response data + */ +declare function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse): { + transaction_hash: string; + contract_address: string; + address: string; + deployer: string; + unique: string; + classHash: string; + calldata_len: string; + calldata: string[]; + salt: string; +}; + +/** + * Main + */ + +/** @deprecated prefer the 'num' naming */ +declare const number: typeof num; + +export { Abi, AbiEntry, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteCode, CairoAssembly, CairoContract, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionReceiptResponse, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractResponse, DeployContractUDCResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LibraryError, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, rpc as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, RejectedTransactionReceiptResponse, RejectedTransactionResponse, Result, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, sequencer as Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, TransactionStatus, TransactionType$1 as TransactionType, Tupled, TypedData, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions }; diff --git a/web/lib/starknet-estfee-tx-ver/dist/index.global.js b/web/lib/starknet-estfee-tx-ver/dist/index.global.js new file mode 100644 index 000000000..f6c0674d5 --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/dist/index.global.js @@ -0,0 +1,14540 @@ +"use strict"; +var starknet = (() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __commonJS = (cb, mod2) => function __require() { + return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; + }; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, + mod2 + )); + var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); + + // node_modules/whatwg-fetch/fetch.js + var fetch_exports = {}; + __export(fetch_exports, { + DOMException: () => DOMException, + Headers: () => Headers, + Request: () => Request, + Response: () => Response, + fetch: () => fetch + }); + function isDataView(obj) { + return obj && DataView.prototype.isPrototypeOf(obj); + } + function normalizeName(name) { + if (typeof name !== "string") { + name = String(name); + } + if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") { + throw new TypeError('Invalid character in header field name: "' + name + '"'); + } + return name.toLowerCase(); + } + function normalizeValue(value) { + if (typeof value !== "string") { + value = String(value); + } + return value; + } + function iteratorFor(items) { + var iterator = { + next: function() { + var value = items.shift(); + return { done: value === void 0, value }; + } + }; + if (support.iterable) { + iterator[Symbol.iterator] = function() { + return iterator; + }; + } + return iterator; + } + function Headers(headers) { + this.map = {}; + if (headers instanceof Headers) { + headers.forEach(function(value, name) { + this.append(name, value); + }, this); + } else if (Array.isArray(headers)) { + headers.forEach(function(header) { + this.append(header[0], header[1]); + }, this); + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function(name) { + this.append(name, headers[name]); + }, this); + } + } + function consumed(body) { + if (body.bodyUsed) { + return Promise.reject(new TypeError("Already read")); + } + body.bodyUsed = true; + } + function fileReaderReady(reader) { + return new Promise(function(resolve, reject) { + reader.onload = function() { + resolve(reader.result); + }; + reader.onerror = function() { + reject(reader.error); + }; + }); + } + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsArrayBuffer(blob); + return promise; + } + function readBlobAsText(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsText(blob); + return promise; + } + function readArrayBufferAsText(buf) { + var view = new Uint8Array(buf); + var chars = new Array(view.length); + for (var i = 0; i < view.length; i++) { + chars[i] = String.fromCharCode(view[i]); + } + return chars.join(""); + } + function bufferClone(buf) { + if (buf.slice) { + return buf.slice(0); + } else { + var view = new Uint8Array(buf.byteLength); + view.set(new Uint8Array(buf)); + return view.buffer; + } + } + function Body() { + this.bodyUsed = false; + this._initBody = function(body) { + this.bodyUsed = this.bodyUsed; + this._bodyInit = body; + if (!body) { + this._bodyText = ""; + } else if (typeof body === "string") { + this._bodyText = body; + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body; + } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { + this._bodyFormData = body; + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this._bodyText = body.toString(); + } else if (support.arrayBuffer && support.blob && isDataView(body)) { + this._bodyArrayBuffer = bufferClone(body.buffer); + this._bodyInit = new Blob([this._bodyArrayBuffer]); + } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { + this._bodyArrayBuffer = bufferClone(body); + } else { + this._bodyText = body = Object.prototype.toString.call(body); + } + if (!this.headers.get("content-type")) { + if (typeof body === "string") { + this.headers.set("content-type", "text/plain;charset=UTF-8"); + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set("content-type", this._bodyBlob.type); + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"); + } + } + }; + if (support.blob) { + this.blob = function() { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + } else if (this._bodyFormData) { + throw new Error("could not read FormData body as blob"); + } else { + return Promise.resolve(new Blob([this._bodyText])); + } + }; + this.arrayBuffer = function() { + if (this._bodyArrayBuffer) { + var isConsumed = consumed(this); + if (isConsumed) { + return isConsumed; + } + if (ArrayBuffer.isView(this._bodyArrayBuffer)) { + return Promise.resolve( + this._bodyArrayBuffer.buffer.slice( + this._bodyArrayBuffer.byteOffset, + this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength + ) + ); + } else { + return Promise.resolve(this._bodyArrayBuffer); + } + } else { + return this.blob().then(readBlobAsArrayBuffer); + } + }; + } + this.text = function() { + var rejected = consumed(this); + if (rejected) { + return rejected; + } + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); + } else if (this._bodyFormData) { + throw new Error("could not read FormData body as text"); + } else { + return Promise.resolve(this._bodyText); + } + }; + if (support.formData) { + this.formData = function() { + return this.text().then(decode); + }; + } + this.json = function() { + return this.text().then(JSON.parse); + }; + return this; + } + function normalizeMethod(method) { + var upcased = method.toUpperCase(); + return methods.indexOf(upcased) > -1 ? upcased : method; + } + function Request(input, options) { + if (!(this instanceof Request)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + } + options = options || {}; + var body = options.body; + if (input instanceof Request) { + if (input.bodyUsed) { + throw new TypeError("Already read"); + } + this.url = input.url; + this.credentials = input.credentials; + if (!options.headers) { + this.headers = new Headers(input.headers); + } + this.method = input.method; + this.mode = input.mode; + this.signal = input.signal; + if (!body && input._bodyInit != null) { + body = input._bodyInit; + input.bodyUsed = true; + } + } else { + this.url = String(input); + } + this.credentials = options.credentials || this.credentials || "same-origin"; + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers); + } + this.method = normalizeMethod(options.method || this.method || "GET"); + this.mode = options.mode || this.mode || null; + this.signal = options.signal || this.signal; + this.referrer = null; + if ((this.method === "GET" || this.method === "HEAD") && body) { + throw new TypeError("Body not allowed for GET or HEAD requests"); + } + this._initBody(body); + if (this.method === "GET" || this.method === "HEAD") { + if (options.cache === "no-store" || options.cache === "no-cache") { + var reParamSearch = /([?&])_=[^&]*/; + if (reParamSearch.test(this.url)) { + this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime()); + } else { + var reQueryString = /\?/; + this.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime(); + } + } + } + } + function decode(body) { + var form = new FormData(); + body.trim().split("&").forEach(function(bytes2) { + if (bytes2) { + var split2 = bytes2.split("="); + var name = split2.shift().replace(/\+/g, " "); + var value = split2.join("=").replace(/\+/g, " "); + form.append(decodeURIComponent(name), decodeURIComponent(value)); + } + }); + return form; + } + function parseHeaders(rawHeaders) { + var headers = new Headers(); + var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " "); + preProcessedHeaders.split("\r").map(function(header) { + return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header; + }).forEach(function(line) { + var parts = line.split(":"); + var key = parts.shift().trim(); + if (key) { + var value = parts.join(":").trim(); + headers.append(key, value); + } + }); + return headers; + } + function Response(bodyInit, options) { + if (!(this instanceof Response)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + } + if (!options) { + options = {}; + } + this.type = "default"; + this.status = options.status === void 0 ? 200 : options.status; + this.ok = this.status >= 200 && this.status < 300; + this.statusText = options.statusText === void 0 ? "" : "" + options.statusText; + this.headers = new Headers(options.headers); + this.url = options.url || ""; + this._initBody(bodyInit); + } + function fetch(input, init) { + return new Promise(function(resolve, reject) { + var request = new Request(input, init); + if (request.signal && request.signal.aborted) { + return reject(new DOMException("Aborted", "AbortError")); + } + var xhr = new XMLHttpRequest(); + function abortXhr() { + xhr.abort(); + } + xhr.onload = function() { + var options = { + status: xhr.status, + statusText: xhr.statusText, + headers: parseHeaders(xhr.getAllResponseHeaders() || "") + }; + options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL"); + var body = "response" in xhr ? xhr.response : xhr.responseText; + setTimeout(function() { + resolve(new Response(body, options)); + }, 0); + }; + xhr.onerror = function() { + setTimeout(function() { + reject(new TypeError("Network request failed")); + }, 0); + }; + xhr.ontimeout = function() { + setTimeout(function() { + reject(new TypeError("Network request failed")); + }, 0); + }; + xhr.onabort = function() { + setTimeout(function() { + reject(new DOMException("Aborted", "AbortError")); + }, 0); + }; + function fixUrl(url) { + try { + return url === "" && global2.location.href ? global2.location.href : url; + } catch (e) { + return url; + } + } + xhr.open(request.method, fixUrl(request.url), true); + if (request.credentials === "include") { + xhr.withCredentials = true; + } else if (request.credentials === "omit") { + xhr.withCredentials = false; + } + if ("responseType" in xhr) { + if (support.blob) { + xhr.responseType = "blob"; + } else if (support.arrayBuffer && request.headers.get("Content-Type") && request.headers.get("Content-Type").indexOf("application/octet-stream") !== -1) { + xhr.responseType = "arraybuffer"; + } + } + if (init && typeof init.headers === "object" && !(init.headers instanceof Headers)) { + Object.getOwnPropertyNames(init.headers).forEach(function(name) { + xhr.setRequestHeader(name, normalizeValue(init.headers[name])); + }); + } else { + request.headers.forEach(function(value, name) { + xhr.setRequestHeader(name, value); + }); + } + if (request.signal) { + request.signal.addEventListener("abort", abortXhr); + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + request.signal.removeEventListener("abort", abortXhr); + } + }; + } + xhr.send(typeof request._bodyInit === "undefined" ? null : request._bodyInit); + }); + } + var global2, support, viewClasses, isArrayBufferView, methods, redirectStatuses, DOMException; + var init_fetch = __esm({ + "node_modules/whatwg-fetch/fetch.js"() { + global2 = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || typeof global2 !== "undefined" && global2; + support = { + searchParams: "URLSearchParams" in global2, + iterable: "Symbol" in global2 && "iterator" in Symbol, + blob: "FileReader" in global2 && "Blob" in global2 && function() { + try { + new Blob(); + return true; + } catch (e) { + return false; + } + }(), + formData: "FormData" in global2, + arrayBuffer: "ArrayBuffer" in global2 + }; + if (support.arrayBuffer) { + viewClasses = [ + "[object Int8Array]", + "[object Uint8Array]", + "[object Uint8ClampedArray]", + "[object Int16Array]", + "[object Uint16Array]", + "[object Int32Array]", + "[object Uint32Array]", + "[object Float32Array]", + "[object Float64Array]" + ]; + isArrayBufferView = ArrayBuffer.isView || function(obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; + }; + } + Headers.prototype.append = function(name, value) { + name = normalizeName(name); + value = normalizeValue(value); + var oldValue = this.map[name]; + this.map[name] = oldValue ? oldValue + ", " + value : value; + }; + Headers.prototype["delete"] = function(name) { + delete this.map[normalizeName(name)]; + }; + Headers.prototype.get = function(name) { + name = normalizeName(name); + return this.has(name) ? this.map[name] : null; + }; + Headers.prototype.has = function(name) { + return this.map.hasOwnProperty(normalizeName(name)); + }; + Headers.prototype.set = function(name, value) { + this.map[normalizeName(name)] = normalizeValue(value); + }; + Headers.prototype.forEach = function(callback, thisArg) { + for (var name in this.map) { + if (this.map.hasOwnProperty(name)) { + callback.call(thisArg, this.map[name], name, this); + } + } + }; + Headers.prototype.keys = function() { + var items = []; + this.forEach(function(value, name) { + items.push(name); + }); + return iteratorFor(items); + }; + Headers.prototype.values = function() { + var items = []; + this.forEach(function(value) { + items.push(value); + }); + return iteratorFor(items); + }; + Headers.prototype.entries = function() { + var items = []; + this.forEach(function(value, name) { + items.push([name, value]); + }); + return iteratorFor(items); + }; + if (support.iterable) { + Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + } + methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"]; + Request.prototype.clone = function() { + return new Request(this, { body: this._bodyInit }); + }; + Body.call(Request.prototype); + Body.call(Response.prototype); + Response.prototype.clone = function() { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }); + }; + Response.error = function() { + var response = new Response(null, { status: 0, statusText: "" }); + response.type = "error"; + return response; + }; + redirectStatuses = [301, 302, 303, 307, 308]; + Response.redirect = function(url, status) { + if (redirectStatuses.indexOf(status) === -1) { + throw new RangeError("Invalid status code"); + } + return new Response(null, { status, headers: { location: url } }); + }; + DOMException = global2.DOMException; + try { + new DOMException(); + } catch (err2) { + DOMException = function(message, name) { + this.message = message; + this.name = name; + var error = Error(message); + this.stack = error.stack; + }; + DOMException.prototype = Object.create(Error.prototype); + DOMException.prototype.constructor = DOMException; + } + fetch.polyfill = true; + if (!global2.fetch) { + global2.fetch = fetch; + global2.Headers = Headers; + global2.Request = Request; + global2.Response = Response; + } + } + }); + + // node_modules/isomorphic-fetch/fetch-npm-browserify.js + var require_fetch_npm_browserify = __commonJS({ + "node_modules/isomorphic-fetch/fetch-npm-browserify.js"(exports, module) { + init_fetch(); + module.exports = self.fetch.bind(self); + } + }); + + // node_modules/url-join/lib/url-join.js + var require_url_join = __commonJS({ + "node_modules/url-join/lib/url-join.js"(exports, module) { + (function(name, context, definition) { + if (typeof module !== "undefined" && module.exports) + module.exports = definition(); + else if (typeof define === "function" && define.amd) + define(definition); + else + context[name] = definition(); + })("urljoin", exports, function() { + function normalize(strArray) { + var resultArray = []; + if (strArray.length === 0) { + return ""; + } + if (typeof strArray[0] !== "string") { + throw new TypeError("Url must be a string. Received " + strArray[0]); + } + if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) { + var first = strArray.shift(); + strArray[0] = first + strArray[0]; + } + if (strArray[0].match(/^file:\/\/\//)) { + strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, "$1:///"); + } else { + strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, "$1://"); + } + for (var i = 0; i < strArray.length; i++) { + var component = strArray[i]; + if (typeof component !== "string") { + throw new TypeError("Url must be a string. Received " + component); + } + if (component === "") { + continue; + } + if (i > 0) { + component = component.replace(/^[\/]+/, ""); + } + if (i < strArray.length - 1) { + component = component.replace(/[\/]+$/, ""); + } else { + component = component.replace(/[\/]+$/, "/"); + } + resultArray.push(component); + } + var str = resultArray.join("/"); + str = str.replace(/\/(\?|&|#[^!])/g, "$1"); + var parts = str.split("?"); + str = parts.shift() + (parts.length > 0 ? "?" : "") + parts.join("&"); + return str; + } + return function() { + var input; + if (typeof arguments[0] === "object") { + input = arguments[0]; + } else { + input = [].slice.call(arguments); + } + return normalize(input); + }; + }); + } + }); + + // src/index.ts + var src_exports = {}; + __export(src_exports, { + Account: () => Account, + AccountInterface: () => AccountInterface, + BlockStatus: () => BlockStatus, + BlockTag: () => BlockTag, + CallData: () => CallData, + Contract: () => Contract, + ContractFactory: () => ContractFactory, + ContractInterface: () => ContractInterface, + CustomError: () => CustomError, + EntryPointType: () => EntryPointType, + GatewayError: () => GatewayError, + HttpError: () => HttpError, + LibraryError: () => LibraryError, + Provider: () => Provider, + ProviderInterface: () => ProviderInterface, + RPC: () => rpc_exports, + RpcProvider: () => RpcProvider, + SIMULATION_FLAG: () => SIMULATION_FLAG, + Sequencer: () => sequencer_exports, + SequencerProvider: () => SequencerProvider, + Signer: () => Signer, + SignerInterface: () => SignerInterface, + TransactionStatus: () => TransactionStatus, + TransactionType: () => TransactionType, + Uint: () => Uint, + ValidateType: () => ValidateType, + addAddressPadding: () => addAddressPadding, + buildUrl: () => buildUrl, + cairo: () => cairo_exports, + constants: () => constants_exports, + contractClassResponseToLegacyCompiledContract: () => contractClassResponseToLegacyCompiledContract, + defaultProvider: () => defaultProvider, + ec: () => ec_exports, + encode: () => encode_exports, + extractContractHashes: () => extractContractHashes, + fixProto: () => fixProto, + fixStack: () => fixStack, + getCalldata: () => getCalldata, + getChecksumAddress: () => getChecksumAddress, + hash: () => hash_exports, + isSierra: () => isSierra, + isUrl: () => isUrl, + json: () => json_exports, + merkle: () => merkle_exports, + num: () => num_exports, + number: () => number2, + parseUDCEvent: () => parseUDCEvent, + provider: () => provider_exports, + selector: () => selector_exports, + shortString: () => shortString_exports, + splitArgsAndOptions: () => splitArgsAndOptions, + stark: () => stark_exports, + starknetId: () => starknetId_exports, + transaction: () => transaction_exports, + typedData: () => typedData_exports, + types: () => types_exports, + uint256: () => uint256_exports, + validateAndParseAddress: () => validateAndParseAddress, + validateChecksumAddress: () => validateChecksumAddress + }); + + // src/constants.ts + var constants_exports = {}; + __export(constants_exports, { + ALPHA: () => ALPHA, + API_VERSION: () => API_VERSION, + BETA: () => BETA, + BaseUrl: () => BaseUrl, + CONSTANT_POINTS: () => CONSTANT_POINTS, + EC_ORDER: () => EC_ORDER, + FIELD_GEN: () => FIELD_GEN, + FIELD_PRIME: () => FIELD_PRIME, + FIELD_SIZE: () => FIELD_SIZE, + IS_BROWSER: () => IS_BROWSER, + MASK_250: () => MASK_250, + MASK_251: () => MASK_251, + MAX_ECDSA_VAL: () => MAX_ECDSA_VAL, + NetworkName: () => NetworkName, + StarknetChainId: () => StarknetChainId, + TransactionHashPrefix: () => TransactionHashPrefix, + UDC: () => UDC, + ZERO: () => ZERO + }); + + // src/utils/encode.ts + var encode_exports = {}; + __export(encode_exports, { + IS_BROWSER: () => IS_BROWSER, + addHexPrefix: () => addHexPrefix, + arrayBufferToString: () => arrayBufferToString, + atobUniversal: () => atobUniversal, + btoaUniversal: () => btoaUniversal, + buf2hex: () => buf2hex, + calcByteLength: () => calcByteLength, + padLeft: () => padLeft, + removeHexPrefix: () => removeHexPrefix, + sanitizeBytes: () => sanitizeBytes, + sanitizeHex: () => sanitizeHex, + stringToArrayBuffer: () => stringToArrayBuffer, + utf8ToArray: () => utf8ToArray + }); + var IS_BROWSER = typeof window !== "undefined"; + var STRING_ZERO = "0"; + function arrayBufferToString(array) { + return new Uint8Array(array).reduce((data, byte) => data + String.fromCharCode(byte), ""); + } + function stringToArrayBuffer(s) { + return Uint8Array.from(s, (c) => c.charCodeAt(0)); + } + function atobUniversal(a) { + return IS_BROWSER ? stringToArrayBuffer(atob(a)) : Buffer.from(a, "base64"); + } + function btoaUniversal(b) { + return IS_BROWSER ? btoa(arrayBufferToString(b)) : Buffer.from(b).toString("base64"); + } + function buf2hex(buffer) { + return [...buffer].map((x) => x.toString(16).padStart(2, "0")).join(""); + } + function removeHexPrefix(hex) { + return hex.replace(/^0x/i, ""); + } + function addHexPrefix(hex) { + return `0x${removeHexPrefix(hex)}`; + } + function padString(str, length, left, padding = STRING_ZERO) { + const diff = length - str.length; + let result = str; + if (diff > 0) { + const pad = padding.repeat(diff); + result = left ? pad + str : str + pad; + } + return result; + } + function padLeft(str, length, padding = STRING_ZERO) { + return padString(str, length, true, padding); + } + function calcByteLength(length, byteSize = 8) { + const remainder = length % byteSize; + return remainder ? (length - remainder) / byteSize * byteSize + byteSize : length; + } + function sanitizeBytes(str, byteSize = 8, padding = STRING_ZERO) { + return padLeft(str, calcByteLength(str.length, byteSize), padding); + } + function sanitizeHex(hex) { + hex = removeHexPrefix(hex); + hex = sanitizeBytes(hex, 2); + if (hex) { + hex = addHexPrefix(hex); + } + return hex; + } + function utf8ToArray(str) { + return new TextEncoder().encode(str); + } + + // src/constants.ts + var ZERO = 0n; + var MASK_250 = 2n ** 250n - 1n; + var MASK_251 = 2n ** 251n; + var API_VERSION = ZERO; + var BaseUrl = /* @__PURE__ */ ((BaseUrl2) => { + BaseUrl2["SN_MAIN"] = "https://alpha-mainnet.starknet.io"; + BaseUrl2["SN_GOERLI"] = "https://alpha4.starknet.io"; + BaseUrl2["SN_GOERLI2"] = "https://alpha4-2.starknet.io"; + return BaseUrl2; + })(BaseUrl || {}); + var NetworkName = /* @__PURE__ */ ((NetworkName2) => { + NetworkName2["SN_MAIN"] = "SN_MAIN"; + NetworkName2["SN_GOERLI"] = "SN_GOERLI"; + NetworkName2["SN_GOERLI2"] = "SN_GOERLI2"; + return NetworkName2; + })(NetworkName || {}); + var StarknetChainId = /* @__PURE__ */ ((StarknetChainId3) => { + StarknetChainId3["SN_MAIN"] = "0x534e5f4d41494e"; + StarknetChainId3["SN_GOERLI"] = "0x534e5f474f45524c49"; + StarknetChainId3["SN_GOERLI2"] = "0x534e5f474f45524c4932"; + return StarknetChainId3; + })(StarknetChainId || {}); + var TransactionHashPrefix = /* @__PURE__ */ ((TransactionHashPrefix2) => { + TransactionHashPrefix2["DECLARE"] = "0x6465636c617265"; + TransactionHashPrefix2["DEPLOY"] = "0x6465706c6f79"; + TransactionHashPrefix2["DEPLOY_ACCOUNT"] = "0x6465706c6f795f6163636f756e74"; + TransactionHashPrefix2["INVOKE"] = "0x696e766f6b65"; + TransactionHashPrefix2["L1_HANDLER"] = "0x6c315f68616e646c6572"; + return TransactionHashPrefix2; + })(TransactionHashPrefix || {}); + var UDC = { + ADDRESS: "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", + ENTRYPOINT: "deployContract" + }; + var FIELD_PRIME = "800000000000011000000000000000000000000000000000000000000000001"; + var FIELD_GEN = "3"; + var FIELD_SIZE = 251; + var EC_ORDER = "800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F"; + var ALPHA = "1"; + var BETA = "6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89"; + var MAX_ECDSA_VAL = "800000000000000000000000000000000000000000000000000000000000000"; + var CONSTANT_POINTS = [ + [ + "49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804", + "3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a" + ], + [ + "1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca", + "5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f" + ], + [ + "234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b", + "3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615" + ], + [ + "3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476", + "7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19" + ], + [ + "40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c", + "109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740" + ], + [ + "2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b", + "6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26" + ], + [ + "6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674", + "606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2" + ], + [ + "7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62", + "a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae" + ], + [ + "3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec", + "45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9" + ], + [ + "1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e", + "30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a" + ], + [ + "6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26", + "31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2" + ], + [ + "54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4", + "c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5" + ], + [ + "35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6", + "5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d" + ], + [ + "4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23", + "5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820" + ], + [ + "648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf", + "72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c" + ], + [ + "bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b", + "6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6" + ], + [ + "35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357", + "3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14" + ], + [ + "36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643", + "7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c" + ], + [ + "5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661", + "9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753" + ], + [ + "21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6", + "51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c" + ], + [ + "19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9", + "515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa" + ], + [ + "888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24", + "730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea" + ], + [ + "75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977", + "4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8" + ], + [ + "640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5", + "3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c" + ], + [ + "6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96", + "7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645" + ], + [ + "5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876", + "518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200" + ], + [ + "6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4", + "2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc" + ], + [ + "542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18", + "5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c" + ], + [ + "299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de", + "1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958" + ], + [ + "628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73", + "ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d" + ], + [ + "6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933", + "6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db" + ], + [ + "28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a", + "7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba" + ], + [ + "619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02", + "2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308" + ], + [ + "641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96", + "6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837" + ], + [ + "58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2", + "124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9" + ], + [ + "a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74", + "1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8" + ], + [ + "744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b", + "7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f" + ], + [ + "434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c", + "7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39" + ], + [ + "7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73", + "56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431" + ], + [ + "4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7", + "ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e" + ], + [ + "250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe", + "1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04" + ], + [ + "2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2", + "55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63" + ], + [ + "249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245", + "7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e" + ], + [ + "6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb", + "640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8" + ], + [ + "2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9", + "636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be" + ], + [ + "4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea", + "1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff" + ], + [ + "46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca", + "1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f" + ], + [ + "2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152", + "1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7" + ], + [ + "386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b", + "2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5" + ], + [ + "407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90", + "436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f" + ], + [ + "1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f", + "69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec" + ], + [ + "7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e", + "34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69" + ], + [ + "299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913", + "b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675" + ], + [ + "551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5", + "5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e" + ], + [ + "7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2", + "3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6" + ], + [ + "28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504", + "7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b" + ], + [ + "1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b", + "4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4" + ], + [ + "2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b", + "9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911" + ], + [ + "770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed", + "42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd" + ], + [ + "5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9", + "3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d" + ], + [ + "6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825", + "1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177" + ], + [ + "404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1", + "3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb" + ], + [ + "20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc", + "106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7" + ], + [ + "119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa", + "1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773" + ], + [ + "45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749", + "ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965" + ], + [ + "1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38", + "593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f" + ], + [ + "186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3", + "55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c" + ], + [ + "58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9", + "6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0" + ], + [ + "13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b", + "3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4" + ], + [ + "48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676", + "4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1" + ], + [ + "4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158", + "620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef" + ], + [ + "4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b", + "4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8" + ], + [ + "7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9", + "2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de" + ], + [ + "65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f", + "3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6" + ], + [ + "1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d", + "21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a" + ], + [ + "3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b", + "5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f" + ], + [ + "4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4", + "5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b" + ], + [ + "6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8", + "e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9" + ], + [ + "748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5", + "3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93" + ], + [ + "7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3", + "5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4" + ], + [ + "6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f", + "32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039" + ], + [ + "1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309", + "56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4" + ], + [ + "1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd", + "431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c" + ], + [ + "6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162", + "14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3" + ], + [ + "738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e", + "33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47" + ], + [ + "2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8", + "92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc" + ], + [ + "181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe", + "5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff" + ], + [ + "1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a", + "4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f" + ], + [ + "e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873", + "34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f" + ], + [ + "4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45", + "3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af" + ], + [ + "37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed", + "37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6" + ], + [ + "27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c", + "6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d" + ], + [ + "2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf", + "306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413" + ], + [ + "307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72", + "3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995" + ], + [ + "79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc", + "40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2" + ], + [ + "4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292", + "7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717" + ], + [ + "645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2", + "15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab" + ], + [ + "1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f", + "583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c" + ], + [ + "66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca", + "505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4" + ], + [ + "5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1", + "bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323" + ], + [ + "a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194", + "4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689" + ], + [ + "1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c", + "7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf" + ], + [ + "48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f", + "781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3" + ], + [ + "17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd", + "6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223" + ], + [ + "5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89", + "1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff" + ], + [ + "6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58", + "436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e" + ], + [ + "7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6", + "484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4" + ], + [ + "17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d", + "7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f" + ], + [ + "7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf", + "33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78" + ], + [ + "7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d", + "6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb" + ], + [ + "273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128", + "653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f" + ], + [ + "3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212", + "65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e" + ], + [ + "5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee", + "3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22" + ], + [ + "7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9", + "71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e" + ], + [ + "40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62", + "499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42" + ], + [ + "6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465", + "35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37" + ], + [ + "604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6", + "68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457" + ], + [ + "73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4", + "4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb" + ], + [ + "3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1", + "677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0" + ], + [ + "39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f", + "20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952" + ], + [ + "326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c", + "7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1" + ], + [ + "53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632", + "2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1" + ], + [ + "6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e", + "beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63" + ], + [ + "3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332", + "529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7" + ], + [ + "3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e", + "3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740" + ], + [ + "7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a", + "68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400" + ], + [ + "1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb", + "5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9" + ], + [ + "3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344", + "52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590" + ], + [ + "44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa", + "6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940" + ], + [ + "7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e", + "78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9" + ], + [ + "7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d", + "4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62" + ], + [ + "7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c", + "636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84" + ], + [ + "758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2", + "1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245" + ], + [ + "7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e", + "229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470" + ], + [ + "78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614", + "246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675" + ], + [ + "6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647", + "599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4" + ], + [ + "4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e", + "1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad" + ], + [ + "3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d", + "617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c" + ], + [ + "5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287", + "1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d" + ], + [ + "3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004", + "7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232" + ], + [ + "3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb", + "563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6" + ], + [ + "16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52", + "7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e" + ], + [ + "75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4", + "35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0" + ], + [ + "3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8", + "6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd" + ], + [ + "54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579", + "7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0" + ], + [ + "d1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0", + "2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45" + ], + [ + "2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d", + "70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b" + ], + [ + "752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3", + "3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef" + ], + [ + "63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e", + "37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e" + ], + [ + "d6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b", + "5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018" + ], + [ + "12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557", + "6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613" + ], + [ + "46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c", + "76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df" + ], + [ + "4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516", + "5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29" + ], + [ + "71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833", + "85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346" + ], + [ + "5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61", + "3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950" + ], + [ + "161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941", + "78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b" + ], + [ + "1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1", + "66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d" + ], + [ + "56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44", + "47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e" + ], + [ + "4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491", + "430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4" + ], + [ + "7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606", + "312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295" + ], + [ + "16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe", + "7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24" + ], + [ + "323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b", + "4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265" + ], + [ + "624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d", + "261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430" + ], + [ + "f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d", + "b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6" + ], + [ + "686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec", + "7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6" + ], + [ + "3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e", + "634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af" + ], + [ + "484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b", + "34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8" + ], + [ + "203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a", + "2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2" + ], + [ + "2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d", + "6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6" + ], + [ + "5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef", + "30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d" + ], + [ + "57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741", + "7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad" + ], + [ + "611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1", + "3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4" + ], + [ + "1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31", + "3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527" + ], + [ + "275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234", + "2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521" + ], + [ + "6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95", + "5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e" + ], + [ + "44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c", + "3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e" + ], + [ + "fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966", + "110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9" + ], + [ + "9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef", + "4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51" + ], + [ + "71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7", + "7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9" + ], + [ + "1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345", + "4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc" + ], + [ + "3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115", + "a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24" + ], + [ + "c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d", + "729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d" + ], + [ + "44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d", + "212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8" + ], + [ + "35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f", + "74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62" + ], + [ + "e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03", + "3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357" + ], + [ + "3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a", + "5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df" + ], + [ + "222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c", + "72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42" + ], + [ + "3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764", + "480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c" + ], + [ + "adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187", + "60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8" + ], + [ + "3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9", + "7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996" + ], + [ + "12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32", + "6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1" + ], + [ + "27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b", + "c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917" + ], + [ + "431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6", + "30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197" + ], + [ + "4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33", + "627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c" + ], + [ + "2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8", + "1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f" + ], + [ + "e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc", + "58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9" + ], + [ + "7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5", + "74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1" + ], + [ + "62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b", + "1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315" + ], + [ + "1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938", + "44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b" + ], + [ + "78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea", + "6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41" + ], + [ + "5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d", + "1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb" + ], + [ + "62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04", + "6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f" + ], + [ + "4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f", + "941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494" + ], + [ + "52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1", + "987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782" + ], + [ + "1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f", + "38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b" + ], + [ + "4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232", + "7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c" + ], + [ + "69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73", + "a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897" + ], + [ + "b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62", + "24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915" + ], + [ + "5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb", + "6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9" + ], + [ + "1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0", + "23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699" + ], + [ + "2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5", + "1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862" + ], + [ + "d26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3", + "34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a" + ], + [ + "91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563", + "e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a" + ], + [ + "1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7", + "7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd" + ], + [ + "4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f", + "47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e" + ], + [ + "3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069", + "47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc" + ], + [ + "758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657", + "3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83" + ], + [ + "19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8", + "5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709" + ], + [ + "28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855", + "14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2" + ], + [ + "3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f", + "69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d" + ], + [ + "77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b", + "7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df" + ], + [ + "97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6", + "2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223" + ], + [ + "a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647", + "37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2" + ], + [ + "e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc", + "1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a" + ], + [ + "2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de", + "6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591" + ], + [ + "744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f", + "685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d" + ], + [ + "40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd", + "2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e" + ], + [ + "5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc", + "2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2" + ], + [ + "5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985", + "49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183" + ], + [ + "2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649", + "61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d" + ], + [ + "ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381", + "190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60" + ], + [ + "233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c", + "7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef" + ], + [ + "42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce", + "12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65" + ], + [ + "30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44", + "5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a" + ], + [ + "4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a", + "4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93" + ], + [ + "62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466", + "5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0" + ], + [ + "5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f", + "5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94" + ], + [ + "670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728", + "26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0" + ], + [ + "3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5", + "56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015" + ], + [ + "4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3", + "1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e" + ], + [ + "4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0", + "97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09" + ], + [ + "574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219", + "49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8" + ], + [ + "7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554", + "47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba" + ], + [ + "67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6", + "39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8" + ], + [ + "63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b", + "60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9" + ], + [ + "3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543", + "56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628" + ], + [ + "758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129", + "622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746" + ], + [ + "38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c", + "145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e" + ], + [ + "206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad", + "6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8" + ], + [ + "56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d", + "526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6" + ], + [ + "4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378", + "3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d" + ], + [ + "450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58", + "1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7" + ], + [ + "6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d", + "28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2" + ], + [ + "1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf", + "fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb" + ], + [ + "4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997", + "40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c" + ], + [ + "21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef", + "4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f" + ], + [ + "350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046", + "5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b" + ], + [ + "529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6", + "3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491" + ], + [ + "55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d", + "159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9" + ], + [ + "405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f", + "4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d" + ], + [ + "376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe", + "5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba" + ], + [ + "2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38", + "7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089" + ], + [ + "3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed", + "5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5" + ], + [ + "7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4", + "3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe" + ], + [ + "4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d", + "204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89" + ], + [ + "79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72", + "3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb" + ], + [ + "297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c", + "6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993" + ], + [ + "44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7", + "1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc" + ], + [ + "6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26", + "64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd" + ], + [ + "14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24", + "5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1" + ], + [ + "95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83", + "1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1" + ], + [ + "2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5", + "5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67" + ], + [ + "61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d", + "23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795" + ], + [ + "79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf", + "2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6" + ], + [ + "45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b", + "2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd" + ], + [ + "37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007", + "50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c" + ], + [ + "71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b", + "3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6" + ], + [ + "78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06", + "5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256" + ], + [ + "b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15", + "653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83" + ], + [ + "441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc", + "4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59" + ], + [ + "2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa", + "4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0" + ], + [ + "3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f", + "4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c" + ], + [ + "5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092", + "5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56" + ], + [ + "3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771", + "459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999" + ], + [ + "5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f", + "56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49" + ], + [ + "1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281", + "5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a" + ], + [ + "1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40", + "6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488" + ], + [ + "61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b", + "27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad" + ], + [ + "7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e", + "481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf" + ], + [ + "124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316", + "33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987" + ], + [ + "61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c", + "5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb" + ], + [ + "70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d", + "3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc" + ], + [ + "41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f", + "7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce" + ], + [ + "62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8", + "1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771" + ], + [ + "441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a", + "29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086" + ], + [ + "2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee", + "11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77" + ], + [ + "5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea", + "63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc" + ], + [ + "3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7", + "7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092" + ], + [ + "95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922", + "159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9" + ], + [ + "621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c", + "65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd" + ], + [ + "54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e", + "680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313" + ], + [ + "21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d", + "7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8" + ], + [ + "3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3", + "12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801" + ], + [ + "befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392", + "6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8" + ], + [ + "15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6", + "30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df" + ], + [ + "38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8", + "786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13" + ], + [ + "6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72", + "1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a" + ], + [ + "5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30", + "1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea" + ], + [ + "309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1", + "505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851" + ], + [ + "89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc", + "1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540" + ], + [ + "480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84", + "511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570" + ], + [ + "3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb", + "49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920" + ], + [ + "66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd", + "4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b" + ], + [ + "373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3", + "5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c" + ], + [ + "26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7", + "157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc" + ], + [ + "ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f", + "517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7" + ], + [ + "25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66", + "10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8" + ], + [ + "243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742", + "1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f" + ], + [ + "48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562", + "3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264" + ], + [ + "592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca", + "48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc" + ], + [ + "31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d", + "a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5" + ], + [ + "4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc", + "512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47" + ], + [ + "26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc", + "75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e" + ], + [ + "3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe", + "20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d" + ], + [ + "483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97", + "2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d" + ], + [ + "65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9", + "562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373" + ], + [ + "284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35", + "5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02" + ], + [ + "32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85", + "7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd" + ], + [ + "1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a", + "478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742" + ], + [ + "270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf", + "3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b" + ], + [ + "6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d", + "5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33" + ], + [ + "48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1", + "2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0" + ], + [ + "e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5", + "36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997" + ], + [ + "5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8", + "6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c" + ], + [ + "15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6", + "69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903" + ], + [ + "274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50", + "6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656" + ], + [ + "4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123", + "116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba" + ], + [ + "4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a", + "2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f" + ], + [ + "5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3", + "4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b" + ], + [ + "11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483", + "36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8" + ], + [ + "4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3", + "e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64" + ], + [ + "2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3", + "527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d" + ], + [ + "52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf", + "19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41" + ], + [ + "541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961", + "78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2" + ], + [ + "5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd", + "137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc" + ], + [ + "15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4", + "4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549" + ], + [ + "68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4", + "7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f" + ], + [ + "67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df", + "7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01" + ], + [ + "596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334", + "49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0" + ], + [ + "567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395", + "6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd" + ], + [ + "cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7", + "4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7" + ], + [ + "4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06", + "2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566" + ], + [ + "760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359", + "1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e" + ], + [ + "6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2", + "3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd" + ], + [ + "4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b", + "2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f" + ], + [ + "5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7", + "76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39" + ], + [ + "2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7", + "62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e" + ], + [ + "5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00", + "14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1" + ], + [ + "7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c", + "bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970" + ], + [ + "37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843", + "672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb" + ], + [ + "5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114", + "7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e" + ], + [ + "25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63", + "3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb" + ], + [ + "32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0", + "bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459" + ], + [ + "49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f", + "57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8" + ], + [ + "10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd", + "8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0" + ], + [ + "79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36", + "146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c" + ], + [ + "6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439", + "68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82" + ], + [ + "71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097", + "54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c" + ], + [ + "27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b", + "14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3" + ], + [ + "6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c", + "5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048" + ], + [ + "32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9", + "518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4" + ], + [ + "4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e", + "3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4" + ], + [ + "4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10", + "20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918" + ], + [ + "87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a", + "112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb" + ], + [ + "6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae", + "54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1" + ], + [ + "19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a", + "1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510" + ], + [ + "12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d", + "4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7" + ], + [ + "13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2", + "40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1" + ], + [ + "255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d", + "3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc" + ], + [ + "7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31", + "4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6" + ], + [ + "2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35", + "44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf" + ], + [ + "750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b", + "54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c" + ], + [ + "3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72", + "7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359" + ], + [ + "4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb", + "63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235" + ], + [ + "1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f", + "4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d" + ], + [ + "2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087", + "2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d" + ], + [ + "4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3", + "5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621" + ], + [ + "2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05", + "1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19" + ], + [ + "4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c", + "33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614" + ], + [ + "7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b", + "5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722" + ], + [ + "7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51", + "26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056" + ], + [ + "36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881", + "33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5" + ], + [ + "403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd", + "47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5" + ], + [ + "3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb", + "2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e" + ], + [ + "3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537", + "f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4" + ], + [ + "235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65", + "37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5" + ], + [ + "3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b", + "4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe" + ], + [ + "48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518", + "73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee" + ], + [ + "48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0", + "3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903" + ], + [ + "2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097", + "19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541" + ], + [ + "1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676", + "36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7" + ], + [ + "2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b", + "7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b" + ], + [ + "348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a", + "3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969" + ], + [ + "7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31", + "42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd" + ], + [ + "2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a", + "5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83" + ], + [ + "1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2", + "dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d" + ], + [ + "54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e", + "16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089" + ], + [ + "525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b", + "58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea" + ], + [ + "54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd", + "53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76" + ], + [ + "4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae", + "2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17" + ], + [ + "21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708", + "59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c" + ], + [ + "167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66", + "22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a" + ], + [ + "31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843", + "1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c" + ], + [ + "1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b", + "2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b" + ], + [ + "c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0", + "45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327" + ], + [ + "394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6", + "1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd" + ], + [ + "410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27", + "361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa" + ], + [ + "38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734", + "624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1" + ], + [ + "78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608", + "19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198" + ], + [ + "6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867", + "7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb" + ], + [ + "32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602", + "3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377" + ], + [ + "49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5", + "1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d" + ], + [ + "2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5", + "759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96" + ], + [ + "3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70", + "22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6" + ], + [ + "5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab", + "715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8" + ], + [ + "19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a", + "896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5" + ], + [ + "61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc", + "38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8" + ], + [ + "2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df", + "1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb" + ], + [ + "7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54", + "21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b" + ], + [ + "b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed", + "5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf" + ], + [ + "e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc", + "550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a" + ], + [ + "7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4", + "2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f" + ], + [ + "7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c", + "410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e" + ], + [ + "225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5", + "411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e" + ], + [ + "1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1", + "3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8" + ], + [ + "59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335", + "1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8" + ], + [ + "2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3", + "62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535" + ], + [ + "6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb", + "7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f" + ], + [ + "34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88", + "3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d" + ], + [ + "436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d", + "67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044" + ], + [ + "592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4", + "27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5" + ], + [ + "89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009", + "557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b" + ], + [ + "1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e", + "72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a" + ], + [ + "574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03", + "5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3" + ], + [ + "513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1", + "687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5" + ], + [ + "53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9", + "35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be" + ], + [ + "213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44", + "744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89" + ], + [ + "735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c", + "7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9" + ], + [ + "3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001", + "79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8" + ], + [ + "51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74", + "10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad" + ], + [ + "c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc", + "53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a" + ], + [ + "5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece", + "39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f" + ], + [ + "3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299", + "15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975" + ], + [ + "6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0", + "11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744" + ], + [ + "7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65", + "3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb" + ], + [ + "2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6", + "461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d" + ], + [ + "34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f", + "33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44" + ], + [ + "6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441", + "6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693" + ], + [ + "17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce", + "3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7" + ], + [ + "70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27", + "d18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8" + ], + [ + "2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf", + "5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1" + ], + [ + "5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1", + "eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487" + ], + [ + "6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61", + "911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984" + ], + [ + "74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293", + "761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92" + ], + [ + "44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9", + "249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0" + ], + [ + "2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc", + "6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5" + ], + [ + "3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb", + "6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb" + ], + [ + "284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677", + "516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7" + ], + [ + "2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32", + "7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec" + ], + [ + "5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7", + "6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece" + ], + [ + "74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f", + "156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531" + ], + [ + "334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45", + "221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2" + ], + [ + "7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30", + "3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86" + ], + [ + "4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8", + "6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749" + ], + [ + "1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7", + "3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583" + ], + [ + "294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1", + "d837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad" + ], + [ + "753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39", + "6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75" + ], + [ + "5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e", + "7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8" + ], + [ + "4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f", + "21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e" + ], + [ + "726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8", + "15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12" + ], + [ + "38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2", + "73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b" + ], + [ + "6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291", + "4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75" + ], + [ + "6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f", + "26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05" + ], + [ + "2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155", + "5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244" + ], + [ + "4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7", + "5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1" + ], + [ + "110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3", + "7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43" + ], + [ + "5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096", + "7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2" + ], + [ + "2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d", + "62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b" + ], + [ + "1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d", + "309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4" + ], + [ + "2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d", + "3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf" + ], + [ + "376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543", + "6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547" + ], + [ + "a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066", + "6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471" + ], + [ + "223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed", + "c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa" + ], + [ + "102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2", + "6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65" + ], + [ + "891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2", + "5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37" + ], + [ + "215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203", + "10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266" + ], + [ + "21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36", + "3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3" + ], + [ + "60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae", + "e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879" + ], + [ + "1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5", + "69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3" + ], + [ + "5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e", + "134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec" + ], + [ + "626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8", + "7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0" + ], + [ + "23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd", + "7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf" + ], + [ + "54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202", + "1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426" + ], + [ + "13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c", + "62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9" + ], + [ + "47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98", + "75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb" + ], + [ + "2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585", + "5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c" + ] + ]; + + // src/types/index.ts + var types_exports = {}; + __export(types_exports, { + BlockStatus: () => BlockStatus, + BlockTag: () => BlockTag, + EntryPointType: () => EntryPointType, + RPC: () => rpc_exports, + SIMULATION_FLAG: () => SIMULATION_FLAG, + Sequencer: () => sequencer_exports, + TransactionStatus: () => TransactionStatus, + TransactionType: () => TransactionType, + Uint: () => Uint, + ValidateType: () => ValidateType + }); + + // src/types/account.ts + var SIMULATION_FLAG = /* @__PURE__ */ ((SIMULATION_FLAG2) => { + SIMULATION_FLAG2[SIMULATION_FLAG2["SKIP_VALIDATE"] = 0] = "SKIP_VALIDATE"; + SIMULATION_FLAG2[SIMULATION_FLAG2["SKIP_EXECUTE"] = 1] = "SKIP_EXECUTE"; + return SIMULATION_FLAG2; + })(SIMULATION_FLAG || {}); + + // src/types/calldata.ts + var ValidateType = /* @__PURE__ */ ((ValidateType2) => { + ValidateType2["DEPLOY"] = "DEPLOY"; + ValidateType2["CALL"] = "CALL"; + ValidateType2["INVOKE"] = "INVOKE"; + return ValidateType2; + })(ValidateType || {}); + var Uint = /* @__PURE__ */ ((Uint2) => { + Uint2["u8"] = "core::integer::u8"; + Uint2["u16"] = "core::integer::u16"; + Uint2["u32"] = "core::integer::u32"; + Uint2["u64"] = "core::integer::u64"; + Uint2["u128"] = "core::integer::u128"; + Uint2["u256"] = "core::integer::u256"; + return Uint2; + })(Uint || {}); + + // src/types/lib/contract/index.ts + var EntryPointType = /* @__PURE__ */ ((EntryPointType2) => { + EntryPointType2["EXTERNAL"] = "EXTERNAL"; + EntryPointType2["L1_HANDLER"] = "L1_HANDLER"; + EntryPointType2["CONSTRUCTOR"] = "CONSTRUCTOR"; + return EntryPointType2; + })(EntryPointType || {}); + + // src/types/lib/index.ts + var TransactionType = /* @__PURE__ */ ((TransactionType3) => { + TransactionType3["DECLARE"] = "DECLARE"; + TransactionType3["DEPLOY"] = "DEPLOY"; + TransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT"; + TransactionType3["INVOKE"] = "INVOKE_FUNCTION"; + return TransactionType3; + })(TransactionType || {}); + var TransactionStatus = /* @__PURE__ */ ((TransactionStatus2) => { + TransactionStatus2["NOT_RECEIVED"] = "NOT_RECEIVED"; + TransactionStatus2["RECEIVED"] = "RECEIVED"; + TransactionStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2"; + TransactionStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1"; + TransactionStatus2["REJECTED"] = "REJECTED"; + return TransactionStatus2; + })(TransactionStatus || {}); + var BlockStatus = /* @__PURE__ */ ((BlockStatus2) => { + BlockStatus2["PENDING"] = "PENDING"; + BlockStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1"; + BlockStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2"; + BlockStatus2["REJECTED"] = "REJECTED"; + return BlockStatus2; + })(BlockStatus || {}); + var BlockTag = /* @__PURE__ */ ((BlockTag2) => { + BlockTag2["pending"] = "pending"; + BlockTag2["latest"] = "latest"; + return BlockTag2; + })(BlockTag || {}); + + // src/types/api/rpc.ts + var rpc_exports = {}; + __export(rpc_exports, { + TransactionType: () => TransactionType2 + }); + var TransactionType2 = /* @__PURE__ */ ((TransactionType3) => { + TransactionType3["DECLARE"] = "DECLARE"; + TransactionType3["DEPLOY"] = "DEPLOY"; + TransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT"; + TransactionType3["INVOKE"] = "INVOKE"; + TransactionType3["L1_HANDLER"] = "L1_HANDLER"; + return TransactionType3; + })(TransactionType2 || {}); + + // src/types/api/sequencer.ts + var sequencer_exports = {}; + + // src/utils/assert.ts + function assert(condition, message) { + if (!condition) { + throw new Error(message || "Assertion failure"); + } + } + + // src/utils/num.ts + var num_exports = {}; + __export(num_exports, { + assertInRange: () => assertInRange, + bigNumberishArrayToDecimalStringArray: () => bigNumberishArrayToDecimalStringArray, + bigNumberishArrayToHexadecimalStringArray: () => bigNumberishArrayToHexadecimalStringArray, + cleanHex: () => cleanHex, + getDecimalString: () => getDecimalString, + getHexString: () => getHexString, + getHexStringArray: () => getHexStringArray, + hexToBytes: () => hexToBytes2, + hexToDecimalString: () => hexToDecimalString, + isBigInt: () => isBigInt, + isHex: () => isHex, + isStringWholeNumber: () => isStringWholeNumber, + toBigInt: () => toBigInt, + toCairoBool: () => toCairoBool, + toHex: () => toHex, + toHexString: () => toHexString, + toStorageKey: () => toStorageKey + }); + + // node_modules/@noble/curves/esm/abstract/utils.js + var utils_exports = {}; + __export(utils_exports, { + bitGet: () => bitGet, + bitLen: () => bitLen, + bitMask: () => bitMask, + bitSet: () => bitSet, + bytesToHex: () => bytesToHex, + bytesToNumberBE: () => bytesToNumberBE, + bytesToNumberLE: () => bytesToNumberLE, + concatBytes: () => concatBytes, + createHmacDrbg: () => createHmacDrbg, + ensureBytes: () => ensureBytes, + equalBytes: () => equalBytes, + hexToBytes: () => hexToBytes, + hexToNumber: () => hexToNumber, + numberToBytesBE: () => numberToBytesBE, + numberToBytesLE: () => numberToBytesLE, + numberToHexUnpadded: () => numberToHexUnpadded, + numberToVarBytesBE: () => numberToVarBytesBE, + utf8ToBytes: () => utf8ToBytes, + validateObject: () => validateObject + }); + var _0n = BigInt(0); + var _1n = BigInt(1); + var _2n = BigInt(2); + var u8a = (a) => a instanceof Uint8Array; + var hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function bytesToHex(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + let hex = ""; + for (let i = 0; i < bytes2.length; i++) { + hex += hexes[bytes2[i]]; + } + return hex; + } + function numberToHexUnpadded(num) { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; + } + function hexToNumber(hex) { + if (typeof hex !== "string") + throw new Error("hex string expected, got " + typeof hex); + return BigInt(hex === "" ? "0" : `0x${hex}`); + } + function hexToBytes(hex) { + if (typeof hex !== "string") + throw new Error("hex string expected, got " + typeof hex); + if (hex.length % 2) + throw new Error("hex string is invalid: unpadded " + hex.length); + const array = new Uint8Array(hex.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error("invalid byte sequence"); + array[i] = byte; + } + return array; + } + function bytesToNumberBE(bytes2) { + return hexToNumber(bytesToHex(bytes2)); + } + function bytesToNumberLE(bytes2) { + if (!u8a(bytes2)) + throw new Error("Uint8Array expected"); + return hexToNumber(bytesToHex(Uint8Array.from(bytes2).reverse())); + } + var numberToBytesBE = (n, len) => hexToBytes(n.toString(16).padStart(len * 2, "0")); + var numberToBytesLE = (n, len) => numberToBytesBE(n, len).reverse(); + var numberToVarBytesBE = (n) => hexToBytes(numberToHexUnpadded(n)); + function ensureBytes(title, hex, expectedLength) { + let res; + if (typeof hex === "string") { + try { + res = hexToBytes(hex); + } catch (e) { + throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`); + } + } else if (u8a(hex)) { + res = Uint8Array.from(hex); + } else { + throw new Error(`${title} must be hex string or Uint8Array`); + } + const len = res.length; + if (typeof expectedLength === "number" && len !== expectedLength) + throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`); + return res; + } + function concatBytes(...arrs) { + const r = new Uint8Array(arrs.reduce((sum, a) => sum + a.length, 0)); + let pad = 0; + arrs.forEach((a) => { + if (!u8a(a)) + throw new Error("Uint8Array expected"); + r.set(a, pad); + pad += a.length; + }); + return r; + } + function equalBytes(b1, b2) { + if (b1.length !== b2.length) + return false; + for (let i = 0; i < b1.length; i++) + if (b1[i] !== b2[i]) + return false; + return true; + } + function utf8ToBytes(str) { + if (typeof str !== "string") { + throw new Error(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + function bitLen(n) { + let len; + for (len = 0; n > _0n; n >>= _1n, len += 1) + ; + return len; + } + var bitGet = (n, pos) => n >> BigInt(pos) & _1n; + var bitSet = (n, pos, value) => n | (value ? _1n : _0n) << BigInt(pos); + var bitMask = (n) => (_2n << BigInt(n - 1)) - _1n; + var u8n = (data) => new Uint8Array(data); + var u8fr = (arr) => Uint8Array.from(arr); + function createHmacDrbg(hashLen, qByteLen, hmacFn) { + if (typeof hashLen !== "number" || hashLen < 2) + throw new Error("hashLen must be a number"); + if (typeof qByteLen !== "number" || qByteLen < 2) + throw new Error("qByteLen must be a number"); + if (typeof hmacFn !== "function") + throw new Error("hmacFn must be a function"); + let v = u8n(hashLen); + let k = u8n(hashLen); + let i = 0; + const reset = () => { + v.fill(1); + k.fill(0); + i = 0; + }; + const h = (...b) => hmacFn(k, v, ...b); + const reseed = (seed = u8n()) => { + k = h(u8fr([0]), seed); + v = h(); + if (seed.length === 0) + return; + k = h(u8fr([1]), seed); + v = h(); + }; + const gen2 = () => { + if (i++ >= 1e3) + throw new Error("drbg: tried 1000 values"); + let len = 0; + const out = []; + while (len < qByteLen) { + v = h(); + const sl = v.slice(); + out.push(sl); + len += v.length; + } + return concatBytes(...out); + }; + const genUntil = (seed, pred) => { + reset(); + reseed(seed); + let res = void 0; + while (!(res = pred(gen2()))) + reseed(); + reset(); + return res; + }; + return genUntil; + } + var validatorFns = { + bigint: (val) => typeof val === "bigint", + function: (val) => typeof val === "function", + boolean: (val) => typeof val === "boolean", + string: (val) => typeof val === "string", + isSafeInteger: (val) => Number.isSafeInteger(val), + array: (val) => Array.isArray(val), + field: (val, object) => object.Fp.isValid(val), + hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) + }; + function validateObject(object, validators, optValidators = {}) { + const checkField = (fieldName, type, isOptional) => { + const checkVal = validatorFns[type]; + if (typeof checkVal !== "function") + throw new Error(`Invalid validator "${type}", expected function`); + const val = object[fieldName]; + if (isOptional && val === void 0) + return; + if (!checkVal(val, object)) { + throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`); + } + }; + for (const [fieldName, type] of Object.entries(validators)) + checkField(fieldName, type, false); + for (const [fieldName, type] of Object.entries(optValidators)) + checkField(fieldName, type, true); + return object; + } + + // src/utils/num.ts + function isHex(hex) { + return /^0x[0-9a-f]*$/i.test(hex); + } + function toBigInt(value) { + return BigInt(value); + } + function isBigInt(value) { + return typeof value === "bigint"; + } + function toHex(number3) { + return addHexPrefix(toBigInt(number3).toString(16)); + } + function toStorageKey(number3) { + const res = addHexPrefix(toBigInt(number3).toString(16).padStart(64, "0")); + return res; + } + function hexToDecimalString(hex) { + return BigInt(addHexPrefix(hex)).toString(10); + } + var cleanHex = (hex) => hex.toLowerCase().replace(/^(0x)0+/, "$1"); + function assertInRange(input, lowerBound, upperBound, inputName = "") { + const messageSuffix = inputName === "" ? "invalid length" : `invalid ${inputName} length`; + const inputBigInt = BigInt(input); + const lowerBoundBigInt = BigInt(lowerBound); + const upperBoundBigInt = BigInt(upperBound); + assert( + inputBigInt >= lowerBoundBigInt && inputBigInt <= upperBoundBigInt, + `Message not signable, ${messageSuffix}.` + ); + } + function bigNumberishArrayToDecimalStringArray(rawCalldata) { + return rawCalldata.map((x) => toBigInt(x).toString(10)); + } + function bigNumberishArrayToHexadecimalStringArray(rawCalldata) { + return rawCalldata.map((x) => toHex(x)); + } + var isStringWholeNumber = (value) => /^\d+$/.test(value); + var toHexString = (value) => toHex(value); + function getDecimalString(value) { + if (isHex(value)) { + return hexToDecimalString(value); + } + if (isStringWholeNumber(value)) { + return value; + } + throw new Error(`${value} need to be hex-string or whole-number-string`); + } + function getHexString(value) { + if (isHex(value)) { + return value; + } + if (isStringWholeNumber(value)) { + return toHexString(value); + } + throw new Error(`${value} need to be hex-string or whole-number-string`); + } + function getHexStringArray(value) { + return value.map((el) => getHexString(el)); + } + var toCairoBool = (value) => (+value).toString(); + function hexToBytes2(value) { + if (!isHex(value)) + throw new Error(`${value} need to be a hex-string`); + let adaptedValue = removeHexPrefix(value); + if (adaptedValue.length % 2 !== 0) { + adaptedValue = `0${adaptedValue}`; + } + return hexToBytes(adaptedValue); + } + + // src/utils/selector.ts + var selector_exports = {}; + __export(selector_exports, { + getSelector: () => getSelector, + getSelectorFromName: () => getSelectorFromName, + keccakBn: () => keccakBn, + starknetKeccak: () => starknetKeccak + }); + + // node_modules/micro-starknet/lib/esm/index.js + var esm_exports = {}; + __export(esm_exports, { + CURVE: () => CURVE, + Fp251: () => Fp251, + Fp253: () => Fp253, + ProjectivePoint: () => ProjectivePoint, + Signature: () => Signature, + _poseidonMDS: () => _poseidonMDS, + _starkCurve: () => _starkCurve, + computeHashOnElements: () => computeHashOnElements, + ethSigToPrivate: () => ethSigToPrivate, + getAccountPath: () => getAccountPath, + getPublicKey: () => getPublicKey, + getSharedSecret: () => getSharedSecret, + getStarkKey: () => getStarkKey, + grindKey: () => grindKey, + hashChain: () => hashChain, + keccak: () => keccak, + pedersen: () => pedersen, + poseidonBasic: () => poseidonBasic, + poseidonCreate: () => poseidonCreate, + poseidonHash: () => poseidonHash, + poseidonHashFunc: () => poseidonHashFunc, + poseidonHashMany: () => poseidonHashMany, + poseidonHashSingle: () => poseidonHashSingle, + poseidonSmall: () => poseidonSmall, + sign: () => sign, + utils: () => utils, + verify: () => verify + }); + + // node_modules/@noble/hashes/esm/_assert.js + function number(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error(`Wrong positive integer: ${n}`); + } + function bool(b) { + if (typeof b !== "boolean") + throw new Error(`Expected boolean, not ${b}`); + } + function bytes(b, ...lengths) { + if (!(b instanceof Uint8Array)) + throw new TypeError("Expected Uint8Array"); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); + } + function hash(hash2) { + if (typeof hash2 !== "function" || typeof hash2.create !== "function") + throw new Error("Hash should be wrapped by utils.wrapConstructor"); + number(hash2.outputLen); + number(hash2.blockLen); + } + function exists(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error("Hash instance has been destroyed"); + if (checkFinished && instance.finished) + throw new Error("Hash#digest() has already been called"); + } + function output(out, instance) { + bytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error(`digestInto() expects output buffer of length at least ${min}`); + } + } + var assert2 = { + number, + bool, + bytes, + hash, + exists, + output + }; + var assert_default = assert2; + + // node_modules/@noble/hashes/esm/_u64.js + var U32_MASK64 = BigInt(2 ** 32 - 1); + var _32n = BigInt(32); + function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) }; + return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; + } + function split(lst, le = false) { + let Ah = new Uint32Array(lst.length); + let Al = new Uint32Array(lst.length); + for (let i = 0; i < lst.length; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; + } + var toBig = (h, l) => BigInt(h >>> 0) << _32n | BigInt(l >>> 0); + var shrSH = (h, l, s) => h >>> s; + var shrSL = (h, l, s) => h << 32 - s | l >>> s; + var rotrSH = (h, l, s) => h >>> s | l << 32 - s; + var rotrSL = (h, l, s) => h << 32 - s | l >>> s; + var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32; + var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s; + var rotr32H = (h, l) => l; + var rotr32L = (h, l) => h; + var rotlSH = (h, l, s) => h << s | l >>> 32 - s; + var rotlSL = (h, l, s) => l << s | h >>> 32 - s; + var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; + var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; + function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; + } + var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); + var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; + var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); + var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; + var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); + var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; + var u64 = { + fromBig, + split, + toBig, + shrSH, + shrSL, + rotrSH, + rotrSL, + rotrBH, + rotrBL, + rotr32H, + rotr32L, + rotlSH, + rotlSL, + rotlBH, + rotlBL, + add, + add3L, + add3H, + add4L, + add4H, + add5H, + add5L + }; + var u64_default = u64; + + // node_modules/@noble/hashes/esm/crypto.js + var crypto = typeof globalThis === "object" && "crypto" in globalThis ? globalThis.crypto : void 0; + + // node_modules/@noble/hashes/esm/utils.js + var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); + var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); + var rotr = (word, shift) => word << 32 - shift | word >>> shift; + var isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68; + if (!isLE) + throw new Error("Non little-endian hardware is not supported"); + var hexes2 = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, "0")); + function utf8ToBytes2(str) { + if (typeof str !== "string") { + throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`); + } + return new TextEncoder().encode(str); + } + function toBytes(data) { + if (typeof data === "string") + data = utf8ToBytes2(data); + if (!(data instanceof Uint8Array)) + throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`); + return data; + } + function concatBytes2(...arrays) { + if (!arrays.every((a) => a instanceof Uint8Array)) + throw new Error("Uint8Array list expected"); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; + } + var Hash = class { + // Safe version that clones internal state + clone() { + return this._cloneInto(); + } + }; + function wrapConstructor(hashConstructor) { + const hashC = (message) => hashConstructor().update(toBytes(message)).digest(); + const tmp = hashConstructor(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashConstructor(); + return hashC; + } + function wrapConstructorWithOpts(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; + } + function randomBytes(bytesLength = 32) { + if (crypto && typeof crypto.getRandomValues === "function") { + return crypto.getRandomValues(new Uint8Array(bytesLength)); + } + throw new Error("crypto.getRandomValues must be defined"); + } + + // node_modules/@noble/hashes/esm/sha3.js + var [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; + var _0n2 = BigInt(0); + var _1n2 = BigInt(1); + var _2n2 = BigInt(2); + var _7n = BigInt(7); + var _256n = BigInt(256); + var _0x71n = BigInt(113); + for (let round = 0, R = _1n2, x = 1, y = 0; round < 24; round++) { + [x, y] = [y, (2 * x + 3 * y) % 5]; + SHA3_PI.push(2 * (5 * y + x)); + SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64); + let t = _0n2; + for (let j = 0; j < 7; j++) { + R = (R << _1n2 ^ (R >> _7n) * _0x71n) % _256n; + if (R & _2n2) + t ^= _1n2 << (_1n2 << BigInt(j)) - _1n2; + } + _SHA3_IOTA.push(t); + } + var [SHA3_IOTA_H, SHA3_IOTA_L] = u64_default.split(_SHA3_IOTA, true); + var rotlH = (h, l, s) => s > 32 ? u64_default.rotlBH(h, l, s) : u64_default.rotlSH(h, l, s); + var rotlL = (h, l, s) => s > 32 ? u64_default.rotlBL(h, l, s) : u64_default.rotlSL(h, l, s); + function keccakP(s, rounds = 24) { + const B = new Uint32Array(5 * 2); + for (let round = 24 - rounds; round < 24; round++) { + for (let x = 0; x < 10; x++) + B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; + for (let x = 0; x < 10; x += 2) { + const idx1 = (x + 8) % 10; + const idx0 = (x + 2) % 10; + const B0 = B[idx0]; + const B1 = B[idx0 + 1]; + const Th = rotlH(B0, B1, 1) ^ B[idx1]; + const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; + for (let y = 0; y < 50; y += 10) { + s[x + y] ^= Th; + s[x + y + 1] ^= Tl; + } + } + let curH = s[2]; + let curL = s[3]; + for (let t = 0; t < 24; t++) { + const shift = SHA3_ROTL[t]; + const Th = rotlH(curH, curL, shift); + const Tl = rotlL(curH, curL, shift); + const PI = SHA3_PI[t]; + curH = s[PI]; + curL = s[PI + 1]; + s[PI] = Th; + s[PI + 1] = Tl; + } + for (let y = 0; y < 50; y += 10) { + for (let x = 0; x < 10; x++) + B[x] = s[y + x]; + for (let x = 0; x < 10; x++) + s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; + } + s[0] ^= SHA3_IOTA_H[round]; + s[1] ^= SHA3_IOTA_L[round]; + } + B.fill(0); + } + var Keccak = class extends Hash { + // NOTE: we accept arguments in bytes instead of bits here. + constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { + super(); + this.blockLen = blockLen; + this.suffix = suffix; + this.outputLen = outputLen; + this.enableXOF = enableXOF; + this.rounds = rounds; + this.pos = 0; + this.posOut = 0; + this.finished = false; + this.destroyed = false; + assert_default.number(outputLen); + if (0 >= this.blockLen || this.blockLen >= 200) + throw new Error("Sha3 supports only keccak-f1600 function"); + this.state = new Uint8Array(200); + this.state32 = u32(this.state); + } + keccak() { + keccakP(this.state32, this.rounds); + this.posOut = 0; + this.pos = 0; + } + update(data) { + assert_default.exists(this); + const { blockLen, state } = this; + data = toBytes(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + for (let i = 0; i < take; i++) + state[this.pos++] ^= data[pos++]; + if (this.pos === blockLen) + this.keccak(); + } + return this; + } + finish() { + if (this.finished) + return; + this.finished = true; + const { state, suffix, pos, blockLen } = this; + state[pos] ^= suffix; + if ((suffix & 128) !== 0 && pos === blockLen - 1) + this.keccak(); + state[blockLen - 1] ^= 128; + this.keccak(); + } + writeInto(out) { + assert_default.exists(this, false); + assert_default.bytes(out); + this.finish(); + const bufferOut = this.state; + const { blockLen } = this; + for (let pos = 0, len = out.length; pos < len; ) { + if (this.posOut >= blockLen) + this.keccak(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out) { + if (!this.enableXOF) + throw new Error("XOF is not possible for this instance"); + return this.writeInto(out); + } + xof(bytes2) { + assert_default.number(bytes2); + return this.xofInto(new Uint8Array(bytes2)); + } + digestInto(out) { + assert_default.output(out, this); + if (this.finished) + throw new Error("digest() was already called"); + this.writeInto(out); + this.destroy(); + return out; + } + digest() { + return this.digestInto(new Uint8Array(this.outputLen)); + } + destroy() { + this.destroyed = true; + this.state.fill(0); + } + _cloneInto(to) { + const { blockLen, suffix, outputLen, rounds, enableXOF } = this; + to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); + to.state32.set(this.state32); + to.pos = this.pos; + to.posOut = this.posOut; + to.finished = this.finished; + to.rounds = rounds; + to.suffix = suffix; + to.outputLen = outputLen; + to.enableXOF = enableXOF; + to.destroyed = this.destroyed; + return to; + } + }; + var gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); + var sha3_224 = gen(6, 144, 224 / 8); + var sha3_256 = gen(6, 136, 256 / 8); + var sha3_384 = gen(6, 104, 384 / 8); + var sha3_512 = gen(6, 72, 512 / 8); + var keccak_224 = gen(1, 144, 224 / 8); + var keccak_256 = gen(1, 136, 256 / 8); + var keccak_384 = gen(1, 104, 384 / 8); + var keccak_512 = gen(1, 72, 512 / 8); + var genShake = (suffix, blockLen, outputLen) => wrapConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true)); + var shake128 = genShake(31, 168, 128 / 8); + var shake256 = genShake(31, 136, 256 / 8); + + // node_modules/@noble/hashes/esm/_sha2.js + function setBigUint64(view, byteOffset, value, isLE2) { + if (typeof view.setBigUint64 === "function") + return view.setBigUint64(byteOffset, value, isLE2); + const _32n2 = BigInt(32); + const _u32_max = BigInt(4294967295); + const wh = Number(value >> _32n2 & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE2 ? 4 : 0; + const l = isLE2 ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE2); + view.setUint32(byteOffset + l, wl, isLE2); + } + var SHA2 = class extends Hash { + constructor(blockLen, outputLen, padOffset, isLE2) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE2; + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + assert_default.exists(this); + const { view, buffer, blockLen } = this; + data = toBytes(data); + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + assert_default.exists(this); + assert_default.output(out, this); + this.finished = true; + const { buffer, view, blockLen, isLE: isLE2 } = this; + let { pos } = this; + buffer[pos++] = 128; + this.buffer.subarray(pos).fill(0); + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2); + this.process(view, 0); + const oview = createView(out); + const len = this.outputLen; + if (len % 4) + throw new Error("_sha2: outputLen should be aligned to 32bit"); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error("_sha2: outputLen bigger than state"); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE2); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.length = length; + to.pos = pos; + to.finished = finished; + to.destroyed = destroyed; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } + }; + + // node_modules/@noble/hashes/esm/sha256.js + var Chi = (a, b, c) => a & b ^ ~a & c; + var Maj = (a, b, c) => a & b ^ a & c ^ b & c; + var SHA256_K = new Uint32Array([ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]); + var IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SHA256_W = new Uint32Array(64); + var SHA256 = class extends SHA2 { + constructor() { + super(64, 32, 8, false); + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + // prettier-ignore + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3; + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10; + SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0; + } + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); + const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0; + const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); + const T2 = sigma0 + Maj(A, B, C) | 0; + H = G; + G = F; + F = E; + E = D + T1 | 0; + D = C; + C = B; + B = A; + A = T1 + T2 | 0; + } + A = A + this.A | 0; + B = B + this.B | 0; + C = C + this.C | 0; + D = D + this.D | 0; + E = E + this.E | 0; + F = F + this.F | 0; + G = G + this.G | 0; + H = H + this.H | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + SHA256_W.fill(0); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + this.buffer.fill(0); + } + }; + var SHA224 = class extends SHA256 { + constructor() { + super(); + this.A = 3238371032 | 0; + this.B = 914150663 | 0; + this.C = 812702999 | 0; + this.D = 4144912697 | 0; + this.E = 4290775857 | 0; + this.F = 1750603025 | 0; + this.G = 1694076839 | 0; + this.H = 3204075428 | 0; + this.outputLen = 28; + } + }; + var sha256 = wrapConstructor(() => new SHA256()); + var sha224 = wrapConstructor(() => new SHA224()); + + // node_modules/@noble/curves/esm/abstract/modular.js + var _0n3 = BigInt(0); + var _1n3 = BigInt(1); + var _2n3 = BigInt(2); + var _3n = BigInt(3); + var _4n = BigInt(4); + var _5n = BigInt(5); + var _8n = BigInt(8); + var _9n = BigInt(9); + var _16n = BigInt(16); + function mod(a, b) { + const result = a % b; + return result >= _0n3 ? result : b + result; + } + function pow(num, power, modulo) { + if (modulo <= _0n3 || power < _0n3) + throw new Error("Expected power/modulo > 0"); + if (modulo === _1n3) + return _0n3; + let res = _1n3; + while (power > _0n3) { + if (power & _1n3) + res = res * num % modulo; + num = num * num % modulo; + power >>= _1n3; + } + return res; + } + function invert(number3, modulo) { + if (number3 === _0n3 || modulo <= _0n3) { + throw new Error(`invert: expected positive integers, got n=${number3} mod=${modulo}`); + } + let a = mod(number3, modulo); + let b = modulo; + let x = _0n3, y = _1n3, u = _1n3, v = _0n3; + while (a !== _0n3) { + const q = b / a; + const r = b % a; + const m = x - u * q; + const n = y - v * q; + b = a, a = r, x = u, y = v, u = m, v = n; + } + const gcd = b; + if (gcd !== _1n3) + throw new Error("invert: does not exist"); + return mod(x, modulo); + } + function tonelliShanks(P) { + const legendreC = (P - _1n3) / _2n3; + let Q, S, Z; + for (Q = P - _1n3, S = 0; Q % _2n3 === _0n3; Q /= _2n3, S++) + ; + for (Z = _2n3; Z < P && pow(Z, legendreC, P) !== P - _1n3; Z++) + ; + if (S === 1) { + const p1div4 = (P + _1n3) / _4n; + return function tonelliFast(Fp, n) { + const root = Fp.pow(n, p1div4); + if (!Fp.eql(Fp.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + const Q1div2 = (Q + _1n3) / _2n3; + return function tonelliSlow(Fp, n) { + if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) + throw new Error("Cannot find square root"); + let r = S; + let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); + let x = Fp.pow(n, Q1div2); + let b = Fp.pow(n, Q); + while (!Fp.eql(b, Fp.ONE)) { + if (Fp.eql(b, Fp.ZERO)) + return Fp.ZERO; + let m = 1; + for (let t2 = Fp.sqr(b); m < r; m++) { + if (Fp.eql(t2, Fp.ONE)) + break; + t2 = Fp.sqr(t2); + } + const ge = Fp.pow(g, _1n3 << BigInt(r - m - 1)); + g = Fp.sqr(ge); + x = Fp.mul(x, ge); + b = Fp.mul(b, g); + r = m; + } + return x; + }; + } + function FpSqrt(P) { + if (P % _4n === _3n) { + const p1div4 = (P + _1n3) / _4n; + return function sqrt3mod4(Fp, n) { + const root = Fp.pow(n, p1div4); + if (!Fp.eql(Fp.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P % _8n === _5n) { + const c1 = (P - _5n) / _8n; + return function sqrt5mod8(Fp, n) { + const n2 = Fp.mul(n, _2n3); + const v = Fp.pow(n2, c1); + const nv = Fp.mul(n, v); + const i = Fp.mul(Fp.mul(nv, _2n3), v); + const root = Fp.mul(nv, Fp.sub(i, Fp.ONE)); + if (!Fp.eql(Fp.sqr(root), n)) + throw new Error("Cannot find square root"); + return root; + }; + } + if (P % _16n === _9n) { + } + return tonelliShanks(P); + } + var FIELD_FIELDS = [ + "create", + "isValid", + "is0", + "neg", + "inv", + "sqrt", + "sqr", + "eql", + "add", + "sub", + "mul", + "pow", + "div", + "addN", + "subN", + "mulN", + "sqrN" + ]; + function validateField(field) { + const initial = { + ORDER: "bigint", + MASK: "bigint", + BYTES: "isSafeInteger", + BITS: "isSafeInteger" + }; + const opts = FIELD_FIELDS.reduce((map, val) => { + map[val] = "function"; + return map; + }, initial); + return validateObject(field, opts); + } + function FpPow(f, num, power) { + if (power < _0n3) + throw new Error("Expected power > 0"); + if (power === _0n3) + return f.ONE; + if (power === _1n3) + return num; + let p = f.ONE; + let d = num; + while (power > _0n3) { + if (power & _1n3) + p = f.mul(p, d); + d = f.sqr(d); + power >>= _1n3; + } + return p; + } + function FpInvertBatch(f, nums) { + const tmp = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i) => { + if (f.is0(num)) + return acc; + tmp[i] = acc; + return f.mul(acc, num); + }, f.ONE); + const inverted = f.inv(lastMultiplied); + nums.reduceRight((acc, num, i) => { + if (f.is0(num)) + return acc; + tmp[i] = f.mul(acc, tmp[i]); + return f.mul(acc, num); + }, inverted); + return tmp; + } + function nLength(n, nBitLength2) { + const _nBitLength = nBitLength2 !== void 0 ? nBitLength2 : n.toString(2).length; + const nByteLength = Math.ceil(_nBitLength / 8); + return { nBitLength: _nBitLength, nByteLength }; + } + function Field(ORDER, bitLen2, isLE2 = false, redef = {}) { + if (ORDER <= _0n3) + throw new Error(`Expected Fp ORDER > 0, got ${ORDER}`); + const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen2); + if (BYTES > 2048) + throw new Error("Field lengths over 2048 bytes are not supported"); + const sqrtP = FpSqrt(ORDER); + const f = Object.freeze({ + ORDER, + BITS, + BYTES, + MASK: bitMask(BITS), + ZERO: _0n3, + ONE: _1n3, + create: (num) => mod(num, ORDER), + isValid: (num) => { + if (typeof num !== "bigint") + throw new Error(`Invalid field element: expected bigint, got ${typeof num}`); + return _0n3 <= num && num < ORDER; + }, + is0: (num) => num === _0n3, + isOdd: (num) => (num & _1n3) === _1n3, + neg: (num) => mod(-num, ORDER), + eql: (lhs, rhs) => lhs === rhs, + sqr: (num) => mod(num * num, ORDER), + add: (lhs, rhs) => mod(lhs + rhs, ORDER), + sub: (lhs, rhs) => mod(lhs - rhs, ORDER), + mul: (lhs, rhs) => mod(lhs * rhs, ORDER), + pow: (num, power) => FpPow(f, num, power), + div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), + // Same as above, but doesn't normalize + sqrN: (num) => num * num, + addN: (lhs, rhs) => lhs + rhs, + subN: (lhs, rhs) => lhs - rhs, + mulN: (lhs, rhs) => lhs * rhs, + inv: (num) => invert(num, ORDER), + sqrt: redef.sqrt || ((n) => sqrtP(f, n)), + invertBatch: (lst) => FpInvertBatch(f, lst), + // TODO: do we really need constant cmov? + // We don't have const-time bigints anyway, so probably will be not very useful + cmov: (a, b, c) => c ? b : a, + toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES), + fromBytes: (bytes2) => { + if (bytes2.length !== BYTES) + throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes2.length}`); + return isLE2 ? bytesToNumberLE(bytes2) : bytesToNumberBE(bytes2); + } + }); + return Object.freeze(f); + } + function hashToPrivateScalar(hash2, groupOrder, isLE2 = false) { + hash2 = ensureBytes("privateHash", hash2); + const hashLen = hash2.length; + const minLen = nLength(groupOrder).nByteLength + 8; + if (minLen < 24 || hashLen < minLen || hashLen > 1024) + throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`); + const num = isLE2 ? bytesToNumberLE(hash2) : bytesToNumberBE(hash2); + return mod(num, groupOrder - _1n3) + _1n3; + } + + // node_modules/@noble/curves/esm/abstract/poseidon.js + var poseidon_exports = {}; + __export(poseidon_exports, { + poseidon: () => poseidon, + splitConstants: () => splitConstants, + validateOpts: () => validateOpts + }); + function validateOpts(opts) { + const { Fp } = opts; + validateField(Fp); + for (const i of ["t", "roundsFull", "roundsPartial"]) { + if (typeof opts[i] !== "number" || !Number.isSafeInteger(opts[i])) + throw new Error(`Poseidon: invalid param ${i}=${opts[i]} (${typeof opts[i]})`); + } + if (opts.reversePartialPowIdx !== void 0 && typeof opts.reversePartialPowIdx !== "boolean") + throw new Error(`Poseidon: invalid param reversePartialPowIdx=${opts.reversePartialPowIdx}`); + let sboxPower = opts.sboxPower; + if (sboxPower === void 0) + sboxPower = 5; + if (typeof sboxPower !== "number" || !Number.isSafeInteger(sboxPower)) + throw new Error(`Poseidon wrong sboxPower=${sboxPower}`); + const _sboxPower = BigInt(sboxPower); + let sboxFn = (n) => FpPow(Fp, n, _sboxPower); + if (sboxPower === 3) + sboxFn = (n) => Fp.mul(Fp.sqrN(n), n); + else if (sboxPower === 5) + sboxFn = (n) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n); + if (opts.roundsFull % 2 !== 0) + throw new Error(`Poseidon roundsFull is not even: ${opts.roundsFull}`); + const rounds = opts.roundsFull + opts.roundsPartial; + if (!Array.isArray(opts.roundConstants) || opts.roundConstants.length !== rounds) + throw new Error("Poseidon: wrong round constants"); + const roundConstants = opts.roundConstants.map((rc) => { + if (!Array.isArray(rc) || rc.length !== opts.t) + throw new Error(`Poseidon wrong round constants: ${rc}`); + return rc.map((i) => { + if (typeof i !== "bigint" || !Fp.isValid(i)) + throw new Error(`Poseidon wrong round constant=${i}`); + return Fp.create(i); + }); + }); + if (!Array.isArray(opts.mds) || opts.mds.length !== opts.t) + throw new Error("Poseidon: wrong MDS matrix"); + const mds = opts.mds.map((mdsRow) => { + if (!Array.isArray(mdsRow) || mdsRow.length !== opts.t) + throw new Error(`Poseidon MDS matrix row: ${mdsRow}`); + return mdsRow.map((i) => { + if (typeof i !== "bigint") + throw new Error(`Poseidon MDS matrix value=${i}`); + return Fp.create(i); + }); + }); + return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds }); + } + function splitConstants(rc, t) { + if (typeof t !== "number") + throw new Error("poseidonSplitConstants: wrong t"); + if (!Array.isArray(rc) || rc.length % t) + throw new Error("poseidonSplitConstants: wrong rc"); + const res = []; + let tmp = []; + for (let i = 0; i < rc.length; i++) { + tmp.push(rc[i]); + if (tmp.length === t) { + res.push(tmp); + tmp = []; + } + } + return res; + } + function poseidon(opts) { + const { t, Fp, rounds, sboxFn, reversePartialPowIdx } = validateOpts(opts); + const halfRoundsFull = Math.floor(opts.roundsFull / 2); + const partialIdx = reversePartialPowIdx ? t - 1 : 0; + const poseidonRound = (values, isFull, idx) => { + values = values.map((i, j) => Fp.add(i, opts.roundConstants[idx][j])); + if (isFull) + values = values.map((i) => sboxFn(i)); + else + values[partialIdx] = sboxFn(values[partialIdx]); + values = opts.mds.map((i) => i.reduce((acc, i2, j) => Fp.add(acc, Fp.mulN(i2, values[j])), Fp.ZERO)); + return values; + }; + const poseidonHash2 = function poseidonHash3(values) { + if (!Array.isArray(values) || values.length !== t) + throw new Error(`Poseidon: wrong values (expected array of bigints with length ${t})`); + values = values.map((i) => { + if (typeof i !== "bigint") + throw new Error(`Poseidon: wrong value=${i} (${typeof i})`); + return Fp.create(i); + }); + let round = 0; + for (let i = 0; i < halfRoundsFull; i++) + values = poseidonRound(values, true, round++); + for (let i = 0; i < opts.roundsPartial; i++) + values = poseidonRound(values, false, round++); + for (let i = 0; i < halfRoundsFull; i++) + values = poseidonRound(values, true, round++); + if (round !== rounds) + throw new Error(`Poseidon: wrong number of rounds: last round=${round}, total=${rounds}`); + return values; + }; + poseidonHash2.roundConstants = opts.roundConstants; + return poseidonHash2; + } + + // node_modules/@noble/curves/esm/abstract/weierstrass.js + var weierstrass_exports = {}; + __export(weierstrass_exports, { + DER: () => DER, + SWUFpSqrtRatio: () => SWUFpSqrtRatio, + mapToCurveSimpleSWU: () => mapToCurveSimpleSWU, + weierstrass: () => weierstrass, + weierstrassPoints: () => weierstrassPoints + }); + + // node_modules/@noble/curves/esm/abstract/curve.js + var _0n4 = BigInt(0); + var _1n4 = BigInt(1); + function wNAF(c, bits) { + const constTimeNegate = (condition, item) => { + const neg = item.negate(); + return condition ? neg : item; + }; + const opts = (W) => { + const windows = Math.ceil(bits / W) + 1; + const windowSize = 2 ** (W - 1); + return { windows, windowSize }; + }; + return { + constTimeNegate, + // non-const time multiplication ladder + unsafeLadder(elm, n) { + let p = c.ZERO; + let d = elm; + while (n > _0n4) { + if (n & _1n4) + p = p.add(d); + d = d.double(); + n >>= _1n4; + } + return p; + }, + /** + * Creates a wNAF precomputation window. Used for caching. + * Default window size is set by `utils.precompute()` and is equal to 8. + * Number of precomputed points depends on the curve size: + * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: + * - 𝑊 is the window size + * - 𝑛 is the bitlength of the curve order. + * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. + * @returns precomputed point tables flattened to a single array + */ + precomputeWindow(elm, W) { + const { windows, windowSize } = opts(W); + const points = []; + let p = elm; + let base = p; + for (let window2 = 0; window2 < windows; window2++) { + base = p; + points.push(base); + for (let i = 1; i < windowSize; i++) { + base = base.add(p); + points.push(base); + } + p = base.double(); + } + return points; + }, + /** + * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. + * @param W window size + * @param precomputes precomputed tables + * @param n scalar (we don't check here, but should be less than curve order) + * @returns real and fake (for const-time) points + */ + wNAF(W, precomputes, n) { + const { windows, windowSize } = opts(W); + let p = c.ZERO; + let f = c.BASE; + const mask = BigInt(2 ** W - 1); + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window2 = 0; window2 < windows; window2++) { + const offset = window2 * windowSize; + let wbits = Number(n & mask); + n >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n4; + } + const offset1 = offset; + const offset2 = offset + Math.abs(wbits) - 1; + const cond1 = window2 % 2 !== 0; + const cond2 = wbits < 0; + if (wbits === 0) { + f = f.add(constTimeNegate(cond1, precomputes[offset1])); + } else { + p = p.add(constTimeNegate(cond2, precomputes[offset2])); + } + } + return { p, f }; + }, + wNAFCached(P, precomputesMap, n, transform) { + const W = P._WINDOW_SIZE || 1; + let comp = precomputesMap.get(P); + if (!comp) { + comp = this.precomputeWindow(P, W); + if (W !== 1) { + precomputesMap.set(P, transform(comp)); + } + } + return this.wNAF(W, comp, n); + } + }; + } + function validateBasic(curve2) { + validateField(curve2.Fp); + validateObject(curve2, { + n: "bigint", + h: "bigint", + Gx: "field", + Gy: "field" + }, { + nBitLength: "isSafeInteger", + nByteLength: "isSafeInteger" + }); + return Object.freeze({ + ...nLength(curve2.n, curve2.nBitLength), + ...curve2, + ...{ p: curve2.Fp.ORDER } + }); + } + + // node_modules/@noble/curves/esm/abstract/weierstrass.js + function validatePointOpts(curve2) { + const opts = validateBasic(curve2); + validateObject(opts, { + a: "field", + b: "field" + }, { + allowedPrivateKeyLengths: "array", + wrapPrivateKey: "boolean", + isTorsionFree: "function", + clearCofactor: "function", + allowInfinityPoint: "boolean", + fromBytes: "function", + toBytes: "function" + }); + const { endo, Fp, a } = opts; + if (endo) { + if (!Fp.eql(a, Fp.ZERO)) { + throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); + } + if (typeof endo !== "object" || typeof endo.beta !== "bigint" || typeof endo.splitScalar !== "function") { + throw new Error("Expected endomorphism with beta: bigint and splitScalar: function"); + } + } + return Object.freeze({ ...opts }); + } + var { bytesToNumberBE: b2n, hexToBytes: h2b } = utils_exports; + var DER = { + // asn.1 DER encoding utils + Err: class DERErr extends Error { + constructor(m = "") { + super(m); + } + }, + _parseInt(data) { + const { Err: E } = DER; + if (data.length < 2 || data[0] !== 2) + throw new E("Invalid signature integer tag"); + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) + throw new E("Invalid signature integer: wrong length"); + if (res[0] & 128) + throw new E("Invalid signature integer: negative"); + if (res[0] === 0 && !(res[1] & 128)) + throw new E("Invalid signature integer: unnecessary leading zero"); + return { d: b2n(res), l: data.subarray(len + 2) }; + }, + toSig(hex) { + const { Err: E } = DER; + const data = typeof hex === "string" ? h2b(hex) : hex; + if (!(data instanceof Uint8Array)) + throw new Error("ui8a expected"); + let l = data.length; + if (l < 2 || data[0] != 48) + throw new E("Invalid signature tag"); + if (data[1] !== l - 2) + throw new E("Invalid signature: incorrect length"); + const { d: r, l: sBytes } = DER._parseInt(data.subarray(2)); + const { d: s, l: rBytesLeft } = DER._parseInt(sBytes); + if (rBytesLeft.length) + throw new E("Invalid signature: left bytes after parsing"); + return { r, s }; + }, + hexFromSig(sig) { + const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2; + const h = (num) => { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; + }; + const s = slice(h(sig.s)); + const r = slice(h(sig.r)); + const shl = s.length / 2; + const rhl = r.length / 2; + const sl = h(shl); + const rl = h(rhl); + return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`; + } + }; + var _0n5 = BigInt(0); + var _1n5 = BigInt(1); + var _2n4 = BigInt(2); + var _3n2 = BigInt(3); + var _4n2 = BigInt(4); + function weierstrassPoints(opts) { + const CURVE2 = validatePointOpts(opts); + const { Fp } = CURVE2; + const toBytes2 = CURVE2.toBytes || ((c, point, isCompressed) => { + const a = point.toAffine(); + return concatBytes(Uint8Array.from([4]), Fp.toBytes(a.x), Fp.toBytes(a.y)); + }); + const fromBytes = CURVE2.fromBytes || ((bytes2) => { + const tail = bytes2.subarray(1); + const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); + const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); + return { x, y }; + }); + function weierstrassEquation(x) { + const { a, b } = CURVE2; + const x2 = Fp.sqr(x); + const x3 = Fp.mul(x2, x); + return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); + } + if (!Fp.eql(Fp.sqr(CURVE2.Gy), weierstrassEquation(CURVE2.Gx))) + throw new Error("bad generator point: equation left != right"); + function isWithinCurveOrder(num) { + return typeof num === "bigint" && _0n5 < num && num < CURVE2.n; + } + function assertGE(num) { + if (!isWithinCurveOrder(num)) + throw new Error("Expected valid bigint: 0 < bigint < curve.n"); + } + function normPrivateKeyToScalar(key) { + const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE2; + if (lengths && typeof key !== "bigint") { + if (key instanceof Uint8Array) + key = bytesToHex(key); + if (typeof key !== "string" || !lengths.includes(key.length)) + throw new Error("Invalid key"); + key = key.padStart(nByteLength * 2, "0"); + } + let num; + try { + num = typeof key === "bigint" ? key : bytesToNumberBE(ensureBytes("private key", key, nByteLength)); + } catch (error) { + throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`); + } + if (wrapPrivateKey) + num = mod(num, n); + assertGE(num); + return num; + } + const pointPrecomputes = /* @__PURE__ */ new Map(); + function assertPrjPoint(other) { + if (!(other instanceof Point)) + throw new Error("ProjectivePoint expected"); + } + class Point { + constructor(px, py, pz) { + this.px = px; + this.py = py; + this.pz = pz; + if (px == null || !Fp.isValid(px)) + throw new Error("x required"); + if (py == null || !Fp.isValid(py)) + throw new Error("y required"); + if (pz == null || !Fp.isValid(pz)) + throw new Error("z required"); + } + // Does not validate if the point is on-curve. + // Use fromHex instead, or call assertValidity() later. + static fromAffine(p) { + const { x, y } = p || {}; + if (!p || !Fp.isValid(x) || !Fp.isValid(y)) + throw new Error("invalid affine point"); + if (p instanceof Point) + throw new Error("projective point not allowed"); + const is0 = (i) => Fp.eql(i, Fp.ZERO); + if (is0(x) && is0(y)) + return Point.ZERO; + return new Point(x, y, Fp.ONE); + } + get x() { + return this.toAffine().x; + } + get y() { + return this.toAffine().y; + } + /** + * Takes a bunch of Projective Points but executes only one + * inversion on all of them. Inversion is very slow operation, + * so this improves performance massively. + * Optimization: converts a list of projective points to a list of identical points with Z=1. + */ + static normalizeZ(points) { + const toInv = Fp.invertBatch(points.map((p) => p.pz)); + return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); + } + /** + * Converts hash string or Uint8Array to Point. + * @param hex short/long ECDSA hex + */ + static fromHex(hex) { + const P = Point.fromAffine(fromBytes(ensureBytes("pointHex", hex))); + P.assertValidity(); + return P; + } + // Multiplies generator point by privateKey. + static fromPrivateKey(privateKey) { + return Point.BASE.multiply(normPrivateKeyToScalar(privateKey)); + } + // "Private method", don't use it directly + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + // A point on curve is valid if it conforms to equation. + assertValidity() { + if (this.is0()) { + if (CURVE2.allowInfinityPoint) + return; + throw new Error("bad point: ZERO"); + } + const { x, y } = this.toAffine(); + if (!Fp.isValid(x) || !Fp.isValid(y)) + throw new Error("bad point: x or y not FE"); + const left = Fp.sqr(y); + const right = weierstrassEquation(x); + if (!Fp.eql(left, right)) + throw new Error("bad point: equation left != right"); + if (!this.isTorsionFree()) + throw new Error("bad point: not in prime-order subgroup"); + } + hasEvenY() { + const { y } = this.toAffine(); + if (Fp.isOdd) + return !Fp.isOdd(y); + throw new Error("Field doesn't support isOdd"); + } + /** + * Compare one point to another. + */ + equals(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1)); + const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1)); + return U1 && U2; + } + /** + * Flips point to one corresponding to (x, -y) in Affine coordinates. + */ + negate() { + return new Point(this.px, Fp.neg(this.py), this.pz); + } + // Renes-Costello-Batina exception-free doubling formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 3 + // Cost: 8M + 3S + 3*a + 2*b3 + 15add. + double() { + const { a, b } = CURVE2; + const b3 = Fp.mul(b, _3n2); + const { px: X1, py: Y1, pz: Z1 } = this; + let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; + let t0 = Fp.mul(X1, X1); + let t1 = Fp.mul(Y1, Y1); + let t2 = Fp.mul(Z1, Z1); + let t3 = Fp.mul(X1, Y1); + t3 = Fp.add(t3, t3); + Z3 = Fp.mul(X1, Z1); + Z3 = Fp.add(Z3, Z3); + X3 = Fp.mul(a, Z3); + Y3 = Fp.mul(b3, t2); + Y3 = Fp.add(X3, Y3); + X3 = Fp.sub(t1, Y3); + Y3 = Fp.add(t1, Y3); + Y3 = Fp.mul(X3, Y3); + X3 = Fp.mul(t3, X3); + Z3 = Fp.mul(b3, Z3); + t2 = Fp.mul(a, t2); + t3 = Fp.sub(t0, t2); + t3 = Fp.mul(a, t3); + t3 = Fp.add(t3, Z3); + Z3 = Fp.add(t0, t0); + t0 = Fp.add(Z3, t0); + t0 = Fp.add(t0, t2); + t0 = Fp.mul(t0, t3); + Y3 = Fp.add(Y3, t0); + t2 = Fp.mul(Y1, Z1); + t2 = Fp.add(t2, t2); + t0 = Fp.mul(t2, t3); + X3 = Fp.sub(X3, t0); + Z3 = Fp.mul(t2, t1); + Z3 = Fp.add(Z3, Z3); + Z3 = Fp.add(Z3, Z3); + return new Point(X3, Y3, Z3); + } + // Renes-Costello-Batina exception-free addition formula. + // There is 30% faster Jacobian formula, but it is not complete. + // https://eprint.iacr.org/2015/1060, algorithm 1 + // Cost: 12M + 0S + 3*a + 3*b3 + 23add. + add(other) { + assertPrjPoint(other); + const { px: X1, py: Y1, pz: Z1 } = this; + const { px: X2, py: Y2, pz: Z2 } = other; + let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; + const a = CURVE2.a; + const b3 = Fp.mul(CURVE2.b, _3n2); + let t0 = Fp.mul(X1, X2); + let t1 = Fp.mul(Y1, Y2); + let t2 = Fp.mul(Z1, Z2); + let t3 = Fp.add(X1, Y1); + let t4 = Fp.add(X2, Y2); + t3 = Fp.mul(t3, t4); + t4 = Fp.add(t0, t1); + t3 = Fp.sub(t3, t4); + t4 = Fp.add(X1, Z1); + let t5 = Fp.add(X2, Z2); + t4 = Fp.mul(t4, t5); + t5 = Fp.add(t0, t2); + t4 = Fp.sub(t4, t5); + t5 = Fp.add(Y1, Z1); + X3 = Fp.add(Y2, Z2); + t5 = Fp.mul(t5, X3); + X3 = Fp.add(t1, t2); + t5 = Fp.sub(t5, X3); + Z3 = Fp.mul(a, t4); + X3 = Fp.mul(b3, t2); + Z3 = Fp.add(X3, Z3); + X3 = Fp.sub(t1, Z3); + Z3 = Fp.add(t1, Z3); + Y3 = Fp.mul(X3, Z3); + t1 = Fp.add(t0, t0); + t1 = Fp.add(t1, t0); + t2 = Fp.mul(a, t2); + t4 = Fp.mul(b3, t4); + t1 = Fp.add(t1, t2); + t2 = Fp.sub(t0, t2); + t2 = Fp.mul(a, t2); + t4 = Fp.add(t4, t2); + t0 = Fp.mul(t1, t4); + Y3 = Fp.add(Y3, t0); + t0 = Fp.mul(t5, t4); + X3 = Fp.mul(t3, X3); + X3 = Fp.sub(X3, t0); + t0 = Fp.mul(t3, t1); + Z3 = Fp.mul(t5, Z3); + Z3 = Fp.add(Z3, t0); + return new Point(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + is0() { + return this.equals(Point.ZERO); + } + wNAF(n) { + return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => { + const toInv = Fp.invertBatch(comp.map((p) => p.pz)); + return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine); + }); + } + /** + * Non-constant-time multiplication. Uses double-and-add algorithm. + * It's faster, but should only be used when you don't care about + * an exposed private key e.g. sig verification, which works over *public* keys. + */ + multiplyUnsafe(n) { + const I = Point.ZERO; + if (n === _0n5) + return I; + assertGE(n); + if (n === _1n5) + return this; + const { endo } = CURVE2; + if (!endo) + return wnaf.unsafeLadder(this, n); + let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let k1p = I; + let k2p = I; + let d = this; + while (k1 > _0n5 || k2 > _0n5) { + if (k1 & _1n5) + k1p = k1p.add(d); + if (k2 & _1n5) + k2p = k2p.add(d); + d = d.double(); + k1 >>= _1n5; + k2 >>= _1n5; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + return k1p.add(k2p); + } + /** + * Constant time multiplication. + * Uses wNAF method. Windowed method may be 10% faster, + * but takes 2x longer to generate and consumes 2x memory. + * Uses precomputes when available. + * Uses endomorphism for Koblitz curves. + * @param scalar by which the point would be multiplied + * @returns New point + */ + multiply(scalar) { + assertGE(scalar); + let n = scalar; + let point, fake; + const { endo } = CURVE2; + if (endo) { + const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n); + let { p: k1p, f: f1p } = this.wNAF(k1); + let { p: k2p, f: f2p } = this.wNAF(k2); + k1p = wnaf.constTimeNegate(k1neg, k1p); + k2p = wnaf.constTimeNegate(k2neg, k2p); + k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz); + point = k1p.add(k2p); + fake = f1p.add(f2p); + } else { + const { p, f } = this.wNAF(n); + point = p; + fake = f; + } + return Point.normalizeZ([point, fake])[0]; + } + /** + * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly. + * Not using Strauss-Shamir trick: precomputation tables are faster. + * The trick could be useful if both P and Q are not G (not in our case). + * @returns non-zero affine point + */ + multiplyAndAddUnsafe(Q, a, b) { + const G = Point.BASE; + const mul = (P, a2) => a2 === _0n5 || a2 === _1n5 || !P.equals(G) ? P.multiplyUnsafe(a2) : P.multiply(a2); + const sum = mul(this, a).add(mul(Q, b)); + return sum.is0() ? void 0 : sum; + } + // Converts Projective point to affine (x, y) coordinates. + // Can accept precomputed Z^-1 - for example, from invertBatch. + // (x, y, z) ∋ (x=x/z, y=y/z) + toAffine(iz) { + const { px: x, py: y, pz: z } = this; + const is0 = this.is0(); + if (iz == null) + iz = is0 ? Fp.ONE : Fp.inv(z); + const ax = Fp.mul(x, iz); + const ay = Fp.mul(y, iz); + const zz = Fp.mul(z, iz); + if (is0) + return { x: Fp.ZERO, y: Fp.ZERO }; + if (!Fp.eql(zz, Fp.ONE)) + throw new Error("invZ was invalid"); + return { x: ax, y: ay }; + } + isTorsionFree() { + const { h: cofactor, isTorsionFree } = CURVE2; + if (cofactor === _1n5) + return true; + if (isTorsionFree) + return isTorsionFree(Point, this); + throw new Error("isTorsionFree() has not been declared for the elliptic curve"); + } + clearCofactor() { + const { h: cofactor, clearCofactor } = CURVE2; + if (cofactor === _1n5) + return this; + if (clearCofactor) + return clearCofactor(Point, this); + return this.multiplyUnsafe(CURVE2.h); + } + toRawBytes(isCompressed = true) { + this.assertValidity(); + return toBytes2(Point, this, isCompressed); + } + toHex(isCompressed = true) { + return bytesToHex(this.toRawBytes(isCompressed)); + } + } + Point.BASE = new Point(CURVE2.Gx, CURVE2.Gy, Fp.ONE); + Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); + const _bits = CURVE2.nBitLength; + const wnaf = wNAF(Point, CURVE2.endo ? Math.ceil(_bits / 2) : _bits); + return { + CURVE: CURVE2, + ProjectivePoint: Point, + normPrivateKeyToScalar, + weierstrassEquation, + isWithinCurveOrder + }; + } + function validateOpts2(curve2) { + const opts = validateBasic(curve2); + validateObject(opts, { + hash: "hash", + hmac: "function", + randomBytes: "function" + }, { + bits2int: "function", + bits2int_modN: "function", + lowS: "boolean" + }); + return Object.freeze({ lowS: true, ...opts }); + } + function weierstrass(curveDef) { + const CURVE2 = validateOpts2(curveDef); + const { Fp, n: CURVE_ORDER2 } = CURVE2; + const compressedLen = Fp.BYTES + 1; + const uncompressedLen = 2 * Fp.BYTES + 1; + function isValidFieldElement(num) { + return _0n5 < num && num < Fp.ORDER; + } + function modN(a) { + return mod(a, CURVE_ORDER2); + } + function invN(a) { + return invert(a, CURVE_ORDER2); + } + const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder } = weierstrassPoints({ + ...CURVE2, + toBytes(c, point, isCompressed) { + const a = point.toAffine(); + const x = Fp.toBytes(a.x); + const cat = concatBytes; + if (isCompressed) { + return cat(Uint8Array.from([point.hasEvenY() ? 2 : 3]), x); + } else { + return cat(Uint8Array.from([4]), x, Fp.toBytes(a.y)); + } + }, + fromBytes(bytes2) { + const len = bytes2.length; + const head = bytes2[0]; + const tail = bytes2.subarray(1); + if (len === compressedLen && (head === 2 || head === 3)) { + const x = bytesToNumberBE(tail); + if (!isValidFieldElement(x)) + throw new Error("Point is not on curve"); + const y2 = weierstrassEquation(x); + let y = Fp.sqrt(y2); + const isYOdd = (y & _1n5) === _1n5; + const isHeadOdd = (head & 1) === 1; + if (isHeadOdd !== isYOdd) + y = Fp.neg(y); + return { x, y }; + } else if (len === uncompressedLen && head === 4) { + const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES)); + const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES)); + return { x, y }; + } else { + throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`); + } + } + }); + const numToNByteStr = (num) => bytesToHex(numberToBytesBE(num, CURVE2.nByteLength)); + function isBiggerThanHalfOrder(number3) { + const HALF = CURVE_ORDER2 >> _1n5; + return number3 > HALF; + } + function normalizeS(s) { + return isBiggerThanHalfOrder(s) ? modN(-s) : s; + } + const slcNum = (b, from, to) => bytesToNumberBE(b.slice(from, to)); + class Signature3 { + constructor(r, s, recovery) { + this.r = r; + this.s = s; + this.recovery = recovery; + this.assertValidity(); + } + // pair (bytes of r, bytes of s) + static fromCompact(hex) { + const l = CURVE2.nByteLength; + hex = ensureBytes("compactSignature", hex, l * 2); + return new Signature3(slcNum(hex, 0, l), slcNum(hex, l, 2 * l)); + } + // DER encoded ECDSA signature + // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script + static fromDER(hex) { + const { r, s } = DER.toSig(ensureBytes("DER", hex)); + return new Signature3(r, s); + } + assertValidity() { + if (!isWithinCurveOrder(this.r)) + throw new Error("r must be 0 < r < CURVE.n"); + if (!isWithinCurveOrder(this.s)) + throw new Error("s must be 0 < s < CURVE.n"); + } + addRecoveryBit(recovery) { + return new Signature3(this.r, this.s, recovery); + } + recoverPublicKey(msgHash) { + const { r, s, recovery: rec } = this; + const h = bits2int_modN(ensureBytes("msgHash", msgHash)); + if (rec == null || ![0, 1, 2, 3].includes(rec)) + throw new Error("recovery id invalid"); + const radj = rec === 2 || rec === 3 ? r + CURVE2.n : r; + if (radj >= Fp.ORDER) + throw new Error("recovery id 2 or 3 invalid"); + const prefix = (rec & 1) === 0 ? "02" : "03"; + const R = Point.fromHex(prefix + numToNByteStr(radj)); + const ir = invN(radj); + const u1 = modN(-h * ir); + const u2 = modN(s * ir); + const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); + if (!Q) + throw new Error("point at infinify"); + Q.assertValidity(); + return Q; + } + // Signatures should be low-s, to prevent malleability. + hasHighS() { + return isBiggerThanHalfOrder(this.s); + } + normalizeS() { + return this.hasHighS() ? new Signature3(this.r, modN(-this.s), this.recovery) : this; + } + // DER-encoded + toDERRawBytes() { + return hexToBytes(this.toDERHex()); + } + toDERHex() { + return DER.hexFromSig({ r: this.r, s: this.s }); + } + // padded bytes of r, then padded bytes of s + toCompactRawBytes() { + return hexToBytes(this.toCompactHex()); + } + toCompactHex() { + return numToNByteStr(this.r) + numToNByteStr(this.s); + } + } + const utils2 = { + isValidPrivateKey(privateKey) { + try { + normPrivateKeyToScalar(privateKey); + return true; + } catch (error) { + return false; + } + }, + normPrivateKeyToScalar, + /** + * Produces cryptographically secure private key from random of size (nBitLength+64) + * as per FIPS 186 B.4.1 with modulo bias being neglible. + */ + randomPrivateKey: () => { + const rand = CURVE2.randomBytes(Fp.BYTES + 8); + const num = hashToPrivateScalar(rand, CURVE_ORDER2); + return numberToBytesBE(num, CURVE2.nByteLength); + }, + /** + * Creates precompute table for an arbitrary EC point. Makes point "cached". + * Allows to massively speed-up `point.multiply(scalar)`. + * @returns cached point + * @example + * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey)); + * fast.multiply(privKey); // much faster ECDH now + */ + precompute(windowSize = 8, point = Point.BASE) { + point._setWindowSize(windowSize); + point.multiply(BigInt(3)); + return point; + } + }; + function getPublicKey2(privateKey, isCompressed = true) { + return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + function isProbPub(item) { + const arr = item instanceof Uint8Array; + const str = typeof item === "string"; + const len = (arr || str) && item.length; + if (arr) + return len === compressedLen || len === uncompressedLen; + if (str) + return len === 2 * compressedLen || len === 2 * uncompressedLen; + if (item instanceof Point) + return true; + return false; + } + function getSharedSecret2(privateA, publicB, isCompressed = true) { + if (isProbPub(privateA)) + throw new Error("first arg must be private key"); + if (!isProbPub(publicB)) + throw new Error("second arg must be public key"); + const b = Point.fromHex(publicB); + return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed); + } + const bits2int2 = CURVE2.bits2int || function(bytes2) { + const num = bytesToNumberBE(bytes2); + const delta = bytes2.length * 8 - CURVE2.nBitLength; + return delta > 0 ? num >> BigInt(delta) : num; + }; + const bits2int_modN = CURVE2.bits2int_modN || function(bytes2) { + return modN(bits2int2(bytes2)); + }; + const ORDER_MASK = bitMask(CURVE2.nBitLength); + function int2octets(num) { + if (typeof num !== "bigint") + throw new Error("bigint expected"); + if (!(_0n5 <= num && num < ORDER_MASK)) + throw new Error(`bigint expected < 2^${CURVE2.nBitLength}`); + return numberToBytesBE(num, CURVE2.nByteLength); + } + function prepSig(msgHash, privateKey, opts = defaultSigOpts) { + if (["recovered", "canonical"].some((k) => k in opts)) + throw new Error("sign() legacy options not supported"); + const { hash: hash2, randomBytes: randomBytes2 } = CURVE2; + let { lowS, prehash, extraEntropy: ent } = opts; + if (lowS == null) + lowS = true; + msgHash = ensureBytes("msgHash", msgHash); + if (prehash) + msgHash = ensureBytes("prehashed msgHash", hash2(msgHash)); + const h1int = bits2int_modN(msgHash); + const d = normPrivateKeyToScalar(privateKey); + const seedArgs = [int2octets(d), int2octets(h1int)]; + if (ent != null) { + const e = ent === true ? randomBytes2(Fp.BYTES) : ent; + seedArgs.push(ensureBytes("extraEntropy", e, Fp.BYTES)); + } + const seed = concatBytes(...seedArgs); + const m = h1int; + function k2sig(kBytes) { + const k = bits2int2(kBytes); + if (!isWithinCurveOrder(k)) + return; + const ik = invN(k); + const q = Point.BASE.multiply(k).toAffine(); + const r = modN(q.x); + if (r === _0n5) + return; + const s = modN(ik * modN(m + r * d)); + if (s === _0n5) + return; + let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n5); + let normS = s; + if (lowS && isBiggerThanHalfOrder(s)) { + normS = normalizeS(s); + recovery ^= 1; + } + return new Signature3(r, normS, recovery); + } + return { seed, k2sig }; + } + const defaultSigOpts = { lowS: CURVE2.lowS, prehash: false }; + const defaultVerOpts = { lowS: CURVE2.lowS, prehash: false }; + function sign2(msgHash, privKey, opts = defaultSigOpts) { + const { seed, k2sig } = prepSig(msgHash, privKey, opts); + const drbg = createHmacDrbg(CURVE2.hash.outputLen, CURVE2.nByteLength, CURVE2.hmac); + return drbg(seed, k2sig); + } + Point.BASE._setWindowSize(8); + function verify2(signature, msgHash, publicKey, opts = defaultVerOpts) { + const sg = signature; + msgHash = ensureBytes("msgHash", msgHash); + publicKey = ensureBytes("publicKey", publicKey); + if ("strict" in opts) + throw new Error("options.strict was renamed to lowS"); + const { lowS, prehash } = opts; + let _sig = void 0; + let P; + try { + if (typeof sg === "string" || sg instanceof Uint8Array) { + try { + _sig = Signature3.fromDER(sg); + } catch (derError) { + if (!(derError instanceof DER.Err)) + throw derError; + _sig = Signature3.fromCompact(sg); + } + } else if (typeof sg === "object" && typeof sg.r === "bigint" && typeof sg.s === "bigint") { + const { r: r2, s: s2 } = sg; + _sig = new Signature3(r2, s2); + } else { + throw new Error("PARSE"); + } + P = Point.fromHex(publicKey); + } catch (error) { + if (error.message === "PARSE") + throw new Error(`signature must be Signature instance, Uint8Array or hex string`); + return false; + } + if (lowS && _sig.hasHighS()) + return false; + if (prehash) + msgHash = CURVE2.hash(msgHash); + const { r, s } = _sig; + const h = bits2int_modN(msgHash); + const is = invN(s); + const u1 = modN(h * is); + const u2 = modN(r * is); + const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); + if (!R) + return false; + const v = modN(R.x); + return v === r; + } + return { + CURVE: CURVE2, + getPublicKey: getPublicKey2, + getSharedSecret: getSharedSecret2, + sign: sign2, + verify: verify2, + ProjectivePoint: Point, + Signature: Signature3, + utils: utils2 + }; + } + function SWUFpSqrtRatio(Fp, Z) { + const q = Fp.ORDER; + let l = _0n5; + for (let o = q - _1n5; o % _2n4 === _0n5; o /= _2n4) + l += _1n5; + const c1 = l; + const c2 = (q - _1n5) / _2n4 ** c1; + const c3 = (c2 - _1n5) / _2n4; + const c4 = _2n4 ** c1 - _1n5; + const c5 = _2n4 ** (c1 - _1n5); + const c6 = Fp.pow(Z, c2); + const c7 = Fp.pow(Z, (c2 + _1n5) / _2n4); + let sqrtRatio = (u, v) => { + let tv1 = c6; + let tv2 = Fp.pow(v, c4); + let tv3 = Fp.sqr(tv2); + tv3 = Fp.mul(tv3, v); + let tv5 = Fp.mul(u, tv3); + tv5 = Fp.pow(tv5, c3); + tv5 = Fp.mul(tv5, tv2); + tv2 = Fp.mul(tv5, v); + tv3 = Fp.mul(tv5, u); + let tv4 = Fp.mul(tv3, tv2); + tv5 = Fp.pow(tv4, c5); + let isQR = Fp.eql(tv5, Fp.ONE); + tv2 = Fp.mul(tv3, c7); + tv5 = Fp.mul(tv4, tv1); + tv3 = Fp.cmov(tv2, tv3, isQR); + tv4 = Fp.cmov(tv5, tv4, isQR); + for (let i = c1; i > _1n5; i--) { + let tv52 = _2n4 ** (i - _2n4); + let tvv5 = Fp.pow(tv4, tv52); + const e1 = Fp.eql(tvv5, Fp.ONE); + tv2 = Fp.mul(tv3, tv1); + tv1 = Fp.mul(tv1, tv1); + tvv5 = Fp.mul(tv4, tv1); + tv3 = Fp.cmov(tv2, tv3, e1); + tv4 = Fp.cmov(tvv5, tv4, e1); + } + return { isValid: isQR, value: tv3 }; + }; + if (Fp.ORDER % _4n2 === _3n2) { + const c12 = (Fp.ORDER - _3n2) / _4n2; + const c22 = Fp.sqrt(Fp.neg(Z)); + sqrtRatio = (u, v) => { + let tv1 = Fp.sqr(v); + const tv2 = Fp.mul(u, v); + tv1 = Fp.mul(tv1, tv2); + let y1 = Fp.pow(tv1, c12); + y1 = Fp.mul(y1, tv2); + const y2 = Fp.mul(y1, c22); + const tv3 = Fp.mul(Fp.sqr(y1), v); + const isQR = Fp.eql(tv3, u); + let y = Fp.cmov(y2, y1, isQR); + return { isValid: isQR, value: y }; + }; + } + return sqrtRatio; + } + function mapToCurveSimpleSWU(Fp, opts) { + validateField(Fp); + if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z)) + throw new Error("mapToCurveSimpleSWU: invalid opts"); + const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z); + if (!Fp.isOdd) + throw new Error("Fp.isOdd is not implemented!"); + return (u) => { + let tv1, tv2, tv3, tv4, tv5, tv6, x, y; + tv1 = Fp.sqr(u); + tv1 = Fp.mul(tv1, opts.Z); + tv2 = Fp.sqr(tv1); + tv2 = Fp.add(tv2, tv1); + tv3 = Fp.add(tv2, Fp.ONE); + tv3 = Fp.mul(tv3, opts.B); + tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); + tv4 = Fp.mul(tv4, opts.A); + tv2 = Fp.sqr(tv3); + tv6 = Fp.sqr(tv4); + tv5 = Fp.mul(tv6, opts.A); + tv2 = Fp.add(tv2, tv5); + tv2 = Fp.mul(tv2, tv3); + tv6 = Fp.mul(tv6, tv4); + tv5 = Fp.mul(tv6, opts.B); + tv2 = Fp.add(tv2, tv5); + x = Fp.mul(tv1, tv3); + const { isValid, value } = sqrtRatio(tv2, tv6); + y = Fp.mul(tv1, u); + y = Fp.mul(y, value); + x = Fp.cmov(x, tv3, isValid); + y = Fp.cmov(y, value, isValid); + const e1 = Fp.isOdd(u) === Fp.isOdd(y); + y = Fp.cmov(Fp.neg(y), y, e1); + x = Fp.div(x, tv4); + return { x, y }; + }; + } + + // node_modules/@noble/hashes/esm/hmac.js + var HMAC = class extends Hash { + constructor(hash2, _key) { + super(); + this.finished = false; + this.destroyed = false; + assert_default.hash(hash2); + const key = toBytes(_key); + this.iHash = hash2.create(); + if (typeof this.iHash.update !== "function") + throw new TypeError("Expected instance of class which extends utils.Hash"); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + pad.set(key.length > blockLen ? hash2.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54; + this.iHash.update(pad); + this.oHash = hash2.create(); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 54 ^ 92; + this.oHash.update(pad); + pad.fill(0); + } + update(buf) { + assert_default.exists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + assert_default.exists(this); + assert_default.bytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } + }; + var hmac = (hash2, key, message) => new HMAC(hash2, key).update(message).digest(); + hmac.create = (hash2, key) => new HMAC(hash2, key); + + // node_modules/@noble/curves/esm/_shortw_utils.js + function getHash(hash2) { + return { + hash: hash2, + hmac: (key, ...msgs) => hmac(hash2, key, concatBytes2(...msgs)), + randomBytes + }; + } + + // node_modules/micro-starknet/lib/esm/index.js + var CURVE_ORDER = BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"); + var nBitLength = 252; + function bits2int(bytes2) { + while (bytes2[0] === 0) + bytes2 = bytes2.subarray(1); + const delta = bytes2.length * 8 - nBitLength; + const num = bytesToNumberBE(bytes2); + return delta > 0 ? num >> BigInt(delta) : num; + } + function hex0xToBytes(hex) { + if (typeof hex === "string") { + hex = strip0x(hex); + if (hex.length & 1) + hex = "0" + hex; + } + return hexToBytes(hex); + } + var curve = weierstrass({ + a: BigInt(1), + b: BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"), + Fp: Field(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")), + n: CURVE_ORDER, + nBitLength, + Gx: BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"), + Gy: BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"), + h: BigInt(1), + lowS: false, + ...getHash(sha256), + bits2int, + bits2int_modN: (bytes2) => { + const hex = bytesToNumberBE(bytes2).toString(16); + if (hex.length === 63) + bytes2 = hex0xToBytes(hex + "0"); + return mod(bits2int(bytes2), CURVE_ORDER); + } + }); + var _starkCurve = curve; + function ensureBytes2(hex) { + return ensureBytes("", typeof hex === "string" ? hex0xToBytes(hex) : hex); + } + function normPrivKey(privKey) { + return bytesToHex(ensureBytes2(privKey)).padStart(64, "0"); + } + function getPublicKey(privKey, isCompressed = false) { + return curve.getPublicKey(normPrivKey(privKey), isCompressed); + } + function getSharedSecret(privKeyA, pubKeyB) { + return curve.getSharedSecret(normPrivKey(privKeyA), pubKeyB); + } + function sign(msgHash, privKey, opts) { + return curve.sign(ensureBytes2(msgHash), normPrivKey(privKey), opts); + } + function verify(signature, msgHash, pubKey) { + const sig = signature instanceof Signature ? signature : ensureBytes2(signature); + return curve.verify(sig, ensureBytes2(msgHash), ensureBytes2(pubKey)); + } + var { CURVE, ProjectivePoint, Signature, utils } = curve; + function extractX(bytes2) { + const hex = bytesToHex(bytes2.subarray(1)); + const stripped = hex.replace(/^0+/gm, ""); + return `0x${stripped}`; + } + function strip0x(hex) { + return hex.replace(/^0x/i, ""); + } + function numberTo0x16(num) { + return `0x${num.toString(16)}`; + } + function grindKey(seed) { + const _seed = ensureBytes2(seed); + const sha256mask = 2n ** 256n; + const limit = sha256mask - mod(sha256mask, CURVE_ORDER); + for (let i = 0; ; i++) { + const key = sha256Num(concatBytes(_seed, numberToVarBytesBE(BigInt(i)))); + if (key < limit) + return mod(key, CURVE_ORDER).toString(16); + if (i === 1e5) + throw new Error("grindKey is broken: tried 100k vals"); + } + } + function getStarkKey(privateKey) { + return extractX(getPublicKey(privateKey, true)); + } + function ethSigToPrivate(signature) { + signature = strip0x(signature); + if (signature.length !== 130) + throw new Error("Wrong ethereum signature"); + return grindKey(signature.substring(0, 64)); + } + var MASK_31 = 2n ** 31n - 1n; + var int31 = (n) => Number(n & MASK_31); + function getAccountPath(layer, application, ethereumAddress, index) { + const layerNum = int31(sha256Num(layer)); + const applicationNum = int31(sha256Num(application)); + const eth = hexToNumber(strip0x(ethereumAddress)); + return `m/2645'/${layerNum}'/${applicationNum}'/${int31(eth)}'/${int31(eth >> 31n)}'/${index}`; + } + var PEDERSEN_POINTS = [ + new ProjectivePoint(2089986280348253421170679821480865132823066470938446095505822317253594081284n, 1713931329540660377023406109199410414810705867260802078187082345529207694986n, 1n), + new ProjectivePoint(996781205833008774514500082376783249102396023663454813447423147977397232763n, 1668503676786377725805489344771023921079126552019160156920634619255970485781n, 1n), + new ProjectivePoint(2251563274489750535117886426533222435294046428347329203627021249169616184184n, 1798716007562728905295480679789526322175868328062420237419143593021674992973n, 1n), + new ProjectivePoint(2138414695194151160943305727036575959195309218611738193261179310511854807447n, 113410276730064486255102093846540133784865286929052426931474106396135072156n, 1n), + new ProjectivePoint(2379962749567351885752724891227938183011949129833673362440656643086021394946n, 776496453633298175483985398648758586525933812536653089401905292063708816422n, 1n) + ]; + function pedersenPrecompute(p1, p2) { + const out = []; + let p = p1; + for (let i = 0; i < 248; i++) { + out.push(p); + p = p.double(); + } + p = p2; + for (let i = 0; i < 4; i++) { + out.push(p); + p = p.double(); + } + return out; + } + var PEDERSEN_POINTS1 = pedersenPrecompute(PEDERSEN_POINTS[1], PEDERSEN_POINTS[2]); + var PEDERSEN_POINTS2 = pedersenPrecompute(PEDERSEN_POINTS[3], PEDERSEN_POINTS[4]); + function pedersenArg(arg) { + let value; + if (typeof arg === "bigint") { + value = arg; + } else if (typeof arg === "number") { + if (!Number.isSafeInteger(arg)) + throw new Error(`Invalid pedersenArg: ${arg}`); + value = BigInt(arg); + } else { + value = bytesToNumberBE(ensureBytes2(arg)); + } + if (!(0n <= value && value < curve.CURVE.Fp.ORDER)) + throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${value}`); + return value; + } + function pedersenSingle(point, value, constants2) { + let x = pedersenArg(value); + for (let j = 0; j < 252; j++) { + const pt = constants2[j]; + if (pt.equals(point)) + throw new Error("Same point"); + if ((x & 1n) !== 0n) + point = point.add(pt); + x >>= 1n; + } + return point; + } + function pedersen(x, y) { + let point = PEDERSEN_POINTS[0]; + point = pedersenSingle(point, x, PEDERSEN_POINTS1); + point = pedersenSingle(point, y, PEDERSEN_POINTS2); + return extractX(point.toRawBytes(true)); + } + function hashChain(data, fn = pedersen) { + if (!Array.isArray(data) || data.length < 1) + throw new Error("data should be array of at least 1 element"); + if (data.length === 1) + return numberTo0x16(pedersenArg(data[0])); + return Array.from(data).reverse().reduce((acc, i) => fn(i, acc)); + } + var computeHashOnElements = (data, fn = pedersen) => [0, ...data, data.length].reduce((x, y) => fn(x, y)); + var MASK_2502 = bitMask(250); + var keccak = (data) => bytesToNumberBE(keccak_256(data)) & MASK_2502; + var sha256Num = (data) => bytesToNumberBE(sha256(data)); + var Fp253 = Field(BigInt("14474011154664525231415395255581126252639794253786371766033694892385558855681")); + var Fp251 = Field(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481")); + function poseidonRoundConstant(Fp, name, idx) { + const val = Fp.fromBytes(sha256(utf8ToBytes2(`${name}${idx}`))); + return Fp.create(val); + } + function _poseidonMDS(Fp, name, m, attempt = 0) { + const x_values = []; + const y_values = []; + for (let i = 0; i < m; i++) { + x_values.push(poseidonRoundConstant(Fp, `${name}x`, attempt * m + i)); + y_values.push(poseidonRoundConstant(Fp, `${name}y`, attempt * m + i)); + } + if ((/* @__PURE__ */ new Set([...x_values, ...y_values])).size !== 2 * m) + throw new Error("X and Y values are not distinct"); + return x_values.map((x) => y_values.map((y) => Fp.inv(Fp.sub(x, y)))); + } + var MDS_SMALL = [ + [3, 1, 1], + [1, -1, 1], + [1, 1, -2] + ].map((i) => i.map(BigInt)); + function poseidonBasic(opts, mds) { + validateField(opts.Fp); + if (!Number.isSafeInteger(opts.rate) || !Number.isSafeInteger(opts.capacity)) + throw new Error(`Wrong poseidon opts: ${opts}`); + const m = opts.rate + opts.capacity; + const rounds = opts.roundsFull + opts.roundsPartial; + const roundConstants = []; + for (let i = 0; i < rounds; i++) { + const row = []; + for (let j = 0; j < m; j++) + row.push(poseidonRoundConstant(opts.Fp, "Hades", m * i + j)); + roundConstants.push(row); + } + const res = poseidon({ + ...opts, + t: m, + sboxPower: 3, + reversePartialPowIdx: true, + mds, + roundConstants + }); + res.m = m; + res.rate = opts.rate; + res.capacity = opts.capacity; + return res; + } + function poseidonCreate(opts, mdsAttempt = 0) { + const m = opts.rate + opts.capacity; + if (!Number.isSafeInteger(mdsAttempt)) + throw new Error(`Wrong mdsAttempt=${mdsAttempt}`); + return poseidonBasic(opts, _poseidonMDS(opts.Fp, "HadesMDS", m, mdsAttempt)); + } + var poseidonSmall = poseidonBasic({ Fp: Fp251, rate: 2, capacity: 1, roundsFull: 8, roundsPartial: 83 }, MDS_SMALL); + function poseidonHash(x, y, fn = poseidonSmall) { + return fn([x, y, 2n])[0]; + } + function poseidonHashFunc(x, y, fn = poseidonSmall) { + return numberToVarBytesBE(poseidonHash(bytesToNumberBE(x), bytesToNumberBE(y), fn)); + } + function poseidonHashSingle(x, fn = poseidonSmall) { + return fn([x, 0n, 1n])[0]; + } + function poseidonHashMany(values, fn = poseidonSmall) { + const { m, rate } = fn; + if (!Array.isArray(values)) + throw new Error("bigint array expected in values"); + const padded = Array.from(values); + padded.push(1n); + while (padded.length % rate !== 0) + padded.push(0n); + let state = new Array(m).fill(0n); + for (let i = 0; i < padded.length; i += rate) { + for (let j = 0; j < rate; j++) + state[j] += padded[i + j]; + state = fn(state); + } + return state[0]; + } + + // src/utils/selector.ts + function keccakBn(value) { + const hexWithoutPrefix = removeHexPrefix(toHex(BigInt(value))); + const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`; + return addHexPrefix(keccak(hexToBytes2(addHexPrefix(evenHex))).toString(16)); + } + function keccakHex(value) { + return addHexPrefix(keccak(utf8ToArray(value)).toString(16)); + } + function starknetKeccak(value) { + const hash2 = BigInt(keccakHex(value)); + return hash2 & MASK_250; + } + function getSelectorFromName(funcName) { + return toHex(starknetKeccak(funcName)); + } + function getSelector(value) { + if (isHex(value)) { + return value; + } + if (isStringWholeNumber(value)) { + return toHexString(value); + } + return getSelectorFromName(value); + } + + // src/utils/shortString.ts + var shortString_exports = {}; + __export(shortString_exports, { + decodeShortString: () => decodeShortString, + encodeShortString: () => encodeShortString, + isASCII: () => isASCII, + isDecimalString: () => isDecimalString, + isLongText: () => isLongText, + isShortString: () => isShortString, + isShortText: () => isShortText, + isText: () => isText, + splitLongString: () => splitLongString + }); + var TEXT_TO_FELT_MAX_LEN = 31; + function isASCII(str) { + return /^[\x00-\x7F]*$/.test(str); + } + function isShortString(str) { + return str.length <= TEXT_TO_FELT_MAX_LEN; + } + function isDecimalString(decim) { + return /^[0-9]*$/i.test(decim); + } + function isText(val) { + return typeof val === "string" && !isHex(val) && !isStringWholeNumber(val); + } + var isShortText = (val) => isText(val) && isShortString(val); + var isLongText = (val) => isText(val) && !isShortString(val); + function splitLongString(longStr) { + const regex = RegExp(`[^]{1,${TEXT_TO_FELT_MAX_LEN}}`, "g"); + return longStr.match(regex) || []; + } + function encodeShortString(str) { + if (!isASCII(str)) + throw new Error(`${str} is not an ASCII string`); + if (!isShortString(str)) + throw new Error(`${str} is too long`); + return addHexPrefix(str.replace(/./g, (char) => char.charCodeAt(0).toString(16))); + } + function decodeShortString(str) { + if (!isASCII(str)) + throw new Error(`${str} is not an ASCII string`); + if (isHex(str)) { + return removeHexPrefix(str).replace(/.{2}/g, (hex) => String.fromCharCode(parseInt(hex, 16))); + } + if (isDecimalString(str)) { + return decodeShortString("0X".concat(BigInt(str).toString(16))); + } + throw new Error(`${str} is not Hex or decimal`); + } + + // src/utils/calldata/cairo.ts + var cairo_exports = {}; + __export(cairo_exports, { + felt: () => felt, + getArrayType: () => getArrayType, + isCairo1Abi: () => isCairo1Abi, + isCairo1Type: () => isCairo1Type, + isLen: () => isLen, + isTypeArray: () => isTypeArray, + isTypeBool: () => isTypeBool, + isTypeContractAddress: () => isTypeContractAddress, + isTypeFelt: () => isTypeFelt, + isTypeNamedTuple: () => isTypeNamedTuple, + isTypeStruct: () => isTypeStruct, + isTypeTuple: () => isTypeTuple, + isTypeUint: () => isTypeUint, + isTypeUint256: () => isTypeUint256, + tuple: () => tuple, + uint256: () => uint256 + }); + + // src/utils/uint256.ts + var uint256_exports = {}; + __export(uint256_exports, { + UINT_128_MAX: () => UINT_128_MAX, + UINT_256_MAX: () => UINT_256_MAX, + bnToUint256: () => bnToUint256, + isUint256: () => isUint256, + uint256ToBN: () => uint256ToBN + }); + function uint256ToBN(uint2562) { + return (toBigInt(uint2562.high) << 128n) + toBigInt(uint2562.low); + } + var UINT_128_MAX = (1n << 128n) - 1n; + var UINT_256_MAX = (1n << 256n) - 1n; + function isUint256(bn) { + return toBigInt(bn) <= UINT_256_MAX; + } + function bnToUint256(bignumber) { + const bn = toBigInt(bignumber); + if (!isUint256(bn)) + throw new Error("Number is too large"); + return { + low: addHexPrefix((bn & UINT_128_MAX).toString(16)), + high: addHexPrefix((bn >> 128n).toString(16)) + }; + } + + // src/utils/calldata/cairo.ts + var isLen = (name) => /_len$/.test(name); + var isTypeFelt = (type) => type === "felt" || type === "core::felt252"; + var isTypeArray = (type) => /\*/.test(type) || type.startsWith("core::array::Array::"); + var isTypeTuple = (type) => /^\(.*\)$/i.test(type); + var isTypeNamedTuple = (type) => /\(.*\)/i.test(type) && type.includes(":"); + var isTypeStruct = (type, structs) => type in structs; + var isTypeUint = (type) => Object.values(Uint).includes(type); + var isTypeUint256 = (type) => type === "core::integer::u256"; + var isTypeBool = (type) => type === "core::bool"; + var isTypeContractAddress = (type) => type === "core::starknet::contract_address::ContractAddress"; + var isCairo1Type = (type) => type.includes("core::"); + var getArrayType = (type) => { + if (isCairo1Type(type)) { + return type.substring(type.indexOf("<") + 1, type.lastIndexOf(">")); + } + return type.replace("*", ""); + }; + function isCairo1Abi(abi) { + const firstFunction = abi.find((entry) => entry.type === "function"); + if (!firstFunction) { + if (abi.find((it) => it.type === "interface")) { + return true; + } + throw new Error(`Error in ABI. No function in ABI.`); + } + if (firstFunction.inputs.length) { + return isCairo1Type(firstFunction.inputs[0].type); + } + if (firstFunction.outputs.length) { + return isCairo1Type(firstFunction.outputs[0].type); + } + throw new Error(`Error in ABI. No input/output in function ${firstFunction.name}`); + } + var uint256 = (it) => { + const bn = BigInt(it); + if (!isUint256(bn)) + throw new Error("Number is too large"); + return { + // eslint-disable-next-line no-bitwise + low: (bn & UINT_128_MAX).toString(10), + // eslint-disable-next-line no-bitwise + high: (bn >> 128n).toString(10) + }; + }; + var tuple = (...args) => ({ ...args }); + function felt(it) { + if (isBigInt(it) || typeof it === "number" && Number.isInteger(it)) { + return it.toString(); + } + if (isText(it)) { + if (!isShortString(it)) + throw new Error( + `${it} is a long string > 31 chars, felt can store short strings, split it to array of short strings` + ); + const encoded = encodeShortString(it); + return BigInt(encoded).toString(); + } + if (typeof it === "string" && isHex(it)) { + return BigInt(it).toString(); + } + if (typeof it === "string" && isStringWholeNumber(it)) { + return it; + } + if (typeof it === "boolean") { + return `${+it}`; + } + throw new Error(`${it} can't be computed by felt()`); + } + + // src/utils/calldata/formatter.ts + var guard = { + isBN: (data, type, key) => { + if (!isBigInt(data[key])) + throw new Error( + `Data and formatter mismatch on ${key}:${type[key]}, expected response data ${key}:${data[key]} to be BN instead it is ${typeof data[key]}` + ); + }, + unknown: (data, type, key) => { + throw new Error(`Unhandled formatter type on ${key}:${type[key]} for data ${key}:${data[key]}`); + } + }; + function formatter(data, type, sameType) { + return Object.entries(data).reduce((acc, [key, value]) => { + const elType = sameType ?? type[key]; + if (!(key in type) && !sameType) { + acc[key] = value; + return acc; + } + if (elType === "string") { + if (Array.isArray(data[key])) { + const arrayStr = formatter( + data[key], + data[key].map((_) => elType) + ); + acc[key] = Object.values(arrayStr).join(""); + return acc; + } + guard.isBN(data, type, key); + acc[key] = decodeShortString(value); + return acc; + } + if (elType === "number") { + guard.isBN(data, type, key); + acc[key] = Number(value); + return acc; + } + if (typeof elType === "function") { + acc[key] = elType(value); + return acc; + } + if (Array.isArray(elType)) { + const arrayObj = formatter(data[key], elType, elType[0]); + acc[key] = Object.values(arrayObj); + return acc; + } + if (typeof elType === "object") { + acc[key] = formatter(data[key], elType); + return acc; + } + guard.unknown(data, type, key); + return acc; + }, {}); + } + + // src/utils/calldata/parser/parser-0-1.1.0.ts + var AbiParser1 = class { + constructor(abi) { + this.abi = abi; + } + /** + * abi method inputs length without '_len' inputs + * cairo 0 reducer + * @param abiMethod FunctionAbi + * @returns number + */ + methodInputsLength(abiMethod) { + return abiMethod.inputs.reduce((acc, input) => !isLen(input.name) ? acc + 1 : acc, 0); + } + /** + * get method definition from abi + * @param name string + * @returns FunctionAbi | undefined + */ + getMethod(name) { + return this.abi.find((it) => it.name === name); + } + /** + * Get Abi in legacy format + * @returns Abi + */ + getLegacyFormat() { + return this.abi; + } + }; + + // src/utils/calldata/parser/parser-2.0.0.ts + var AbiParser2 = class { + constructor(abi) { + this.abi = abi; + } + /** + * abi method inputs length + * @param abiMethod FunctionAbi + * @returns number + */ + methodInputsLength(abiMethod) { + return abiMethod.inputs.length; + } + /** + * get method definition from abi + * @param name string + * @returns FunctionAbi | undefined + */ + getMethod(name) { + const intf = this.abi.find((it) => it.type === "interface"); + return intf.items.find((it) => it.name === name); + } + /** + * Get Abi in legacy format + * @returns Abi + */ + getLegacyFormat() { + return this.abi.flatMap((e) => { + if (e.type === "interface") { + return e.items; + } + return e; + }); + } + }; + + // src/utils/calldata/parser/index.ts + function createAbiParser(abi) { + const version = getAbiVersion(abi); + if (version === 0 || version === 1) { + return new AbiParser1(abi); + } + if (version === 2) { + return new AbiParser2(abi); + } + throw Error(`Unsupported ABI version ${version}`); + } + function getAbiVersion(abi) { + if (abi.find((it) => it.type === "interface")) + return 2; + if (isCairo1Abi(abi)) + return 1; + return 0; + } + function isNoConstructorValid(method, argsCalldata, abiMethod) { + return method === "constructor" && !abiMethod && !argsCalldata.length; + } + + // src/utils/calldata/tuple.ts + function parseNamedTuple(namedTuple) { + const name = namedTuple.substring(0, namedTuple.indexOf(":")); + const type = namedTuple.substring(name.length + ":".length); + return { name, type }; + } + function parseSubTuple(s) { + if (!s.includes("(")) + return { subTuple: [], result: s }; + const subTuple = []; + let result = ""; + let i = 0; + while (i < s.length) { + if (s[i] === "(") { + let counter = 1; + const lBracket = i; + i++; + while (counter) { + if (s[i] === ")") + counter--; + if (s[i] === "(") + counter++; + i++; + } + subTuple.push(s.substring(lBracket, i)); + result += " "; + i--; + } else { + result += s[i]; + } + i++; + } + return { + subTuple, + result + }; + } + function extractCairo0Tuple(type) { + const cleanType = type.replace(/\s/g, "").slice(1, -1); + const { subTuple, result } = parseSubTuple(cleanType); + let recomposed = result.split(",").map((it) => { + return subTuple.length ? it.replace(" ", subTuple.shift()) : it; + }); + if (isTypeNamedTuple(type)) { + recomposed = recomposed.reduce((acc, it) => { + return acc.concat(parseNamedTuple(it)); + }, []); + } + return recomposed; + } + function extractCairo1Tuple(type) { + const cleanType = type.replace(/\s/g, "").slice(1, -1); + const { subTuple, result } = parseSubTuple(cleanType); + const recomposed = result.split(",").map((it) => { + return subTuple.length ? it.replace(" ", subTuple.shift()) : it; + }); + return recomposed; + } + function extractTupleMemberTypes(type) { + if (isCairo1Type(type)) { + return extractCairo1Tuple(type); + } + return extractCairo0Tuple(type); + } + + // src/utils/calldata/propertyOrder.ts + function errorU256(key) { + return Error( + `Your object includes the property : ${key}, containing an Uint256 object without the 'low' and 'high' keys.` + ); + } + function orderPropsByAbi(unorderedObject, abiOfObject, structs) { + const orderStruct = (unorderedObject2, abiObject) => { + const orderedObject2 = abiObject.reduce((orderedObject, abiParam) => { + const setProperty = (value) => Object.defineProperty(orderedObject, abiParam.name, { + enumerable: true, + value: value ?? unorderedObject2[abiParam.name] + }); + if (unorderedObject2[abiParam.name] === "undefined") { + if (isCairo1Type(abiParam.type) || !isLen(abiParam.name)) { + throw Error(`Your object needs a property with key : ${abiParam.name} .`); + } + } + switch (true) { + case isTypeStruct(abiParam.type, structs): + setProperty( + orderStruct( + unorderedObject2[abiParam.name], + structs[abiParam.type].members + ) + ); + break; + case isTypeUint256(abiParam.type): { + const u256 = unorderedObject2[abiParam.name]; + if (typeof u256 !== "object") { + setProperty(); + break; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + setProperty({ low: u256.low, high: u256.high }); + break; + } + case isTypeTuple(abiParam.type): + setProperty(orderTuple(unorderedObject2[abiParam.name], abiParam)); + break; + case isTypeArray(abiParam.type): + setProperty(orderArray(unorderedObject2[abiParam.name], abiParam)); + break; + case (!isCairo1Type(abiParam.type) && isLen(abiParam.name)): + break; + default: + setProperty(); + } + return orderedObject; + }, {}); + return orderedObject2; + }; + function orderArray(myArray, abiParam) { + const typeInArray = getArrayType(abiParam.type); + if (typeof myArray === "string") { + return myArray; + } + switch (true) { + case typeInArray in structs: + return myArray.map((myObj) => orderStruct(myObj, structs[typeInArray].members)); + case typeInArray === "core::integer::u256" /* u256 */: + return myArray.map((u256) => { + if (typeof u256 !== "object") { + return u256; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + return { low: u256.low, high: u256.high }; + }); + case isTypeTuple(typeInArray): + return myArray.map((myElem) => orderTuple(myElem, { name: "0", type: typeInArray })); + case isTypeArray(typeInArray): + return myArray.map((myElem) => orderArray(myElem, { name: "0", type: typeInArray })); + default: + return myArray; + } + } + function orderTuple(unorderedObject2, abiParam) { + const typeList = extractTupleMemberTypes(abiParam.type); + const orderedObject2 = typeList.reduce((orderedObject, abiTypeCairoX, index) => { + const myObjKeys = Object.keys(unorderedObject2); + const setProperty = (value) => Object.defineProperty(orderedObject, index.toString(), { + enumerable: true, + value: value ?? unorderedObject2[myObjKeys[index]] + }); + const abiType = abiTypeCairoX?.type ? abiTypeCairoX.type : abiTypeCairoX; + switch (true) { + case isTypeStruct(abiType, structs): + setProperty( + orderStruct( + unorderedObject2[myObjKeys[index]], + structs[abiType].members + ) + ); + break; + case isTypeUint256(abiType): { + const u256 = unorderedObject2[myObjKeys[index]]; + if (typeof u256 !== "object") { + setProperty(); + break; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + setProperty({ low: u256.low, high: u256.high }); + break; + } + case isTypeTuple(abiType): + setProperty( + orderTuple(unorderedObject2[myObjKeys[index]], { + name: "0", + type: abiType + }) + ); + break; + case isTypeArray(abiType): + setProperty( + orderArray(unorderedObject2[myObjKeys[index]], { + name: "0", + type: abiType + }) + ); + break; + default: + setProperty(); + } + return orderedObject; + }, {}); + return orderedObject2; + } + return orderStruct(unorderedObject, abiOfObject); + } + + // src/utils/calldata/requestParser.ts + function parseBaseTypes(type, val) { + switch (true) { + case isTypeUint256(type): + const el_uint256 = uint256(val); + return [felt(el_uint256.low), felt(el_uint256.high)]; + default: + return felt(val); + } + } + function parseTuple(element, typeStr) { + const memberTypes = extractTupleMemberTypes(typeStr); + const elements = Object.values(element); + if (elements.length !== memberTypes.length) { + throw Error( + `ParseTuple: provided and expected abi tuple size do not match. + provided: ${elements} + expected: ${memberTypes}` + ); + } + return memberTypes.map((it, dx) => { + return { + element: elements[dx], + type: it.type ?? it + }; + }); + } + function parseUint256(element) { + if (typeof element === "object") { + const { low, high } = element; + return [felt(low), felt(high)]; + } + const el_uint256 = uint256(element); + return [felt(el_uint256.low), felt(el_uint256.high)]; + } + function parseCalldataValue(element, type, structs) { + if (element === void 0) { + throw Error(`Missing parameter for type ${type}`); + } + if (Array.isArray(element)) { + const result = []; + result.push(felt(element.length)); + const arrayType = getArrayType(type); + return element.reduce((acc, it) => { + return acc.concat(parseCalldataValue(it, arrayType, structs)); + }, result); + } + if (structs[type] && structs[type].members.length) { + if (isTypeUint256(type)) { + return parseUint256(element); + } + const { members } = structs[type]; + const subElement = element; + return members.reduce((acc, it) => { + return acc.concat(parseCalldataValue(subElement[it.name], it.type, structs)); + }, []); + } + if (isTypeTuple(type)) { + const tupled = parseTuple(element, type); + return tupled.reduce((acc, it) => { + const parsedData = parseCalldataValue(it.element, it.type, structs); + return acc.concat(parsedData); + }, []); + } + if (isTypeUint256(type)) { + return parseUint256(element); + } + if (typeof element === "object") { + throw Error(`Parameter ${element} do not align with abi parameter ${type}`); + } + return parseBaseTypes(type, element); + } + function parseCalldataField(argsIterator, input, structs) { + const { name, type } = input; + let { value } = argsIterator.next(); + switch (true) { + case isTypeArray(type): + if (!Array.isArray(value) && !isText(value)) { + throw Error(`ABI expected parameter ${name} to be array or long string, got ${value}`); + } + if (typeof value === "string") { + value = splitLongString(value); + } + return parseCalldataValue(value, input.type, structs); + case (isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type)): + return parseCalldataValue(value, type, structs); + default: + return parseBaseTypes(type, value); + } + } + + // src/utils/calldata/responseParser.ts + function parseBaseTypes2(type, it) { + let temp; + switch (true) { + case isTypeBool(type): + temp = it.next().value; + return Boolean(BigInt(temp)); + case isTypeUint256(type): + const low = it.next().value; + const high = it.next().value; + return uint256ToBN({ low, high }); + default: + temp = it.next().value; + return BigInt(temp); + } + } + function parseResponseValue(responseIterator, element, structs) { + if (isTypeUint256(element.type)) { + const low = responseIterator.next().value; + const high = responseIterator.next().value; + return uint256ToBN({ low, high }); + } + if (element.type in structs && structs[element.type]) { + return structs[element.type].members.reduce((acc, el) => { + acc[el.name] = parseResponseValue(responseIterator, el, structs); + return acc; + }, {}); + } + if (isTypeTuple(element.type)) { + const memberTypes = extractTupleMemberTypes(element.type); + return memberTypes.reduce((acc, it, idx) => { + const name = it?.name ? it.name : idx; + const type = it?.type ? it.type : it; + const el = { name, type }; + acc[name] = parseResponseValue(responseIterator, el, structs); + return acc; + }, {}); + } + if (isTypeArray(element.type)) { + const parsedDataArr = []; + const el = { name: "", type: getArrayType(element.type) }; + const len = BigInt(responseIterator.next().value); + while (parsedDataArr.length < len) { + parsedDataArr.push(parseResponseValue(responseIterator, el, structs)); + } + return parsedDataArr; + } + return parseBaseTypes2(element.type, responseIterator); + } + function responseParser(responseIterator, output2, structs, parsedResult) { + const { name, type } = output2; + let temp; + switch (true) { + case isLen(name): + temp = responseIterator.next().value; + return BigInt(temp); + case (type in structs || isTypeTuple(type)): + return parseResponseValue(responseIterator, output2, structs); + case isTypeArray(type): + if (isCairo1Type(type)) { + return parseResponseValue(responseIterator, output2, structs); + } + const parsedDataArr = []; + if (parsedResult && parsedResult[`${name}_len`]) { + const arrLen = parsedResult[`${name}_len`]; + while (parsedDataArr.length < arrLen) { + parsedDataArr.push( + parseResponseValue( + responseIterator, + { name, type: output2.type.replace("*", "") }, + structs + ) + ); + } + } + return parsedDataArr; + default: + return parseBaseTypes2(type, responseIterator); + } + } + + // src/utils/calldata/validate.ts + var validateFelt = (parameter, input) => { + assert( + typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint", + `Validate: arg ${input.name} should be a felt typed as (String, Number or BigInt)` + ); + }; + var validateUint = (parameter, input) => { + if (typeof parameter === "number") { + assert( + parameter <= Number.MAX_SAFE_INTEGER, + `Validation: Parameter is to large to be typed as Number use (BigInt or String)` + ); + } + assert( + typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint" || typeof parameter === "object" && "low" in parameter && "high" in parameter, + `Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)` + ); + const param = typeof parameter === "object" ? uint256ToBN(parameter) : toBigInt(parameter); + switch (input.type) { + case "core::integer::u8" /* u8 */: + assert( + param >= 0n && param <= 255n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0 - 255]` + ); + break; + case "core::integer::u16" /* u16 */: + assert( + param >= 0n && param <= 65535n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 65535]` + ); + break; + case "core::integer::u32" /* u32 */: + assert( + param >= 0n && param <= 4294967295n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 4294967295]` + ); + break; + case "core::integer::u64" /* u64 */: + assert( + param >= 0n && param <= 2n ** 64n - 1n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^64-1]` + ); + break; + case "core::integer::u128" /* u128 */: + assert( + param >= 0n && param <= 2n ** 128n - 1n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^128-1]` + ); + break; + case "core::integer::u256" /* u256 */: + assert( + param >= 0n && param <= 2n ** 256n - 1n, + `Validate: arg ${input.name} is ${input.type} 0 - 2^256-1` + ); + break; + default: + break; + } + }; + var validateBool = (parameter, input) => { + assert( + typeof parameter === "boolean", + `Validate: arg ${input.name} of cairo type ${input.type} should be type (Boolean)` + ); + }; + var validateStruct = (parameter, input, structs) => { + if (input.type === "core::integer::u256" /* u256 */) { + validateUint(parameter, input); + return; + } + assert( + typeof parameter === "object" && !Array.isArray(parameter), + `Validate: arg ${input.name} is cairo type struct (${input.type}), and should be defined as js object (not array)` + ); + structs[input.type].members.forEach(({ name }) => { + assert( + Object.keys(parameter).includes(name), + `Validate: arg ${input.name} should have a property ${name}` + ); + }); + }; + var validateTuple = (parameter, input) => { + assert( + typeof parameter === "object" && !Array.isArray(parameter), + `Validate: arg ${input.name} should be a tuple (defined as object)` + ); + }; + var validateArray = (parameter, input, structs) => { + const baseType = getArrayType(input.type); + if (isTypeFelt(baseType) && isLongText(parameter)) + return; + assert(Array.isArray(parameter), `Validate: arg ${input.name} should be an Array`); + switch (true) { + case isTypeFelt(baseType): + parameter.forEach((param) => validateFelt(param, input)); + break; + case isTypeTuple(baseType): + parameter.forEach((it) => validateTuple(it, { name: input.name, type: baseType })); + break; + case isTypeStruct(baseType, structs): + parameter.forEach( + (it) => validateStruct(it, { name: input.name, type: baseType }, structs) + ); + break; + case isTypeUint(baseType): + parameter.forEach((param) => validateUint(param, input)); + break; + case isTypeBool(baseType): + parameter.forEach((param) => validateBool(param, input)); + break; + case isTypeArray(baseType): + parameter.forEach( + (param) => validateArray(param, { name: "", type: baseType }, structs) + ); + break; + default: + throw new Error( + `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}` + ); + } + }; + function validateFields(abiMethod, args, structs) { + abiMethod.inputs.reduce((acc, input) => { + const parameter = args[acc]; + switch (true) { + case isLen(input.name): + return acc; + case isTypeFelt(input.type): + validateFelt(parameter, input); + break; + case isTypeUint(input.type): + validateUint(parameter, input); + break; + case isTypeBool(input.type): + validateBool(parameter, input); + break; + case isTypeContractAddress(input.type): + break; + case isTypeStruct(input.type, structs): + validateStruct(parameter, input, structs); + break; + case isTypeTuple(input.type): + validateTuple(parameter, input); + break; + case isTypeArray(input.type): + validateArray(parameter, input, structs); + break; + default: + throw new Error( + `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}` + ); + } + return acc + 1; + }, 0); + } + + // src/utils/calldata/index.ts + var CallData = class { + constructor(abi) { + this.structs = CallData.getAbiStruct(abi); + this.parser = createAbiParser(abi); + this.abi = this.parser.getLegacyFormat(); + } + /** + * Validate arguments passed to the method as corresponding to the ones in the abi + * @param type ValidateType - type of the method + * @param method string - name of the method + * @param args ArgsOrCalldata - arguments that are passed to the method + */ + validate(type, method, args = []) { + if (type !== "DEPLOY" /* DEPLOY */) { + const invocableFunctionNames = this.abi.filter((abi) => { + if (abi.type !== "function") + return false; + const isView = abi.stateMutability === "view" || abi.state_mutability === "view"; + return type === "INVOKE" /* INVOKE */ ? !isView : isView; + }).map((abi) => abi.name); + assert( + invocableFunctionNames.includes(method), + `${type === "INVOKE" /* INVOKE */ ? "invocable" : "viewable"} method not found in abi` + ); + } + const abiMethod = this.abi.find( + (abi) => type === "DEPLOY" /* DEPLOY */ ? abi.name === method && abi.type === "constructor" : abi.name === method && abi.type === "function" + ); + if (isNoConstructorValid(method, args, abiMethod)) { + return; + } + const inputsLength = this.parser.methodInputsLength(abiMethod); + if (args.length !== inputsLength) { + throw Error( + `Invalid number of arguments, expected ${inputsLength} arguments, but got ${args.length}` + ); + } + validateFields(abiMethod, args, this.structs); + } + /** + * Compile contract callData with abi + * Parse the calldata by using input fields from the abi for that method + * @param method string - method name + * @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order). + * @return Calldata - parsed arguments in format that contract is expecting + * @example + * ```typescript + * const calldata = myCallData.compile("constructor",["0x34a",[1,3n]]); + * ``` + * ```typescript + * const calldata2 = myCallData.compile("constructor",{list:[1,3n],balance:"0x34"}); // wrong order is valid + * ``` + */ + compile(method, argsCalldata) { + const abiMethod = this.abi.find((abi) => abi.name === method); + if (isNoConstructorValid(method, argsCalldata, abiMethod)) { + return []; + } + let args; + if (Array.isArray(argsCalldata)) { + args = argsCalldata; + } else { + const orderedObject = orderPropsByAbi(argsCalldata, abiMethod.inputs, this.structs); + args = Object.values(orderedObject); + validateFields(abiMethod, args, this.structs); + } + const argsIterator = args[Symbol.iterator](); + const callArray = abiMethod.inputs.reduce( + (acc, input) => isLen(input.name) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs)), + [] + ); + Object.defineProperty(callArray, "__compiled__", { + enumerable: false, + writable: false, + value: true + }); + return callArray; + } + /** + * Compile contract callData without abi + * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data + * @returns Calldata + */ + static compile(rawArgs) { + const createTree = (obj) => { + const getEntries = (o, prefix = "") => { + const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o; + return Object.entries(oe).flatMap(([k, v]) => { + let value = v; + if (isLongText(value)) + value = splitLongString(value); + if (k === "entrypoint") + value = getSelectorFromName(value); + const kk = Array.isArray(oe) && k === "0" ? "$$len" : k; + if (isBigInt(value)) + return [[`${prefix}${kk}`, felt(value)]]; + return Object(value) === value ? getEntries(value, `${prefix}${kk}.`) : [[`${prefix}${kk}`, felt(value)]]; + }); + }; + return Object.fromEntries(getEntries(obj)); + }; + let callTreeArray; + if (!Array.isArray(rawArgs)) { + const callTree = createTree(rawArgs); + callTreeArray = Object.values(callTree); + } else { + const callObj = { ...rawArgs }; + const callTree = createTree(callObj); + callTreeArray = Object.values(callTree); + } + Object.defineProperty(callTreeArray, "__compiled__", { + enumerable: false, + writable: false, + value: true + }); + return callTreeArray; + } + /** + * Parse elements of the response array and structuring them into response object + * @param method string - method name + * @param response string[] - response from the method + * @return Result - parsed response corresponding to the abi + */ + parse(method, response) { + const { outputs } = this.abi.find((abi) => abi.name === method); + const responseIterator = response.flat()[Symbol.iterator](); + const parsed = outputs.flat().reduce((acc, output2, idx) => { + const propName = output2.name ?? idx; + acc[propName] = responseParser(responseIterator, output2, this.structs, acc); + if (acc[propName] && acc[`${propName}_len`]) { + delete acc[`${propName}_len`]; + } + return acc; + }, {}); + return Object.keys(parsed).length === 1 && 0 in parsed ? parsed[0] : parsed; + } + /** + * Format cairo method response data to native js values based on provided format schema + * @param method string - cairo method name + * @param response string[] - cairo method response + * @param format object - formatter object schema + * @returns Result - parsed and formatted response object + */ + format(method, response, format) { + const parsed = this.parse(method, response); + return formatter(parsed, format); + } + /** + * Helper to extract structs from abi + * @param abi Abi + * @returns AbiStructs - structs from abi + */ + static getAbiStruct(abi) { + return abi.filter((abiEntry) => abiEntry.type === "struct").reduce( + (acc, abiEntry) => ({ + ...acc, + [abiEntry.name]: abiEntry + }), + {} + ); + } + /** + * Helper: Compile HexCalldata | RawCalldata | RawArgs + * @param rawCalldata HexCalldata | RawCalldata | RawArgs + * @returns Calldata + */ + static toCalldata(rawCalldata = []) { + return CallData.compile(rawCalldata); + } + /** + * Helper: Convert raw to HexCalldata + * @param raw HexCalldata | RawCalldata | RawArgs + * @returns HexCalldata + */ + static toHex(raw = []) { + const calldata = CallData.compile(raw); + return calldata.map((it) => toHex(it)); + } + }; + + // src/utils/hash.ts + var hash_exports = {}; + __export(hash_exports, { + calculateContractAddressFromHash: () => calculateContractAddressFromHash, + calculateDeclareTransactionHash: () => calculateDeclareTransactionHash, + calculateDeployAccountTransactionHash: () => calculateDeployAccountTransactionHash, + calculateDeployTransactionHash: () => calculateDeployTransactionHash, + calculateTransactionHash: () => calculateTransactionHash, + calculateTransactionHashCommon: () => calculateTransactionHashCommon, + computeCompiledClassHash: () => computeCompiledClassHash, + computeContractClassHash: () => computeContractClassHash, + computeHashOnElements: () => computeHashOnElements2, + computeLegacyContractClassHash: () => computeLegacyContractClassHash, + computeSierraContractClassHash: () => computeSierraContractClassHash, + default: () => computeHintedClassHash, + feeTransactionVersion: () => feeTransactionVersion, + feeTransactionVersion_2: () => feeTransactionVersion_2, + formatSpaces: () => formatSpaces, + getSelector: () => getSelector, + getSelectorFromName: () => getSelectorFromName, + getVersionsByType: () => getVersionsByType, + keccakBn: () => keccakBn, + poseidon: () => poseidon_exports, + starknetKeccak: () => starknetKeccak, + transactionVersion: () => transactionVersion, + transactionVersion_2: () => transactionVersion_2 + }); + + // src/utils/ec.ts + var ec_exports = {}; + __export(ec_exports, { + starkCurve: () => esm_exports, + weierstrass: () => weierstrass_exports + }); + + // src/utils/json.ts + var json_exports = {}; + __export(json_exports, { + parse: () => parse2, + parseAlwaysAsBig: () => parseAlwaysAsBig, + stringify: () => stringify2, + stringifyAlwaysAsBig: () => stringifyAlwaysAsBig + }); + + // node_modules/lossless-json/lib/esm/utils.js + function isInteger(value) { + return INTEGER_REGEX.test(value); + } + var INTEGER_REGEX = /^-?[0-9]+$/; + function isNumber(value) { + return NUMBER_REGEX.test(value); + } + var NUMBER_REGEX = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/; + function isSafeNumber(value, config) { + var num = parseFloat(value); + var str = String(num); + var v = extractSignificantDigits(value); + var s = extractSignificantDigits(str); + if (v === s) { + return true; + } + if ((config === null || config === void 0 ? void 0 : config.approx) === true) { + var requiredDigits = 14; + if (!isInteger(value) && s.length >= requiredDigits && v.startsWith(s.substring(0, requiredDigits))) { + return true; + } + } + return false; + } + var UnsafeNumberReason = /* @__PURE__ */ function(UnsafeNumberReason2) { + UnsafeNumberReason2["underflow"] = "underflow"; + UnsafeNumberReason2["overflow"] = "overflow"; + UnsafeNumberReason2["truncate_integer"] = "truncate_integer"; + UnsafeNumberReason2["truncate_float"] = "truncate_float"; + return UnsafeNumberReason2; + }({}); + function getUnsafeNumberReason(value) { + if (isSafeNumber(value, { + approx: false + })) { + return void 0; + } + if (isInteger(value)) { + return UnsafeNumberReason.truncate_integer; + } + var num = parseFloat(value); + if (!isFinite(num)) { + return UnsafeNumberReason.overflow; + } + if (num === 0) { + return UnsafeNumberReason.underflow; + } + return UnsafeNumberReason.truncate_float; + } + function extractSignificantDigits(value) { + return value.replace(EXPONENTIAL_PART_REGEX, "").replace(DOT_REGEX, "").replace(TRAILING_ZEROS_REGEX, "").replace(LEADING_MINUS_AND_ZEROS_REGEX, ""); + } + var EXPONENTIAL_PART_REGEX = /[eE][+-]?\d+$/; + var LEADING_MINUS_AND_ZEROS_REGEX = /^-?(0*)?/; + var DOT_REGEX = /\./; + var TRAILING_ZEROS_REGEX = /0+$/; + + // node_modules/lossless-json/lib/esm/LosslessNumber.js + function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return _typeof(key) === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (_typeof(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var LosslessNumber = /* @__PURE__ */ function() { + function LosslessNumber2(value) { + _classCallCheck(this, LosslessNumber2); + _defineProperty(this, "isLosslessNumber", true); + if (!isNumber(value)) { + throw new Error('Invalid number (value: "' + value + '")'); + } + this.value = value; + } + _createClass(LosslessNumber2, [{ + key: "valueOf", + value: function valueOf() { + var unsafeReason = getUnsafeNumberReason(this.value); + if (unsafeReason === void 0 || unsafeReason === UnsafeNumberReason.truncate_float) { + return parseFloat(this.value); + } + if (isInteger(this.value)) { + return BigInt(this.value); + } + throw new Error("Cannot safely convert to number: " + "the value '".concat(this.value, "' would ").concat(unsafeReason, " and become ").concat(parseFloat(this.value))); + } + /** + * Get the value of the LosslessNumber as string. + */ + }, { + key: "toString", + value: function toString2() { + return this.value; + } + // Note: we do NOT implement a .toJSON() method, and you should not implement + // or use that, it cannot safely turn the numeric value in the string into + // stringified JSON since it has to be parsed into a number first. + }]); + return LosslessNumber2; + }(); + function isLosslessNumber(value) { + return value && _typeof(value) === "object" && value.isLosslessNumber === true || false; + } + + // node_modules/lossless-json/lib/esm/numberParsers.js + function parseLosslessNumber(value) { + return new LosslessNumber(value); + } + function parseNumberAndBigInt(value) { + return isInteger(value) ? BigInt(value) : parseFloat(value); + } + + // node_modules/lossless-json/lib/esm/revive.js + function _typeof2(obj) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof2(obj); + } + function revive(json, reviver) { + return reviveValue({ + "": json + }, "", json, reviver); + } + function reviveValue(context, key, value, reviver) { + if (Array.isArray(value)) { + return reviver.call(context, key, reviveArray(value, reviver)); + } else if (value && _typeof2(value) === "object" && !isLosslessNumber(value)) { + return reviver.call(context, key, reviveObject(value, reviver)); + } else { + return reviver.call(context, key, value); + } + } + function reviveObject(object, reviver) { + Object.keys(object).forEach(function(key) { + var value = reviveValue(object, key, object[key], reviver); + if (value !== void 0) { + object[key] = value; + } else { + delete object[key]; + } + }); + return object; + } + function reviveArray(array, reviver) { + for (var i = 0; i < array.length; i++) { + array[i] = reviveValue(array, i + "", array[i], reviver); + } + return array; + } + + // node_modules/lossless-json/lib/esm/parse.js + function _typeof3(obj) { + "@babel/helpers - typeof"; + return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof3(obj); + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray(o, minLen); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; + } + function parse(text, reviver) { + var parseNumber = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : parseLosslessNumber; + var i = 0; + var value = parseValue(); + expectValue(value); + expectEndOfInput(); + return reviver ? revive(value, reviver) : value; + function parseObject() { + if (text.charCodeAt(i) === codeOpeningBrace) { + i++; + skipWhitespace(); + var object = {}; + var initial = true; + while (i < text.length && text.charCodeAt(i) !== codeClosingBrace) { + if (!initial) { + eatComma(); + skipWhitespace(); + } else { + initial = false; + } + var start = i; + var key = parseString(); + if (key === void 0) { + throwObjectKeyExpected(); + } + skipWhitespace(); + eatColon(); + var _value = parseValue(); + if (_value === void 0) { + throwObjectValueExpected(); + } + if (Object.prototype.hasOwnProperty.call(object, key) && !isDeepEqual(_value, object[key])) { + throwDuplicateKey(key, start + 1); + } + object[key] = _value; + } + if (text.charCodeAt(i) !== codeClosingBrace) { + throwObjectKeyOrEndExpected(); + } + i++; + return object; + } + } + function parseArray() { + if (text.charCodeAt(i) === codeOpeningBracket) { + i++; + skipWhitespace(); + var array = []; + var initial = true; + while (i < text.length && text.charCodeAt(i) !== codeClosingBracket) { + if (!initial) { + eatComma(); + } else { + initial = false; + } + var _value2 = parseValue(); + expectArrayItem(_value2); + array.push(_value2); + } + if (text.charCodeAt(i) !== codeClosingBracket) { + throwArrayItemOrEndExpected(); + } + i++; + return array; + } + } + function parseValue() { + var _ref, _ref2, _ref3, _ref4, _ref5, _parseString; + skipWhitespace(); + var value2 = (_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_parseString = parseString()) !== null && _parseString !== void 0 ? _parseString : parseNumeric()) !== null && _ref5 !== void 0 ? _ref5 : parseObject()) !== null && _ref4 !== void 0 ? _ref4 : parseArray()) !== null && _ref3 !== void 0 ? _ref3 : parseKeyword("true", true)) !== null && _ref2 !== void 0 ? _ref2 : parseKeyword("false", false)) !== null && _ref !== void 0 ? _ref : parseKeyword("null", null); + skipWhitespace(); + return value2; + } + function parseKeyword(name, value2) { + if (text.slice(i, i + name.length) === name) { + i += name.length; + return value2; + } + } + function skipWhitespace() { + while (isWhitespace(text.charCodeAt(i))) { + i++; + } + } + function parseString() { + if (text.charCodeAt(i) === codeDoubleQuote) { + i++; + var result = ""; + while (i < text.length && text.charCodeAt(i) !== codeDoubleQuote) { + if (text.charCodeAt(i) === codeBackslash) { + var char = text[i + 1]; + var escapeChar = escapeCharacters[char]; + if (escapeChar !== void 0) { + result += escapeChar; + i++; + } else if (char === "u") { + if (isHex2(text.charCodeAt(i + 2)) && isHex2(text.charCodeAt(i + 3)) && isHex2(text.charCodeAt(i + 4)) && isHex2(text.charCodeAt(i + 5))) { + result += String.fromCharCode(parseInt(text.slice(i + 2, i + 6), 16)); + i += 5; + } else { + throwInvalidUnicodeCharacter(i); + } + } else { + throwInvalidEscapeCharacter(i); + } + } else { + if (isValidStringCharacter(text.charCodeAt(i))) { + result += text[i]; + } else { + throwInvalidCharacter(text[i]); + } + } + i++; + } + expectEndOfString(); + i++; + return result; + } + } + function parseNumeric() { + var start = i; + if (text.charCodeAt(i) === codeMinus) { + i++; + expectDigit(start); + } + if (text.charCodeAt(i) === codeZero) { + i++; + } else if (isNonZeroDigit(text.charCodeAt(i))) { + i++; + while (isDigit(text.charCodeAt(i))) { + i++; + } + } + if (text.charCodeAt(i) === codeDot) { + i++; + expectDigit(start); + while (isDigit(text.charCodeAt(i))) { + i++; + } + } + if (text.charCodeAt(i) === codeLowercaseE || text.charCodeAt(i) === codeUppercaseE) { + i++; + if (text.charCodeAt(i) === codeMinus || text.charCodeAt(i) === codePlus) { + i++; + } + expectDigit(start); + while (isDigit(text.charCodeAt(i))) { + i++; + } + } + if (i > start) { + return parseNumber(text.slice(start, i)); + } + } + function eatComma() { + if (text.charCodeAt(i) !== codeComma) { + throw new SyntaxError("Comma ',' expected after value ".concat(gotAt())); + } + i++; + } + function eatColon() { + if (text.charCodeAt(i) !== codeColon) { + throw new SyntaxError("Colon ':' expected after property name ".concat(gotAt())); + } + i++; + } + function expectValue(value2) { + if (value2 === void 0) { + throw new SyntaxError("JSON value expected ".concat(gotAt())); + } + } + function expectArrayItem(value2) { + if (value2 === void 0) { + throw new SyntaxError("Array item expected ".concat(gotAt())); + } + } + function expectEndOfInput() { + if (i < text.length) { + throw new SyntaxError("Expected end of input ".concat(gotAt())); + } + } + function expectDigit(start) { + if (!isDigit(text.charCodeAt(i))) { + var numSoFar = text.slice(start, i); + throw new SyntaxError("Invalid number '".concat(numSoFar, "', expecting a digit ").concat(gotAt())); + } + } + function expectEndOfString() { + if (text.charCodeAt(i) !== codeDoubleQuote) { + throw new SyntaxError(`End of string '"' expected `.concat(gotAt())); + } + } + function throwObjectKeyExpected() { + throw new SyntaxError("Quoted object key expected ".concat(gotAt())); + } + function throwDuplicateKey(key, pos2) { + throw new SyntaxError("Duplicate key '".concat(key, "' encountered at position ").concat(pos2)); + } + function throwObjectKeyOrEndExpected() { + throw new SyntaxError("Quoted object key or end of object '}' expected ".concat(gotAt())); + } + function throwArrayItemOrEndExpected() { + throw new SyntaxError("Array item or end of array ']' expected ".concat(gotAt())); + } + function throwInvalidCharacter(char) { + throw new SyntaxError("Invalid character '".concat(char, "' ").concat(pos())); + } + function throwInvalidEscapeCharacter(start) { + var chars = text.slice(start, start + 2); + throw new SyntaxError("Invalid escape character '".concat(chars, "' ").concat(pos())); + } + function throwObjectValueExpected() { + throw new SyntaxError("Object value expected after ':' ".concat(pos())); + } + function throwInvalidUnicodeCharacter(start) { + var end = start + 2; + while (/\w/.test(text[end])) { + end++; + } + var chars = text.slice(start, end); + throw new SyntaxError("Invalid unicode character '".concat(chars, "' ").concat(pos())); + } + function pos() { + return "at position ".concat(i); + } + function got() { + return i < text.length ? "but got '".concat(text[i], "'") : "but reached end of input"; + } + function gotAt() { + return got() + " " + pos(); + } + } + function isWhitespace(code) { + return code === codeSpace || code === codeNewline || code === codeTab || code === codeReturn; + } + function isHex2(code) { + return code >= codeZero && code <= codeNine || code >= codeUppercaseA && code <= codeUppercaseF || code >= codeLowercaseA && code <= codeLowercaseF; + } + function isDigit(code) { + return code >= codeZero && code <= codeNine; + } + function isNonZeroDigit(code) { + return code >= codeOne && code <= codeNine; + } + function isValidStringCharacter(code) { + return code >= 32 && code <= 1114111; + } + function isDeepEqual(a, b) { + if (a === b) { + return true; + } + if (Array.isArray(a) && Array.isArray(b)) { + return a.length === b.length && a.every(function(item, index) { + return isDeepEqual(item, b[index]); + }); + } + if (isObject(a) && isObject(b)) { + var keys = _toConsumableArray(new Set([].concat(_toConsumableArray(Object.keys(a)), _toConsumableArray(Object.keys(b))))); + return keys.every(function(key) { + return isDeepEqual(a[key], b[key]); + }); + } + return false; + } + function isObject(value) { + return _typeof3(value) === "object" && value !== null; + } + var escapeCharacters = { + '"': '"', + "\\": "\\", + "/": "/", + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: " " + // note that \u is handled separately in parseString() + }; + var codeBackslash = 92; + var codeOpeningBrace = 123; + var codeClosingBrace = 125; + var codeOpeningBracket = 91; + var codeClosingBracket = 93; + var codeSpace = 32; + var codeNewline = 10; + var codeTab = 9; + var codeReturn = 13; + var codeDoubleQuote = 34; + var codePlus = 43; + var codeMinus = 45; + var codeZero = 48; + var codeOne = 49; + var codeNine = 57; + var codeComma = 44; + var codeDot = 46; + var codeColon = 58; + var codeUppercaseA = 65; + var codeLowercaseA = 97; + var codeUppercaseE = 69; + var codeLowercaseE = 101; + var codeUppercaseF = 70; + var codeLowercaseF = 102; + + // node_modules/lossless-json/lib/esm/stringify.js + function _typeof4(obj) { + "@babel/helpers - typeof"; + return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof4(obj); + } + function stringify(value, replacer, space, numberStringifiers) { + var resolvedSpace = resolveSpace(space); + var replacedValue = typeof replacer === "function" ? replacer.call({ + "": value + }, "", value) : value; + return stringifyValue(replacedValue, ""); + function stringifyValue(value2, indent) { + if (Array.isArray(numberStringifiers)) { + var stringifier = numberStringifiers.find(function(item) { + return item.test(value2); + }); + if (stringifier) { + var str = stringifier.stringify(value2); + if (typeof str !== "string" || !isNumber(str)) { + throw new Error("Invalid JSON number: output of a number stringifier must be a string containing a JSON number " + "(output: ".concat(str, ")")); + } + return str; + } + } + if (typeof value2 === "boolean" || typeof value2 === "number" || typeof value2 === "string" || value2 === null || value2 instanceof Date || value2 instanceof Boolean || value2 instanceof Number || value2 instanceof String) { + return JSON.stringify(value2); + } + if (value2 && value2.isLosslessNumber) { + return value2.toString(); + } + if (typeof value2 === "bigint") { + return value2.toString(); + } + if (Array.isArray(value2)) { + return stringifyArray(value2, indent); + } + if (value2 && _typeof4(value2) === "object") { + return stringifyObject(value2, indent); + } + return void 0; + } + function stringifyArray(array, indent) { + if (array.length === 0) { + return "[]"; + } + var childIndent = resolvedSpace ? indent + resolvedSpace : void 0; + var str = resolvedSpace ? "[\n" : "["; + for (var i = 0; i < array.length; i++) { + var item = typeof replacer === "function" ? replacer.call(array, String(i), array[i]) : array[i]; + if (resolvedSpace) { + str += childIndent; + } + if (typeof item !== "undefined" && typeof item !== "function") { + str += stringifyValue(item, childIndent); + } else { + str += "null"; + } + if (i < array.length - 1) { + str += resolvedSpace ? ",\n" : ","; + } + } + str += resolvedSpace ? "\n" + indent + "]" : "]"; + return str; + } + function stringifyObject(object, indent) { + if (typeof object.toJSON === "function") { + return stringify(object.toJSON(), replacer, space, void 0); + } + var keys = Array.isArray(replacer) ? replacer.map(String) : Object.keys(object); + if (keys.length === 0) { + return "{}"; + } + var childIndent = resolvedSpace ? indent + resolvedSpace : void 0; + var first = true; + var str = resolvedSpace ? "{\n" : "{"; + keys.forEach(function(key) { + var value2 = typeof replacer === "function" ? replacer.call(object, key, object[key]) : object[key]; + if (includeProperty(key, value2)) { + if (first) { + first = false; + } else { + str += resolvedSpace ? ",\n" : ","; + } + var keyStr = JSON.stringify(key); + str += resolvedSpace ? childIndent + keyStr + ": " : keyStr + ":"; + str += stringifyValue(value2, childIndent); + } + }); + str += resolvedSpace ? "\n" + indent + "}" : "}"; + return str; + } + function includeProperty(key, value2) { + return typeof value2 !== "undefined" && typeof value2 !== "function" && _typeof4(value2) !== "symbol"; + } + } + function resolveSpace(space) { + if (typeof space === "number") { + return " ".repeat(space); + } + if (typeof space === "string" && space !== "") { + return space; + } + return void 0; + } + + // src/utils/json.ts + var parseIntAsNumberOrBigInt = (x) => { + if (!isInteger(x)) + return parseFloat(x); + const v = parseInt(x, 10); + return Number.isSafeInteger(v) ? v : BigInt(x); + }; + var parse2 = (x) => parse(String(x), void 0, parseIntAsNumberOrBigInt); + var parseAlwaysAsBig = (x) => parse(String(x), void 0, parseNumberAndBigInt); + var stringify2 = (value, replacer, space, numberStringifiers) => stringify(value, replacer, space, numberStringifiers); + var stringifyAlwaysAsBig = stringify2; + + // src/utils/hash.ts + var transactionVersion = 1n; + var transactionVersion_2 = 2n; + var feeTransactionVersion = 1n; + var feeTransactionVersion_2 = 2n; + function getVersionsByType(versionType) { + return versionType === "fee" ? { v1: feeTransactionVersion, v2: feeTransactionVersion_2 } : { v1: transactionVersion, v2: transactionVersion_2 }; + } + function computeHashOnElements2(data) { + return [...data, data.length].reduce((x, y) => esm_exports.pedersen(toBigInt(x), toBigInt(y)), 0).toString(); + } + function calculateTransactionHashCommon(txHashPrefix, version, contractAddress, entryPointSelector, calldata, maxFee, chainId, additionalData = []) { + const calldataHash = computeHashOnElements2(calldata); + const dataToHash = [ + txHashPrefix, + version, + contractAddress, + entryPointSelector, + calldataHash, + maxFee, + chainId, + ...additionalData + ]; + return computeHashOnElements2(dataToHash); + } + function calculateDeployTransactionHash(contractAddress, constructorCalldata, version, chainId, constructorName = "constructor") { + return calculateTransactionHashCommon( + "0x6465706c6f79" /* DEPLOY */, + version, + contractAddress, + getSelectorFromName(constructorName), + constructorCalldata, + 0, + chainId + ); + } + function calculateDeclareTransactionHash(classHash, senderAddress, version, maxFee, chainId, nonce, compiledClassHash) { + return calculateTransactionHashCommon( + "0x6465636c617265" /* DECLARE */, + version, + senderAddress, + 0, + [classHash], + maxFee, + chainId, + [nonce, ...compiledClassHash ? [compiledClassHash] : []] + ); + } + function calculateDeployAccountTransactionHash(contractAddress, classHash, constructorCalldata, salt, version, maxFee, chainId, nonce) { + const calldata = [classHash, salt, ...constructorCalldata]; + return calculateTransactionHashCommon( + "0x6465706c6f795f6163636f756e74" /* DEPLOY_ACCOUNT */, + version, + contractAddress, + 0, + calldata, + maxFee, + chainId, + [nonce] + ); + } + function calculateTransactionHash(contractAddress, version, calldata, maxFee, chainId, nonce) { + return calculateTransactionHashCommon( + "0x696e766f6b65" /* INVOKE */, + version, + contractAddress, + 0, + calldata, + maxFee, + chainId, + [nonce] + ); + } + function calculateContractAddressFromHash(salt, classHash, constructorCalldata, deployerAddress) { + const compiledCalldata = CallData.compile(constructorCalldata); + const constructorCalldataHash = computeHashOnElements2(compiledCalldata); + const CONTRACT_ADDRESS_PREFIX = felt("0x535441524b4e45545f434f4e54524143545f41444452455353"); + return computeHashOnElements2([ + CONTRACT_ADDRESS_PREFIX, + deployerAddress, + salt, + classHash, + constructorCalldataHash + ]); + } + function nullSkipReplacer(key, value) { + if (key === "attributes" || key === "accessible_scopes") { + return Array.isArray(value) && value.length === 0 ? void 0 : value; + } + if (key === "debug_info") { + return null; + } + return value === null ? void 0 : value; + } + function formatSpaces(json) { + let insideQuotes = false; + const newString = []; + for (const char of json) { + if (char === '"' && (newString.length > 0 && newString.slice(-1)[0] === "\\") === false) { + insideQuotes = !insideQuotes; + } + if (insideQuotes) { + newString.push(char); + } else { + newString.push(char === ":" ? ": " : char === "," ? ", " : char); + } + } + return newString.join(""); + } + function computeHintedClassHash(compiledContract) { + const { abi, program } = compiledContract; + const contractClass = { abi, program }; + const serializedJson = formatSpaces(stringify2(contractClass, nullSkipReplacer)); + return addHexPrefix(esm_exports.keccak(utf8ToArray(serializedJson)).toString(16)); + } + function computeLegacyContractClassHash(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + const apiVersion = toHex(API_VERSION); + const externalEntryPointsHash = computeHashOnElements2( + compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset]) + ); + const l1HandlerEntryPointsHash = computeHashOnElements2( + compiledContract.entry_points_by_type.L1_HANDLER.flatMap((e) => [e.selector, e.offset]) + ); + const constructorEntryPointHash = computeHashOnElements2( + compiledContract.entry_points_by_type.CONSTRUCTOR.flatMap((e) => [e.selector, e.offset]) + ); + const builtinsHash = computeHashOnElements2( + compiledContract.program.builtins.map((s) => encodeShortString(s)) + ); + const hintedClassHash = computeHintedClassHash(compiledContract); + const dataHash = computeHashOnElements2(compiledContract.program.data); + return computeHashOnElements2([ + apiVersion, + externalEntryPointsHash, + l1HandlerEntryPointsHash, + constructorEntryPointHash, + builtinsHash, + hintedClassHash, + dataHash + ]); + } + function hashBuiltins(builtins) { + return poseidonHashMany( + builtins.flatMap((it) => { + return BigInt(encodeShortString(it)); + }) + ); + } + function hashEntryPoint(data) { + const base = data.flatMap((it) => { + return [BigInt(it.selector), BigInt(it.offset), hashBuiltins(it.builtins)]; + }); + return poseidonHashMany(base); + } + function computeCompiledClassHash(casm) { + const COMPILED_CLASS_VERSION = "COMPILED_CLASS_V1"; + const compiledClassVersion = BigInt(encodeShortString(COMPILED_CLASS_VERSION)); + const externalEntryPointsHash = hashEntryPoint(casm.entry_points_by_type.EXTERNAL); + const l1Handlers = hashEntryPoint(casm.entry_points_by_type.L1_HANDLER); + const constructor = hashEntryPoint(casm.entry_points_by_type.CONSTRUCTOR); + const bytecode = poseidonHashMany(casm.bytecode.map((it) => BigInt(it))); + return toHex( + poseidonHashMany([ + compiledClassVersion, + externalEntryPointsHash, + l1Handlers, + constructor, + bytecode + ]) + ); + } + function hashEntryPointSierra(data) { + const base = data.flatMap((it) => { + return [BigInt(it.selector), BigInt(it.function_idx)]; + }); + return poseidonHashMany(base); + } + function hashAbi(sierra) { + const indentString = formatSpaces(stringify2(sierra.abi, null)); + return BigInt(addHexPrefix(esm_exports.keccak(utf8ToArray(indentString)).toString(16))); + } + function computeSierraContractClassHash(sierra) { + const CONTRACT_CLASS_VERSION = "CONTRACT_CLASS_V0.1.0"; + const compiledClassVersion = BigInt(encodeShortString(CONTRACT_CLASS_VERSION)); + const externalEntryPointsHash = hashEntryPointSierra(sierra.entry_points_by_type.EXTERNAL); + const l1Handlers = hashEntryPointSierra(sierra.entry_points_by_type.L1_HANDLER); + const constructor = hashEntryPointSierra(sierra.entry_points_by_type.CONSTRUCTOR); + const abiHash = hashAbi(sierra); + const sierraProgram = poseidonHashMany(sierra.sierra_program.map((it) => BigInt(it))); + return toHex( + poseidonHashMany([ + compiledClassVersion, + externalEntryPointsHash, + l1Handlers, + constructor, + abiHash, + sierraProgram + ]) + ); + } + function computeContractClassHash(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + if ("sierra_program" in compiledContract) { + return computeSierraContractClassHash(compiledContract); + } + return computeLegacyContractClassHash(compiledContract); + } + + // src/utils/stark.ts + var stark_exports = {}; + __export(stark_exports, { + compressProgram: () => compressProgram, + decompressProgram: () => decompressProgram, + estimatedFeeToMaxFee: () => estimatedFeeToMaxFee, + formatSignature: () => formatSignature, + makeAddress: () => makeAddress, + randomAddress: () => randomAddress, + signatureToDecimalArray: () => signatureToDecimalArray, + signatureToHexArray: () => signatureToHexArray + }); + + // node_modules/pako/dist/pako.esm.mjs + var Z_FIXED$1 = 4; + var Z_BINARY = 0; + var Z_TEXT = 1; + var Z_UNKNOWN$1 = 2; + function zero$1(buf) { + let len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + } + var STORED_BLOCK = 0; + var STATIC_TREES = 1; + var DYN_TREES = 2; + var MIN_MATCH$1 = 3; + var MAX_MATCH$1 = 258; + var LENGTH_CODES$1 = 29; + var LITERALS$1 = 256; + var L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; + var D_CODES$1 = 30; + var BL_CODES$1 = 19; + var HEAP_SIZE$1 = 2 * L_CODES$1 + 1; + var MAX_BITS$1 = 15; + var Buf_size = 16; + var MAX_BL_BITS = 7; + var END_BLOCK = 256; + var REP_3_6 = 16; + var REPZ_3_10 = 17; + var REPZ_11_138 = 18; + var extra_lbits = ( + /* extra bits for each length code */ + new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]) + ); + var extra_dbits = ( + /* extra bits for each distance code */ + new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]) + ); + var extra_blbits = ( + /* extra bits for each bit length code */ + new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]) + ); + var bl_order = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); + var DIST_CODE_LEN = 512; + var static_ltree = new Array((L_CODES$1 + 2) * 2); + zero$1(static_ltree); + var static_dtree = new Array(D_CODES$1 * 2); + zero$1(static_dtree); + var _dist_code = new Array(DIST_CODE_LEN); + zero$1(_dist_code); + var _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); + zero$1(_length_code); + var base_length = new Array(LENGTH_CODES$1); + zero$1(base_length); + var base_dist = new Array(D_CODES$1); + zero$1(base_dist); + function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + this.static_tree = static_tree; + this.extra_bits = extra_bits; + this.extra_base = extra_base; + this.elems = elems; + this.max_length = max_length; + this.has_stree = static_tree && static_tree.length; + } + var static_l_desc; + var static_d_desc; + var static_bl_desc; + function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; + this.max_code = 0; + this.stat_desc = stat_desc; + } + var d_code = (dist) => { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; + }; + var put_short = (s, w) => { + s.pending_buf[s.pending++] = w & 255; + s.pending_buf[s.pending++] = w >>> 8 & 255; + }; + var send_bits = (s, value, length) => { + if (s.bi_valid > Buf_size - length) { + s.bi_buf |= value << s.bi_valid & 65535; + put_short(s, s.bi_buf); + s.bi_buf = value >> Buf_size - s.bi_valid; + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= value << s.bi_valid & 65535; + s.bi_valid += length; + } + }; + var send_code = (s, c, tree) => { + send_bits( + s, + tree[c * 2], + tree[c * 2 + 1] + /*.Len*/ + ); + }; + var bi_reverse = (code, len) => { + let res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; + }; + var bi_flush = (s) => { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 255; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } + }; + var gen_bitlen = (s, desc) => { + const tree = desc.dyn_tree; + const max_code = desc.max_code; + const stree = desc.stat_desc.static_tree; + const has_stree = desc.stat_desc.has_stree; + const extra = desc.stat_desc.extra_bits; + const base = desc.stat_desc.extra_base; + const max_length = desc.stat_desc.max_length; + let h; + let n, m; + let bits; + let xbits; + let f; + let overflow = 0; + for (bits = 0; bits <= MAX_BITS$1; bits++) { + s.bl_count[bits] = 0; + } + tree[s.heap[s.heap_max] * 2 + 1] = 0; + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1] = bits; + if (n > max_code) { + continue; + } + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1] + xbits); + } + } + if (overflow === 0) { + return; + } + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { + bits--; + } + s.bl_count[bits]--; + s.bl_count[bits + 1] += 2; + s.bl_count[max_length]--; + overflow -= 2; + } while (overflow > 0); + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { + continue; + } + if (tree[m * 2 + 1] !== bits) { + s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2]; + tree[m * 2 + 1] = bits; + } + n--; + } + } + }; + var gen_codes = (tree, max_code, bl_count) => { + const next_code = new Array(MAX_BITS$1 + 1); + let code = 0; + let bits; + let n; + for (bits = 1; bits <= MAX_BITS$1; bits++) { + code = code + bl_count[bits - 1] << 1; + next_code[bits] = code; + } + for (n = 0; n <= max_code; n++) { + let len = tree[n * 2 + 1]; + if (len === 0) { + continue; + } + tree[n * 2] = bi_reverse(next_code[len]++, len); + } + }; + var tr_static_init = () => { + let n; + let bits; + let length; + let code; + let dist; + const bl_count = new Array(MAX_BITS$1 + 1); + length = 0; + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { + base_length[code] = length; + for (n = 0; n < 1 << extra_lbits[code]; n++) { + _length_code[length++] = code; + } + } + _length_code[length - 1] = code; + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < 1 << extra_dbits[code]; n++) { + _dist_code[dist++] = code; + } + } + dist >>= 7; + for (; code < D_CODES$1; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < 1 << extra_dbits[code] - 7; n++) { + _dist_code[256 + dist++] = code; + } + } + for (bits = 0; bits <= MAX_BITS$1; bits++) { + bl_count[bits] = 0; + } + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1] = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1] = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1] = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1] = 8; + n++; + bl_count[8]++; + } + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); + for (n = 0; n < D_CODES$1; n++) { + static_dtree[n * 2 + 1] = 5; + static_dtree[n * 2] = bi_reverse(n, 5); + } + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); + }; + var init_block = (s) => { + let n; + for (n = 0; n < L_CODES$1; n++) { + s.dyn_ltree[n * 2] = 0; + } + for (n = 0; n < D_CODES$1; n++) { + s.dyn_dtree[n * 2] = 0; + } + for (n = 0; n < BL_CODES$1; n++) { + s.bl_tree[n * 2] = 0; + } + s.dyn_ltree[END_BLOCK * 2] = 1; + s.opt_len = s.static_len = 0; + s.sym_next = s.matches = 0; + }; + var bi_windup = (s) => { + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; + }; + var smaller = (tree, n, m, depth) => { + const _n2 = n * 2; + const _m2 = m * 2; + return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m]; + }; + var pqdownheap = (s, tree, k) => { + const v = s.heap[k]; + let j = k << 1; + while (j <= s.heap_len) { + if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + if (smaller(tree, v, s.heap[j], s.depth)) { + break; + } + s.heap[k] = s.heap[j]; + k = j; + j <<= 1; + } + s.heap[k] = v; + }; + var compress_block = (s, ltree, dtree) => { + let dist; + let lc; + let sx = 0; + let code; + let extra; + if (s.sym_next !== 0) { + do { + dist = s.pending_buf[s.sym_buf + sx++] & 255; + dist += (s.pending_buf[s.sym_buf + sx++] & 255) << 8; + lc = s.pending_buf[s.sym_buf + sx++]; + if (dist === 0) { + send_code(s, lc, ltree); + } else { + code = _length_code[lc]; + send_code(s, code + LITERALS$1 + 1, ltree); + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); + } + dist--; + code = d_code(dist); + send_code(s, code, dtree); + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); + } + } + } while (sx < s.sym_next); + } + send_code(s, END_BLOCK, ltree); + }; + var build_tree = (s, desc) => { + const tree = desc.dyn_tree; + const stree = desc.stat_desc.static_tree; + const has_stree = desc.stat_desc.has_stree; + const elems = desc.stat_desc.elems; + let n, m; + let max_code = -1; + let node; + s.heap_len = 0; + s.heap_max = HEAP_SIZE$1; + for (n = 0; n < elems; n++) { + if (tree[n * 2] !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + } else { + tree[n * 2 + 1] = 0; + } + } + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0; + tree[node * 2] = 1; + s.depth[node] = 0; + s.opt_len--; + if (has_stree) { + s.static_len -= stree[node * 2 + 1]; + } + } + desc.max_code = max_code; + for (n = s.heap_len >> 1; n >= 1; n--) { + pqdownheap(s, tree, n); + } + node = elems; + do { + n = s.heap[ + 1 + /*SMALLEST*/ + ]; + s.heap[ + 1 + /*SMALLEST*/ + ] = s.heap[s.heap_len--]; + pqdownheap( + s, + tree, + 1 + /*SMALLEST*/ + ); + m = s.heap[ + 1 + /*SMALLEST*/ + ]; + s.heap[--s.heap_max] = n; + s.heap[--s.heap_max] = m; + tree[node * 2] = tree[n * 2] + tree[m * 2]; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1] = tree[m * 2 + 1] = node; + s.heap[ + 1 + /*SMALLEST*/ + ] = node++; + pqdownheap( + s, + tree, + 1 + /*SMALLEST*/ + ); + } while (s.heap_len >= 2); + s.heap[--s.heap_max] = s.heap[ + 1 + /*SMALLEST*/ + ]; + gen_bitlen(s, desc); + gen_codes(tree, max_code, s.bl_count); + }; + var scan_tree = (s, tree, max_code) => { + let n; + let prevlen = -1; + let curlen; + let nextlen = tree[0 * 2 + 1]; + let count = 0; + let max_count = 7; + let min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1] = 65535; + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen === nextlen) { + continue; + } else if (count < min_count) { + s.bl_tree[curlen * 2] += count; + } else if (curlen !== 0) { + if (curlen !== prevlen) { + s.bl_tree[curlen * 2]++; + } + s.bl_tree[REP_3_6 * 2]++; + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]++; + } else { + s.bl_tree[REPZ_11_138 * 2]++; + } + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + }; + var send_tree = (s, tree, max_code) => { + let n; + let prevlen = -1; + let curlen; + let nextlen = tree[0 * 2 + 1]; + let count = 0; + let max_count = 7; + let min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen === nextlen) { + continue; + } else if (count < min_count) { + do { + send_code(s, curlen, s.bl_tree); + } while (--count !== 0); + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + }; + var build_bl_tree = (s) => { + let max_blindex; + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + build_tree(s, s.bl_desc); + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) { + break; + } + } + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + return max_blindex; + }; + var send_all_trees = (s, lcodes, dcodes, blcodes) => { + let rank2; + send_bits(s, lcodes - 257, 5); + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); + for (rank2 = 0; rank2 < blcodes; rank2++) { + send_bits(s, s.bl_tree[bl_order[rank2] * 2 + 1], 3); + } + send_tree(s, s.dyn_ltree, lcodes - 1); + send_tree(s, s.dyn_dtree, dcodes - 1); + }; + var detect_data_type = (s) => { + let block_mask = 4093624447; + let n; + for (n = 0; n <= 31; n++, block_mask >>>= 1) { + if (block_mask & 1 && s.dyn_ltree[n * 2] !== 0) { + return Z_BINARY; + } + } + if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS$1; n++) { + if (s.dyn_ltree[n * 2] !== 0) { + return Z_TEXT; + } + } + return Z_BINARY; + }; + var static_init_done = false; + var _tr_init$1 = (s) => { + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + s.bi_buf = 0; + s.bi_valid = 0; + init_block(s); + }; + var _tr_stored_block$1 = (s, buf, stored_len, last) => { + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); + bi_windup(s); + put_short(s, stored_len); + put_short(s, ~stored_len); + if (stored_len) { + s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending); + } + s.pending += stored_len; + }; + var _tr_align$1 = (s) => { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); + }; + var _tr_flush_block$1 = (s, buf, stored_len, last) => { + let opt_lenb, static_lenb; + let max_blindex = 0; + if (s.level > 0) { + if (s.strm.data_type === Z_UNKNOWN$1) { + s.strm.data_type = detect_data_type(s); + } + build_tree(s, s.l_desc); + build_tree(s, s.d_desc); + max_blindex = build_bl_tree(s); + opt_lenb = s.opt_len + 3 + 7 >>> 3; + static_lenb = s.static_len + 3 + 7 >>> 3; + if (static_lenb <= opt_lenb) { + opt_lenb = static_lenb; + } + } else { + opt_lenb = static_lenb = stored_len + 5; + } + if (stored_len + 4 <= opt_lenb && buf !== -1) { + _tr_stored_block$1(s, buf, stored_len, last); + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + init_block(s); + if (last) { + bi_windup(s); + } + }; + var _tr_tally$1 = (s, dist, lc) => { + s.pending_buf[s.sym_buf + s.sym_next++] = dist; + s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8; + s.pending_buf[s.sym_buf + s.sym_next++] = lc; + if (dist === 0) { + s.dyn_ltree[lc * 2]++; + } else { + s.matches++; + dist--; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]++; + s.dyn_dtree[d_code(dist) * 2]++; + } + return s.sym_next === s.sym_end; + }; + var _tr_init_1 = _tr_init$1; + var _tr_stored_block_1 = _tr_stored_block$1; + var _tr_flush_block_1 = _tr_flush_block$1; + var _tr_tally_1 = _tr_tally$1; + var _tr_align_1 = _tr_align$1; + var trees = { + _tr_init: _tr_init_1, + _tr_stored_block: _tr_stored_block_1, + _tr_flush_block: _tr_flush_block_1, + _tr_tally: _tr_tally_1, + _tr_align: _tr_align_1 + }; + var adler32 = (adler, buf, len, pos) => { + let s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0; + while (len !== 0) { + n = len > 2e3 ? 2e3 : len; + len -= n; + do { + s1 = s1 + buf[pos++] | 0; + s2 = s2 + s1 | 0; + } while (--n); + s1 %= 65521; + s2 %= 65521; + } + return s1 | s2 << 16 | 0; + }; + var adler32_1 = adler32; + var makeTable = () => { + let c, table = []; + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1; + } + table[n] = c; + } + return table; + }; + var crcTable = new Uint32Array(makeTable()); + var crc32 = (crc, buf, len, pos) => { + const t = crcTable; + const end = pos + len; + crc ^= -1; + for (let i = pos; i < end; i++) { + crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255]; + } + return crc ^ -1; + }; + var crc32_1 = crc32; + var messages = { + 2: "need dictionary", + /* Z_NEED_DICT 2 */ + 1: "stream end", + /* Z_STREAM_END 1 */ + 0: "", + /* Z_OK 0 */ + "-1": "file error", + /* Z_ERRNO (-1) */ + "-2": "stream error", + /* Z_STREAM_ERROR (-2) */ + "-3": "data error", + /* Z_DATA_ERROR (-3) */ + "-4": "insufficient memory", + /* Z_MEM_ERROR (-4) */ + "-5": "buffer error", + /* Z_BUF_ERROR (-5) */ + "-6": "incompatible version" + /* Z_VERSION_ERROR (-6) */ + }; + var constants$2 = { + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type + }; + var { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees; + var { + Z_NO_FLUSH: Z_NO_FLUSH$2, + Z_PARTIAL_FLUSH, + Z_FULL_FLUSH: Z_FULL_FLUSH$1, + Z_FINISH: Z_FINISH$3, + Z_BLOCK: Z_BLOCK$1, + Z_OK: Z_OK$3, + Z_STREAM_END: Z_STREAM_END$3, + Z_STREAM_ERROR: Z_STREAM_ERROR$2, + Z_DATA_ERROR: Z_DATA_ERROR$2, + Z_BUF_ERROR: Z_BUF_ERROR$1, + Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, + Z_FILTERED, + Z_HUFFMAN_ONLY, + Z_RLE, + Z_FIXED, + Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_UNKNOWN, + Z_DEFLATED: Z_DEFLATED$2 + } = constants$2; + var MAX_MEM_LEVEL = 9; + var MAX_WBITS$1 = 15; + var DEF_MEM_LEVEL = 8; + var LENGTH_CODES = 29; + var LITERALS = 256; + var L_CODES = LITERALS + 1 + LENGTH_CODES; + var D_CODES = 30; + var BL_CODES = 19; + var HEAP_SIZE = 2 * L_CODES + 1; + var MAX_BITS = 15; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; + var PRESET_DICT = 32; + var INIT_STATE = 42; + var GZIP_STATE = 57; + var EXTRA_STATE = 69; + var NAME_STATE = 73; + var COMMENT_STATE = 91; + var HCRC_STATE = 103; + var BUSY_STATE = 113; + var FINISH_STATE = 666; + var BS_NEED_MORE = 1; + var BS_BLOCK_DONE = 2; + var BS_FINISH_STARTED = 3; + var BS_FINISH_DONE = 4; + var OS_CODE = 3; + var err = (strm, errorCode) => { + strm.msg = messages[errorCode]; + return errorCode; + }; + var rank = (f) => { + return f * 2 - (f > 4 ? 9 : 0); + }; + var zero = (buf) => { + let len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + }; + var slide_hash = (s) => { + let n, m; + let p; + let wsize = s.w_size; + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = m >= wsize ? m - wsize : 0; + } while (--n); + n = wsize; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = m >= wsize ? m - wsize : 0; + } while (--n); + }; + var HASH_ZLIB = (s, prev, data) => (prev << s.hash_shift ^ data) & s.hash_mask; + var HASH = HASH_ZLIB; + var flush_pending = (strm) => { + const s = strm.state; + let len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { + return; + } + strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } + }; + var flush_block_only = (s, last) => { + _tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); + }; + var put_byte = (s, b) => { + s.pending_buf[s.pending++] = b; + }; + var putShortMSB = (s, b) => { + s.pending_buf[s.pending++] = b >>> 8 & 255; + s.pending_buf[s.pending++] = b & 255; + }; + var read_buf = (strm, buf, start, size) => { + let len = strm.avail_in; + if (len > size) { + len = size; + } + if (len === 0) { + return 0; + } + strm.avail_in -= len; + buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start); + if (strm.state.wrap === 1) { + strm.adler = adler32_1(strm.adler, buf, len, start); + } else if (strm.state.wrap === 2) { + strm.adler = crc32_1(strm.adler, buf, len, start); + } + strm.next_in += len; + strm.total_in += len; + return len; + }; + var longest_match = (s, cur_match) => { + let chain_length = s.max_chain_length; + let scan = s.strstart; + let match; + let len; + let best_len = s.prev_length; + let nice_match = s.nice_match; + const limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0; + const _win = s.window; + const wmask = s.w_mask; + const prev = s.prev; + const strend = s.strstart + MAX_MATCH; + let scan_end1 = _win[scan + best_len - 1]; + let scan_end = _win[scan + best_len]; + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + if (nice_match > s.lookahead) { + nice_match = s.lookahead; + } + do { + match = cur_match; + if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { + continue; + } + scan += 2; + match++; + do { + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; + }; + var fill_window = (s) => { + const _w_size = s.w_size; + let n, more, str; + do { + more = s.window_size - s.lookahead - s.strstart; + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + s.block_start -= _w_size; + if (s.insert > s.strstart) { + s.insert = s.strstart; + } + slide_hash(s); + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + s.ins_h = HASH(s, s.ins_h, s.window[str + 1]); + while (s.insert) { + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + }; + var deflate_stored = (s, flush) => { + let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5; + let len, left, have, last = 0; + let used = s.strm.avail_in; + do { + len = 65535; + have = s.bi_valid + 42 >> 3; + if (s.strm.avail_out < have) { + break; + } + have = s.strm.avail_out - have; + left = s.strstart - s.block_start; + if (len > left + s.strm.avail_in) { + len = left + s.strm.avail_in; + } + if (len > have) { + len = have; + } + if (len < min_block && (len === 0 && flush !== Z_FINISH$3 || flush === Z_NO_FLUSH$2 || len !== left + s.strm.avail_in)) { + break; + } + last = flush === Z_FINISH$3 && len === left + s.strm.avail_in ? 1 : 0; + _tr_stored_block(s, 0, 0, last); + s.pending_buf[s.pending - 4] = len; + s.pending_buf[s.pending - 3] = len >> 8; + s.pending_buf[s.pending - 2] = ~len; + s.pending_buf[s.pending - 1] = ~len >> 8; + flush_pending(s.strm); + if (left) { + if (left > len) { + left = len; + } + s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out); + s.strm.next_out += left; + s.strm.avail_out -= left; + s.strm.total_out += left; + s.block_start += left; + len -= left; + } + if (len) { + read_buf(s.strm, s.strm.output, s.strm.next_out, len); + s.strm.next_out += len; + s.strm.avail_out -= len; + s.strm.total_out += len; + } + } while (last === 0); + used -= s.strm.avail_in; + if (used) { + if (used >= s.w_size) { + s.matches = 2; + s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0); + s.strstart = s.w_size; + s.insert = s.strstart; + } else { + if (s.window_size - s.strstart <= used) { + s.strstart -= s.w_size; + s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0); + if (s.matches < 2) { + s.matches++; + } + if (s.insert > s.strstart) { + s.insert = s.strstart; + } + } + s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart); + s.strstart += used; + s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used; + } + s.block_start = s.strstart; + } + if (s.high_water < s.strstart) { + s.high_water = s.strstart; + } + if (last) { + return BS_FINISH_DONE; + } + if (flush !== Z_NO_FLUSH$2 && flush !== Z_FINISH$3 && s.strm.avail_in === 0 && s.strstart === s.block_start) { + return BS_BLOCK_DONE; + } + have = s.window_size - s.strstart; + if (s.strm.avail_in > have && s.block_start >= s.w_size) { + s.block_start -= s.w_size; + s.strstart -= s.w_size; + s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0); + if (s.matches < 2) { + s.matches++; + } + have += s.w_size; + if (s.insert > s.strstart) { + s.insert = s.strstart; + } + } + if (have > s.strm.avail_in) { + have = s.strm.avail_in; + } + if (have) { + read_buf(s.strm, s.window, s.strstart, have); + s.strstart += have; + s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have; + } + if (s.high_water < s.strstart) { + s.high_water = s.strstart; + } + have = s.bi_valid + 42 >> 3; + have = s.pending_buf_size - have > 65535 ? 65535 : s.pending_buf_size - have; + min_block = have > s.w_size ? s.w_size : have; + left = s.strstart - s.block_start; + if (left >= min_block || (left || flush === Z_FINISH$3) && flush !== Z_NO_FLUSH$2 && s.strm.avail_in === 0 && left <= have) { + len = left > have ? have : left; + last = flush === Z_FINISH$3 && s.strm.avail_in === 0 && len === left ? 1 : 0; + _tr_stored_block(s, s.block_start, len, last); + s.block_start += len; + flush_pending(s.strm); + } + return last ? BS_FINISH_STARTED : BS_NEED_MORE; + }; + var deflate_fast = (s, flush) => { + let hash_head; + let bflush; + for (; ; ) { + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s.lookahead >= MIN_MATCH) { + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { + s.match_length = longest_match(s, hash_head); + } + if (s.match_length >= MIN_MATCH) { + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + s.lookahead -= s.match_length; + if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) { + s.match_length--; + do { + s.strstart++; + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } while (--s.match_length !== 0); + s.strstart++; + } else { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]); + } + } else { + bflush = _tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + } + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH$3) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.sym_next) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + }; + var deflate_slow = (s, flush) => { + let hash_head; + let bflush; + let max_insert; + for (; ; ) { + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s.lookahead >= MIN_MATCH) { + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { + s.match_length = longest_match(s, hash_head); + if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) { + s.match_length = MIN_MATCH - 1; + } + } + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } else if (s.match_available) { + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); + if (bflush) { + flush_block_only(s, false); + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + if (s.match_available) { + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH$3) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.sym_next) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + }; + var deflate_rle = (s, flush) => { + let bflush; + let prev; + let scan, strend; + const _win = s.window; + for (; ; ) { + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + } + if (s.match_length >= MIN_MATCH) { + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + bflush = _tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + } + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush === Z_FINISH$3) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.sym_next) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + }; + var deflate_huff = (s, flush) => { + let bflush; + for (; ; ) { + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH$2) { + return BS_NEED_MORE; + } + break; + } + } + s.match_length = 0; + bflush = _tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush === Z_FINISH$3) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.sym_next) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + }; + function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; + } + var configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), + /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), + /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), + /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), + /* 3 */ + new Config(4, 4, 16, 16, deflate_slow), + /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), + /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), + /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), + /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), + /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) + /* 9 max compression */ + ]; + var lm_init = (s) => { + s.window_size = 2 * s.w_size; + zero(s.head); + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; + }; + function DeflateState() { + this.strm = null; + this.status = 0; + this.pending_buf = null; + this.pending_buf_size = 0; + this.pending_out = 0; + this.pending = 0; + this.wrap = 0; + this.gzhead = null; + this.gzindex = 0; + this.method = Z_DEFLATED$2; + this.last_flush = -1; + this.w_size = 0; + this.w_bits = 0; + this.w_mask = 0; + this.window = null; + this.window_size = 0; + this.prev = null; + this.head = null; + this.ins_h = 0; + this.hash_size = 0; + this.hash_bits = 0; + this.hash_mask = 0; + this.hash_shift = 0; + this.block_start = 0; + this.match_length = 0; + this.prev_match = 0; + this.match_available = 0; + this.strstart = 0; + this.match_start = 0; + this.lookahead = 0; + this.prev_length = 0; + this.max_chain_length = 0; + this.max_lazy_match = 0; + this.level = 0; + this.strategy = 0; + this.good_match = 0; + this.nice_match = 0; + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + this.l_desc = null; + this.d_desc = null; + this.bl_desc = null; + this.bl_count = new Uint16Array(MAX_BITS + 1); + this.heap = new Uint16Array(2 * L_CODES + 1); + zero(this.heap); + this.heap_len = 0; + this.heap_max = 0; + this.depth = new Uint16Array(2 * L_CODES + 1); + zero(this.depth); + this.sym_buf = 0; + this.lit_bufsize = 0; + this.sym_next = 0; + this.sym_end = 0; + this.opt_len = 0; + this.static_len = 0; + this.matches = 0; + this.insert = 0; + this.bi_buf = 0; + this.bi_valid = 0; + } + var deflateStateCheck = (strm) => { + if (!strm) { + return 1; + } + const s = strm.state; + if (!s || s.strm !== strm || s.status !== INIT_STATE && //#ifdef GZIP + s.status !== GZIP_STATE && //#endif + s.status !== EXTRA_STATE && s.status !== NAME_STATE && s.status !== COMMENT_STATE && s.status !== HCRC_STATE && s.status !== BUSY_STATE && s.status !== FINISH_STATE) { + return 1; + } + return 0; + }; + var deflateResetKeep = (strm) => { + if (deflateStateCheck(strm)) { + return err(strm, Z_STREAM_ERROR$2); + } + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + const s = strm.state; + s.pending = 0; + s.pending_out = 0; + if (s.wrap < 0) { + s.wrap = -s.wrap; + } + s.status = //#ifdef GZIP + s.wrap === 2 ? GZIP_STATE : ( + //#endif + s.wrap ? INIT_STATE : BUSY_STATE + ); + strm.adler = s.wrap === 2 ? 0 : 1; + s.last_flush = -2; + _tr_init(s); + return Z_OK$3; + }; + var deflateReset = (strm) => { + const ret = deflateResetKeep(strm); + if (ret === Z_OK$3) { + lm_init(strm.state); + } + return ret; + }; + var deflateSetHeader = (strm, head) => { + if (deflateStateCheck(strm) || strm.state.wrap !== 2) { + return Z_STREAM_ERROR$2; + } + strm.state.gzhead = head; + return Z_OK$3; + }; + var deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { + if (!strm) { + return Z_STREAM_ERROR$2; + } + let wrap = 1; + if (level === Z_DEFAULT_COMPRESSION$1) { + level = 6; + } + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } else if (windowBits > 15) { + wrap = 2; + windowBits -= 16; + } + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED || windowBits === 8 && wrap !== 1) { + return err(strm, Z_STREAM_ERROR$2); + } + if (windowBits === 8) { + windowBits = 9; + } + const s = new DeflateState(); + strm.state = s; + s.strm = strm; + s.status = INIT_STATE; + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + s.window = new Uint8Array(s.w_size * 2); + s.head = new Uint16Array(s.hash_size); + s.prev = new Uint16Array(s.w_size); + s.lit_bufsize = 1 << memLevel + 6; + s.pending_buf_size = s.lit_bufsize * 4; + s.pending_buf = new Uint8Array(s.pending_buf_size); + s.sym_buf = s.lit_bufsize; + s.sym_end = (s.lit_bufsize - 1) * 3; + s.level = level; + s.strategy = strategy; + s.method = method; + return deflateReset(strm); + }; + var deflateInit = (strm, level) => { + return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); + }; + var deflate$2 = (strm, flush) => { + if (deflateStateCheck(strm) || flush > Z_BLOCK$1 || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2; + } + const s = strm.state; + if (!strm.output || strm.avail_in !== 0 && !strm.input || s.status === FINISH_STATE && flush !== Z_FINISH$3) { + return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2); + } + const old_flush = s.last_flush; + s.last_flush = flush; + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; + return Z_OK$3; + } + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH$3) { + return err(strm, Z_BUF_ERROR$1); + } + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR$1); + } + if (s.status === INIT_STATE && s.wrap === 0) { + s.status = BUSY_STATE; + } + if (s.status === INIT_STATE) { + let header = Z_DEFLATED$2 + (s.w_bits - 8 << 4) << 8; + let level_flags = -1; + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= level_flags << 6; + if (s.strstart !== 0) { + header |= PRESET_DICT; + } + header += 31 - header % 31; + putShortMSB(s, header); + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 65535); + } + strm.adler = 1; + s.status = BUSY_STATE; + flush_pending(strm); + if (s.pending !== 0) { + s.last_flush = -1; + return Z_OK$3; + } + } + if (s.status === GZIP_STATE) { + strm.adler = 0; + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + flush_pending(strm); + if (s.pending !== 0) { + s.last_flush = -1; + return Z_OK$3; + } + } else { + put_byte( + s, + (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 255); + put_byte(s, s.gzhead.time >> 8 & 255); + put_byte(s, s.gzhead.time >> 16 & 255); + put_byte(s, s.gzhead.time >> 24 & 255); + put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); + put_byte(s, s.gzhead.os & 255); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 255); + put_byte(s, s.gzhead.extra.length >> 8 & 255); + } + if (s.gzhead.hcrc) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra) { + let beg = s.pending; + let left = (s.gzhead.extra.length & 65535) - s.gzindex; + while (s.pending + left > s.pending_buf_size) { + let copy = s.pending_buf_size - s.pending; + s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending); + s.pending = s.pending_buf_size; + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + s.gzindex += copy; + flush_pending(strm); + if (s.pending !== 0) { + s.last_flush = -1; + return Z_OK$3; + } + beg = 0; + left -= copy; + } + let gzhead_extra = new Uint8Array(s.gzhead.extra); + s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending); + s.pending += left; + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + s.gzindex = 0; + } + s.status = NAME_STATE; + } + if (s.status === NAME_STATE) { + if (s.gzhead.name) { + let beg = s.pending; + let val; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + if (s.pending !== 0) { + s.last_flush = -1; + return Z_OK$3; + } + beg = 0; + } + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + s.gzindex = 0; + } + s.status = COMMENT_STATE; + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment) { + let beg = s.pending; + let val; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + if (s.pending !== 0) { + s.last_flush = -1; + return Z_OK$3; + } + beg = 0; + } + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg); + } + } + s.status = HCRC_STATE; + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + if (s.pending !== 0) { + s.last_flush = -1; + return Z_OK$3; + } + } + put_byte(s, strm.adler & 255); + put_byte(s, strm.adler >> 8 & 255); + strm.adler = 0; + } + s.status = BUSY_STATE; + flush_pending(strm); + if (s.pending !== 0) { + s.last_flush = -1; + return Z_OK$3; + } + } + if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE) { + let bstate = s.level === 0 ? deflate_stored(s, flush) : s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush); + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + } + return Z_OK$3; + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + _tr_align(s); + } else if (flush !== Z_BLOCK$1) { + _tr_stored_block(s, 0, 0, false); + if (flush === Z_FULL_FLUSH$1) { + zero(s.head); + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; + return Z_OK$3; + } + } + } + if (flush !== Z_FINISH$3) { + return Z_OK$3; + } + if (s.wrap <= 0) { + return Z_STREAM_END$3; + } + if (s.wrap === 2) { + put_byte(s, strm.adler & 255); + put_byte(s, strm.adler >> 8 & 255); + put_byte(s, strm.adler >> 16 & 255); + put_byte(s, strm.adler >> 24 & 255); + put_byte(s, strm.total_in & 255); + put_byte(s, strm.total_in >> 8 & 255); + put_byte(s, strm.total_in >> 16 & 255); + put_byte(s, strm.total_in >> 24 & 255); + } else { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 65535); + } + flush_pending(strm); + if (s.wrap > 0) { + s.wrap = -s.wrap; + } + return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3; + }; + var deflateEnd = (strm) => { + if (deflateStateCheck(strm)) { + return Z_STREAM_ERROR$2; + } + const status = strm.state.status; + strm.state = null; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3; + }; + var deflateSetDictionary = (strm, dictionary) => { + let dictLength = dictionary.length; + if (deflateStateCheck(strm)) { + return Z_STREAM_ERROR$2; + } + const s = strm.state; + const wrap = s.wrap; + if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) { + return Z_STREAM_ERROR$2; + } + if (wrap === 1) { + strm.adler = adler32_1(strm.adler, dictionary, dictLength, 0); + } + s.wrap = 0; + if (dictLength >= s.w_size) { + if (wrap === 0) { + zero(s.head); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + let tmpDict = new Uint8Array(s.w_size); + tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + const avail = strm.avail_in; + const next = strm.next_in; + const input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + let str = s.strstart; + let n = s.lookahead - (MIN_MATCH - 1); + do { + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK$3; + }; + var deflateInit_1 = deflateInit; + var deflateInit2_1 = deflateInit2; + var deflateReset_1 = deflateReset; + var deflateResetKeep_1 = deflateResetKeep; + var deflateSetHeader_1 = deflateSetHeader; + var deflate_2$1 = deflate$2; + var deflateEnd_1 = deflateEnd; + var deflateSetDictionary_1 = deflateSetDictionary; + var deflateInfo = "pako deflate (from Nodeca project)"; + var deflate_1$2 = { + deflateInit: deflateInit_1, + deflateInit2: deflateInit2_1, + deflateReset: deflateReset_1, + deflateResetKeep: deflateResetKeep_1, + deflateSetHeader: deflateSetHeader_1, + deflate: deflate_2$1, + deflateEnd: deflateEnd_1, + deflateSetDictionary: deflateSetDictionary_1, + deflateInfo + }; + var _has = (obj, key) => { + return Object.prototype.hasOwnProperty.call(obj, key); + }; + var assign = function(obj) { + const sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + const source = sources.shift(); + if (!source) { + continue; + } + if (typeof source !== "object") { + throw new TypeError(source + "must be non-object"); + } + for (const p in source) { + if (_has(source, p)) { + obj[p] = source[p]; + } + } + } + return obj; + }; + var flattenChunks = (chunks) => { + let len = 0; + for (let i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + const result = new Uint8Array(len); + for (let i = 0, pos = 0, l = chunks.length; i < l; i++) { + let chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + return result; + }; + var common = { + assign, + flattenChunks + }; + var STR_APPLY_UIA_OK = true; + try { + String.fromCharCode.apply(null, new Uint8Array(1)); + } catch (__) { + STR_APPLY_UIA_OK = false; + } + var _utf8len = new Uint8Array(256); + for (let q = 0; q < 256; q++) { + _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1; + } + _utf8len[254] = _utf8len[254] = 1; + var string2buf = (str) => { + if (typeof TextEncoder === "function" && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; + } + buf = new Uint8Array(buf_len); + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + if (c < 128) { + buf[i++] = c; + } else if (c < 2048) { + buf[i++] = 192 | c >>> 6; + buf[i++] = 128 | c & 63; + } else if (c < 65536) { + buf[i++] = 224 | c >>> 12; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } else { + buf[i++] = 240 | c >>> 18; + buf[i++] = 128 | c >>> 12 & 63; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } + } + return buf; + }; + var buf2binstring = (buf, len) => { + if (len < 65534) { + if (buf.subarray && STR_APPLY_UIA_OK) { + return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len)); + } + } + let result = ""; + for (let i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; + }; + var buf2string = (buf, max) => { + const len = max || buf.length; + if (typeof TextDecoder === "function" && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + let i, out; + const utf16buf = new Array(len * 2); + for (out = 0, i = 0; i < len; ) { + let c = buf[i++]; + if (c < 128) { + utf16buf[out++] = c; + continue; + } + let c_len = _utf8len[c]; + if (c_len > 4) { + utf16buf[out++] = 65533; + i += c_len - 1; + continue; + } + c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; + while (c_len > 1 && i < len) { + c = c << 6 | buf[i++] & 63; + c_len--; + } + if (c_len > 1) { + utf16buf[out++] = 65533; + continue; + } + if (c < 65536) { + utf16buf[out++] = c; + } else { + c -= 65536; + utf16buf[out++] = 55296 | c >> 10 & 1023; + utf16buf[out++] = 56320 | c & 1023; + } + } + return buf2binstring(utf16buf, out); + }; + var utf8border = (buf, max) => { + max = max || buf.length; + if (max > buf.length) { + max = buf.length; + } + let pos = max - 1; + while (pos >= 0 && (buf[pos] & 192) === 128) { + pos--; + } + if (pos < 0) { + return max; + } + if (pos === 0) { + return max; + } + return pos + _utf8len[buf[pos]] > max ? pos : max; + }; + var strings = { + string2buf, + buf2string, + utf8border + }; + function ZStream() { + this.input = null; + this.next_in = 0; + this.avail_in = 0; + this.total_in = 0; + this.output = null; + this.next_out = 0; + this.avail_out = 0; + this.total_out = 0; + this.msg = ""; + this.state = null; + this.data_type = 2; + this.adler = 0; + } + var zstream = ZStream; + var toString$1 = Object.prototype.toString; + var { + Z_NO_FLUSH: Z_NO_FLUSH$1, + Z_SYNC_FLUSH, + Z_FULL_FLUSH, + Z_FINISH: Z_FINISH$2, + Z_OK: Z_OK$2, + Z_STREAM_END: Z_STREAM_END$2, + Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY, + Z_DEFLATED: Z_DEFLATED$1 + } = constants$2; + function Deflate$1(options) { + this.options = common.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED$1, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY + }, options || {}); + let opt = this.options; + if (opt.raw && opt.windowBits > 0) { + opt.windowBits = -opt.windowBits; + } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) { + opt.windowBits += 16; + } + this.err = 0; + this.msg = ""; + this.ended = false; + this.chunks = []; + this.strm = new zstream(); + this.strm.avail_out = 0; + let status = deflate_1$2.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + if (status !== Z_OK$2) { + throw new Error(messages[status]); + } + if (opt.header) { + deflate_1$2.deflateSetHeader(this.strm, opt.header); + } + if (opt.dictionary) { + let dict; + if (typeof opt.dictionary === "string") { + dict = strings.string2buf(opt.dictionary); + } else if (toString$1.call(opt.dictionary) === "[object ArrayBuffer]") { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + status = deflate_1$2.deflateSetDictionary(this.strm, dict); + if (status !== Z_OK$2) { + throw new Error(messages[status]); + } + this._dict_set = true; + } + } + Deflate$1.prototype.push = function(data, flush_mode) { + const strm = this.strm; + const chunkSize = this.options.chunkSize; + let status, _flush_mode; + if (this.ended) { + return false; + } + if (flush_mode === ~~flush_mode) + _flush_mode = flush_mode; + else + _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1; + if (typeof data === "string") { + strm.input = strings.string2buf(data); + } else if (toString$1.call(data) === "[object ArrayBuffer]") { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + strm.next_in = 0; + strm.avail_in = strm.input.length; + for (; ; ) { + if (strm.avail_out === 0) { + strm.output = new Uint8Array(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { + this.onData(strm.output.subarray(0, strm.next_out)); + strm.avail_out = 0; + continue; + } + status = deflate_1$2.deflate(strm, _flush_mode); + if (status === Z_STREAM_END$2) { + if (strm.next_out > 0) { + this.onData(strm.output.subarray(0, strm.next_out)); + } + status = deflate_1$2.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK$2; + } + if (strm.avail_out === 0) { + this.onData(strm.output); + continue; + } + if (_flush_mode > 0 && strm.next_out > 0) { + this.onData(strm.output.subarray(0, strm.next_out)); + strm.avail_out = 0; + continue; + } + if (strm.avail_in === 0) + break; + } + return true; + }; + Deflate$1.prototype.onData = function(chunk) { + this.chunks.push(chunk); + }; + Deflate$1.prototype.onEnd = function(status) { + if (status === Z_OK$2) { + this.result = common.flattenChunks(this.chunks); + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; + }; + function deflate$1(input, options) { + const deflator = new Deflate$1(options); + deflator.push(input, true); + if (deflator.err) { + throw deflator.msg || messages[deflator.err]; + } + return deflator.result; + } + function deflateRaw$1(input, options) { + options = options || {}; + options.raw = true; + return deflate$1(input, options); + } + function gzip$1(input, options) { + options = options || {}; + options.gzip = true; + return deflate$1(input, options); + } + var Deflate_1$1 = Deflate$1; + var deflate_2 = deflate$1; + var deflateRaw_1$1 = deflateRaw$1; + var gzip_1$1 = gzip$1; + var constants$1 = constants$2; + var deflate_1$1 = { + Deflate: Deflate_1$1, + deflate: deflate_2, + deflateRaw: deflateRaw_1$1, + gzip: gzip_1$1, + constants: constants$1 + }; + var BAD$1 = 16209; + var TYPE$1 = 16191; + var inffast = function inflate_fast(strm, start) { + let _in; + let last; + let _out; + let beg; + let end; + let dmax; + let wsize; + let whave; + let wnext; + let s_window; + let hold; + let bits; + let lcode; + let dcode; + let lmask; + let dmask; + let here; + let op; + let len; + let dist; + let from; + let from_source; + let input, output2; + const state = strm.state; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output2 = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); + dmax = state.dmax; + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = lcode[hold & lmask]; + dolen: + for (; ; ) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op === 0) { + output2[_out++] = here & 65535; + } else if (op & 16) { + len = here & 65535; + op &= 15; + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & (1 << op) - 1; + hold >>>= op; + bits -= op; + } + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + dodist: + for (; ; ) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op & 16) { + dist = here & 65535; + op &= 15; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & (1 << op) - 1; + if (dist > dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD$1; + break top; + } + hold >>>= op; + bits -= op; + op = _out - beg; + if (dist > op) { + op = dist - op; + if (op > whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD$1; + break top; + } + } + from = 0; + from_source = s_window; + if (wnext === 0) { + from += wsize - op; + if (op < len) { + len -= op; + do { + output2[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output2; + } + } else if (wnext < op) { + from += wsize + wnext - op; + op -= wnext; + if (op < len) { + len -= op; + do { + output2[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { + op = wnext; + len -= op; + do { + output2[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output2; + } + } + } else { + from += wnext - op; + if (op < len) { + len -= op; + do { + output2[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output2; + } + } + while (len > 2) { + output2[_out++] = from_source[from++]; + output2[_out++] = from_source[from++]; + output2[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output2[_out++] = from_source[from++]; + if (len > 1) { + output2[_out++] = from_source[from++]; + } + } + } else { + from = _out - dist; + do { + output2[_out++] = output2[from++]; + output2[_out++] = output2[from++]; + output2[_out++] = output2[from++]; + len -= 3; + } while (len > 2); + if (len) { + output2[_out++] = output2[from++]; + if (len > 1) { + output2[_out++] = output2[from++]; + } + } + } + } else if ((op & 64) === 0) { + here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dodist; + } else { + strm.msg = "invalid distance code"; + state.mode = BAD$1; + break top; + } + break; + } + } else if ((op & 64) === 0) { + here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dolen; + } else if (op & 32) { + state.mode = TYPE$1; + break top; + } else { + strm.msg = "invalid literal/length code"; + state.mode = BAD$1; + break top; + } + break; + } + } while (_in < last && _out < end); + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last); + strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); + state.hold = hold; + state.bits = bits; + return; + }; + var MAXBITS = 15; + var ENOUGH_LENS$1 = 852; + var ENOUGH_DISTS$1 = 592; + var CODES$1 = 0; + var LENS$1 = 1; + var DISTS$1 = 2; + var lbase = new Uint16Array([ + /* Length codes 257..285 base */ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 13, + 15, + 17, + 19, + 23, + 27, + 31, + 35, + 43, + 51, + 59, + 67, + 83, + 99, + 115, + 131, + 163, + 195, + 227, + 258, + 0, + 0 + ]); + var lext = new Uint8Array([ + /* Length codes 257..285 extra */ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 17, + 17, + 17, + 17, + 18, + 18, + 18, + 18, + 19, + 19, + 19, + 19, + 20, + 20, + 20, + 20, + 21, + 21, + 21, + 21, + 16, + 72, + 78 + ]); + var dbase = new Uint16Array([ + /* Distance codes 0..29 base */ + 1, + 2, + 3, + 4, + 5, + 7, + 9, + 13, + 17, + 25, + 33, + 49, + 65, + 97, + 129, + 193, + 257, + 385, + 513, + 769, + 1025, + 1537, + 2049, + 3073, + 4097, + 6145, + 8193, + 12289, + 16385, + 24577, + 0, + 0 + ]); + var dext = new Uint8Array([ + /* Distance codes 0..29 extra */ + 16, + 16, + 16, + 16, + 17, + 17, + 18, + 18, + 19, + 19, + 20, + 20, + 21, + 21, + 22, + 22, + 23, + 23, + 24, + 24, + 25, + 25, + 26, + 26, + 27, + 27, + 28, + 28, + 29, + 29, + 64, + 64 + ]); + var inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) => { + const bits = opts.bits; + let len = 0; + let sym = 0; + let min = 0, max = 0; + let root = 0; + let curr = 0; + let drop = 0; + let left = 0; + let used = 0; + let huff = 0; + let incr; + let fill; + let low; + let mask; + let next; + let base = null; + let match; + const count = new Uint16Array(MAXBITS + 1); + const offs = new Uint16Array(MAXBITS + 1); + let extra = null; + let here_bits, here_op, here_val; + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { + break; + } + } + if (root > max) { + root = max; + } + if (max === 0) { + table[table_index++] = 1 << 24 | 64 << 16 | 0; + table[table_index++] = 1 << 24 | 64 << 16 | 0; + opts.bits = 1; + return 0; + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { + break; + } + } + if (root < min) { + root = min; + } + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } + } + if (left > 0 && (type === CODES$1 || max !== 1)) { + return -1; + } + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + if (type === CODES$1) { + base = extra = work; + match = 20; + } else if (type === LENS$1) { + base = lbase; + extra = lext; + match = 257; + } else { + base = dbase; + extra = dext; + match = 0; + } + huff = 0; + sym = 0; + len = min; + next = table_index; + curr = root; + drop = 0; + low = -1; + used = 1 << root; + mask = used - 1; + if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) { + return 1; + } + for (; ; ) { + here_bits = len - drop; + if (work[sym] + 1 < match) { + here_op = 0; + here_val = work[sym]; + } else if (work[sym] >= match) { + here_op = extra[work[sym] - match]; + here_val = base[work[sym] - match]; + } else { + here_op = 32 + 64; + here_val = 0; + } + incr = 1 << len - drop; + fill = 1 << curr; + min = fill; + do { + fill -= incr; + table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; + } while (fill !== 0); + incr = 1 << len - 1; + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + sym++; + if (--count[len] === 0) { + if (len === max) { + break; + } + len = lens[lens_index + work[sym]]; + } + if (len > root && (huff & mask) !== low) { + if (drop === 0) { + drop = root; + } + next += min; + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { + break; + } + curr++; + left <<= 1; + } + used += 1 << curr; + if (type === LENS$1 && used > ENOUGH_LENS$1 || type === DISTS$1 && used > ENOUGH_DISTS$1) { + return 1; + } + low = huff & mask; + table[low] = root << 24 | curr << 16 | next - table_index | 0; + } + } + if (huff !== 0) { + table[next + huff] = len - drop << 24 | 64 << 16 | 0; + } + opts.bits = root; + return 0; + }; + var inftrees = inflate_table; + var CODES = 0; + var LENS = 1; + var DISTS = 2; + var { + Z_FINISH: Z_FINISH$1, + Z_BLOCK, + Z_TREES, + Z_OK: Z_OK$1, + Z_STREAM_END: Z_STREAM_END$1, + Z_NEED_DICT: Z_NEED_DICT$1, + Z_STREAM_ERROR: Z_STREAM_ERROR$1, + Z_DATA_ERROR: Z_DATA_ERROR$1, + Z_MEM_ERROR: Z_MEM_ERROR$1, + Z_BUF_ERROR, + Z_DEFLATED + } = constants$2; + var HEAD = 16180; + var FLAGS = 16181; + var TIME = 16182; + var OS = 16183; + var EXLEN = 16184; + var EXTRA = 16185; + var NAME = 16186; + var COMMENT = 16187; + var HCRC = 16188; + var DICTID = 16189; + var DICT = 16190; + var TYPE = 16191; + var TYPEDO = 16192; + var STORED = 16193; + var COPY_ = 16194; + var COPY = 16195; + var TABLE = 16196; + var LENLENS = 16197; + var CODELENS = 16198; + var LEN_ = 16199; + var LEN = 16200; + var LENEXT = 16201; + var DIST = 16202; + var DISTEXT = 16203; + var MATCH = 16204; + var LIT = 16205; + var CHECK = 16206; + var LENGTH = 16207; + var DONE = 16208; + var BAD = 16209; + var MEM = 16210; + var SYNC = 16211; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + var MAX_WBITS = 15; + var DEF_WBITS = MAX_WBITS; + var zswap32 = (q) => { + return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); + }; + function InflateState() { + this.strm = null; + this.mode = 0; + this.last = false; + this.wrap = 0; + this.havedict = false; + this.flags = 0; + this.dmax = 0; + this.check = 0; + this.total = 0; + this.head = null; + this.wbits = 0; + this.wsize = 0; + this.whave = 0; + this.wnext = 0; + this.window = null; + this.hold = 0; + this.bits = 0; + this.length = 0; + this.offset = 0; + this.extra = 0; + this.lencode = null; + this.distcode = null; + this.lenbits = 0; + this.distbits = 0; + this.ncode = 0; + this.nlen = 0; + this.ndist = 0; + this.have = 0; + this.next = null; + this.lens = new Uint16Array(320); + this.work = new Uint16Array(288); + this.lendyn = null; + this.distdyn = null; + this.sane = 0; + this.back = 0; + this.was = 0; + } + var inflateStateCheck = (strm) => { + if (!strm) { + return 1; + } + const state = strm.state; + if (!state || state.strm !== strm || state.mode < HEAD || state.mode > SYNC) { + return 1; + } + return 0; + }; + var inflateResetKeep = (strm) => { + if (inflateStateCheck(strm)) { + return Z_STREAM_ERROR$1; + } + const state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ""; + if (state.wrap) { + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.flags = -1; + state.dmax = 32768; + state.head = null; + state.hold = 0; + state.bits = 0; + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); + state.sane = 1; + state.back = -1; + return Z_OK$1; + }; + var inflateReset = (strm) => { + if (inflateStateCheck(strm)) { + return Z_STREAM_ERROR$1; + } + const state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + }; + var inflateReset2 = (strm, windowBits) => { + let wrap; + if (inflateStateCheck(strm)) { + return Z_STREAM_ERROR$1; + } + const state = strm.state; + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } else { + wrap = (windowBits >> 4) + 5; + if (windowBits < 48) { + windowBits &= 15; + } + } + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR$1; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); + }; + var inflateInit2 = (strm, windowBits) => { + if (!strm) { + return Z_STREAM_ERROR$1; + } + const state = new InflateState(); + strm.state = state; + state.strm = strm; + state.window = null; + state.mode = HEAD; + const ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK$1) { + strm.state = null; + } + return ret; + }; + var inflateInit = (strm) => { + return inflateInit2(strm, DEF_WBITS); + }; + var virgin = true; + var lenfix; + var distfix; + var fixedtables = (state) => { + if (virgin) { + lenfix = new Int32Array(512); + distfix = new Int32Array(32); + let sym = 0; + while (sym < 144) { + state.lens[sym++] = 8; + } + while (sym < 256) { + state.lens[sym++] = 9; + } + while (sym < 280) { + state.lens[sym++] = 7; + } + while (sym < 288) { + state.lens[sym++] = 8; + } + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + sym = 0; + while (sym < 32) { + state.lens[sym++] = 5; + } + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + virgin = false; + } + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; + }; + var updatewindow = (strm, src, end, copy) => { + let dist; + const state = strm.state; + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + state.window = new Uint8Array(state.wsize); + } + if (copy >= state.wsize) { + state.window.set(src.subarray(end - state.wsize, end), 0); + state.wnext = 0; + state.whave = state.wsize; + } else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext); + copy -= dist; + if (copy) { + state.window.set(src.subarray(end - copy, end), 0); + state.wnext = copy; + state.whave = state.wsize; + } else { + state.wnext += dist; + if (state.wnext === state.wsize) { + state.wnext = 0; + } + if (state.whave < state.wsize) { + state.whave += dist; + } + } + } + return 0; + }; + var inflate$2 = (strm, flush) => { + let state; + let input, output2; + let next; + let put; + let have, left; + let hold; + let bits; + let _in, _out; + let copy; + let from; + let from_source; + let here = 0; + let here_bits, here_op, here_val; + let last_bits, last_op, last_val; + let len; + let ret; + const hbuf = new Uint8Array(4); + let opts; + let n; + const order = ( + /* permutation of code lengths */ + new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]) + ); + if (inflateStateCheck(strm) || !strm.output || !strm.input && strm.avail_in !== 0) { + return Z_STREAM_ERROR$1; + } + state = strm.state; + if (state.mode === TYPE) { + state.mode = TYPEDO; + } + put = strm.next_out; + output2 = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + _in = have; + _out = left; + ret = Z_OK$1; + inf_leave: + for (; ; ) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.wrap & 2 && hold === 35615) { + if (state.wbits === 0) { + state.wbits = 15; + } + state.check = 0; + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32_1(state.check, hbuf, 2, 0); + hold = 0; + bits = 0; + state.mode = FLAGS; + break; + } + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 255) << 8) + (hold >> 8)) % 31) { + strm.msg = "incorrect header check"; + state.mode = BAD; + break; + } + if ((hold & 15) !== Z_DEFLATED) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + hold >>>= 4; + bits -= 4; + len = (hold & 15) + 8; + if (state.wbits === 0) { + state.wbits = len; + } + if (len > 15 || len > state.wbits) { + strm.msg = "invalid window size"; + state.mode = BAD; + break; + } + state.dmax = 1 << state.wbits; + state.flags = 0; + strm.adler = state.check = 1; + state.mode = hold & 512 ? DICTID : TYPE; + hold = 0; + bits = 0; + break; + case FLAGS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.flags = hold; + if ((state.flags & 255) !== Z_DEFLATED) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + if (state.flags & 57344) { + strm.msg = "unknown header flags set"; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = hold >> 8 & 1; + } + if (state.flags & 512 && state.wrap & 4) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32_1(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = TIME; + case TIME: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.time = hold; + } + if (state.flags & 512 && state.wrap & 4) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + hbuf[2] = hold >>> 16 & 255; + hbuf[3] = hold >>> 24 & 255; + state.check = crc32_1(state.check, hbuf, 4, 0); + } + hold = 0; + bits = 0; + state.mode = OS; + case OS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.xflags = hold & 255; + state.head.os = hold >> 8; + } + if (state.flags & 512 && state.wrap & 4) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32_1(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = EXLEN; + case EXLEN: + if (state.flags & 1024) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 512 && state.wrap & 4) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32_1(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + } else if (state.head) { + state.head.extra = null; + } + state.mode = EXTRA; + case EXTRA: + if (state.flags & 1024) { + copy = state.length; + if (copy > have) { + copy = have; + } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + state.head.extra = new Uint8Array(state.head.extra_len); + } + state.head.extra.set( + input.subarray( + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + next + copy + ), + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + } + if (state.flags & 512 && state.wrap & 4) { + state.check = crc32_1(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { + break inf_leave; + } + } + state.length = 0; + state.mode = NAME; + case NAME: + if (state.flags & 2048) { + if (have === 0) { + break inf_leave; + } + copy = 0; + do { + len = input[next + copy++]; + if (state.head && len && state.length < 65536) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 512 && state.wrap & 4) { + state.check = crc32_1(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { + break inf_leave; + } + } else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + case COMMENT: + if (state.flags & 4096) { + if (have === 0) { + break inf_leave; + } + copy = 0; + do { + len = input[next + copy++]; + if (state.head && len && state.length < 65536) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 512 && state.wrap & 4) { + state.check = crc32_1(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { + break inf_leave; + } + } else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + case HCRC: + if (state.flags & 512) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.wrap & 4 && hold !== (state.check & 65535)) { + strm.msg = "header crc mismatch"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + if (state.head) { + state.head.hcrc = state.flags >> 9 & 1; + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + strm.adler = state.check = zswap32(hold); + hold = 0; + bits = 0; + state.mode = DICT; + case DICT: + if (state.havedict === 0) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + return Z_NEED_DICT$1; + } + strm.adler = state.check = 1; + state.mode = TYPE; + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { + break inf_leave; + } + case TYPEDO: + if (state.last) { + hold >>>= bits & 7; + bits -= bits & 7; + state.mode = CHECK; + break; + } + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.last = hold & 1; + hold >>>= 1; + bits -= 1; + switch (hold & 3) { + case 0: + state.mode = STORED; + break; + case 1: + fixedtables(state); + state.mode = LEN_; + if (flush === Z_TREES) { + hold >>>= 2; + bits -= 2; + break inf_leave; + } + break; + case 2: + state.mode = TABLE; + break; + case 3: + strm.msg = "invalid block type"; + state.mode = BAD; + } + hold >>>= 2; + bits -= 2; + break; + case STORED: + hold >>>= bits & 7; + bits -= bits & 7; + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { + strm.msg = "invalid stored block lengths"; + state.mode = BAD; + break; + } + state.length = hold & 65535; + hold = 0; + bits = 0; + state.mode = COPY_; + if (flush === Z_TREES) { + break inf_leave; + } + case COPY_: + state.mode = COPY; + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { + copy = have; + } + if (copy > left) { + copy = left; + } + if (copy === 0) { + break inf_leave; + } + output2.set(input.subarray(next, next + copy), put); + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + state.mode = TYPE; + break; + case TABLE: + while (bits < 14) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.nlen = (hold & 31) + 257; + hold >>>= 5; + bits -= 5; + state.ndist = (hold & 31) + 1; + hold >>>= 5; + bits -= 5; + state.ncode = (hold & 15) + 4; + hold >>>= 4; + bits -= 4; + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = "too many length or distance symbols"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = LENLENS; + case LENLENS: + while (state.have < state.ncode) { + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.lens[order[state.have++]] = hold & 7; + hold >>>= 3; + bits -= 3; + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + state.lencode = state.lendyn; + state.lenbits = 7; + opts = { bits: state.lenbits }; + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid code lengths set"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = CODELENS; + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (; ; ) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_val < 16) { + hold >>>= here_bits; + bits -= here_bits; + state.lens[state.have++] = here_val; + } else { + if (here_val === 16) { + n = here_bits + 2; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + if (state.have === 0) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 3); + hold >>>= 2; + bits -= 2; + } else if (here_val === 17) { + n = here_bits + 3; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy = 3 + (hold & 7); + hold >>>= 3; + bits -= 3; + } else { + n = here_bits + 7; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy = 11 + (hold & 127); + hold >>>= 7; + bits -= 7; + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + if (state.mode === BAD) { + break; + } + if (state.lens[256] === 0) { + strm.msg = "invalid code -- missing end-of-block"; + state.mode = BAD; + break; + } + state.lenbits = 9; + opts = { bits: state.lenbits }; + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid literal/lengths set"; + state.mode = BAD; + break; + } + state.distbits = 6; + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + state.distbits = opts.bits; + if (ret) { + strm.msg = "invalid distances set"; + state.mode = BAD; + break; + } + state.mode = LEN_; + if (flush === Z_TREES) { + break inf_leave; + } + case LEN_: + state.mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + inffast(strm, _out); + put = strm.next_out; + output2 = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (; ; ) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_op && (here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (; ; ) { + here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + state.mode = LIT; + break; + } + if (here_op & 32) { + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = "invalid literal/length code"; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + case LENEXT: + if (state.extra) { + n = state.extra; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + state.was = state.length; + state.mode = DIST; + case DIST: + for (; ; ) { + here = state.distcode[hold & (1 << state.distbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (; ; ) { + here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + if (here_op & 64) { + strm.msg = "invalid distance code"; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = here_op & 15; + state.mode = DISTEXT; + case DISTEXT: + if (state.extra) { + n = state.extra; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.offset += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + if (state.offset > state.dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + state.mode = MATCH; + case MATCH: + if (left === 0) { + break inf_leave; + } + copy = _out - left; + if (state.offset > copy) { + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } else { + from = state.wnext - copy; + } + if (copy > state.length) { + copy = state.length; + } + from_source = state.window; + } else { + from_source = output2; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { + copy = left; + } + left -= copy; + state.length -= copy; + do { + output2[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { + state.mode = LEN; + } + break; + case LIT: + if (left === 0) { + break inf_leave; + } + output2[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold |= input[next++] << bits; + bits += 8; + } + _out -= left; + strm.total_out += _out; + state.total += _out; + if (state.wrap & 4 && _out) { + strm.adler = state.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/ + state.flags ? crc32_1(state.check, output2, _out, put - _out) : adler32_1(state.check, output2, _out, put - _out); + } + _out = left; + if (state.wrap & 4 && (state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = "incorrect data check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = LENGTH; + case LENGTH: + if (state.wrap && state.flags) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.wrap & 4 && hold !== (state.total & 4294967295)) { + strm.msg = "incorrect length check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = DONE; + case DONE: + ret = Z_STREAM_END$1; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR$1; + break inf_leave; + case MEM: + return Z_MEM_ERROR$1; + case SYNC: + default: + return Z_STREAM_ERROR$1; + } + } + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH$1)) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) + ; + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap & 4 && _out) { + strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/ + state.flags ? crc32_1(state.check, output2, _out, strm.next_out - _out) : adler32_1(state.check, output2, _out, strm.next_out - _out); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if ((_in === 0 && _out === 0 || flush === Z_FINISH$1) && ret === Z_OK$1) { + ret = Z_BUF_ERROR; + } + return ret; + }; + var inflateEnd = (strm) => { + if (inflateStateCheck(strm)) { + return Z_STREAM_ERROR$1; + } + let state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK$1; + }; + var inflateGetHeader = (strm, head) => { + if (inflateStateCheck(strm)) { + return Z_STREAM_ERROR$1; + } + const state = strm.state; + if ((state.wrap & 2) === 0) { + return Z_STREAM_ERROR$1; + } + state.head = head; + head.done = false; + return Z_OK$1; + }; + var inflateSetDictionary = (strm, dictionary) => { + const dictLength = dictionary.length; + let state; + let dictid; + let ret; + if (inflateStateCheck(strm)) { + return Z_STREAM_ERROR$1; + } + state = strm.state; + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR$1; + } + if (state.mode === DICT) { + dictid = 1; + dictid = adler32_1(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR$1; + } + } + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR$1; + } + state.havedict = 1; + return Z_OK$1; + }; + var inflateReset_1 = inflateReset; + var inflateReset2_1 = inflateReset2; + var inflateResetKeep_1 = inflateResetKeep; + var inflateInit_1 = inflateInit; + var inflateInit2_1 = inflateInit2; + var inflate_2$1 = inflate$2; + var inflateEnd_1 = inflateEnd; + var inflateGetHeader_1 = inflateGetHeader; + var inflateSetDictionary_1 = inflateSetDictionary; + var inflateInfo = "pako inflate (from Nodeca project)"; + var inflate_1$2 = { + inflateReset: inflateReset_1, + inflateReset2: inflateReset2_1, + inflateResetKeep: inflateResetKeep_1, + inflateInit: inflateInit_1, + inflateInit2: inflateInit2_1, + inflate: inflate_2$1, + inflateEnd: inflateEnd_1, + inflateGetHeader: inflateGetHeader_1, + inflateSetDictionary: inflateSetDictionary_1, + inflateInfo + }; + function GZheader() { + this.text = 0; + this.time = 0; + this.xflags = 0; + this.os = 0; + this.extra = null; + this.extra_len = 0; + this.name = ""; + this.comment = ""; + this.hcrc = 0; + this.done = false; + } + var gzheader = GZheader; + var toString = Object.prototype.toString; + var { + Z_NO_FLUSH, + Z_FINISH, + Z_OK, + Z_STREAM_END, + Z_NEED_DICT, + Z_STREAM_ERROR, + Z_DATA_ERROR, + Z_MEM_ERROR + } = constants$2; + function Inflate$1(options) { + this.options = common.assign({ + chunkSize: 1024 * 64, + windowBits: 15, + to: "" + }, options || {}); + const opt = this.options; + if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { + opt.windowBits = -15; + } + } + if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) { + opt.windowBits += 32; + } + if (opt.windowBits > 15 && opt.windowBits < 48) { + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + this.err = 0; + this.msg = ""; + this.ended = false; + this.chunks = []; + this.strm = new zstream(); + this.strm.avail_out = 0; + let status = inflate_1$2.inflateInit2( + this.strm, + opt.windowBits + ); + if (status !== Z_OK) { + throw new Error(messages[status]); + } + this.header = new gzheader(); + inflate_1$2.inflateGetHeader(this.strm, this.header); + if (opt.dictionary) { + if (typeof opt.dictionary === "string") { + opt.dictionary = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { + opt.dictionary = new Uint8Array(opt.dictionary); + } + if (opt.raw) { + status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== Z_OK) { + throw new Error(messages[status]); + } + } + } + } + Inflate$1.prototype.push = function(data, flush_mode) { + const strm = this.strm; + const chunkSize = this.options.chunkSize; + const dictionary = this.options.dictionary; + let status, _flush_mode, last_avail_out; + if (this.ended) + return false; + if (flush_mode === ~~flush_mode) + _flush_mode = flush_mode; + else + _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; + if (toString.call(data) === "[object ArrayBuffer]") { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + strm.next_in = 0; + strm.avail_in = strm.input.length; + for (; ; ) { + if (strm.avail_out === 0) { + strm.output = new Uint8Array(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = inflate_1$2.inflate(strm, _flush_mode); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$2.inflateSetDictionary(strm, dictionary); + if (status === Z_OK) { + status = inflate_1$2.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { + status = Z_NEED_DICT; + } + } + while (strm.avail_in > 0 && status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { + inflate_1$2.inflateReset(strm); + status = inflate_1$2.inflate(strm, _flush_mode); + } + switch (status) { + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: + this.onEnd(status); + this.ended = true; + return false; + } + last_avail_out = strm.avail_out; + if (strm.next_out) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { + if (this.options.to === "string") { + let next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + let tail = strm.next_out - next_out_utf8; + let utf8str = strings.buf2string(strm.output, next_out_utf8); + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) + strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0); + this.onData(utf8str); + } else { + this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out)); + } + } + } + if (status === Z_OK && last_avail_out === 0) + continue; + if (status === Z_STREAM_END) { + status = inflate_1$2.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return true; + } + if (strm.avail_in === 0) + break; + } + return true; + }; + Inflate$1.prototype.onData = function(chunk) { + this.chunks.push(chunk); + }; + Inflate$1.prototype.onEnd = function(status) { + if (status === Z_OK) { + if (this.options.to === "string") { + this.result = this.chunks.join(""); + } else { + this.result = common.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; + }; + function inflate$1(input, options) { + const inflator = new Inflate$1(options); + inflator.push(input); + if (inflator.err) + throw inflator.msg || messages[inflator.err]; + return inflator.result; + } + function inflateRaw$1(input, options) { + options = options || {}; + options.raw = true; + return inflate$1(input, options); + } + var Inflate_1$1 = Inflate$1; + var inflate_2 = inflate$1; + var inflateRaw_1$1 = inflateRaw$1; + var ungzip$1 = inflate$1; + var constants = constants$2; + var inflate_1$1 = { + Inflate: Inflate_1$1, + inflate: inflate_2, + inflateRaw: inflateRaw_1$1, + ungzip: ungzip$1, + constants + }; + var { Deflate, deflate, deflateRaw, gzip } = deflate_1$1; + var { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1; + var gzip_1 = gzip; + var ungzip_1 = ungzip; + + // src/utils/stark.ts + function compressProgram(jsonProgram) { + const stringified = typeof jsonProgram === "string" ? jsonProgram : stringify2(jsonProgram); + const compressedProgram = gzip_1(stringified); + return btoaUniversal(compressedProgram); + } + function decompressProgram(base64) { + if (Array.isArray(base64)) + return base64; + const decompressed = arrayBufferToString(ungzip_1(atobUniversal(base64))); + return parse2(decompressed); + } + function randomAddress() { + const randomKeyPair = utils.randomPrivateKey(); + return getStarkKey(randomKeyPair); + } + function makeAddress(input) { + return addHexPrefix(input).toLowerCase(); + } + function formatSignature(sig) { + if (!sig) + throw Error("formatSignature: provided signature is undefined"); + if (Array.isArray(sig)) { + return sig.map((it) => toHex(it)); + } + try { + const { r, s } = sig; + return [toHex(r), toHex(s)]; + } catch (e) { + throw new Error("Signature need to be weierstrass.SignatureType or an array for custom"); + } + } + function signatureToDecimalArray(sig) { + return bigNumberishArrayToDecimalStringArray(formatSignature(sig)); + } + function signatureToHexArray(sig) { + return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig)); + } + function estimatedFeeToMaxFee(estimatedFee, overhead = 0.5) { + const overHeadPercent = Math.round((1 + overhead) * 100); + return toBigInt(estimatedFee) * toBigInt(overHeadPercent) / 100n; + } + + // src/utils/contract.ts + function isSierra(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + return "sierra_program" in compiledContract; + } + function extractContractHashes(payload) { + const response = { ...payload }; + if (isSierra(payload.contract)) { + if (!payload.compiledClassHash && payload.casm) { + response.compiledClassHash = computeCompiledClassHash(payload.casm); + } + if (!response.compiledClassHash) + throw new Error( + "Extract compiledClassHash failed, provide (CairoAssembly).casm file or compiledClassHash" + ); + } + response.classHash = payload.classHash ?? computeContractClassHash(payload.contract); + if (!response.classHash) + throw new Error("Extract classHash failed, provide (CompiledContract).json file or classHash"); + return response; + } + function contractClassResponseToLegacyCompiledContract(ccr) { + if (isSierra(ccr)) { + throw Error("ContractClassResponse need to be LegacyContractClass (cairo0 response class)"); + } + const contract = ccr; + return { ...contract, program: decompressProgram(contract.program) }; + } + + // src/utils/fetchPonyfill.ts + var import_isomorphic_fetch = __toESM(require_fetch_npm_browserify()); + var fetchPonyfill_default = typeof window !== "undefined" && window.fetch || // use buildin fetch in browser if available + typeof global !== "undefined" && global.fetch || // use buildin fetch in node, react-native and service worker if available + import_isomorphic_fetch.default; + + // src/utils/provider.ts + var provider_exports = {}; + __export(provider_exports, { + createSierraContractClass: () => createSierraContractClass, + parseContract: () => parseContract, + wait: () => wait + }); + function wait(delay) { + return new Promise((res) => { + setTimeout(res, delay); + }); + } + function createSierraContractClass(contract) { + const result = { ...contract }; + delete result.sierra_program_debug_info; + result.abi = formatSpaces(stringify2(contract.abi)); + result.sierra_program = formatSpaces(stringify2(contract.sierra_program)); + result.sierra_program = compressProgram(result.sierra_program); + return result; + } + function parseContract(contract) { + const parsedContract = typeof contract === "string" ? parse2(contract) : contract; + if (!isSierra(contract)) { + return { + ...parsedContract, + ..."program" in parsedContract && { program: compressProgram(parsedContract.program) } + }; + } + return createSierraContractClass(parsedContract); + } + + // src/utils/responseParser/rpc.ts + var RPCResponseParser = class { + parseGetBlockResponse(res) { + return { + timestamp: res.timestamp, + block_hash: res.block_hash, + block_number: res.block_number, + new_root: res.new_root, + parent_hash: res.parent_hash, + status: res.status, + transactions: res.transactions + }; + } + parseGetTransactionResponse(res) { + return { + calldata: res.calldata || [], + contract_address: res.contract_address, + sender_address: res.contract_address, + max_fee: res.max_fee, + nonce: res.nonce, + signature: res.signature || [], + transaction_hash: res.transaction_hash, + version: res.version + }; + } + parseFeeEstimateResponse(res) { + return { + overall_fee: toBigInt(res[0].overall_fee), + gas_consumed: toBigInt(res[0].gas_consumed), + gas_price: toBigInt(res[0].gas_price) + }; + } + parseFeeEstimateBulkResponse(res) { + return res.map((val) => ({ + overall_fee: toBigInt(val.overall_fee), + gas_consumed: toBigInt(val.gas_consumed), + gas_price: toBigInt(val.gas_price) + })); + } + parseCallContractResponse(res) { + return { + result: res + }; + } + parseSimulateTransactionResponse(res) { + return res.map((it) => { + return { + ...it, + suggestedMaxFee: estimatedFeeToMaxFee(BigInt(it.fee_estimation.overall_fee)) + }; + }); + } + parseContractClassResponse(res) { + return { + ...res, + abi: typeof res.abi === "string" ? JSON.parse(res.abi) : res.abi + }; + } + }; + + // src/provider/errors.ts + function fixStack(target, fn = target.constructor) { + const { captureStackTrace } = Error; + captureStackTrace && captureStackTrace(target, fn); + } + function fixProto(target, prototype) { + const { setPrototypeOf } = Object; + setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype; + } + var CustomError = class extends Error { + constructor(message) { + super(message); + Object.defineProperty(this, "name", { + value: new.target.name, + enumerable: false, + configurable: true + }); + fixProto(this, new.target.prototype); + fixStack(this); + } + }; + var LibraryError = class extends CustomError { + }; + var GatewayError = class extends LibraryError { + constructor(message, errorCode) { + super(message); + this.errorCode = errorCode; + } + }; + var HttpError = class extends LibraryError { + constructor(message, errorCode) { + super(message); + this.errorCode = errorCode; + } + }; + + // src/utils/starknetId.ts + var starknetId_exports = {}; + __export(starknetId_exports, { + StarknetIdContract: () => StarknetIdContract, + getStarknetIdContract: () => getStarknetIdContract, + useDecoded: () => useDecoded, + useEncoded: () => useEncoded + }); + var basicAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789-"; + var basicSizePlusOne = BigInt(basicAlphabet.length + 1); + var bigAlphabet = "\u8FD9\u6765"; + var basicAlphabetSize = BigInt(basicAlphabet.length); + var bigAlphabetSize = BigInt(bigAlphabet.length); + var bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1); + function extractStars(str) { + let k = 0; + while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) { + str = str.substring(0, str.length - 1); + k += 1; + } + return [str, k]; + } + function useDecoded(encoded) { + let decoded = ""; + encoded.forEach((subdomain) => { + while (subdomain !== ZERO) { + const code = subdomain % basicSizePlusOne; + subdomain /= basicSizePlusOne; + if (code === BigInt(basicAlphabet.length)) { + const nextSubdomain = subdomain / bigAlphabetSizePlusOne; + if (nextSubdomain === ZERO) { + const code2 = subdomain % bigAlphabetSizePlusOne; + subdomain = nextSubdomain; + if (code2 === ZERO) + decoded += basicAlphabet[0]; + else + decoded += bigAlphabet[Number(code2) - 1]; + } else { + const code2 = subdomain % bigAlphabetSize; + decoded += bigAlphabet[Number(code2)]; + subdomain /= bigAlphabetSize; + } + } else + decoded += basicAlphabet[Number(code)]; + } + const [str, k] = extractStars(decoded); + if (k) + decoded = str + (k % 2 === 0 ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) + bigAlphabet[0] + basicAlphabet[1] : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1)); + decoded += "."; + }); + if (!decoded) { + return decoded; + } + return decoded.concat("stark"); + } + function useEncoded(decoded) { + let encoded = BigInt(0); + let multiplier = BigInt(1); + if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) { + const [str, k] = extractStars(decoded.substring(0, decoded.length - 2)); + decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1)); + } else { + const [str, k] = extractStars(decoded); + if (k) + decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1)); + } + for (let i = 0; i < decoded.length; i += 1) { + const char = decoded[i]; + const index = basicAlphabet.indexOf(char); + const bnIndex = BigInt(basicAlphabet.indexOf(char)); + if (index !== -1) { + if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) { + encoded += multiplier * basicAlphabetSize; + multiplier *= basicSizePlusOne; + multiplier *= basicSizePlusOne; + } else { + encoded += multiplier * bnIndex; + multiplier *= basicSizePlusOne; + } + } else if (bigAlphabet.indexOf(char) !== -1) { + encoded += multiplier * basicAlphabetSize; + multiplier *= basicSizePlusOne; + const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char); + encoded += multiplier * BigInt(newid); + multiplier *= bigAlphabetSize; + } + } + return encoded; + } + var StarknetIdContract = /* @__PURE__ */ ((StarknetIdContract2) => { + StarknetIdContract2["MAINNET"] = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678"; + StarknetIdContract2["TESTNET"] = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce"; + return StarknetIdContract2; + })(StarknetIdContract || {}); + function getStarknetIdContract(chainId) { + switch (chainId) { + case "0x534e5f4d41494e" /* SN_MAIN */: + return "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678" /* MAINNET */; + case "0x534e5f474f45524c49" /* SN_GOERLI */: + return "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce" /* TESTNET */; + default: + throw new Error("Starknet.id is not yet deployed on this network"); + } + } + + // src/provider/starknetId.ts + async function getStarkName(provider, address, StarknetIdContract2) { + const chainId = await provider.getChainId(); + const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId); + try { + const hexDomain = await provider.callContract({ + contractAddress: contract, + entrypoint: "address_to_domain", + calldata: CallData.compile({ + address + }) + }); + const decimalDomain = hexDomain.result.map((element) => BigInt(element)).slice(1); + const stringDomain = useDecoded(decimalDomain); + if (!stringDomain) { + throw Error("Starkname not found"); + } + return stringDomain; + } catch (e) { + if (e instanceof Error && e.message === "Starkname not found") { + throw e; + } + throw Error("Could not get stark name"); + } + } + async function getAddressFromStarkName(provider, name, StarknetIdContract2) { + const chainId = await provider.getChainId(); + const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId); + try { + const addressData = await provider.callContract({ + contractAddress: contract, + entrypoint: "domain_to_address", + calldata: CallData.compile({ + domain: [useEncoded(name.replace(".stark", "")).toString(10)] + }) + }); + return addressData.result[0]; + } catch { + throw Error("Could not get address from stark name"); + } + } + + // src/provider/utils.ts + var validBlockTags = Object.values(BlockTag); + var Block = class { + constructor(_identifier) { + this.hash = null; + this.number = null; + this.tag = null; + this.valueOf = () => this.number; + this.toString = () => this.hash; + this.setIdentifier(_identifier); + } + setIdentifier(__identifier) { + if (typeof __identifier === "string" && isHex(__identifier)) { + this.hash = __identifier; + } else if (typeof __identifier === "bigint") { + this.hash = toHex(__identifier); + } else if (typeof __identifier === "number") { + this.number = __identifier; + } else if (typeof __identifier === "string" && validBlockTags.includes(__identifier)) { + this.tag = __identifier; + } else { + this.tag = "pending" /* pending */; + } + } + // TODO: fix any + get queryIdentifier() { + if (this.number !== null) { + return `blockNumber=${this.number}`; + } + if (this.hash !== null) { + return `blockHash=${this.hash}`; + } + return `blockNumber=${this.tag}`; + } + // TODO: fix any + get identifier() { + if (this.number !== null) { + return { block_number: this.number }; + } + if (this.hash !== null) { + return { block_hash: this.hash }; + } + return this.tag; + } + set identifier(_identifier) { + this.setIdentifier(_identifier); + } + get sequencerIdentifier() { + return this.hash !== null ? { blockHash: this.hash } : { blockNumber: this.number ?? this.tag }; + } + }; + + // src/provider/rpc.ts + var defaultOptions = { + headers: { "Content-Type": "application/json" }, + blockIdentifier: "latest", + retries: 200 + }; + var RpcProvider = class { + constructor(optionsOrProvider) { + this.responseParser = new RPCResponseParser(); + const { nodeUrl, retries, headers, blockIdentifier, chainId } = optionsOrProvider; + this.nodeUrl = nodeUrl; + this.retries = retries || defaultOptions.retries; + this.headers = { ...defaultOptions.headers, ...headers }; + this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier; + this.chainId = chainId; + this.getChainId(); + } + fetch(method, params) { + const body = stringify2({ method, jsonrpc: "2.0", params, id: 0 }); + return fetchPonyfill_default(this.nodeUrl, { + method: "POST", + body, + headers: this.headers + }); + } + errorHandler(error) { + if (error) { + const { code, message } = error; + throw new LibraryError(`${code}: ${message}`); + } + } + async fetchEndpoint(method, params) { + try { + const rawResult = await this.fetch(method, params); + const { error, result } = await rawResult.json(); + this.errorHandler(error); + return result; + } catch (error) { + this.errorHandler(error?.response?.data); + throw error; + } + } + // Methods from Interface + async getChainId() { + this.chainId ?? (this.chainId = await this.fetchEndpoint("starknet_chainId")); + return this.chainId; + } + async getBlock(blockIdentifier = this.blockIdentifier) { + return this.getBlockWithTxHashes(blockIdentifier).then( + this.responseParser.parseGetBlockResponse + ); + } + async getBlockHashAndNumber() { + return this.fetchEndpoint("starknet_blockHashAndNumber"); + } + async getBlockWithTxHashes(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockWithTxHashes", { block_id }); + } + async getBlockWithTxs(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockWithTxs", { block_id }); + } + async getClassHashAt(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClassHashAt", { + block_id, + contract_address: contractAddress + }); + } + async getNonceForAddress(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getNonce", { + contract_address: contractAddress, + block_id + }); + } + async getPendingTransactions() { + return this.fetchEndpoint("starknet_pendingTransactions"); + } + async getProtocolVersion() { + throw new Error("Pathfinder does not implement this rpc 0.1.0 method"); + } + async getStateUpdate(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getStateUpdate", { block_id }); + } + async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) { + const parsedKey = toStorageKey(key); + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getStorageAt", { + contract_address: contractAddress, + key: parsedKey, + block_id + }); + } + // Methods from Interface + async getTransaction(txHash) { + return this.getTransactionByHash(txHash).then(this.responseParser.parseGetTransactionResponse); + } + async getTransactionByHash(txHash) { + return this.fetchEndpoint("starknet_getTransactionByHash", { transaction_hash: txHash }); + } + async getTransactionByBlockIdAndIndex(blockIdentifier, index) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex", { block_id, index }); + } + async getTransactionReceipt(txHash) { + return this.fetchEndpoint("starknet_getTransactionReceipt", { transaction_hash: txHash }); + } + async getClassByHash(classHash) { + return this.getClass(classHash); + } + async getClass(classHash, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClass", { + class_hash: classHash, + block_id + }).then(this.responseParser.parseContractClassResponse); + } + async getClassAt(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClassAt", { + block_id, + contract_address: contractAddress + }).then(this.responseParser.parseContractClassResponse); + } + async getCode(_contractAddress, _blockIdentifier) { + throw new Error("RPC does not implement getCode function"); + } + async getEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier) { + return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier); + } + async getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "INVOKE_FUNCTION" /* INVOKE */, + ...invocation, + ...invocationDetails + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getDeclareEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "DECLARE" /* DECLARE */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getDeployAccountEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getEstimateFeeBulk(invocations, { blockIdentifier = this.blockIdentifier, skipValidate = false }) { + if (skipValidate) { + console.warn("getEstimateFeeBulk RPC does not support skipValidate"); + } + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_estimateFee", { + request: invocations.map((it) => this.buildTransaction(it, "fee")), + block_id + }).then(this.responseParser.parseFeeEstimateBulkResponse); + } + async declareContract({ contract, signature, senderAddress, compiledClassHash }, details) { + if (!isSierra(contract)) { + return this.fetchEndpoint("starknet_addDeclareTransaction", { + declare_transaction: { + type: rpc_exports.TransactionType.DECLARE, + contract_class: { + program: contract.program, + entry_points_by_type: contract.entry_points_by_type, + abi: contract.abi + }, + version: toHex(transactionVersion), + max_fee: toHex(details.maxFee || 0), + signature: signatureToHexArray(signature), + sender_address: senderAddress, + nonce: toHex(details.nonce) + } + }); + } + return this.fetchEndpoint("starknet_addDeclareTransaction", { + declare_transaction: { + type: rpc_exports.TransactionType.DECLARE, + contract_class: { + sierra_program: decompressProgram(contract.sierra_program), + contract_class_version: contract.contract_class_version, + entry_points_by_type: contract.entry_points_by_type, + abi: contract.abi + }, + compiled_class_hash: compiledClassHash || "", + version: toHex(transactionVersion_2), + max_fee: toHex(details.maxFee || 0), + signature: signatureToHexArray(signature), + sender_address: senderAddress, + nonce: toHex(details.nonce) + } + }); + } + async deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }, details) { + return this.fetchEndpoint("starknet_addDeployAccountTransaction", { + deploy_account_transaction: { + constructor_calldata: CallData.toHex(constructorCalldata || []), + class_hash: toHex(classHash), + contract_address_salt: toHex(addressSalt || 0), + type: rpc_exports.TransactionType.DEPLOY_ACCOUNT, + max_fee: toHex(details.maxFee || 0), + version: toHex(details.version || 0), + signature: signatureToHexArray(signature), + nonce: toHex(details.nonce) + } + }); + } + async invokeFunction(functionInvocation, details) { + return this.fetchEndpoint("starknet_addInvokeTransaction", { + invoke_transaction: { + sender_address: functionInvocation.contractAddress, + calldata: CallData.toHex(functionInvocation.calldata), + type: rpc_exports.TransactionType.INVOKE, + max_fee: toHex(details.maxFee || 0), + version: "0x1", + signature: signatureToHexArray(functionInvocation.signature), + nonce: toHex(details.nonce) + } + }); + } + // Methods from Interface + async callContract(call, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const result = await this.fetchEndpoint("starknet_call", { + request: { + contract_address: call.contractAddress, + entry_point_selector: getSelectorFromName(call.entrypoint), + calldata: CallData.toHex(call.calldata) + }, + block_id + }); + return this.responseParser.parseCallContractResponse(result); + } + async traceTransaction(transactionHash) { + return this.fetchEndpoint("starknet_traceTransaction", { transaction_hash: transactionHash }); + } + async traceBlockTransactions(blockHash) { + return this.fetchEndpoint("starknet_traceBlockTransactions", { block_hash: blockHash }); + } + async waitForTransaction(txHash, options) { + const errorStates = ["REJECTED" /* REJECTED */, "NOT_RECEIVED" /* NOT_RECEIVED */]; + let { retries } = this; + let onchain = false; + let txReceipt = {}; + const retryInterval = options?.retryInterval ?? 8e3; + const successStates = options?.successStates ?? [ + "ACCEPTED_ON_L1" /* ACCEPTED_ON_L1 */, + "ACCEPTED_ON_L2" /* ACCEPTED_ON_L2 */ + ]; + while (!onchain) { + await wait(retryInterval); + try { + txReceipt = await this.getTransactionReceipt(txHash); + if (!("status" in txReceipt)) { + const error = new Error("transaction status"); + throw error; + } + if (txReceipt.status && successStates.includes(txReceipt.status)) { + onchain = true; + } else if (txReceipt.status && errorStates.includes(txReceipt.status)) { + const message = txReceipt.status; + const error = new Error(message); + error.response = txReceipt; + throw error; + } + } catch (error) { + if (error instanceof Error && errorStates.includes(error.message)) { + throw error; + } + if (retries === 0) { + throw new Error(`waitForTransaction timed-out with retries ${this.retries}`); + } + } + retries -= 1; + } + await wait(retryInterval); + return txReceipt; + } + /** + * Gets the transaction count from a block. + * + * + * @param blockIdentifier + * @returns Number of transactions + */ + async getTransactionCount(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockTransactionCount", { block_id }); + } + /** + * Gets the latest block number + * + * + * @returns Number of the latest block + */ + async getBlockNumber() { + return this.fetchEndpoint("starknet_blockNumber"); + } + /** + * Gets syncing status of the node + * + * + * @returns Object with the stats data + */ + async getSyncingStats() { + return this.fetchEndpoint("starknet_syncing"); + } + /** + * Gets all the events filtered + * + * + * @returns events and the pagination of the events + */ + async getEvents(eventFilter) { + return this.fetchEndpoint("starknet_getEvents", { filter: eventFilter }); + } + async getSimulateTransaction(invocations, { + blockIdentifier = this.blockIdentifier, + skipValidate = false, + skipExecute = false + }) { + const block_id = new Block(blockIdentifier).identifier; + const simulationFlags = []; + if (skipValidate) + simulationFlags.push(0 /* SKIP_VALIDATE */); + if (skipExecute) + simulationFlags.push(1 /* SKIP_EXECUTE */); + return this.fetchEndpoint("starknet_simulateTransaction", { + block_id, + transactions: invocations.map((it) => this.buildTransaction(it)), + // TODO: Pathfinder 0.5.6 bug, should be transaction + simulation_flags: simulationFlags + }).then(this.responseParser.parseSimulateTransactionResponse); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } + buildTransaction(invocation, versionType) { + const defaultVersions = getVersionsByType(versionType); + const details = { + signature: signatureToHexArray(invocation.signature), + nonce: toHex(invocation.nonce), + max_fee: toHex(invocation.maxFee || 0) + }; + if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) { + return { + type: rpc_exports.TransactionType.INVOKE, + // Diff between sequencer and rpc invoke type + sender_address: invocation.contractAddress, + calldata: CallData.toHex(invocation.calldata), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + if (invocation.type === rpc_exports.TransactionType.DECLARE) { + if (!isSierra(invocation.contract)) { + const legacyContract = invocation.contract; + return { + type: invocation.type, + contract_class: legacyContract, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + const sierraContract = invocation.contract; + return { + // compiled_class_hash + type: invocation.type, + contract_class: { + ...sierraContract, + sierra_program: decompressProgram(sierraContract.sierra_program) + }, + compiled_class_hash: invocation.compiledClassHash || "", + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v2), + ...details + }; + } + if (invocation.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + return { + type: invocation.type, + constructor_calldata: CallData.toHex(invocation.constructorCalldata || []), + class_hash: toHex(invocation.classHash), + contract_address_salt: toHex(invocation.addressSalt || 0), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + throw Error("RPC buildTransaction received unknown TransactionType"); + } + }; + + // src/provider/sequencer.ts + var import_url_join2 = __toESM(require_url_join()); + + // src/utils/responseParser/index.ts + var ResponseParser = class { + }; + + // src/utils/responseParser/sequencer.ts + var SequencerAPIResponseParser = class extends ResponseParser { + parseGetBlockResponse(res) { + return { + ...res, + new_root: res.state_root, + parent_hash: res.parent_block_hash, + transactions: Object.values(res.transactions).map((value) => "transaction_hash" in value && value.transaction_hash).filter(Boolean) + }; + } + parseGetTransactionResponse(res) { + return { + ...res, + calldata: "calldata" in res.transaction ? res.transaction.calldata : [], + contract_class: "contract_class" in res.transaction ? res.transaction.contract_class : void 0, + entry_point_selector: "entry_point_selector" in res.transaction ? res.transaction.entry_point_selector : void 0, + max_fee: "max_fee" in res.transaction ? res.transaction.max_fee : void 0, + nonce: res.transaction.nonce, + sender_address: "sender_address" in res.transaction ? res.transaction.sender_address : void 0, + signature: "signature" in res.transaction ? res.transaction.signature : void 0, + transaction_hash: "transaction_hash" in res.transaction ? res.transaction.transaction_hash : void 0, + version: "version" in res.transaction ? res.transaction.version : void 0 + }; + } + parseGetTransactionReceiptResponse(res) { + return { + transaction_hash: res.transaction_hash, + status: res.status, + messages_sent: res.l2_to_l1_messages, + // TODO: parse + events: res.events, + ..."block_hash" in res && { block_hash: res.block_hash }, + ..."block_number" in res && { block_number: res.block_number }, + ..."actual_fee" in res && { actual_fee: res.actual_fee }, + ..."transaction_index" in res && { transaction_index: res.transaction_index }, + ..."execution_resources" in res && { execution_resources: res.execution_resources }, + ..."l1_to_l2_consumed_message" in res && { + // eslint-disable-next-line @typescript-eslint/dot-notation + l1_to_l2_consumed_message: res["l1_to_l2_consumed_message"] + }, + ..."transaction_failure_reason" in res && { + transaction_failure_reason: res.transaction_failure_reason + } + }; + } + parseFeeEstimateResponse(res) { + if ("overall_fee" in res) { + let gasInfo = {}; + try { + gasInfo = { + gas_consumed: toBigInt(res.gas_usage), + gas_price: toBigInt(res.gas_price) + }; + } catch { + } + return { + overall_fee: toBigInt(res.overall_fee), + ...gasInfo + }; + } + return { + overall_fee: toBigInt(res.amount) + }; + } + parseFeeEstimateBulkResponse(res) { + return [].concat(res).map((item) => { + if ("overall_fee" in item) { + let gasInfo = {}; + try { + gasInfo = { + gas_consumed: toBigInt(item.gas_usage), + gas_price: toBigInt(item.gas_price) + }; + } catch { + } + return { + overall_fee: toBigInt(item.overall_fee), + ...gasInfo + }; + } + return { + overall_fee: toBigInt(item.amount) + }; + }); + } + parseSimulateTransactionResponse(res) { + const suggestedMaxFee = "overall_fee" in res.fee_estimation ? res.fee_estimation.overall_fee : res.fee_estimation.amount; + return [ + { + transaction_trace: res.trace, + fee_estimation: res.fee_estimation, + suggestedMaxFee: estimatedFeeToMaxFee(BigInt(suggestedMaxFee)) + } + ]; + } + parseCallContractResponse(res) { + return { + result: res.result + }; + } + parseInvokeFunctionResponse(res) { + return { + transaction_hash: res.transaction_hash + }; + } + parseDeployContractResponse(res) { + return { + transaction_hash: res.transaction_hash, + contract_address: res.address + }; + } + parseDeclareContractResponse(res) { + return { + transaction_hash: res.transaction_hash, + class_hash: res.class_hash + }; + } + parseGetStateUpdateResponse(res) { + const nonces = Object.entries(res.state_diff.nonces).map(([contract_address, nonce]) => ({ + contract_address, + nonce + })); + const storage_diffs = Object.entries(res.state_diff.storage_diffs).map( + ([address, storage_entries]) => ({ address, storage_entries }) + ); + return { + ...res, + state_diff: { + ...res.state_diff, + storage_diffs, + nonces + } + }; + } + parseContractClassResponse(res) { + const response = isSierra(res) ? res : parseContract(res); + return { + ...response, + abi: typeof response.abi === "string" ? JSON.parse(response.abi) : response.abi + }; + } + }; + + // src/utils/url.ts + var import_url_join = __toESM(require_url_join()); + var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/; + var localhostDomainRE = /^localhost[:?\d]*(?:[^:?\d]\S*)?$/; + var nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/; + function isUrl(s) { + if (!s) { + return false; + } + if (typeof s !== "string") { + return false; + } + const match = s.match(protocolAndDomainRE); + if (!match) { + return false; + } + const everythingAfterProtocol = match[1]; + if (!everythingAfterProtocol) { + return false; + } + if (localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol)) { + return true; + } + return false; + } + function buildUrl(baseUrl, defaultPath, urlOrPath) { + return isUrl(urlOrPath) ? urlOrPath : (0, import_url_join.default)(baseUrl, urlOrPath ?? defaultPath); + } + + // src/provider/sequencer.ts + function isEmptyQueryObject(obj) { + return obj === void 0 || Object.keys(obj).length === 0 || Object.keys(obj).length === 1 && Object.entries(obj).every(([k, v]) => k === "blockIdentifier" && v === null); + } + var defaultOptions2 = { + network: "SN_GOERLI2" /* SN_GOERLI2 */, + blockIdentifier: "pending" /* pending */ + }; + var SequencerProvider = class { + constructor(optionsOrProvider = defaultOptions2) { + this.responseParser = new SequencerAPIResponseParser(); + if ("network" in optionsOrProvider) { + this.baseUrl = SequencerProvider.getNetworkFromName(optionsOrProvider.network); + this.feederGatewayUrl = buildUrl(this.baseUrl, "feeder_gateway"); + this.gatewayUrl = buildUrl(this.baseUrl, "gateway"); + } else { + this.baseUrl = optionsOrProvider.baseUrl; + this.feederGatewayUrl = buildUrl( + this.baseUrl, + "feeder_gateway", + optionsOrProvider.feederGatewayUrl + ); + this.gatewayUrl = buildUrl(this.baseUrl, "gateway", optionsOrProvider.gatewayUrl); + } + this.chainId = optionsOrProvider?.chainId ?? SequencerProvider.getChainIdFromBaseUrl(this.baseUrl); + this.headers = optionsOrProvider.headers; + this.blockIdentifier = optionsOrProvider?.blockIdentifier || defaultOptions2.blockIdentifier; + } + static getNetworkFromName(name) { + switch (name) { + case ("SN_MAIN" /* SN_MAIN */ || "0x534e5f4d41494e" /* SN_MAIN */): + return "https://alpha-mainnet.starknet.io" /* SN_MAIN */; + case ("SN_GOERLI" /* SN_GOERLI */ || "0x534e5f474f45524c49" /* SN_GOERLI */): + return "https://alpha4.starknet.io" /* SN_GOERLI */; + case ("SN_GOERLI2" /* SN_GOERLI2 */ || "0x534e5f474f45524c4932" /* SN_GOERLI2 */): + return "https://alpha4-2.starknet.io" /* SN_GOERLI2 */; + default: + throw new Error("Could not detect base url from NetworkName"); + } + } + static getChainIdFromBaseUrl(baseUrl) { + try { + const url = new URL(baseUrl); + if (url.host.includes("mainnet.starknet.io")) { + return "0x534e5f4d41494e" /* SN_MAIN */; + } + if (url.host.includes("alpha4-2.starknet.io")) { + return "0x534e5f474f45524c4932" /* SN_GOERLI2 */; + } + return "0x534e5f474f45524c49" /* SN_GOERLI */; + } catch { + console.error(`Could not parse baseUrl: ${baseUrl}`); + return "0x534e5f474f45524c49" /* SN_GOERLI */; + } + } + getFetchUrl(endpoint) { + const gatewayUrlEndpoints = ["add_transaction"]; + return gatewayUrlEndpoints.includes(endpoint) ? this.gatewayUrl : this.feederGatewayUrl; + } + getFetchMethod(endpoint) { + const postMethodEndpoints = [ + "add_transaction", + "call_contract", + "estimate_fee", + "estimate_message_fee", + "estimate_fee_bulk", + "simulate_transaction" + ]; + return postMethodEndpoints.includes(endpoint) ? "POST" : "GET"; + } + getQueryString(query) { + if (isEmptyQueryObject(query)) { + return ""; + } + const queryString = Object.entries(query).map(([key, value]) => { + if (key === "blockIdentifier") { + const block = new Block(value); + return `${block.queryIdentifier}`; + } + return `${key}=${value}`; + }).join("&"); + return `?${queryString}`; + } + getHeaders(method) { + if (method === "POST") { + return { + "Content-Type": "application/json", + ...this.headers + }; + } + return this.headers; + } + // typesafe fetch + async fetchEndpoint(endpoint, ...[query, request]) { + const baseUrl = this.getFetchUrl(endpoint); + const method = this.getFetchMethod(endpoint); + const queryString = this.getQueryString(query); + const url = (0, import_url_join2.default)(baseUrl, endpoint, queryString); + return this.fetch(url, { + method, + body: request + }); + } + async fetch(endpoint, options) { + const url = buildUrl(this.baseUrl, "", endpoint); + const method = options?.method ?? "GET"; + const headers = this.getHeaders(method); + const body = stringify2(options?.body); + try { + const response = await fetchPonyfill_default(url, { + method, + body, + headers + }); + const textResponse = await response.text(); + if (!response.ok) { + let responseBody; + try { + responseBody = parse2(textResponse); + } catch { + throw new HttpError(response.statusText, response.status); + } + throw new GatewayError(responseBody.message, responseBody.code); + } + const parseChoice = options?.parseAlwaysAsBigInt ? parseAlwaysAsBig : parse2; + return parseChoice(textResponse); + } catch (error) { + if (error instanceof Error && !(error instanceof LibraryError)) + throw Error(`Could not ${method} from endpoint \`${url}\`: ${error.message}`); + throw error; + } + } + async getChainId() { + return Promise.resolve(this.chainId); + } + async callContract({ contractAddress, entrypoint: entryPointSelector, calldata = [] }, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint( + "call_contract", + { blockIdentifier }, + { + // TODO - determine best choice once both are fully supported in devnet + // signature: [], + // sender_address: contractAddress, + contract_address: contractAddress, + entry_point_selector: getSelectorFromName(entryPointSelector), + calldata: CallData.compile(calldata) + } + ).then(this.responseParser.parseCallContractResponse); + } + async getBlock(blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_block", { blockIdentifier }).then( + this.responseParser.parseGetBlockResponse + ); + } + async getNonceForAddress(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_nonce", { contractAddress, blockIdentifier }); + } + async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) { + const parsedKey = toBigInt(key).toString(10); + return this.fetchEndpoint("get_storage_at", { + blockIdentifier, + contractAddress, + key: parsedKey + }); + } + async getTransaction(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction", { transactionHash: txHashHex }).then((result) => { + if (Object.values(result).length === 1) + throw new LibraryError(result.status); + return this.responseParser.parseGetTransactionResponse(result); + }); + } + async getTransactionReceipt(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_receipt", { transactionHash: txHashHex }).then( + this.responseParser.parseGetTransactionReceiptResponse + ); + } + async getClassAt(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_full_contract", { blockIdentifier, contractAddress }).then( + this.responseParser.parseContractClassResponse + ); + } + async getClassHashAt(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_class_hash_at", { blockIdentifier, contractAddress }); + } + async getClassByHash(classHash, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_class_by_hash", { classHash, blockIdentifier }).then( + this.responseParser.parseContractClassResponse + ); + } + async getCompiledClassByClassHash(classHash, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_compiled_class_by_class_hash", { classHash, blockIdentifier }); + } + async invokeFunction(functionInvocation, details) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "INVOKE_FUNCTION" /* INVOKE */, + sender_address: functionInvocation.contractAddress, + calldata: CallData.compile(functionInvocation.calldata ?? []), + signature: signatureToDecimalArray(functionInvocation.signature), + nonce: toHex(details.nonce), + max_fee: toHex(details.maxFee || 0), + version: "0x1" + }).then(this.responseParser.parseInvokeFunctionResponse); + } + async deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }, details) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + contract_address_salt: addressSalt ?? randomAddress(), + constructor_calldata: CallData.compile(constructorCalldata ?? []), + class_hash: toHex(classHash), + max_fee: toHex(details.maxFee || 0), + version: toHex(details.version || 0), + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature) + }).then(this.responseParser.parseDeployContractResponse); + } + async declareContract({ senderAddress, contract, signature, compiledClassHash }, details) { + if (!isSierra(contract)) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "DECLARE" /* DECLARE */, + contract_class: contract, + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature), + sender_address: senderAddress, + max_fee: toHex(details.maxFee || 0), + version: toHex(transactionVersion) + }).then(this.responseParser.parseDeclareContractResponse); + } + return this.fetchEndpoint("add_transaction", void 0, { + type: "DECLARE" /* DECLARE */, + sender_address: senderAddress, + compiled_class_hash: compiledClassHash, + contract_class: contract, + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature), + max_fee: toHex(details.maxFee || 0), + version: toHex(transactionVersion_2) + }).then(this.responseParser.parseDeclareContractResponse); + } + async getEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier, skipValidate = false) { + return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier, skipValidate); + } + async getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "INVOKE_FUNCTION" /* INVOKE */, + ...invocation, + ...invocationDetails + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getDeclareEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "DECLARE" /* DECLARE */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getDeployAccountEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getEstimateFeeBulk(invocations, { blockIdentifier = this.blockIdentifier, skipValidate = false }) { + const transactions = invocations.map((it) => this.buildTransaction(it, "fee")); + return this.fetchEndpoint( + "estimate_fee_bulk", + { blockIdentifier, skipValidate }, + transactions + ).then(this.responseParser.parseFeeEstimateBulkResponse); + } + async getCode(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_code", { contractAddress, blockIdentifier }); + } + async waitForTransaction(txHash, options) { + const errorStates = ["REJECTED" /* REJECTED */, "NOT_RECEIVED" /* NOT_RECEIVED */]; + let onchain = false; + let res; + const retryInterval = options?.retryInterval ?? 8e3; + const successStates = options?.successStates ?? [ + "ACCEPTED_ON_L1" /* ACCEPTED_ON_L1 */, + "ACCEPTED_ON_L2" /* ACCEPTED_ON_L2 */ + ]; + while (!onchain) { + await wait(retryInterval); + res = await this.getTransactionStatus(txHash); + if (successStates.includes(res.tx_status)) { + onchain = true; + } else if (errorStates.includes(res.tx_status)) { + const message = res.tx_failure_reason ? `${res.tx_status}: ${res.tx_failure_reason.code} +${res.tx_failure_reason.error_message}` : res.tx_status; + const error = new Error(message); + error.response = res; + throw error; + } + } + const txReceipt = await this.getTransactionReceipt(txHash); + return txReceipt; + } + /** + * Gets the status of a transaction. + * @param txHash BigNumberish + * @returns GetTransactionStatusResponse - the transaction status object + */ + async getTransactionStatus(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_status", { transactionHash: txHashHex }); + } + /** + * Gets the smart contract address on the goerli testnet. + * @returns GetContractAddressesResponse - starknet smart contract addresses + */ + async getContractAddresses() { + return this.fetchEndpoint("get_contract_addresses"); + } + /** + * Gets the transaction trace from a tx id. + * @param txHash BigNumberish + * @returns TransactionTraceResponse - the transaction trace + */ + async getTransactionTrace(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_trace", { transactionHash: txHashHex }); + } + async estimateMessageFee({ from_address, to_address, entry_point_selector, payload }, blockIdentifier = this.blockIdentifier) { + const validCallL1Handler = { + from_address: getDecimalString(from_address), + to_address: getHexString(to_address), + entry_point_selector: getSelector(entry_point_selector), + payload: getHexStringArray(payload) + }; + return this.fetchEndpoint("estimate_message_fee", { blockIdentifier }, validCallL1Handler); + } + /** + * Simulate transaction using Sequencer provider + * WARNING!: Sequencer will process only first element from invocations array + * + * @param invocations Array of invocations, but only first invocation will be processed + * @param blockIdentifier block identifier, default 'latest' + * @param skipValidate Skip Account __validate__ method + * @returns + */ + async getSimulateTransaction(invocations, { + blockIdentifier = this.blockIdentifier, + skipValidate = false, + skipExecute = false + }) { + if (invocations.length > 1) { + console.warn("Sequencer simulate process only first element from invocations list"); + } + if (skipExecute) { + console.warn("Sequencer can't skip account __execute__"); + } + const transaction = this.buildTransaction(invocations[0]); + return this.fetchEndpoint( + "simulate_transaction", + { + blockIdentifier, + skipValidate: skipValidate ?? false + }, + transaction + ).then(this.responseParser.parseSimulateTransactionResponse); + } + async getStateUpdate(blockIdentifier = this.blockIdentifier) { + const args = new Block(blockIdentifier).sequencerIdentifier; + return this.fetchEndpoint("get_state_update", { ...args }).then( + this.responseParser.parseGetStateUpdateResponse + ); + } + // consider adding an optional trace retrieval parameter to the getBlock method + async getBlockTraces(blockIdentifier = this.blockIdentifier) { + const args = new Block(blockIdentifier).sequencerIdentifier; + return this.fetchEndpoint("get_block_traces", { ...args }); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } + /** + * Build Single AccountTransaction from Single AccountInvocation + * @param invocation AccountInvocationItem + * @param versionType 'fee' | 'transaction' - used to determine default versions + * @returns AccountTransactionItem + */ + buildTransaction(invocation, versionType) { + const defaultVersions = getVersionsByType(versionType); + const details = { + signature: signatureToDecimalArray(invocation.signature), + nonce: toHex(invocation.nonce) + }; + if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) { + return { + type: invocation.type, + sender_address: invocation.contractAddress, + calldata: CallData.compile(invocation.calldata ?? []), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + if (invocation.type === "DECLARE" /* DECLARE */) { + if (!isSierra(invocation.contract)) { + return { + type: invocation.type, + contract_class: invocation.contract, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v1), + // fee from getDeclareEstimateFee use t.v. instead of feet.v. + ...details + }; + } + return { + type: invocation.type, + contract_class: invocation.contract, + compiled_class_hash: invocation.compiledClassHash, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v2), + // fee on getDeclareEstimateFee use t.v. instead of feet.v. + ...details + }; + } + if (invocation.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + return { + type: invocation.type, + constructor_calldata: CallData.compile(invocation.constructorCalldata || []), + class_hash: toHex(invocation.classHash), + contract_address_salt: toHex(invocation.addressSalt || 0), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + throw Error("Sequencer buildTransaction received unknown TransactionType"); + } + }; + + // src/provider/default.ts + var Provider = class { + constructor(providerOrOptions) { + if (providerOrOptions instanceof Provider) { + this.provider = providerOrOptions.provider; + } else if (providerOrOptions instanceof RpcProvider || providerOrOptions instanceof SequencerProvider) { + this.provider = providerOrOptions; + } else if (providerOrOptions && "rpc" in providerOrOptions) { + this.provider = new RpcProvider(providerOrOptions.rpc); + } else if (providerOrOptions && "sequencer" in providerOrOptions) { + this.provider = new SequencerProvider(providerOrOptions.sequencer); + } else { + this.provider = new SequencerProvider(); + } + } + async getChainId() { + return this.provider.getChainId(); + } + async getBlock(blockIdentifier) { + return this.provider.getBlock(blockIdentifier); + } + async getClassAt(contractAddress, blockIdentifier) { + return this.provider.getClassAt(contractAddress, blockIdentifier); + } + async getClassHashAt(contractAddress, blockIdentifier) { + return this.provider.getClassHashAt(contractAddress, blockIdentifier); + } + getClassByHash(classHash) { + return this.provider.getClassByHash(classHash); + } + async getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier) { + return this.provider.getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier); + } + async getInvokeEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier, skipValidate) { + return this.provider.getInvokeEstimateFee( + invocationWithTxType, + invocationDetails, + blockIdentifier, + skipValidate + ); + } + async getEstimateFeeBulk(invocations, options) { + return this.provider.getEstimateFeeBulk(invocations, options); + } + async getNonceForAddress(contractAddress, blockIdentifier) { + return this.provider.getNonceForAddress(contractAddress, blockIdentifier); + } + async getStorageAt(contractAddress, key, blockIdentifier) { + return this.provider.getStorageAt(contractAddress, key, blockIdentifier); + } + async getTransaction(txHash) { + return this.provider.getTransaction(txHash); + } + async getTransactionReceipt(txHash) { + return this.provider.getTransactionReceipt(txHash); + } + async callContract(request, blockIdentifier) { + return this.provider.callContract(request, blockIdentifier); + } + async invokeFunction(functionInvocation, details) { + return this.provider.invokeFunction(functionInvocation, details); + } + async deployAccountContract(payload, details) { + return this.provider.deployAccountContract(payload, details); + } + async declareContract(transaction, details) { + return this.provider.declareContract(transaction, details); + } + async getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate) { + return this.provider.getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate); + } + getDeployAccountEstimateFee(transaction, details, blockIdentifier, skipValidate) { + return this.provider.getDeployAccountEstimateFee( + transaction, + details, + blockIdentifier, + skipValidate + ); + } + async getCode(contractAddress, blockIdentifier) { + return this.provider.getCode(contractAddress, blockIdentifier); + } + async waitForTransaction(txHash, options) { + return this.provider.waitForTransaction(txHash, options); + } + async getSimulateTransaction(invocations, options) { + return this.provider.getSimulateTransaction(invocations, options); + } + async getStateUpdate(blockIdentifier) { + return this.provider.getStateUpdate(blockIdentifier); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } + }; + + // src/signer/interface.ts + var SignerInterface = class { + }; + + // src/utils/transaction.ts + var transaction_exports = {}; + __export(transaction_exports, { + fromCallsToExecuteCalldata: () => fromCallsToExecuteCalldata, + fromCallsToExecuteCalldataWithNonce: () => fromCallsToExecuteCalldataWithNonce, + fromCallsToExecuteCalldata_cairo1: () => fromCallsToExecuteCalldata_cairo1, + getExecuteCalldata: () => getExecuteCalldata, + transformCallsToMulticallArrays: () => transformCallsToMulticallArrays, + transformCallsToMulticallArrays_cairo1: () => transformCallsToMulticallArrays_cairo1 + }); + var transformCallsToMulticallArrays = (calls) => { + const callArray = []; + const calldata = []; + calls.forEach((call) => { + const data = CallData.compile(call.calldata || []); + callArray.push({ + to: toBigInt(call.contractAddress).toString(10), + selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10), + data_offset: calldata.length.toString(), + data_len: data.length.toString() + }); + calldata.push(...data); + }); + return { + callArray, + calldata: CallData.compile({ calldata }) + }; + }; + var fromCallsToExecuteCalldata = (calls) => { + const { callArray, calldata } = transformCallsToMulticallArrays(calls); + const compiledCalls = CallData.compile({ callArray }); + return [...compiledCalls, ...calldata]; + }; + var fromCallsToExecuteCalldataWithNonce = (calls, nonce) => { + return [...fromCallsToExecuteCalldata(calls), toBigInt(nonce).toString()]; + }; + var transformCallsToMulticallArrays_cairo1 = (calls) => { + const callArray = calls.map((call) => ({ + to: toBigInt(call.contractAddress).toString(10), + selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10), + calldata: CallData.compile(call.calldata || []) + })); + return callArray; + }; + var fromCallsToExecuteCalldata_cairo1 = (calls) => { + const orderCalls = calls.map((call) => ({ + contractAddress: call.contractAddress, + entrypoint: call.entrypoint, + calldata: call.calldata + })); + return CallData.compile({ orderCalls }); + }; + var getExecuteCalldata = (calls, cairoVersion = "0") => { + if (cairoVersion === "1") { + return fromCallsToExecuteCalldata_cairo1(calls); + } + return fromCallsToExecuteCalldata(calls); + }; + + // src/utils/typedData.ts + var typedData_exports = {}; + __export(typedData_exports, { + encodeData: () => encodeData, + encodeType: () => encodeType, + encodeValue: () => encodeValue, + getDependencies: () => getDependencies, + getMessageHash: () => getMessageHash, + getStructHash: () => getStructHash, + getTypeHash: () => getTypeHash, + isMerkleTreeType: () => isMerkleTreeType, + prepareSelector: () => prepareSelector + }); + + // src/utils/merkle.ts + var merkle_exports = {}; + __export(merkle_exports, { + MerkleTree: () => MerkleTree, + proofMerklePath: () => proofMerklePath + }); + var MerkleTree = class { + constructor(leafHashes) { + this.branches = []; + this.leaves = leafHashes; + this.root = this.build(leafHashes); + } + build(leaves) { + if (leaves.length === 1) { + return leaves[0]; + } + if (leaves.length !== this.leaves.length) { + this.branches.push(leaves); + } + const newLeaves = []; + for (let i = 0; i < leaves.length; i += 2) { + if (i + 1 === leaves.length) { + newLeaves.push(MerkleTree.hash(leaves[i], "0x0")); + } else { + newLeaves.push(MerkleTree.hash(leaves[i], leaves[i + 1])); + } + } + return this.build(newLeaves); + } + static hash(a, b) { + const [aSorted, bSorted] = [toBigInt(a), toBigInt(b)].sort((x, y) => x >= y ? 1 : -1); + return esm_exports.pedersen(aSorted, bSorted); + } + getProof(leaf, branch = this.leaves, hashPath = []) { + const index = branch.indexOf(leaf); + if (index === -1) { + throw new Error("leaf not found"); + } + if (branch.length === 1) { + return hashPath; + } + const isLeft = index % 2 === 0; + const neededBranch = (isLeft ? branch[index + 1] : branch[index - 1]) ?? "0x0"; + const newHashPath = [...hashPath, neededBranch]; + const currentBranchLevelIndex = this.leaves.length === branch.length ? -1 : this.branches.findIndex((b) => b.length === branch.length); + const nextBranch = this.branches[currentBranchLevelIndex + 1] ?? [this.root]; + return this.getProof( + MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf), + nextBranch, + newHashPath + ); + } + }; + function proofMerklePath(root, leaf, path) { + if (path.length === 0) { + return root === leaf; + } + const [next, ...rest] = path; + return proofMerklePath(root, MerkleTree.hash(leaf, next), rest); + } + + // src/utils/typedData.ts + function getHex(value) { + try { + return toHex(value); + } catch (e) { + if (typeof value === "string") { + return toHex(encodeShortString(value)); + } + throw new Error(`Invalid BigNumberish: ${value}`); + } + } + var validateTypedData = (data) => { + const typedData = data; + const valid = Boolean(typedData.types && typedData.primaryType && typedData.message); + return valid; + }; + function prepareSelector(selector) { + return isHex(selector) ? selector : getSelectorFromName(selector); + } + function isMerkleTreeType(type) { + return type.type === "merkletree"; + } + var getDependencies = (types, type, dependencies = []) => { + if (type[type.length - 1] === "*") { + type = type.slice(0, -1); + } + if (dependencies.includes(type)) { + return dependencies; + } + if (!types[type]) { + return dependencies; + } + return [ + type, + ...types[type].reduce( + (previous, t) => [ + ...previous, + ...getDependencies(types, t.type, previous).filter( + (dependency) => !previous.includes(dependency) + ) + ], + [] + ) + ]; + }; + function getMerkleTreeType(types, ctx) { + if (ctx.parent && ctx.key) { + const parentType = types[ctx.parent]; + const merkleType = parentType.find((t) => t.name === ctx.key); + const isMerkleTree = isMerkleTreeType(merkleType); + if (!isMerkleTree) { + throw new Error(`${ctx.key} is not a merkle tree`); + } + if (merkleType.contains.endsWith("*")) { + throw new Error(`Merkle tree contain property must not be an array but was given ${ctx.key}`); + } + return merkleType.contains; + } + return "raw"; + } + var encodeType = (types, type) => { + const [primary, ...dependencies] = getDependencies(types, type); + const newTypes = !primary ? [] : [primary, ...dependencies.sort()]; + return newTypes.map((dependency) => { + return `${dependency}(${types[dependency].map((t) => `${t.name}:${t.type}`)})`; + }).join(""); + }; + var getTypeHash = (types, type) => { + return getSelectorFromName(encodeType(types, type)); + }; + var encodeValue = (types, type, data, ctx = {}) => { + if (types[type]) { + return [type, getStructHash(types, type, data)]; + } + if (Object.keys(types).map((x) => `${x}*`).includes(type)) { + const structHashes = data.map((struct) => { + return getStructHash(types, type.slice(0, -1), struct); + }); + return [type, computeHashOnElements2(structHashes)]; + } + if (type === "merkletree") { + const merkleTreeType = getMerkleTreeType(types, ctx); + const structHashes = data.map((struct) => { + return encodeValue(types, merkleTreeType, struct)[1]; + }); + const { root } = new MerkleTree(structHashes); + return ["felt", root]; + } + if (type === "felt*") { + return ["felt*", computeHashOnElements2(data)]; + } + if (type === "selector") { + return ["felt", prepareSelector(data)]; + } + return [type, getHex(data)]; + }; + var encodeData = (types, type, data) => { + const [returnTypes, values] = types[type].reduce( + ([ts, vs], field) => { + if (data[field.name] === void 0 || data[field.name] === null) { + throw new Error(`Cannot encode data: missing data for '${field.name}'`); + } + const value = data[field.name]; + const [t, encodedValue] = encodeValue(types, field.type, value, { + parent: type, + key: field.name + }); + return [ + [...ts, t], + [...vs, encodedValue] + ]; + }, + [["felt"], [getTypeHash(types, type)]] + ); + return [returnTypes, values]; + }; + var getStructHash = (types, type, data) => { + return computeHashOnElements2(encodeData(types, type, data)[1]); + }; + var getMessageHash = (typedData, account) => { + if (!validateTypedData(typedData)) { + throw new Error("Typed data does not match JSON schema"); + } + const message = [ + encodeShortString("StarkNet Message"), + getStructHash(typedData.types, "StarkNetDomain", typedData.domain), + account, + getStructHash(typedData.types, typedData.primaryType, typedData.message) + ]; + return computeHashOnElements2(message); + }; + + // src/signer/default.ts + var Signer = class { + constructor(pk = esm_exports.utils.randomPrivateKey()) { + this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk); + } + async getPubKey() { + return esm_exports.getStarkKey(this.pk); + } + async signMessage(typedData, accountAddress) { + const msgHash = getMessageHash(typedData, accountAddress); + return esm_exports.sign(msgHash, this.pk); + } + async signTransaction(transactions, transactionsDetail, abis) { + if (abis && abis.length !== transactions.length) { + throw new Error("ABI must be provided for each transaction or no transaction"); + } + const calldata = getExecuteCalldata(transactions, transactionsDetail.cairoVersion); + const msgHash = calculateTransactionHash( + transactionsDetail.walletAddress, + transactionsDetail.version, + calldata, + transactionsDetail.maxFee, + transactionsDetail.chainId, + transactionsDetail.nonce + ); + return esm_exports.sign(msgHash, this.pk); + } + async signDeployAccountTransaction({ + classHash, + contractAddress, + constructorCalldata, + addressSalt, + maxFee, + version, + chainId, + nonce + }) { + const msgHash = calculateDeployAccountTransactionHash( + contractAddress, + classHash, + CallData.compile(constructorCalldata), + addressSalt, + version, + maxFee, + chainId, + nonce + ); + return esm_exports.sign(msgHash, this.pk); + } + async signDeclareTransaction({ + classHash, + senderAddress, + chainId, + maxFee, + version, + nonce, + compiledClassHash + }) { + const msgHash = calculateDeclareTransactionHash( + classHash, + senderAddress, + version, + maxFee, + chainId, + nonce, + compiledClassHash + ); + return esm_exports.sign(msgHash, this.pk); + } + }; + + // src/utils/events.ts + function parseUDCEvent(txReceipt) { + if (!txReceipt.events) { + throw new Error("UDC emited event is empty"); + } + const event = txReceipt.events.find( + (it) => cleanHex(it.from_address) === cleanHex(UDC.ADDRESS) + ) || { + data: [] + }; + return { + transaction_hash: txReceipt.transaction_hash, + contract_address: event.data[0], + address: event.data[0], + deployer: event.data[1], + unique: event.data[2], + classHash: event.data[3], + calldata_len: event.data[4], + calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)), + salt: event.data[event.data.length - 1] + }; + } + + // src/account/default.ts + var Account = class extends Provider { + constructor(providerOrOptions, address, pkOrSigner, cairoVersion = "0") { + super(providerOrOptions); + this.deploySelf = this.deployAccount; + this.address = address.toLowerCase(); + this.signer = typeof pkOrSigner === "string" || pkOrSigner instanceof Uint8Array ? new Signer(pkOrSigner) : pkOrSigner; + this.cairoVersion = cairoVersion; + } + async getNonce(blockIdentifier) { + return super.getNonceForAddress(this.address, blockIdentifier); + } + async getNonceSafe(nonce) { + try { + return toBigInt(nonce ?? await this.getNonce()); + } catch (error) { + return 0n; + } + } + async estimateFee(calls, estimateFeeDetails) { + return this.estimateInvokeFee(calls, estimateFeeDetails); + } + async estimateInvokeFee(calls, { nonce: providedNonce, blockIdentifier, skipValidate } = {}) { + const transactions = Array.isArray(calls) ? calls : [calls]; + const nonce = toBigInt(providedNonce ?? await this.getNonce()); + const version = toBigInt(feeTransactionVersion); + const chainId = await this.getChainId(); + const signerDetails = { + walletAddress: this.address, + nonce, + maxFee: ZERO, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const invocation = await this.buildInvocation(transactions, signerDetails); + const response = await super.getInvokeEstimateFee( + { ...invocation }, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateDeclareFee({ contract, classHash: providedClassHash, casm, compiledClassHash }, { blockIdentifier, nonce: providedNonce, skipValidate } = {}) { + const nonce = toBigInt(providedNonce ?? await this.getNonce()); + const version = !isSierra(contract) ? feeTransactionVersion : feeTransactionVersion_2; + const chainId = await this.getChainId(); + const declareContractTransaction = await this.buildDeclarePayload( + { classHash: providedClassHash, contract, casm, compiledClassHash }, + { + nonce, + chainId, + version, + walletAddress: this.address, + maxFee: ZERO, + cairoVersion: this.cairoVersion + } + ); + const response = await super.getDeclareEstimateFee( + declareContractTransaction, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateAccountDeployFee({ + classHash, + addressSalt = 0, + constructorCalldata = [], + contractAddress: providedContractAddress + }, { blockIdentifier, skipValidate } = {}) { + const version = toBigInt(feeTransactionVersion); + const nonce = ZERO; + const chainId = await this.getChainId(); + const payload = await this.buildAccountDeployPayload( + { classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress }, + { + nonce, + chainId, + version, + walletAddress: this.address, + maxFee: ZERO, + cairoVersion: this.cairoVersion + } + ); + const response = await super.getDeployAccountEstimateFee( + { ...payload }, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateDeployFee(payload, transactionsDetail) { + const calls = this.buildUDCContractPayload(payload); + return this.estimateInvokeFee(calls, transactionsDetail); + } + async estimateFeeBulk(invocations, { nonce, blockIdentifier, skipValidate } = {}) { + const accountInvocations = await this.accountInvocationsFactory(invocations, { + versions: [feeTransactionVersion, feeTransactionVersion_2], + nonce, + blockIdentifier + }); + const response = await super.getEstimateFeeBulk(accountInvocations, { + blockIdentifier, + skipValidate + }); + return [].concat(response).map((elem) => { + const suggestedMaxFee = estimatedFeeToMaxFee(elem.overall_fee); + return { + ...elem, + suggestedMaxFee + }; + }); + } + async buildInvocation(call, signerDetails) { + const calldata = getExecuteCalldata(call, this.cairoVersion); + const signature = await this.signer.signTransaction(call, signerDetails); + return { + contractAddress: this.address, + calldata, + signature + }; + } + async execute(calls, abis = void 0, transactionsDetail = {}) { + const transactions = Array.isArray(calls) ? calls : [calls]; + const nonce = toBigInt(transactionsDetail.nonce ?? await this.getNonce()); + const maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { type: "INVOKE_FUNCTION" /* INVOKE */, payload: calls }, + transactionsDetail + ); + const version = toBigInt(transactionVersion); + const chainId = await this.getChainId(); + const signerDetails = { + walletAddress: this.address, + nonce, + maxFee, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const signature = await this.signer.signTransaction(transactions, signerDetails, abis); + const calldata = getExecuteCalldata(transactions, this.cairoVersion); + return this.invokeFunction( + { contractAddress: this.address, calldata, signature }, + { + nonce, + maxFee, + version + } + ); + } + /** + * First check if contract is already declared, if not declare it + * If contract already declared returned transaction_hash is ''. + * Method will pass even if contract is already declared + * @param payload DeclareContractPayload + * @param transactionsDetail (optional) InvocationsDetails = \{\} + * @returns DeclareContractResponse + */ + async declareIfNot(payload, transactionsDetail = {}) { + const declareContractPayload = extractContractHashes(payload); + try { + await this.getClassByHash(declareContractPayload.classHash); + } catch (error) { + return this.declare(payload, transactionsDetail); + } + return { + transaction_hash: "", + class_hash: declareContractPayload.classHash + }; + } + async declare(payload, transactionsDetail = {}) { + const declareContractPayload = extractContractHashes(payload); + const details = {}; + details.nonce = toBigInt(transactionsDetail.nonce ?? await this.getNonce()); + details.maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { + type: "DECLARE" /* DECLARE */, + payload: declareContractPayload + }, + transactionsDetail + ); + details.version = !isSierra(payload.contract) ? transactionVersion : transactionVersion_2; + details.chainId = await this.getChainId(); + const declareContractTransaction = await this.buildDeclarePayload(declareContractPayload, { + ...details, + walletAddress: this.address, + cairoVersion: this.cairoVersion + }); + return this.declareContract(declareContractTransaction, details); + } + async deploy(payload, details) { + const params = [].concat(payload).map((it) => { + const { + classHash, + salt, + unique = true, + constructorCalldata = [] + } = it; + const compiledConstructorCallData = CallData.compile(constructorCalldata); + const deploySalt = salt ?? randomAddress(); + return { + call: { + contractAddress: UDC.ADDRESS, + entrypoint: UDC.ENTRYPOINT, + calldata: [ + classHash, + deploySalt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData + ] + }, + address: calculateContractAddressFromHash( + unique ? esm_exports.pedersen(this.address, deploySalt) : deploySalt, + classHash, + compiledConstructorCallData, + unique ? UDC.ADDRESS : 0 + ) + }; + }); + const calls = params.map((it) => it.call); + const addresses = params.map((it) => it.address); + const invokeResponse = await this.execute(calls, void 0, details); + return { + ...invokeResponse, + contract_address: addresses + }; + } + async deployContract(payload, details) { + const deployTx = await this.deploy(payload, details); + const txReceipt = await this.waitForTransaction(deployTx.transaction_hash); + return parseUDCEvent(txReceipt); + } + async declareAndDeploy(payload, details) { + const { constructorCalldata, salt, unique } = payload; + let declare = await this.declareIfNot(payload, details); + if (declare.transaction_hash !== "") { + const tx = await this.waitForTransaction(declare.transaction_hash); + declare = { ...declare, ...tx }; + } + const deploy = await this.deployContract( + { classHash: declare.class_hash, salt, unique, constructorCalldata }, + details + ); + return { declare: { ...declare }, deploy }; + } + async deployAccount({ + classHash, + constructorCalldata = [], + addressSalt = 0, + contractAddress: providedContractAddress + }, transactionsDetail = {}) { + const version = toBigInt(transactionVersion); + const nonce = ZERO; + const chainId = await this.getChainId(); + const compiledCalldata = CallData.compile(constructorCalldata); + const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0); + const maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + payload: { + classHash, + constructorCalldata: compiledCalldata, + addressSalt, + contractAddress + } + }, + transactionsDetail + ); + const signature = await this.signer.signDeployAccountTransaction({ + classHash, + constructorCalldata: compiledCalldata, + contractAddress, + addressSalt, + chainId, + maxFee, + version, + nonce + }); + return this.deployAccountContract( + { classHash, addressSalt, constructorCalldata, signature }, + { + nonce, + maxFee, + version + } + ); + } + async signMessage(typedData) { + return this.signer.signMessage(typedData, this.address); + } + async hashMessage(typedData) { + return getMessageHash(typedData, this.address); + } + async verifyMessageHash(hash2, signature) { + try { + await this.callContract({ + contractAddress: this.address, + entrypoint: "isValidSignature", + calldata: CallData.compile({ + hash: toBigInt(hash2).toString(), + signature: formatSignature(signature) + }) + }); + return true; + } catch { + return false; + } + } + async verifyMessage(typedData, signature) { + const hash2 = await this.hashMessage(typedData); + return this.verifyMessageHash(hash2, signature); + } + async getSuggestedMaxFee({ type, payload }, details) { + let feeEstimate; + switch (type) { + case "INVOKE_FUNCTION" /* INVOKE */: + feeEstimate = await this.estimateInvokeFee(payload, details); + break; + case "DECLARE" /* DECLARE */: + feeEstimate = await this.estimateDeclareFee(payload, details); + break; + case "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */: + feeEstimate = await this.estimateAccountDeployFee(payload, details); + break; + case "DEPLOY" /* DEPLOY */: + feeEstimate = await this.estimateDeployFee(payload, details); + break; + default: + feeEstimate = { suggestedMaxFee: ZERO, overall_fee: ZERO }; + break; + } + return feeEstimate.suggestedMaxFee; + } + /** + * will be renamed to buildDeclareContractTransaction + */ + async buildDeclarePayload(payload, { nonce, chainId, version, walletAddress, maxFee }) { + const { classHash, contract, compiledClassHash } = extractContractHashes(payload); + const compressedCompiledContract = parseContract(contract); + const signature = await this.signer.signDeclareTransaction({ + classHash, + compiledClassHash, + senderAddress: walletAddress, + chainId, + maxFee, + version, + nonce + }); + return { + senderAddress: walletAddress, + signature, + contract: compressedCompiledContract, + compiledClassHash + }; + } + async buildAccountDeployPayload({ + classHash, + addressSalt = 0, + constructorCalldata = [], + contractAddress: providedContractAddress + }, { nonce, chainId, version, maxFee }) { + const compiledCalldata = CallData.compile(constructorCalldata); + const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0); + const signature = await this.signer.signDeployAccountTransaction({ + classHash, + contractAddress, + chainId, + maxFee, + version, + nonce, + addressSalt, + constructorCalldata: compiledCalldata + }); + return { + classHash, + addressSalt, + constructorCalldata: compiledCalldata, + signature + }; + } + buildUDCContractPayload(payload) { + const calls = [].concat(payload).map((it) => { + const { + classHash, + salt = "0", + unique = true, + constructorCalldata = [] + } = it; + const compiledConstructorCallData = CallData.compile(constructorCalldata); + return { + contractAddress: UDC.ADDRESS, + entrypoint: UDC.ENTRYPOINT, + calldata: [ + classHash, + salt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData + ] + }; + }); + return calls; + } + async simulateTransaction(invocations, { nonce, blockIdentifier, skipValidate, skipExecute } = {}) { + const accountInvocations = await this.accountInvocationsFactory(invocations, { + versions: [transactionVersion, transactionVersion_2], + nonce, + blockIdentifier + }); + return super.getSimulateTransaction(accountInvocations, { + blockIdentifier, + skipValidate, + skipExecute + }); + } + async accountInvocationsFactory(invocations, { versions, nonce, blockIdentifier }) { + const version = versions[0]; + const safeNonce = await this.getNonceSafe(nonce); + const chainId = await this.getChainId(); + return Promise.all( + [].concat(invocations).map(async (transaction, index) => { + const signerDetails = { + walletAddress: this.address, + nonce: toBigInt(Number(safeNonce) + index), + maxFee: ZERO, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const txPayload = "payload" in transaction ? transaction.payload : transaction; + const common2 = { + type: transaction.type, + version, + nonce: toBigInt(Number(safeNonce) + index), + blockIdentifier + }; + if (transaction.type === "INVOKE_FUNCTION" /* INVOKE */) { + const payload = await this.buildInvocation( + [].concat(txPayload), + signerDetails + ); + return { + ...common2, + ...payload + }; + } + if (transaction.type === "DECLARE" /* DECLARE */) { + signerDetails.version = !isSierra(txPayload.contract) ? toBigInt(versions[0]) : toBigInt(versions[1]); + const payload = await this.buildDeclarePayload(txPayload, signerDetails); + return { + ...common2, + ...payload, + version: signerDetails.version + }; + } + if (transaction.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + const payload = await this.buildAccountDeployPayload(txPayload, signerDetails); + return { + ...common2, + ...payload + }; + } + if (transaction.type === "DEPLOY" /* DEPLOY */) { + const calls = this.buildUDCContractPayload(txPayload); + const payload = await this.buildInvocation(calls, signerDetails); + return { + ...common2, + ...payload, + type: "INVOKE_FUNCTION" /* INVOKE */ + }; + } + throw Error(`accountInvocationsFactory: unsupported transaction type: ${transaction}`); + }) + ); + } + async getStarkName(address = this.address, StarknetIdContract2) { + return super.getStarkName(address, StarknetIdContract2); + } + }; + + // src/provider/interface.ts + var ProviderInterface = class { + }; + + // src/provider/index.ts + var defaultProvider = new Provider(); + + // src/account/interface.ts + var AccountInterface = class extends ProviderInterface { + }; + + // src/contract/default.ts + var splitArgsAndOptions = (args) => { + const options = [ + "blockIdentifier", + "parseRequest", + "parseResponse", + "formatResponse", + "maxFee", + "nonce", + "signature", + "addressSalt" + ]; + const lastArg = args[args.length - 1]; + if (typeof lastArg === "object" && options.some((x) => x in lastArg)) { + return { args, options: args.pop() }; + } + return { args }; + }; + function buildCall(contract, functionAbi) { + return async function(...args) { + const params = splitArgsAndOptions(args); + return contract.call(functionAbi.name, params.args, { + parseRequest: true, + parseResponse: true, + ...params.options + }); + }; + } + function buildInvoke(contract, functionAbi) { + return async function(...args) { + const params = splitArgsAndOptions(args); + return contract.invoke(functionAbi.name, params.args, { + parseRequest: true, + ...params.options + }); + }; + } + function buildDefault(contract, functionAbi) { + if (functionAbi.stateMutability === "view" || functionAbi.state_mutability === "view") { + return buildCall(contract, functionAbi); + } + return buildInvoke(contract, functionAbi); + } + function buildPopulate(contract, functionAbi) { + return function(...args) { + return contract.populate(functionAbi.name, args); + }; + } + function buildEstimate(contract, functionAbi) { + return function(...args) { + return contract.estimate(functionAbi.name, args); + }; + } + function getCalldata(args, callback) { + if (Array.isArray(args) && "__compiled__" in args) + return args; + if (Array.isArray(args) && Array.isArray(args[0]) && "__compiled__" in args[0]) + return args[0]; + return callback(); + } + var Contract = class { + /** + * Contract class to handle contract methods + * + * @param abi - Abi of the contract object + * @param address (optional) - address to connect to + * @param providerOrAccount (optional) - Provider or Account to attach to + */ + constructor(abi, address, providerOrAccount = defaultProvider) { + this.address = address && address.toLowerCase(); + this.providerOrAccount = providerOrAccount; + this.callData = new CallData(abi); + this.structs = CallData.getAbiStruct(abi); + const parser = createAbiParser(abi); + this.abi = parser.getLegacyFormat(); + const options = { enumerable: true, value: {}, writable: false }; + Object.defineProperties(this, { + functions: { enumerable: true, value: {}, writable: false }, + callStatic: { enumerable: true, value: {}, writable: false }, + populateTransaction: { enumerable: true, value: {}, writable: false }, + estimateFee: { enumerable: true, value: {}, writable: false } + }); + this.abi.forEach((abiElement) => { + if (abiElement.type !== "function") + return; + const signature = abiElement.name; + if (!this[signature]) { + Object.defineProperty(this, signature, { + ...options, + value: buildDefault(this, abiElement) + }); + } + if (!this.functions[signature]) { + Object.defineProperty(this.functions, signature, { + ...options, + value: buildDefault(this, abiElement) + }); + } + if (!this.callStatic[signature]) { + Object.defineProperty(this.callStatic, signature, { + ...options, + value: buildCall(this, abiElement) + }); + } + if (!this.populateTransaction[signature]) { + Object.defineProperty(this.populateTransaction, signature, { + ...options, + value: buildPopulate(this, abiElement) + }); + } + if (!this.estimateFee[signature]) { + Object.defineProperty(this.estimateFee, signature, { + ...options, + value: buildEstimate(this, abiElement) + }); + } + }); + } + attach(address) { + this.address = address; + } + connect(providerOrAccount) { + this.providerOrAccount = providerOrAccount; + } + async deployed() { + if (this.deployTransactionHash) { + await this.providerOrAccount.waitForTransaction(this.deployTransactionHash); + this.deployTransactionHash = void 0; + } + return this; + } + async call(method, args = [], { + parseRequest = true, + parseResponse = true, + formatResponse = void 0, + blockIdentifier = void 0 + } = {}) { + assert(this.address !== null, "contract is not connected to an address"); + const calldata = getCalldata(args, () => { + if (parseRequest) { + this.callData.validate("CALL" /* CALL */, method, args); + return this.callData.compile(method, args); + } + console.warn("Call skipped parsing but provided rawArgs, possible malfunction request"); + return args; + }); + return this.providerOrAccount.callContract( + { + contractAddress: this.address, + calldata, + entrypoint: method + }, + blockIdentifier + ).then((x) => { + if (!parseResponse) { + return x.result; + } + if (formatResponse) { + return this.callData.format(method, x.result, formatResponse); + } + return this.callData.parse(method, x.result); + }); + } + invoke(method, args = [], { parseRequest = true, maxFee, nonce, signature } = {}) { + assert(this.address !== null, "contract is not connected to an address"); + const calldata = getCalldata(args, () => { + if (parseRequest) { + this.callData.validate("INVOKE" /* INVOKE */, method, args); + return this.callData.compile(method, args); + } + console.warn("Invoke skipped parsing but provided rawArgs, possible malfunction request"); + return args; + }); + const invocation = { + contractAddress: this.address, + calldata, + entrypoint: method + }; + if ("execute" in this.providerOrAccount) { + return this.providerOrAccount.execute(invocation, void 0, { + maxFee, + nonce + }); + } + if (!nonce) + throw new Error(`Nonce is required when invoking a function without an account`); + console.warn(`Invoking ${method} without an account. This will not work on a public node.`); + return this.providerOrAccount.invokeFunction( + { + ...invocation, + signature + }, + { + nonce + } + ); + } + async estimate(method, args = []) { + assert(this.address !== null, "contract is not connected to an address"); + if (!getCalldata(args, () => false)) { + this.callData.validate("INVOKE" /* INVOKE */, method, args); + } + const invocation = this.populate(method, args); + if ("estimateInvokeFee" in this.providerOrAccount) { + return this.providerOrAccount.estimateInvokeFee(invocation); + } + throw Error("Contract must be connected to the account contract to estimate"); + } + populate(method, args = []) { + const calldata = getCalldata(args, () => this.callData.compile(method, args)); + return { + contractAddress: this.address, + entrypoint: method, + calldata + }; + } + isCairo1() { + return cairo_exports.isCairo1Abi(this.abi); + } + }; + + // src/contract/interface.ts + var ContractInterface = class { + }; + + // src/contract/contractFactory.ts + var ContractFactory = class { + /** + * @param params CFParams + * - compiledContract: CompiledContract; + * - account: AccountInterface; + * - casm?: CairoAssembly; + * - classHash?: string; + * - compiledClassHash?: string; + * - abi?: Abi; + */ + constructor(params) { + this.compiledContract = params.compiledContract; + this.account = params.account; + this.casm = params.casm; + this.abi = params.abi ?? params.compiledContract.abi; + this.classHash = params.classHash; + this.compiledClassHash = params.compiledClassHash; + this.CallData = new CallData(this.abi); + } + /** + * Deploys contract and returns new instance of the Contract + * If contract is not declared it will first declare it, and then deploy + * + * @param args - Array of the constructor arguments for deployment + * @param options (optional) Object - parseRequest, parseResponse, addressSalt + * @returns deployed Contract + */ + async deploy(...args) { + const { args: param, options = { parseRequest: true } } = splitArgsAndOptions(args); + const constructorCalldata = getCalldata(param, () => { + if (options.parseRequest) { + this.CallData.validate("DEPLOY" /* DEPLOY */, "constructor", param); + return this.CallData.compile("constructor", param); + } + console.warn("Call skipped parsing but provided rawArgs, possible malfunction request"); + return param; + }); + const { + deploy: { contract_address, transaction_hash } + } = await this.account.declareAndDeploy({ + contract: this.compiledContract, + casm: this.casm, + classHash: this.classHash, + compiledClassHash: this.compiledClassHash, + constructorCalldata, + salt: options.addressSalt + }); + assert(Boolean(contract_address), "Deployment of the contract failed"); + const contractInstance = new Contract( + this.compiledContract.abi, + contract_address, + this.account + ); + contractInstance.deployTransactionHash = transaction_hash; + return contractInstance; + } + /** + * Attaches to new Account + * + * @param account - new Provider or Account to attach to + * @returns ContractFactory + */ + connect(account) { + this.account = account; + return this; + } + /** + * Attaches current abi and account to the new address + * + * @param address - Contract address + * @returns Contract + */ + attach(address) { + return new Contract(this.abi, address, this.account); + } + // ethers.js' getDeployTransaction cant be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation + }; + + // src/utils/address.ts + function addAddressPadding(address) { + return addHexPrefix(removeHexPrefix(toHex(address)).padStart(64, "0")); + } + function validateAndParseAddress(address) { + assertInRange(address, ZERO, MASK_251, "Starknet Address"); + const result = addAddressPadding(address); + if (!result.match(/^(0x)?[0-9a-fA-F]{64}$/)) { + throw new Error("Invalid Address Format"); + } + return result; + } + function getChecksumAddress(address) { + const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split(""); + const hex = removeHexPrefix(keccakBn(address)); + const hashed = hexToBytes(hex.padStart(64, "0")); + for (let i = 0; i < chars.length; i += 2) { + if (hashed[i >> 1] >> 4 >= 8) { + chars[i] = chars[i].toUpperCase(); + } + if ((hashed[i >> 1] & 15) >= 8) { + chars[i + 1] = chars[i + 1].toUpperCase(); + } + } + return addHexPrefix(chars.join("")); + } + function validateChecksumAddress(address) { + return getChecksumAddress(address) === address; + } + + // src/index.ts + var number2 = num_exports; + return __toCommonJS(src_exports); +})(); +/*! Bundled license information: + +@noble/curves/esm/abstract/utils.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/hashes/esm/utils.js: + (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/modular.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/poseidon.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/curve.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/abstract/weierstrass.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +@noble/curves/esm/_shortw_utils.js: + (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) + +pako/dist/pako.esm.mjs: + (*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *) +*/ +//# sourceMappingURL=index.global.js.map \ No newline at end of file diff --git a/web/lib/starknet-estfee-tx-ver/dist/index.global.js.map b/web/lib/starknet-estfee-tx-ver/dist/index.global.js.map new file mode 100644 index 000000000..bbab10988 --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/dist/index.global.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../node_modules/whatwg-fetch/fetch.js","../node_modules/isomorphic-fetch/fetch-npm-browserify.js","../node_modules/url-join/lib/url-join.js","../src/index.ts","../src/constants.ts","../src/utils/encode.ts","../src/types/index.ts","../src/types/account.ts","../src/types/calldata.ts","../src/types/lib/contract/index.ts","../src/types/lib/index.ts","../src/types/api/rpc.ts","../src/types/api/sequencer.ts","../src/utils/assert.ts","../src/utils/num.ts","../node_modules/@noble/curves/src/abstract/utils.ts","../src/utils/selector.ts","../node_modules/micro-starknet/lib/esm/index.js","../node_modules/@noble/hashes/src/_assert.ts","../node_modules/@noble/hashes/src/_u64.ts","../node_modules/@noble/hashes/src/crypto.ts","../node_modules/@noble/hashes/src/utils.ts","../node_modules/@noble/hashes/src/sha3.ts","../node_modules/@noble/hashes/src/_sha2.ts","../node_modules/@noble/hashes/src/sha256.ts","../node_modules/@noble/curves/src/abstract/modular.ts","../node_modules/@noble/curves/src/abstract/poseidon.ts","../node_modules/@noble/curves/src/abstract/weierstrass.ts","../node_modules/@noble/curves/src/abstract/curve.ts","../node_modules/@noble/hashes/src/hmac.ts","../node_modules/@noble/curves/src/_shortw_utils.ts","../src/utils/shortString.ts","../src/utils/calldata/cairo.ts","../src/utils/uint256.ts","../src/utils/calldata/formatter.ts","../src/utils/calldata/parser/parser-0-1.1.0.ts","../src/utils/calldata/parser/parser-2.0.0.ts","../src/utils/calldata/parser/index.ts","../src/utils/calldata/tuple.ts","../src/utils/calldata/propertyOrder.ts","../src/utils/calldata/requestParser.ts","../src/utils/calldata/responseParser.ts","../src/utils/calldata/validate.ts","../src/utils/calldata/index.ts","../src/utils/hash.ts","../src/utils/ec.ts","../src/utils/json.ts","../node_modules/lossless-json/src/utils.ts","../node_modules/lossless-json/src/LosslessNumber.ts","../node_modules/lossless-json/src/numberParsers.ts","../node_modules/lossless-json/src/revive.ts","../node_modules/lossless-json/src/parse.ts","../node_modules/lossless-json/src/stringify.ts","../src/utils/stark.ts","../node_modules/pako/dist/pako.esm.mjs","../src/utils/contract.ts","../src/utils/fetchPonyfill.ts","../src/utils/provider.ts","../src/utils/responseParser/rpc.ts","../src/provider/errors.ts","../src/utils/starknetId.ts","../src/provider/starknetId.ts","../src/provider/utils.ts","../src/provider/rpc.ts","../src/provider/sequencer.ts","../src/utils/responseParser/index.ts","../src/utils/responseParser/sequencer.ts","../src/utils/url.ts","../src/provider/default.ts","../src/signer/interface.ts","../src/utils/transaction.ts","../src/utils/typedData.ts","../src/utils/merkle.ts","../src/signer/default.ts","../src/utils/events.ts","../src/account/default.ts","../src/provider/interface.ts","../src/provider/index.ts","../src/account/interface.ts","../src/contract/default.ts","../src/contract/interface.ts","../src/contract/contractFactory.ts","../src/utils/address.ts"],"sourcesContent":["var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global)\n\nvar support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = global.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!global.fetch) {\n global.fetch = fetch\n global.Headers = Headers\n global.Request = Request\n global.Response = Response\n}\n","// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\nrequire('whatwg-fetch');\nmodule.exports = self.fetch.bind(self);\n","(function (name, context, definition) {\n if (typeof module !== 'undefined' && module.exports) module.exports = definition();\n else if (typeof define === 'function' && define.amd) define(definition);\n else context[name] = definition();\n})('urljoin', this, function () {\n\n function normalize (strArray) {\n var resultArray = [];\n if (strArray.length === 0) { return ''; }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n var first = strArray.shift();\n strArray[0] = first + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (var i = 0; i < strArray.length; i++) {\n var component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') { continue; }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n\n }\n\n var str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n var parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n return str;\n }\n\n return function () {\n var input;\n\n if (typeof arguments[0] === 'object') {\n input = arguments[0];\n } else {\n input = [].slice.call(arguments);\n }\n\n return normalize(input);\n };\n\n});\n","/**\n * Main\n */\nexport * from './account';\nexport * from './contract';\nexport * from './provider';\nexport * from './signer';\n\n// TODO: decide on final export style\nexport * from './types';\nexport * as types from './types';\n\n/**\n * Utils\n */\nexport * as constants from './constants';\nexport * as encode from './utils/encode';\nexport * as hash from './utils/hash';\nexport * as json from './utils/json';\nexport * as num from './utils/num';\nexport * as transaction from './utils/transaction';\nexport * as stark from './utils/stark';\nexport * as merkle from './utils/merkle';\nexport * as uint256 from './utils/uint256';\nexport * as shortString from './utils/shortString';\nexport * as typedData from './utils/typedData';\nexport * as ec from './utils/ec';\nexport * as starknetId from './utils/starknetId';\nexport * as provider from './utils/provider';\nexport * as selector from './utils/selector';\nexport * from './utils/address';\nexport * from './utils/url';\nexport * from './utils/calldata';\nexport * from './utils/contract';\nexport * from './utils/events';\n\n/**\n * Deprecated\n */\n/* eslint-disable import/first */\nimport * as num from './utils/num';\n\n/** @deprecated prefer the 'num' naming */\nexport const number = num;\n","export { IS_BROWSER } from './utils/encode';\n\nexport const ZERO = 0n;\nexport const MASK_250 = 2n ** 250n - 1n; // 2 ** 250 - 1\nexport const MASK_251 = 2n ** 251n;\nexport const API_VERSION = ZERO;\n\nexport enum BaseUrl {\n SN_MAIN = 'https://alpha-mainnet.starknet.io',\n SN_GOERLI = 'https://alpha4.starknet.io',\n SN_GOERLI2 = 'https://alpha4-2.starknet.io',\n}\n\nexport enum NetworkName {\n SN_MAIN = 'SN_MAIN',\n SN_GOERLI = 'SN_GOERLI',\n SN_GOERLI2 = 'SN_GOERLI2',\n}\n\nexport enum StarknetChainId {\n SN_MAIN = '0x534e5f4d41494e', // encodeShortString('SN_MAIN'),\n SN_GOERLI = '0x534e5f474f45524c49', // encodeShortString('SN_GOERLI'),\n SN_GOERLI2 = '0x534e5f474f45524c4932', // encodeShortString('SN_GOERLI2'),\n}\n\nexport enum TransactionHashPrefix {\n DECLARE = '0x6465636c617265', // encodeShortString('declare'),\n DEPLOY = '0x6465706c6f79', // encodeShortString('deploy'),\n DEPLOY_ACCOUNT = '0x6465706c6f795f6163636f756e74', // encodeShortString('deploy_account'),\n INVOKE = '0x696e766f6b65', // encodeShortString('invoke'),\n L1_HANDLER = '0x6c315f68616e646c6572', // encodeShortString('l1_handler'),\n}\n\nexport const UDC = {\n ADDRESS: '0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf',\n ENTRYPOINT: 'deployContract',\n};\n\n/**\n * The following is taken from https://github.com/starkware-libs/starkex-resources/blob/master/crypto/starkware/crypto/signature/pedersen_params.json but converted to hex, because JS is very bad handling big integers by default\n * Please do not edit until the JSON changes.\n */\nexport const FIELD_PRIME = '800000000000011000000000000000000000000000000000000000000000001';\nexport const FIELD_GEN = '3';\nexport const FIELD_SIZE = 251;\nexport const EC_ORDER = '800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F';\nexport const ALPHA = '1';\nexport const BETA = '6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89';\nexport const MAX_ECDSA_VAL = '800000000000000000000000000000000000000000000000000000000000000';\nexport const CONSTANT_POINTS = [\n [\n '49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804',\n '3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a',\n ],\n [\n '1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca',\n '5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f',\n ],\n [\n '234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b',\n '3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615',\n ],\n [\n '3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476',\n '7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19',\n ],\n [\n '40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c',\n '109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740',\n ],\n [\n '2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b',\n '6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26',\n ],\n [\n '6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674',\n '606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2',\n ],\n [\n '7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62',\n 'a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae',\n ],\n [\n '3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec',\n '45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9',\n ],\n [\n '1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e',\n '30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a',\n ],\n [\n '6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26',\n '31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2',\n ],\n [\n '54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4',\n 'c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5',\n ],\n [\n '35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6',\n '5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d',\n ],\n [\n '4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23',\n '5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820',\n ],\n [\n '648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf',\n '72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c',\n ],\n [\n 'bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b',\n '6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6',\n ],\n [\n '35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357',\n '3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14',\n ],\n [\n '36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643',\n '7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c',\n ],\n [\n '5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661',\n '9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753',\n ],\n [\n '21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6',\n '51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c',\n ],\n [\n '19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9',\n '515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa',\n ],\n [\n '888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24',\n '730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea',\n ],\n [\n '75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977',\n '4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8',\n ],\n [\n '640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5',\n '3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c',\n ],\n [\n '6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96',\n '7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645',\n ],\n [\n '5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876',\n '518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200',\n ],\n [\n '6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4',\n '2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc',\n ],\n [\n '542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18',\n '5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c',\n ],\n [\n '299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de',\n '1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958',\n ],\n [\n '628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73',\n 'ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d',\n ],\n [\n '6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933',\n '6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db',\n ],\n [\n '28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a',\n '7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba',\n ],\n [\n '619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02',\n '2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308',\n ],\n [\n '641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96',\n '6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837',\n ],\n [\n '58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2',\n '124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9',\n ],\n [\n 'a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74',\n '1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8',\n ],\n [\n '744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b',\n '7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f',\n ],\n [\n '434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c',\n '7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39',\n ],\n [\n '7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73',\n '56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431',\n ],\n [\n '4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7',\n 'ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e',\n ],\n [\n '250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe',\n '1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04',\n ],\n [\n '2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2',\n '55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63',\n ],\n [\n '249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245',\n '7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e',\n ],\n [\n '6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb',\n '640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8',\n ],\n [\n '2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9',\n '636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be',\n ],\n [\n '4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea',\n '1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff',\n ],\n [\n '46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca',\n '1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f',\n ],\n [\n '2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152',\n '1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7',\n ],\n [\n '386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b',\n '2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5',\n ],\n [\n '407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90',\n '436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f',\n ],\n [\n '1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f',\n '69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec',\n ],\n [\n '7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e',\n '34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69',\n ],\n [\n '299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913',\n 'b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675',\n ],\n [\n '551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5',\n '5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e',\n ],\n [\n '7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2',\n '3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6',\n ],\n [\n '28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504',\n '7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b',\n ],\n [\n '1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b',\n '4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4',\n ],\n [\n '2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b',\n '9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911',\n ],\n [\n '770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed',\n '42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd',\n ],\n [\n '5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9',\n '3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d',\n ],\n [\n '6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825',\n '1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177',\n ],\n [\n '404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1',\n '3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb',\n ],\n [\n '20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc',\n '106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7',\n ],\n [\n '119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa',\n '1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773',\n ],\n [\n '45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749',\n 'ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965',\n ],\n [\n '1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38',\n '593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f',\n ],\n [\n '186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3',\n '55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c',\n ],\n [\n '58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9',\n '6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0',\n ],\n [\n '13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b',\n '3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4',\n ],\n [\n '48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676',\n '4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1',\n ],\n [\n '4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158',\n '620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef',\n ],\n [\n '4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b',\n '4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8',\n ],\n [\n '7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9',\n '2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de',\n ],\n [\n '65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f',\n '3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6',\n ],\n [\n '1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d',\n '21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a',\n ],\n [\n '3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b',\n '5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f',\n ],\n [\n '4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4',\n '5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b',\n ],\n [\n '6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8',\n 'e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9',\n ],\n [\n '748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5',\n '3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93',\n ],\n [\n '7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3',\n '5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4',\n ],\n [\n '6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f',\n '32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039',\n ],\n [\n '1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309',\n '56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4',\n ],\n [\n '1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd',\n '431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c',\n ],\n [\n '6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162',\n '14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3',\n ],\n [\n '738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e',\n '33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47',\n ],\n [\n '2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8',\n '92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc',\n ],\n [\n '181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe',\n '5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff',\n ],\n [\n '1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a',\n '4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f',\n ],\n [\n 'e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873',\n '34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f',\n ],\n [\n '4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45',\n '3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af',\n ],\n [\n '37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed',\n '37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6',\n ],\n [\n '27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c',\n '6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d',\n ],\n [\n '2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf',\n '306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413',\n ],\n [\n '307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72',\n '3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995',\n ],\n [\n '79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc',\n '40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2',\n ],\n [\n '4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292',\n '7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717',\n ],\n [\n '645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2',\n '15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab',\n ],\n [\n '1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f',\n '583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c',\n ],\n [\n '66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca',\n '505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4',\n ],\n [\n '5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1',\n 'bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323',\n ],\n [\n 'a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194',\n '4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689',\n ],\n [\n '1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c',\n '7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf',\n ],\n [\n '48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f',\n '781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3',\n ],\n [\n '17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd',\n '6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223',\n ],\n [\n '5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89',\n '1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff',\n ],\n [\n '6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58',\n '436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e',\n ],\n [\n '7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6',\n '484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4',\n ],\n [\n '17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d',\n '7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f',\n ],\n [\n '7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf',\n '33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78',\n ],\n [\n '7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d',\n '6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb',\n ],\n [\n '273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128',\n '653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f',\n ],\n [\n '3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212',\n '65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e',\n ],\n [\n '5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee',\n '3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22',\n ],\n [\n '7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9',\n '71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e',\n ],\n [\n '40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62',\n '499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42',\n ],\n [\n '6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465',\n '35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37',\n ],\n [\n '604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6',\n '68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457',\n ],\n [\n '73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4',\n '4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb',\n ],\n [\n '3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1',\n '677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0',\n ],\n [\n '39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f',\n '20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952',\n ],\n [\n '326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c',\n '7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1',\n ],\n [\n '53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632',\n '2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1',\n ],\n [\n '6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e',\n 'beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63',\n ],\n [\n '3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332',\n '529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7',\n ],\n [\n '3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e',\n '3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740',\n ],\n [\n '7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a',\n '68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400',\n ],\n [\n '1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb',\n '5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9',\n ],\n [\n '3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344',\n '52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590',\n ],\n [\n '44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa',\n '6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940',\n ],\n [\n '7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e',\n '78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9',\n ],\n [\n '7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d',\n '4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62',\n ],\n [\n '7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c',\n '636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84',\n ],\n [\n '758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2',\n '1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245',\n ],\n [\n '7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e',\n '229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470',\n ],\n [\n '78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614',\n '246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675',\n ],\n [\n '6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647',\n '599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4',\n ],\n [\n '4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e',\n '1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad',\n ],\n [\n '3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d',\n '617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c',\n ],\n [\n '5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287',\n '1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d',\n ],\n [\n '3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004',\n '7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232',\n ],\n [\n '3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb',\n '563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6',\n ],\n [\n '16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52',\n '7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e',\n ],\n [\n '75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4',\n '35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0',\n ],\n [\n '3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8',\n '6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd',\n ],\n [\n '54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579',\n '7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0',\n ],\n [\n 'd1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0',\n '2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45',\n ],\n [\n '2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d',\n '70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b',\n ],\n [\n '752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3',\n '3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef',\n ],\n [\n '63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e',\n '37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e',\n ],\n [\n 'd6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b',\n '5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018',\n ],\n [\n '12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557',\n '6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613',\n ],\n [\n '46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c',\n '76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df',\n ],\n [\n '4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516',\n '5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29',\n ],\n [\n '71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833',\n '85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346',\n ],\n [\n '5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61',\n '3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950',\n ],\n [\n '161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941',\n '78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b',\n ],\n [\n '1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1',\n '66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d',\n ],\n [\n '56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44',\n '47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e',\n ],\n [\n '4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491',\n '430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4',\n ],\n [\n '7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606',\n '312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295',\n ],\n [\n '16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe',\n '7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24',\n ],\n [\n '323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b',\n '4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265',\n ],\n [\n '624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d',\n '261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430',\n ],\n [\n 'f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d',\n 'b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6',\n ],\n [\n '686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec',\n '7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6',\n ],\n [\n '3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e',\n '634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af',\n ],\n [\n '484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b',\n '34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8',\n ],\n [\n '203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a',\n '2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2',\n ],\n [\n '2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d',\n '6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6',\n ],\n [\n '5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef',\n '30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d',\n ],\n [\n '57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741',\n '7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad',\n ],\n [\n '611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1',\n '3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4',\n ],\n [\n '1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31',\n '3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527',\n ],\n [\n '275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234',\n '2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521',\n ],\n [\n '6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95',\n '5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e',\n ],\n [\n '44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c',\n '3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e',\n ],\n [\n 'fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966',\n '110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9',\n ],\n [\n '9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef',\n '4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51',\n ],\n [\n '71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7',\n '7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9',\n ],\n [\n '1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345',\n '4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc',\n ],\n [\n '3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115',\n 'a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24',\n ],\n [\n 'c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d',\n '729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d',\n ],\n [\n '44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d',\n '212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8',\n ],\n [\n '35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f',\n '74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62',\n ],\n [\n 'e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03',\n '3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357',\n ],\n [\n '3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a',\n '5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df',\n ],\n [\n '222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c',\n '72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42',\n ],\n [\n '3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764',\n '480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c',\n ],\n [\n 'adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187',\n '60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8',\n ],\n [\n '3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9',\n '7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996',\n ],\n [\n '12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32',\n '6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1',\n ],\n [\n '27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b',\n 'c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917',\n ],\n [\n '431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6',\n '30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197',\n ],\n [\n '4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33',\n '627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c',\n ],\n [\n '2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8',\n '1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f',\n ],\n [\n 'e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc',\n '58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9',\n ],\n [\n '7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5',\n '74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1',\n ],\n [\n '62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b',\n '1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315',\n ],\n [\n '1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938',\n '44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b',\n ],\n [\n '78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea',\n '6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41',\n ],\n [\n '5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d',\n '1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb',\n ],\n [\n '62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04',\n '6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f',\n ],\n [\n '4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f',\n '941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494',\n ],\n [\n '52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1',\n '987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782',\n ],\n [\n '1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f',\n '38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b',\n ],\n [\n '4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232',\n '7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c',\n ],\n [\n '69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73',\n 'a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897',\n ],\n [\n 'b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62',\n '24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915',\n ],\n [\n '5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb',\n '6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9',\n ],\n [\n '1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0',\n '23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699',\n ],\n [\n '2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5',\n '1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862',\n ],\n [\n 'd26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3',\n '34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a',\n ],\n [\n '91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563',\n 'e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a',\n ],\n [\n '1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7',\n '7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd',\n ],\n [\n '4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f',\n '47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e',\n ],\n [\n '3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069',\n '47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc',\n ],\n [\n '758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657',\n '3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83',\n ],\n [\n '19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8',\n '5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709',\n ],\n [\n '28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855',\n '14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2',\n ],\n [\n '3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f',\n '69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d',\n ],\n [\n '77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b',\n '7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df',\n ],\n [\n '97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6',\n '2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223',\n ],\n [\n 'a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647',\n '37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2',\n ],\n [\n 'e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc',\n '1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a',\n ],\n [\n '2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de',\n '6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591',\n ],\n [\n '744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f',\n '685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d',\n ],\n [\n '40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd',\n '2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e',\n ],\n [\n '5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc',\n '2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2',\n ],\n [\n '5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985',\n '49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183',\n ],\n [\n '2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649',\n '61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d',\n ],\n [\n 'ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381',\n '190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60',\n ],\n [\n '233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c',\n '7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef',\n ],\n [\n '42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce',\n '12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65',\n ],\n [\n '30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44',\n '5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a',\n ],\n [\n '4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a',\n '4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93',\n ],\n [\n '62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466',\n '5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0',\n ],\n [\n '5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f',\n '5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94',\n ],\n [\n '670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728',\n '26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0',\n ],\n [\n '3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5',\n '56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015',\n ],\n [\n '4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3',\n '1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e',\n ],\n [\n '4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0',\n '97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09',\n ],\n [\n '574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219',\n '49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8',\n ],\n [\n '7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554',\n '47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba',\n ],\n [\n '67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6',\n '39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8',\n ],\n [\n '63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b',\n '60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9',\n ],\n [\n '3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543',\n '56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628',\n ],\n [\n '758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129',\n '622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746',\n ],\n [\n '38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c',\n '145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e',\n ],\n [\n '206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad',\n '6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8',\n ],\n [\n '56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d',\n '526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6',\n ],\n [\n '4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378',\n '3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d',\n ],\n [\n '450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58',\n '1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7',\n ],\n [\n '6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d',\n '28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2',\n ],\n [\n '1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf',\n 'fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb',\n ],\n [\n '4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997',\n '40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c',\n ],\n [\n '21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef',\n '4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f',\n ],\n [\n '350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046',\n '5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b',\n ],\n [\n '529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6',\n '3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491',\n ],\n [\n '55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d',\n '159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9',\n ],\n [\n '405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f',\n '4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d',\n ],\n [\n '376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe',\n '5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba',\n ],\n [\n '2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38',\n '7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089',\n ],\n [\n '3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed',\n '5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5',\n ],\n [\n '7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4',\n '3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe',\n ],\n [\n '4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d',\n '204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89',\n ],\n [\n '79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72',\n '3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb',\n ],\n [\n '297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c',\n '6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993',\n ],\n [\n '44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7',\n '1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc',\n ],\n [\n '6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26',\n '64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd',\n ],\n [\n '14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24',\n '5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1',\n ],\n [\n '95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83',\n '1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1',\n ],\n [\n '2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5',\n '5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67',\n ],\n [\n '61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d',\n '23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795',\n ],\n [\n '79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf',\n '2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6',\n ],\n [\n '45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b',\n '2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd',\n ],\n [\n '37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007',\n '50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c',\n ],\n [\n '71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b',\n '3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6',\n ],\n [\n '78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06',\n '5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256',\n ],\n [\n 'b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15',\n '653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83',\n ],\n [\n '441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc',\n '4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59',\n ],\n [\n '2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa',\n '4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0',\n ],\n [\n '3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f',\n '4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c',\n ],\n [\n '5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092',\n '5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56',\n ],\n [\n '3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771',\n '459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999',\n ],\n [\n '5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f',\n '56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49',\n ],\n [\n '1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281',\n '5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a',\n ],\n [\n '1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40',\n '6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488',\n ],\n [\n '61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b',\n '27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad',\n ],\n [\n '7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e',\n '481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf',\n ],\n [\n '124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316',\n '33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987',\n ],\n [\n '61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c',\n '5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb',\n ],\n [\n '70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d',\n '3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc',\n ],\n [\n '41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f',\n '7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce',\n ],\n [\n '62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8',\n '1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771',\n ],\n [\n '441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a',\n '29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086',\n ],\n [\n '2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee',\n '11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77',\n ],\n [\n '5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea',\n '63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc',\n ],\n [\n '3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7',\n '7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092',\n ],\n [\n '95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922',\n '159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9',\n ],\n [\n '621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c',\n '65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd',\n ],\n [\n '54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e',\n '680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313',\n ],\n [\n '21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d',\n '7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8',\n ],\n [\n '3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3',\n '12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801',\n ],\n [\n 'befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392',\n '6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8',\n ],\n [\n '15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6',\n '30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df',\n ],\n [\n '38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8',\n '786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13',\n ],\n [\n '6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72',\n '1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a',\n ],\n [\n '5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30',\n '1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea',\n ],\n [\n '309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1',\n '505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851',\n ],\n [\n '89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc',\n '1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540',\n ],\n [\n '480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84',\n '511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570',\n ],\n [\n '3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb',\n '49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920',\n ],\n [\n '66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd',\n '4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b',\n ],\n [\n '373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3',\n '5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c',\n ],\n [\n '26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7',\n '157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc',\n ],\n [\n 'ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f',\n '517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7',\n ],\n [\n '25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66',\n '10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8',\n ],\n [\n '243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742',\n '1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f',\n ],\n [\n '48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562',\n '3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264',\n ],\n [\n '592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca',\n '48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc',\n ],\n [\n '31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d',\n 'a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5',\n ],\n [\n '4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc',\n '512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47',\n ],\n [\n '26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc',\n '75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e',\n ],\n [\n '3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe',\n '20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d',\n ],\n [\n '483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97',\n '2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d',\n ],\n [\n '65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9',\n '562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373',\n ],\n [\n '284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35',\n '5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02',\n ],\n [\n '32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85',\n '7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd',\n ],\n [\n '1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a',\n '478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742',\n ],\n [\n '270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf',\n '3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b',\n ],\n [\n '6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d',\n '5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33',\n ],\n [\n '48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1',\n '2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0',\n ],\n [\n 'e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5',\n '36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997',\n ],\n [\n '5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8',\n '6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c',\n ],\n [\n '15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6',\n '69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903',\n ],\n [\n '274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50',\n '6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656',\n ],\n [\n '4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123',\n '116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba',\n ],\n [\n '4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a',\n '2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f',\n ],\n [\n '5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3',\n '4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b',\n ],\n [\n '11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483',\n '36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8',\n ],\n [\n '4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3',\n 'e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64',\n ],\n [\n '2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3',\n '527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d',\n ],\n [\n '52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf',\n '19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41',\n ],\n [\n '541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961',\n '78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2',\n ],\n [\n '5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd',\n '137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc',\n ],\n [\n '15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4',\n '4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549',\n ],\n [\n '68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4',\n '7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f',\n ],\n [\n '67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df',\n '7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01',\n ],\n [\n '596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334',\n '49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0',\n ],\n [\n '567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395',\n '6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd',\n ],\n [\n 'cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7',\n '4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7',\n ],\n [\n '4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06',\n '2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566',\n ],\n [\n '760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359',\n '1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e',\n ],\n [\n '6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2',\n '3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd',\n ],\n [\n '4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b',\n '2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f',\n ],\n [\n '5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7',\n '76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39',\n ],\n [\n '2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7',\n '62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e',\n ],\n [\n '5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00',\n '14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1',\n ],\n [\n '7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c',\n 'bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970',\n ],\n [\n '37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843',\n '672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb',\n ],\n [\n '5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114',\n '7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e',\n ],\n [\n '25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63',\n '3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb',\n ],\n [\n '32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0',\n 'bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459',\n ],\n [\n '49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f',\n '57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8',\n ],\n [\n '10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd',\n '8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0',\n ],\n [\n '79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36',\n '146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c',\n ],\n [\n '6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439',\n '68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82',\n ],\n [\n '71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097',\n '54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c',\n ],\n [\n '27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b',\n '14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3',\n ],\n [\n '6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c',\n '5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048',\n ],\n [\n '32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9',\n '518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4',\n ],\n [\n '4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e',\n '3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4',\n ],\n [\n '4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10',\n '20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918',\n ],\n [\n '87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a',\n '112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb',\n ],\n [\n '6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae',\n '54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1',\n ],\n [\n '19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a',\n '1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510',\n ],\n [\n '12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d',\n '4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7',\n ],\n [\n '13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2',\n '40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1',\n ],\n [\n '255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d',\n '3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc',\n ],\n [\n '7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31',\n '4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6',\n ],\n [\n '2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35',\n '44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf',\n ],\n [\n '750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b',\n '54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c',\n ],\n [\n '3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72',\n '7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359',\n ],\n [\n '4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb',\n '63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235',\n ],\n [\n '1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f',\n '4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d',\n ],\n [\n '2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087',\n '2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d',\n ],\n [\n '4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3',\n '5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621',\n ],\n [\n '2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05',\n '1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19',\n ],\n [\n '4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c',\n '33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614',\n ],\n [\n '7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b',\n '5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722',\n ],\n [\n '7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51',\n '26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056',\n ],\n [\n '36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881',\n '33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5',\n ],\n [\n '403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd',\n '47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5',\n ],\n [\n '3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb',\n '2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e',\n ],\n [\n '3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537',\n 'f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4',\n ],\n [\n '235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65',\n '37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5',\n ],\n [\n '3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b',\n '4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe',\n ],\n [\n '48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518',\n '73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee',\n ],\n [\n '48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0',\n '3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903',\n ],\n [\n '2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097',\n '19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541',\n ],\n [\n '1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676',\n '36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7',\n ],\n [\n '2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b',\n '7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b',\n ],\n [\n '348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a',\n '3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969',\n ],\n [\n '7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31',\n '42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd',\n ],\n [\n '2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a',\n '5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83',\n ],\n [\n '1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2',\n 'dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d',\n ],\n [\n '54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e',\n '16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089',\n ],\n [\n '525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b',\n '58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea',\n ],\n [\n '54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd',\n '53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76',\n ],\n [\n '4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae',\n '2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17',\n ],\n [\n '21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708',\n '59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c',\n ],\n [\n '167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66',\n '22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a',\n ],\n [\n '31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843',\n '1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c',\n ],\n [\n '1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b',\n '2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b',\n ],\n [\n 'c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0',\n '45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327',\n ],\n [\n '394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6',\n '1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd',\n ],\n [\n '410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27',\n '361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa',\n ],\n [\n '38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734',\n '624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1',\n ],\n [\n '78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608',\n '19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198',\n ],\n [\n '6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867',\n '7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb',\n ],\n [\n '32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602',\n '3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377',\n ],\n [\n '49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5',\n '1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d',\n ],\n [\n '2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5',\n '759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96',\n ],\n [\n '3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70',\n '22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6',\n ],\n [\n '5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab',\n '715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8',\n ],\n [\n '19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a',\n '896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5',\n ],\n [\n '61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc',\n '38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8',\n ],\n [\n '2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df',\n '1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb',\n ],\n [\n '7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54',\n '21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b',\n ],\n [\n 'b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed',\n '5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf',\n ],\n [\n 'e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc',\n '550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a',\n ],\n [\n '7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4',\n '2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f',\n ],\n [\n '7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c',\n '410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e',\n ],\n [\n '225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5',\n '411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e',\n ],\n [\n '1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1',\n '3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8',\n ],\n [\n '59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335',\n '1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8',\n ],\n [\n '2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3',\n '62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535',\n ],\n [\n '6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb',\n '7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f',\n ],\n [\n '34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88',\n '3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d',\n ],\n [\n '436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d',\n '67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044',\n ],\n [\n '592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4',\n '27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5',\n ],\n [\n '89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009',\n '557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b',\n ],\n [\n '1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e',\n '72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a',\n ],\n [\n '574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03',\n '5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3',\n ],\n [\n '513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1',\n '687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5',\n ],\n [\n '53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9',\n '35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be',\n ],\n [\n '213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44',\n '744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89',\n ],\n [\n '735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c',\n '7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9',\n ],\n [\n '3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001',\n '79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8',\n ],\n [\n '51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74',\n '10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad',\n ],\n [\n 'c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc',\n '53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a',\n ],\n [\n '5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece',\n '39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f',\n ],\n [\n '3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299',\n '15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975',\n ],\n [\n '6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0',\n '11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744',\n ],\n [\n '7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65',\n '3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb',\n ],\n [\n '2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6',\n '461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d',\n ],\n [\n '34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f',\n '33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44',\n ],\n [\n '6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441',\n '6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693',\n ],\n [\n '17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce',\n '3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7',\n ],\n [\n '70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27',\n 'd18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8',\n ],\n [\n '2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf',\n '5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1',\n ],\n [\n '5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1',\n 'eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487',\n ],\n [\n '6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61',\n '911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984',\n ],\n [\n '74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293',\n '761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92',\n ],\n [\n '44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9',\n '249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0',\n ],\n [\n '2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc',\n '6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5',\n ],\n [\n '3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb',\n '6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb',\n ],\n [\n '284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677',\n '516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7',\n ],\n [\n '2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32',\n '7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec',\n ],\n [\n '5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7',\n '6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece',\n ],\n [\n '74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f',\n '156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531',\n ],\n [\n '334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45',\n '221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2',\n ],\n [\n '7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30',\n '3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86',\n ],\n [\n '4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8',\n '6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749',\n ],\n [\n '1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7',\n '3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583',\n ],\n [\n '294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1',\n 'd837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad',\n ],\n [\n '753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39',\n '6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75',\n ],\n [\n '5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e',\n '7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8',\n ],\n [\n '4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f',\n '21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e',\n ],\n [\n '726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8',\n '15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12',\n ],\n [\n '38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2',\n '73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b',\n ],\n [\n '6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291',\n '4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75',\n ],\n [\n '6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f',\n '26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05',\n ],\n [\n '2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155',\n '5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244',\n ],\n [\n '4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7',\n '5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1',\n ],\n [\n '110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3',\n '7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43',\n ],\n [\n '5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096',\n '7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2',\n ],\n [\n '2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d',\n '62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b',\n ],\n [\n '1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d',\n '309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4',\n ],\n [\n '2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d',\n '3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf',\n ],\n [\n '376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543',\n '6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547',\n ],\n [\n 'a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066',\n '6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471',\n ],\n [\n '223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed',\n 'c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa',\n ],\n [\n '102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2',\n '6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65',\n ],\n [\n '891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2',\n '5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37',\n ],\n [\n '215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203',\n '10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266',\n ],\n [\n '21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36',\n '3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3',\n ],\n [\n '60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae',\n 'e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879',\n ],\n [\n '1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5',\n '69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3',\n ],\n [\n '5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e',\n '134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec',\n ],\n [\n '626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8',\n '7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0',\n ],\n [\n '23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd',\n '7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf',\n ],\n [\n '54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202',\n '1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426',\n ],\n [\n '13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c',\n '62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9',\n ],\n [\n '47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98',\n '75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb',\n ],\n [\n '2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585',\n '5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c',\n ],\n];\n","/* eslint-disable no-param-reassign */\nexport const IS_BROWSER = typeof window !== 'undefined';\n\nconst STRING_ZERO = '0';\n\nexport function arrayBufferToString(array: ArrayBuffer): string {\n return new Uint8Array(array).reduce((data, byte) => data + String.fromCharCode(byte), '');\n}\n\nexport function stringToArrayBuffer(s: string): Uint8Array {\n return Uint8Array.from(s, (c) => c.charCodeAt(0));\n}\n\nexport function atobUniversal(a: string): Uint8Array {\n return IS_BROWSER ? stringToArrayBuffer(atob(a)) : Buffer.from(a, 'base64');\n}\n\nexport function btoaUniversal(b: ArrayBuffer): string {\n return IS_BROWSER ? btoa(arrayBufferToString(b)) : Buffer.from(b).toString('base64');\n}\n\nexport function buf2hex(buffer: Uint8Array) {\n return [...buffer].map((x) => x.toString(16).padStart(2, '0')).join('');\n}\n\n/**\n * Some function imported from https://github.com/pedrouid/enc-utils/blob/master/src/index.ts\n * enc-utils is no dependency to avoid using `Buffer` which just works in node and no browsers\n */\n\nexport function removeHexPrefix(hex: string): string {\n return hex.replace(/^0x/i, '');\n}\n\nexport function addHexPrefix(hex: string): string {\n return `0x${removeHexPrefix(hex)}`;\n}\n\nfunction padString(str: string, length: number, left: boolean, padding = STRING_ZERO): string {\n const diff = length - str.length;\n let result = str;\n if (diff > 0) {\n const pad = padding.repeat(diff);\n result = left ? pad + str : str + pad;\n }\n return result;\n}\n\nexport function padLeft(str: string, length: number, padding = STRING_ZERO): string {\n return padString(str, length, true, padding);\n}\n\nexport function calcByteLength(length: number, byteSize = 8): number {\n const remainder = length % byteSize;\n return remainder ? ((length - remainder) / byteSize) * byteSize + byteSize : length;\n}\n\nexport function sanitizeBytes(str: string, byteSize = 8, padding = STRING_ZERO): string {\n return padLeft(str, calcByteLength(str.length, byteSize), padding);\n}\n\nexport function sanitizeHex(hex: string): string {\n hex = removeHexPrefix(hex);\n hex = sanitizeBytes(hex, 2);\n if (hex) {\n hex = addHexPrefix(hex);\n }\n return hex;\n}\n\n// implemented using TextEncoder to make it isomorphic\nexport function utf8ToArray(str: string): Uint8Array {\n return new TextEncoder().encode(str);\n}\n","export * from './account';\nexport * from './calldata';\nexport * from './contract';\nexport * from './lib';\nexport * from './provider';\nexport * from './signer';\nexport * from './typedData';\n\nexport * as RPC from './api/rpc';\nexport {\n CallL1Handler,\n DeployedContractItem,\n ExecutionResources,\n FunctionInvocation,\n GetContractAddressesResponse,\n GetTransactionStatusResponse,\n SequencerIdentifier,\n} from './api/sequencer';\nexport * as Sequencer from './api/sequencer';\n","import { BigNumberish, BlockIdentifier } from './lib';\nimport { DeclareTransactionReceiptResponse, EstimateFeeResponse } from './provider';\n\nexport interface EstimateFee extends EstimateFeeResponse {\n suggestedMaxFee: bigint;\n}\n\nexport type EstimateFeeBulk = Array;\n\nexport type AccountInvocationsFactoryDetails = {\n versions: bigint[];\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n};\n\nexport interface EstimateFeeDetails {\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n}\n\nexport interface DeployContractResponse {\n contract_address: string;\n transaction_hash: string;\n}\n\nexport type MultiDeployContractResponse = {\n contract_address: Array;\n transaction_hash: string;\n};\n\nexport type DeployContractUDCResponse = {\n contract_address: string;\n transaction_hash: string;\n address: string;\n deployer: string;\n unique: string;\n classHash: string;\n calldata_len: string;\n calldata: Array;\n salt: string;\n};\n\nexport type DeclareDeployUDCResponse = {\n declare: {\n class_hash: BigNumberish;\n } & Partial;\n deploy: DeployContractUDCResponse;\n};\n\nexport type SimulateTransactionDetails = {\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n skipExecute?: boolean;\n};\n\nexport enum SIMULATION_FLAG {\n SKIP_VALIDATE,\n SKIP_EXECUTE,\n}\n","export enum ValidateType {\n DEPLOY = 'DEPLOY',\n CALL = 'CALL',\n INVOKE = 'INVOKE',\n}\n\nexport enum Uint {\n u8 = 'core::integer::u8',\n u16 = 'core::integer::u16',\n u32 = 'core::integer::u32',\n u64 = 'core::integer::u64',\n u128 = 'core::integer::u128',\n u256 = 'core::integer::u256', // This one is struct\n}\n","import { LegacyCompiledContract, LegacyContractClass } from './legacy';\nimport { CompiledSierra, SierraContractClass } from './sierra';\n\n// Final types\n/**\n * format produced after compressing compiled contract\n * CompressedCompiledContract\n */\nexport type ContractClass = LegacyContractClass | SierraContractClass;\n\n/**\n * format produced after compile .cairo to .json\n */\nexport type CompiledContract = LegacyCompiledContract | CompiledSierra;\n\n/**\n * Compressed or decompressed Cairo0 or Cairo1 Contract\n */\nexport type CairoContract = ContractClass | CompiledContract;\n\n// Basic elements\nexport enum EntryPointType {\n EXTERNAL = 'EXTERNAL',\n L1_HANDLER = 'L1_HANDLER',\n CONSTRUCTOR = 'CONSTRUCTOR',\n}\n\nexport * from './abi';\nexport * from './legacy';\nexport * from './sierra';\n","import { StarknetChainId } from '../../constants';\nimport { weierstrass } from '../../utils/ec';\nimport { CompiledContract, CompiledSierraCasm, ContractClass } from './contract';\n\nexport type WeierstrassSignatureType = weierstrass.SignatureType;\nexport type ArraySignatureType = string[];\nexport type Signature = ArraySignatureType | WeierstrassSignatureType;\n\nexport type BigNumberish = string | number | bigint;\n\n/**\n * Compiled calldata ready to be sent\n * decimal-string array\n */\nexport type Calldata = string[] & { readonly __compiled__?: boolean };\n\n/**\n * Represents an integer in the range [0, 2^256)\n */\nexport interface Uint256 {\n // The low 128 bits of the value\n low: BigNumberish;\n // The high 128 bits of the value\n high: BigNumberish;\n}\n\n/**\n * BigNumberish array\n * use CallData.compile() to convert to Calldata\n */\nexport type RawCalldata = BigNumberish[];\n\n/**\n * Hexadecimal-string array\n */\nexport type HexCalldata = string[];\n\nexport type AllowArray = T | T[];\n\nexport type OptionalPayload = { payload: T } | T;\n\nexport type RawArgs = RawArgsObject | RawArgsArray;\n\nexport type RawArgsObject = {\n [inputName: string]: MultiType | MultiType[] | RawArgs;\n};\n\nexport type RawArgsArray = Array;\n\nexport type MultiType = BigNumberish | Uint256 | object | boolean;\n\nexport type UniversalDeployerContractPayload = {\n classHash: BigNumberish;\n salt?: string;\n unique?: boolean;\n constructorCalldata?: RawArgs;\n};\n\nexport type DeployAccountContractPayload = {\n classHash: string;\n constructorCalldata?: RawArgs;\n addressSalt?: BigNumberish;\n contractAddress?: string;\n};\n\nexport type DeployAccountContractTransaction = Omit<\n DeployAccountContractPayload,\n 'contractAddress'\n> & {\n signature?: Signature;\n};\n\nexport type DeclareContractPayload = {\n contract: CompiledContract | string;\n classHash?: string;\n casm?: CompiledSierraCasm;\n compiledClassHash?: string;\n};\n\nexport type CompleteDeclareContractPayload = {\n contract: CompiledContract | string;\n classHash: string;\n casm?: CompiledSierraCasm;\n compiledClassHash?: string;\n};\n\nexport type DeclareAndDeployContractPayload = Omit &\n DeclareContractPayload;\n\nexport type DeclareContractTransaction = {\n contract: ContractClass;\n senderAddress: string;\n signature?: Signature;\n compiledClassHash?: string;\n};\n\nexport type CallDetails = {\n contractAddress: string;\n calldata?: RawArgs | Calldata;\n entrypoint?: string; // TODO: check if required\n};\n\nexport type Invocation = CallDetails & { signature?: Signature };\n\nexport type Call = CallDetails & { entrypoint: string };\n\nexport type CairoVersion = '0' | '1';\n\nexport type InvocationsDetails = {\n nonce?: BigNumberish;\n maxFee?: BigNumberish;\n version?: BigNumberish;\n};\n\n/**\n * Contain all additional details params\n */\nexport type Details = {\n nonce: BigNumberish;\n maxFee: BigNumberish;\n version: BigNumberish;\n chainId: StarknetChainId;\n};\n\nexport type InvocationsDetailsWithNonce = InvocationsDetails & {\n nonce: BigNumberish;\n};\n\nexport enum TransactionType {\n DECLARE = 'DECLARE',\n DEPLOY = 'DEPLOY',\n DEPLOY_ACCOUNT = 'DEPLOY_ACCOUNT',\n INVOKE = 'INVOKE_FUNCTION',\n}\n\nexport enum TransactionStatus {\n NOT_RECEIVED = 'NOT_RECEIVED',\n RECEIVED = 'RECEIVED',\n ACCEPTED_ON_L2 = 'ACCEPTED_ON_L2',\n ACCEPTED_ON_L1 = 'ACCEPTED_ON_L1',\n REJECTED = 'REJECTED',\n}\n\nexport enum BlockStatus {\n PENDING = 'PENDING',\n ACCEPTED_ON_L1 = 'ACCEPTED_ON_L1',\n ACCEPTED_ON_L2 = 'ACCEPTED_ON_L2',\n REJECTED = 'REJECTED',\n}\n\nexport enum BlockTag {\n pending = 'pending',\n latest = 'latest',\n}\n\nexport type BlockNumber = BlockTag | null | number;\n\n/**\n * hex string and BN are detected as block hashes\n * decimal string and number are detected as block numbers\n * null appends nothing to the request url\n */\nexport type BlockIdentifier = BlockNumber | BigNumberish;\n\n/**\n * items used by AccountInvocations\n */\nexport type AccountInvocationItem = (\n | ({ type: TransactionType.DECLARE } & DeclareContractTransaction)\n | ({ type: TransactionType.DEPLOY_ACCOUNT } & DeployAccountContractTransaction)\n | ({ type: TransactionType.INVOKE } & Invocation)\n) &\n InvocationsDetailsWithNonce;\n\n/**\n * Complete invocations array with account details (internal type from account -> provider)\n */\nexport type AccountInvocations = AccountInvocationItem[];\n\n/**\n * Invocations array user provide to bulk method (simulate)\n */\nexport type Invocations = Array<\n | ({ type: TransactionType.DECLARE } & OptionalPayload)\n | ({ type: TransactionType.DEPLOY } & OptionalPayload<\n AllowArray\n >)\n | ({ type: TransactionType.DEPLOY_ACCOUNT } & OptionalPayload)\n | ({ type: TransactionType.INVOKE } & OptionalPayload>)\n>;\n\nexport type Tupled = { element: any; type: string };\n\nexport type Args = {\n [inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[];\n};\nexport type ParsedStruct = {\n [key: string]: BigNumberish | ParsedStruct;\n};\n\nexport type waitForTransactionOptions = {\n retryInterval?: number;\n successStates?: Array;\n};\n\nexport type getSimulateTransactionOptions = {\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n skipExecute?: boolean;\n};\n\nexport type getEstimateFeeBulkOptions = {\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n};\n\nexport interface CallStruct {\n to: string;\n selector: string;\n calldata: string[];\n}\n\nexport * from './contract';\n","import { ADDRESS, CONTRACT_STORAGE_DIFF_ITEM, FELT, OPENRPC } from './openrpc';\n\nexport type Response = {\n id: number;\n jsonrpc: string;\n result?: any;\n error?: {\n code: string;\n message: string;\n };\n};\n\nexport type ChainId = OPENRPC.CHAIN_ID;\nexport type CallResponse = OPENRPC.CallResponse;\nexport type ContractAddress = ADDRESS;\nexport type Felt = FELT;\nexport type Nonce = OPENRPC.Nonce;\nexport type ContractClass = OPENRPC.ContractClass | OPENRPC.DeprecatedContractClass;\nexport type StateUpdate = OPENRPC.StateUpdate;\nexport type Transaction = OPENRPC.Transaction;\nexport type PendingTransactions = OPENRPC.PendingTransactions;\nexport type TransactionHash = OPENRPC.TransactionHash;\nexport type Trace = OPENRPC.Trace;\nexport type Traces = OPENRPC.Traces;\nexport type BlockHash = OPENRPC.BlockHash;\nexport type BlockHashAndNumber = OPENRPC.BlockHashAndNumber;\nexport type EstimateFeeResponse = OPENRPC.EstimatedFee;\nexport type GetBlockWithTxHashesResponse = OPENRPC.BlockWithTxHashes;\nexport type GetBlockWithTxs = OPENRPC.BlockWithTxs;\nexport type GetStorageAtResponse = OPENRPC.Storage;\nexport type TransactionReceipt = OPENRPC.TransactionReceipt;\nexport type GetTransactionByHashResponse = OPENRPC.Transaction;\nexport type GetTransactionByBlockIdAndIndex = OPENRPC.Transaction;\nexport type GetTransactionCountResponse = number;\nexport type GetBlockNumberResponse = OPENRPC.BlockNumber;\nexport type GetSyncingStatsResponse = OPENRPC.SyncingStatus;\nexport type EventFilter = OPENRPC.EventFilter;\nexport type GetEventsResponse = OPENRPC.Events;\nexport type InvokedTransaction = OPENRPC.InvokedTransaction;\nexport type DeclaredTransaction = OPENRPC.DeclaredTransaction;\nexport type DeployedTransaction = OPENRPC.DeployedTransaction;\nexport type SimulationFlags = OPENRPC.SimulationFlags;\nexport type BroadcastedTransaction = OPENRPC.BroadcastedTransaction;\nexport type EstimatedFee = OPENRPC.EstimatedFee;\nexport type Methods = OPENRPC.Methods;\nexport type Storage = OPENRPC.Storage;\nexport type SimulateTransactionResponse = OPENRPC.SimulatedTransactions;\n\nexport enum TransactionType {\n DECLARE = 'DECLARE',\n DEPLOY = 'DEPLOY',\n DEPLOY_ACCOUNT = 'DEPLOY_ACCOUNT',\n INVOKE = 'INVOKE',\n L1_HANDLER = 'L1_HANDLER',\n}\n\n// Exported Diff on Sequencer (can be removed when diff resolved by new RPC v)\nexport type StorageDiffs = Array;\nexport type DeprecatedDeclaredClasses = Array;\nexport type Nonces = Array<{\n contract_address: ADDRESS;\n nonce: FELT;\n}>;\nexport type ReplacedClasses = Array<{ contract_address: ADDRESS; class_hash: FELT }>;\n","import {\n Abi,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n BlockNumber,\n BlockStatus,\n ByteCode,\n CairoAssembly,\n CompiledContract,\n ContractClass,\n EntryPointType,\n RawCalldata,\n TransactionStatus,\n TransactionType,\n} from '../lib';\n\n// #region | originally not included in the namespace\nexport type GetTransactionStatusResponse = {\n tx_status: TransactionStatus;\n block_hash?: string;\n tx_failure_reason?: {\n code: string;\n error_message: string;\n };\n};\n\nexport type GetContractAddressesResponse = {\n Starknet: string;\n GpsStatementVerifier: string;\n};\n\nexport type FunctionInvocation = {\n caller_address: string;\n contract_address: string;\n calldata: RawCalldata;\n call_type?: string;\n class_hash?: string;\n selector?: string;\n entry_point_type?: EntryPointType.EXTERNAL; // TODO: check this\n result: Array;\n execution_resources: ExecutionResources;\n internal_calls: Array;\n events: Array;\n messages: Array;\n};\n\nexport type ExecutionResources = {\n n_steps: number;\n builtin_instance_counter: {\n pedersen_builtin: number;\n range_check_builtin: number;\n bitwise_builtin: number;\n output_builtin: number;\n ecdsa_builtin: number;\n ec_op_builtin?: number;\n };\n n_memory_holes: number;\n};\n\nexport type CallL1Handler = {\n from_address: string;\n to_address: string;\n entry_point_selector: string;\n payload: Array;\n};\n\nexport type DeployedContractItem = {\n address: string;\n class_hash: string;\n};\n\nexport type SequencerIdentifier = { blockHash: string } | { blockNumber: BlockNumber };\n// #endregion\n\nexport type TransactionTraceResponse = {\n validate_invocation?: FunctionInvocation;\n function_invocation?: FunctionInvocation;\n fee_transfer_invocation?: FunctionInvocation;\n constructor_invocation?: FunctionInvocation;\n signature: string[];\n};\n\nexport type DeclareTransaction = {\n type: TransactionType.DECLARE;\n sender_address: string;\n contract_class: ContractClass;\n signature?: string[];\n nonce: BigNumberish;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n compiled_class_hash?: string; // v2 declare\n};\n\nexport type DeployTransaction = {\n type: TransactionType.DEPLOY;\n contract_definition: ContractClass;\n contract_address_salt: BigNumberish;\n constructor_calldata: string[];\n nonce?: BigNumberish;\n};\n\nexport type DeployAccountTransaction = {\n type: TransactionType.DEPLOY_ACCOUNT;\n class_hash: string;\n contract_address_salt: BigNumberish;\n constructor_calldata: string[];\n signature?: string[];\n max_fee?: BigNumberish;\n version?: BigNumberish;\n nonce?: BigNumberish;\n};\n\nexport type InvokeFunctionTransaction = {\n type: TransactionType.INVOKE;\n sender_address: string;\n signature?: string[];\n entry_point_type?: EntryPointType.EXTERNAL; // TODO: check this\n calldata?: RawCalldata;\n nonce: BigNumberish;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n};\n\nexport type Transaction =\n | DeclareTransaction\n | DeployTransaction\n | InvokeFunctionTransaction\n | DeployAccountTransaction;\n\nexport type AddTransactionResponse = {\n transaction_hash: string;\n code?: 'TRANSACTION_RECEIVED';\n address?: string;\n class_hash?: string;\n};\n\nexport type GetCodeResponse = {\n bytecode: ByteCode;\n abi: Abi;\n};\n\nexport interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction {\n transaction_hash: string;\n entry_point_selector: string;\n}\n\nexport type TransactionResponse =\n | DeclareTransaction\n | DeployTransaction\n | InvokeFunctionTransactionResponse;\n\nexport type SuccessfulTransactionResponse = {\n status: TransactionStatus;\n transaction: TransactionResponse;\n block_hash: string;\n block_number: BlockNumber;\n transaction_index: number;\n};\n\nexport type FailedTransactionResponse = {\n status: TransactionStatus.REJECTED;\n transaction_failure_reason: {\n code: string;\n error_message: string;\n };\n transaction: TransactionResponse;\n};\n\nexport type GetTransactionResponse = SuccessfulTransactionResponse | FailedTransactionResponse;\n\nexport type TransactionReceiptResponse =\n | SuccessfulTransactionReceiptResponse\n | FailedTransactionReceiptResponse;\n\nexport type SuccessfulTransactionReceiptResponse = {\n status: TransactionStatus;\n transaction_hash: string;\n transaction_index: number;\n block_hash: string;\n block_number: BlockNumber;\n l2_to_l1_messages: string[];\n events: string[];\n actual_fee: string;\n execution_resources: ExecutionResources;\n};\n\nexport type FailedTransactionReceiptResponse = {\n status: TransactionStatus.REJECTED;\n transaction_failure_reason: {\n code: string;\n error_message: string;\n };\n transaction_hash: string;\n l2_to_l1_messages: string[];\n events: string[];\n};\n\nexport type GetBlockResponse = {\n block_number: number;\n state_root: string;\n block_hash: string;\n transactions: {\n [txHash: string]: TransactionResponse;\n };\n timestamp: number;\n transaction_receipts: {\n [txHash: string]: {\n block_hash: string;\n transaction_hash: string;\n l2_to_l1_messages: {\n to_address: string;\n payload: string[];\n from_address: string;\n }[];\n block_number: BlockNumber;\n status: TransactionStatus;\n transaction_index: number;\n };\n };\n parent_block_hash: string;\n status: BlockStatus;\n gas_price: string;\n sequencer_address: string;\n starknet_version: string;\n};\n\nexport type CallContractTransaction = {\n calldata?: RawCalldata;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n entry_point_selector: string;\n} & (\n | {\n sender_address: string;\n signature: string[];\n }\n | {\n contract_address: string;\n signature?: never;\n }\n);\n\nexport type CallContractResponse = {\n result: string[];\n};\n\nexport type InvokeEstimateFee = Omit;\nexport type DeclareEstimateFee = Omit;\nexport type DeployAccountEstimateFee = Omit;\nexport type DeployEstimateFee = DeployTransaction;\n\nexport type SimulateTransactionResponse = {\n trace: TransactionTraceResponse; // diff with OPENRPC \"transaction_trace\"\n fee_estimation: EstimateFeeResponse;\n};\n\nexport type AccountTransactionItem =\n | InvokeEstimateFee\n | DeclareEstimateFee\n | DeployEstimateFee\n | DeployAccountEstimateFee;\n\n/**\n * Transaction filled with account data\n */\nexport type AccountTransaction = AllowArray;\n\n// Support 0.9.1 changes in a backward-compatible way\nexport type EstimateFeeResponse =\n | {\n overall_fee: number;\n gas_price: number;\n gas_usage: number;\n uint: string;\n }\n | {\n amount: bigint;\n unit: string;\n };\n\nexport type EstimateFeeResponseBulk = AllowArray;\n\nexport type BlockTransactionTracesResponse = {\n traces: Array;\n};\n\nexport type Storage = string;\n\nexport type StateUpdateResponse = {\n block_hash: string;\n new_root: string;\n old_root: string;\n state_diff: {\n storage_diffs: StorageDiffs;\n nonces: Nonces;\n deployed_contracts: Array;\n old_declared_contracts: OldDeclaredContracts;\n declared_classes: DeclaredClasses;\n replaced_classes: ReplacedClasses; // no definition is it array of string\n };\n};\n\nexport type StorageDiffs = { [address: string]: Array };\n\nexport type StateDiffItem = { key: string; value: string };\n\nexport type Nonces = { [address: string]: Nonce };\n\nexport type Nonce = string;\n\nexport type DeployedContracts = DeployedContractItem[];\n\nexport type OldDeclaredContracts = string[];\n\nexport type DeclaredClasses = DeclaredClass[];\n\nexport type DeclaredClass = { class_hash: string; compiled_class_hash: string };\n\nexport type ReplacedClasses = string[]; // no definition is it array of string ?\n\nexport type Endpoints = {\n get_contract_addresses: {\n QUERY: never;\n REQUEST: never;\n RESPONSE: GetContractAddressesResponse;\n };\n add_transaction: {\n QUERY: never;\n REQUEST: Transaction;\n RESPONSE: AddTransactionResponse;\n };\n get_transaction: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: GetTransactionResponse;\n };\n get_transaction_status: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: GetTransactionStatusResponse;\n };\n get_transaction_trace: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: TransactionTraceResponse;\n };\n get_transaction_receipt: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: TransactionReceiptResponse;\n };\n get_nonce: {\n QUERY: {\n contractAddress: string;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: Nonce;\n };\n get_storage_at: {\n QUERY: {\n contractAddress: string;\n key: BigNumberish;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: Storage;\n };\n get_code: {\n QUERY: {\n contractAddress: string;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: GetCodeResponse;\n };\n get_block: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: GetBlockResponse;\n };\n call_contract: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: CallContractTransaction;\n RESPONSE: CallContractResponse;\n };\n estimate_fee: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransactionItem;\n RESPONSE: EstimateFeeResponse;\n };\n get_class_by_hash: {\n QUERY: {\n classHash: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: CompiledContract;\n };\n get_class_hash_at: {\n QUERY: {\n contractAddress: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: string;\n };\n get_state_update: {\n QUERY: {\n blockHash?: string;\n blockNumber?: BlockNumber;\n };\n REQUEST: never;\n RESPONSE: StateUpdateResponse;\n };\n get_full_contract: {\n QUERY: {\n contractAddress: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: CompiledContract;\n };\n estimate_message_fee: {\n QUERY: any;\n REQUEST: any;\n RESPONSE: EstimateFeeResponse;\n };\n simulate_transaction: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransaction;\n RESPONSE: SimulateTransactionResponse;\n };\n estimate_fee_bulk: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransaction;\n RESPONSE: EstimateFeeResponseBulk;\n };\n get_block_traces: {\n QUERY: {\n blockHash?: string;\n blockNumber?: BlockNumber;\n };\n REQUEST: never;\n RESPONSE: BlockTransactionTracesResponse;\n };\n get_compiled_class_by_class_hash: {\n QUERY: {\n classHash: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: any;\n RESPONSE: CairoAssembly;\n };\n};\n","export default function assert(condition: any, message?: string): asserts condition {\n if (!condition) {\n throw new Error(message || 'Assertion failure');\n }\n}\n","import { hexToBytes as hexToBytesNoble } from '@noble/curves/abstract/utils';\n\nimport { BigNumberish } from '../types';\nimport assert from './assert';\nimport { addHexPrefix, removeHexPrefix } from './encode';\n\n/** @deprecated prefer importing from 'types' over 'num' */\nexport type { BigNumberish };\n\nexport function isHex(hex: string): boolean {\n return /^0x[0-9a-f]*$/i.test(hex);\n}\n\nexport function toBigInt(value: BigNumberish): bigint {\n return BigInt(value);\n}\n\nexport function isBigInt(value: any): value is bigint {\n return typeof value === 'bigint';\n}\n\nexport function toHex(number: BigNumberish): string {\n return addHexPrefix(toBigInt(number).toString(16));\n}\n\n/**\n * Convert BigNumberish to STORAGE_KEY\n * Same as toHex but conforming pattern STORAGE_KEY pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$\n * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.\n * 0x0 + [0-7] + 62 hex = 0x + 64 hex\n * @param number BigNumberish\n */\nexport function toStorageKey(number: BigNumberish): string {\n const res = addHexPrefix(toBigInt(number).toString(16).padStart(64, '0'));\n return res;\n}\n\nexport function hexToDecimalString(hex: string): string {\n return BigInt(addHexPrefix(hex)).toString(10);\n}\n\n/**\n * Remove hex string leading zero and lower case '0x01A'.. -> '0x1a..'\n * @param hex string\n */\nexport const cleanHex = (hex: string) => hex.toLowerCase().replace(/^(0x)0+/, '$1');\n\n/*\n Asserts input is equal to or greater then lowerBound and lower then upperBound.\n Assert message specifies inputName.\n input, lowerBound, and upperBound should be of type BN.\n inputName should be a string.\n*/\nexport function assertInRange(\n input: BigNumberish,\n lowerBound: BigNumberish,\n upperBound: BigNumberish,\n inputName = ''\n) {\n const messageSuffix = inputName === '' ? 'invalid length' : `invalid ${inputName} length`;\n const inputBigInt = BigInt(input);\n const lowerBoundBigInt = BigInt(lowerBound);\n const upperBoundBigInt = BigInt(upperBound);\n\n assert(\n inputBigInt >= lowerBoundBigInt && inputBigInt <= upperBoundBigInt,\n `Message not signable, ${messageSuffix}.`\n );\n}\n\nexport function bigNumberishArrayToDecimalStringArray(rawCalldata: BigNumberish[]): string[] {\n return rawCalldata.map((x) => toBigInt(x).toString(10));\n}\n\nexport function bigNumberishArrayToHexadecimalStringArray(rawCalldata: BigNumberish[]): string[] {\n return rawCalldata.map((x) => toHex(x));\n}\n\nexport const isStringWholeNumber = (value: string) => /^\\d+$/.test(value);\nexport const toHexString = (value: string) => toHex(value);\n\nexport function getDecimalString(value: string) {\n if (isHex(value)) {\n return hexToDecimalString(value);\n }\n if (isStringWholeNumber(value)) {\n return value;\n }\n throw new Error(`${value} need to be hex-string or whole-number-string`);\n}\n\nexport function getHexString(value: string) {\n if (isHex(value)) {\n return value;\n }\n if (isStringWholeNumber(value)) {\n return toHexString(value);\n }\n throw new Error(`${value} need to be hex-string or whole-number-string`);\n}\n\nexport function getHexStringArray(value: Array) {\n return value.map((el) => getHexString(el));\n}\n\nexport const toCairoBool = (value: boolean): string => (+value).toString();\n\n/**\n * Convert a hex string to an array of Bytes (Uint8Array)\n * @param value hex string\n * @returns an array of Bytes\n */\nexport function hexToBytes(value: string): Uint8Array {\n if (!isHex(value)) throw new Error(`${value} need to be a hex-string`);\n\n let adaptedValue: string = removeHexPrefix(value);\n if (adaptedValue.length % 2 !== 0) {\n adaptedValue = `0${adaptedValue}`;\n }\n return hexToBytesNoble(adaptedValue);\n}\n","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst u8a = (a: any): a is Uint8Array => a instanceof Uint8Array;\n\n// We accept hex strings besides Uint8Array for simplicity\nexport type Hex = Uint8Array | string;\n// Very few implementations accept numbers, we do it to ease learning curve\nexport type PrivKey = Hex | bigint;\nexport type CHash = {\n (message: Uint8Array | string): Uint8Array;\n blockLen: number;\n outputLen: number;\n create(opts?: { dkLen?: number }): any; // For shake\n};\nexport type FHash = (message: Uint8Array | string) => Uint8Array;\n\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\nexport function bytesToHex(bytes: Uint8Array): string {\n if (!u8a(bytes)) throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\nexport function numberToHexUnpadded(num: number | bigint): string {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n}\n\nexport function hexToNumber(hex: string): bigint {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // Big Endian\n return BigInt(hex === '' ? '0' : `0x${hex}`);\n}\n\n// Caching slows it down 2-3x\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n if (hex.length % 2) throw new Error('hex string is invalid: unpadded ' + hex.length);\n const array = new Uint8Array(hex.length / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0) throw new Error('invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n\n// Big Endian\nexport function bytesToNumberBE(bytes: Uint8Array): bigint {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes: Uint8Array): bigint {\n if (!u8a(bytes)) throw new Error('Uint8Array expected');\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\n\nexport const numberToBytesBE = (n: bigint, len: number) =>\n hexToBytes(n.toString(16).padStart(len * 2, '0'));\nexport const numberToBytesLE = (n: bigint, len: number) => numberToBytesBE(n, len).reverse();\n// Returns variable number bytes (minimal bigint encoding?)\nexport const numberToVarBytesBE = (n: bigint) => hexToBytes(numberToHexUnpadded(n));\n\nexport function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array {\n let res: Uint8Array;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n } catch (e) {\n throw new Error(`${title} must be valid hex string, got \"${hex}\". Cause: ${e}`);\n }\n } else if (u8a(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n } else {\n throw new Error(`${title} must be hex string or Uint8Array`);\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);\n return res;\n}\n\n// Copies several Uint8Arrays into one.\nexport function concatBytes(...arrs: Uint8Array[]): Uint8Array {\n const r = new Uint8Array(arrs.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrs.forEach((a) => {\n if (!u8a(a)) throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\n\nexport function equalBytes(b1: Uint8Array, b2: Uint8Array) {\n // We don't care about timing attacks here\n if (b1.length !== b2.length) return false;\n for (let i = 0; i < b1.length; i++) if (b1[i] !== b2[i]) return false;\n return true;\n}\n\n// Global symbols in both browsers and Node.js since v11\n// See https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') {\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n }\n return new TextEncoder().encode(str);\n}\n\n// Bit operations\n\n// Amount of bits inside bigint (Same as n.toString(2).length)\nexport function bitLen(n: bigint) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1);\n return len;\n}\n// Gets single bit at position. NOTE: first bit position is 0 (same as arrays)\n// Same as !!+Array.from(n.toString(2)).reverse()[pos]\nexport const bitGet = (n: bigint, pos: number) => (n >> BigInt(pos)) & _1n;\n// Sets single bit at position\nexport const bitSet = (n: bigint, pos: number, value: boolean) =>\n n | ((value ? _1n : _0n) << BigInt(pos));\n// Return mask for N bits (Same as BigInt(`0b${Array(i).fill('1').join('')}`))\n// Not using ** operator with bigints for old engines.\nexport const bitMask = (n: number) => (_2n << BigInt(n - 1)) - _1n;\n\n// DRBG\n\nconst u8n = (data?: any) => new Uint8Array(data); // creates Uint8Array\nconst u8fr = (arr: any) => Uint8Array.from(arr); // another shortcut\ntype Pred = (v: Uint8Array) => T | undefined;\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(\n hashLen: number,\n qByteLen: number,\n hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array\n): (seed: Uint8Array, predicate: Pred) => T {\n if (typeof hashLen !== 'number' || hashLen < 2) throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2) throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function') throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b: Uint8Array[]) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n()) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0) return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000) throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out: Uint8Array[] = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed: Uint8Array, pred: Pred): T => {\n reset();\n reseed(seed); // Steps D-G\n let res: T | undefined = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen()))) reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n\n// Validating curves and fields\n\nconst validatorFns = {\n bigint: (val: any) => typeof val === 'bigint',\n function: (val: any) => typeof val === 'function',\n boolean: (val: any) => typeof val === 'boolean',\n string: (val: any) => typeof val === 'string',\n isSafeInteger: (val: any) => Number.isSafeInteger(val),\n array: (val: any) => Array.isArray(val),\n field: (val: any, object: any) => (object as any).Fp.isValid(val),\n hash: (val: any) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n} as const;\ntype Validator = keyof typeof validatorFns;\ntype ValMap> = { [K in keyof T]?: Validator };\n// type Record = { [P in K]: T; }\n\nexport function validateObject>(\n object: T,\n validators: ValMap,\n optValidators: ValMap = {}\n) {\n const checkField = (fieldName: keyof T, type: Validator, isOptional: boolean) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error(`Invalid validator \"${type}\", expected function`);\n\n const val = object[fieldName as keyof typeof object];\n if (isOptional && val === undefined) return;\n if (!checkVal(val, object)) {\n throw new Error(\n `Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`\n );\n }\n };\n for (const [fieldName, type] of Object.entries(validators)) checkField(fieldName, type!, false);\n for (const [fieldName, type] of Object.entries(optValidators)) checkField(fieldName, type!, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n","import { keccak } from 'micro-starknet';\n\nimport { MASK_250 } from '../constants';\nimport { BigNumberish } from '../types';\nimport { addHexPrefix, removeHexPrefix, utf8ToArray } from './encode';\nimport { hexToBytes, isHex, isStringWholeNumber, toHex, toHexString } from './num';\n\n/**\n * Keccak hash BigNumberish value\n * @param value BigNumberish\n * @returns string - hexadecimal string\n */\nexport function keccakBn(value: BigNumberish): string {\n const hexWithoutPrefix = removeHexPrefix(toHex(BigInt(value)));\n const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`;\n return addHexPrefix(keccak(hexToBytes(addHexPrefix(evenHex))).toString(16));\n}\n\n/**\n * Keccak hash string value\n * @param value string\n * @returns string - hexadecimal string\n */\nfunction keccakHex(value: string): string {\n return addHexPrefix(keccak(utf8ToArray(value)).toString(16));\n}\n\n/**\n * Function to get the starknet keccak hash from a string\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L17-L22)\n * @param value - string you want to get the starknetKeccak hash from\n * @returns starknet keccak hash as BigNumber\n */\nexport function starknetKeccak(value: string): bigint {\n const hash = BigInt(keccakHex(value));\n // eslint-disable-next-line no-bitwise\n return hash & MASK_250;\n}\n\n/**\n * Function to get the hex selector from a given function name\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L25-L26)\n * @param funcName - selectors abi function name\n * @returns hex selector of given abi function name\n */\nexport function getSelectorFromName(funcName: string) {\n // sometimes BigInteger pads the hex string with zeros, which is not allowed in the starknet api\n return toHex(starknetKeccak(funcName));\n}\n\n/**\n * Function to get hex selector from function name, decimal string or hex string\n * @param value hex string | decimal string | string\n * @returns Hex selector\n */\nexport function getSelector(value: string) {\n if (isHex(value)) {\n return value;\n }\n if (isStringWholeNumber(value)) {\n return toHexString(value);\n }\n return getSelectorFromName(value);\n}\n","import { keccak_256 } from '@noble/hashes/sha3';\nimport { sha256 } from '@noble/hashes/sha256';\nimport { utf8ToBytes } from '@noble/hashes/utils';\nimport { Field, mod, validateField } from '@noble/curves/abstract/modular';\nimport { poseidon } from '@noble/curves/abstract/poseidon';\nimport { weierstrass } from '@noble/curves/abstract/weierstrass';\nimport * as u from '@noble/curves/abstract/utils';\nimport { getHash } from '@noble/curves/_shortw_utils';\nconst CURVE_ORDER = BigInt('3618502788666131213697322783095070105526743751716087489154079457884512865583');\nconst nBitLength = 252;\nfunction bits2int(bytes) {\n while (bytes[0] === 0)\n bytes = bytes.subarray(1);\n const delta = bytes.length * 8 - nBitLength;\n const num = u.bytesToNumberBE(bytes);\n return delta > 0 ? num >> BigInt(delta) : num;\n}\nfunction hex0xToBytes(hex) {\n if (typeof hex === 'string') {\n hex = strip0x(hex);\n if (hex.length & 1)\n hex = '0' + hex;\n }\n return u.hexToBytes(hex);\n}\nconst curve = weierstrass({\n a: BigInt(1),\n b: BigInt('3141592653589793238462643383279502884197169399375105820974944592307816406665'),\n Fp: Field(BigInt('0x800000000000011000000000000000000000000000000000000000000000001')),\n n: CURVE_ORDER,\n nBitLength,\n Gx: BigInt('874739451078007766457464989774322083649278607533249481151382481072868806602'),\n Gy: BigInt('152666792071518830868575557812948353041420400780739481342941381225525861407'),\n h: BigInt(1),\n lowS: false,\n ...getHash(sha256),\n bits2int,\n bits2int_modN: (bytes) => {\n const hex = u.bytesToNumberBE(bytes).toString(16);\n if (hex.length === 63)\n bytes = hex0xToBytes(hex + '0');\n return mod(bits2int(bytes), CURVE_ORDER);\n },\n});\nexport const _starkCurve = curve;\nfunction ensureBytes(hex) {\n return u.ensureBytes('', typeof hex === 'string' ? hex0xToBytes(hex) : hex);\n}\nfunction normPrivKey(privKey) {\n return u.bytesToHex(ensureBytes(privKey)).padStart(64, '0');\n}\nexport function getPublicKey(privKey, isCompressed = false) {\n return curve.getPublicKey(normPrivKey(privKey), isCompressed);\n}\nexport function getSharedSecret(privKeyA, pubKeyB) {\n return curve.getSharedSecret(normPrivKey(privKeyA), pubKeyB);\n}\nexport function sign(msgHash, privKey, opts) {\n return curve.sign(ensureBytes(msgHash), normPrivKey(privKey), opts);\n}\nexport function verify(signature, msgHash, pubKey) {\n const sig = signature instanceof Signature ? signature : ensureBytes(signature);\n return curve.verify(sig, ensureBytes(msgHash), ensureBytes(pubKey));\n}\nconst { CURVE, ProjectivePoint, Signature, utils } = curve;\nexport { CURVE, ProjectivePoint, Signature, utils };\nfunction extractX(bytes) {\n const hex = u.bytesToHex(bytes.subarray(1));\n const stripped = hex.replace(/^0+/gm, '');\n return `0x${stripped}`;\n}\nfunction strip0x(hex) {\n return hex.replace(/^0x/i, '');\n}\nfunction numberTo0x16(num) {\n return `0x${num.toString(16)}`;\n}\nexport function grindKey(seed) {\n const _seed = ensureBytes(seed);\n const sha256mask = 2n ** 256n;\n const limit = sha256mask - mod(sha256mask, CURVE_ORDER);\n for (let i = 0;; i++) {\n const key = sha256Num(u.concatBytes(_seed, u.numberToVarBytesBE(BigInt(i))));\n if (key < limit)\n return mod(key, CURVE_ORDER).toString(16);\n if (i === 100000)\n throw new Error('grindKey is broken: tried 100k vals');\n }\n}\nexport function getStarkKey(privateKey) {\n return extractX(getPublicKey(privateKey, true));\n}\nexport function ethSigToPrivate(signature) {\n signature = strip0x(signature);\n if (signature.length !== 130)\n throw new Error('Wrong ethereum signature');\n return grindKey(signature.substring(0, 64));\n}\nconst MASK_31 = 2n ** 31n - 1n;\nconst int31 = (n) => Number(n & MASK_31);\nexport function getAccountPath(layer, application, ethereumAddress, index) {\n const layerNum = int31(sha256Num(layer));\n const applicationNum = int31(sha256Num(application));\n const eth = u.hexToNumber(strip0x(ethereumAddress));\n return `m/2645'/${layerNum}'/${applicationNum}'/${int31(eth)}'/${int31(eth >> 31n)}'/${index}`;\n}\nconst PEDERSEN_POINTS = [\n new ProjectivePoint(2089986280348253421170679821480865132823066470938446095505822317253594081284n, 1713931329540660377023406109199410414810705867260802078187082345529207694986n, 1n),\n new ProjectivePoint(996781205833008774514500082376783249102396023663454813447423147977397232763n, 1668503676786377725805489344771023921079126552019160156920634619255970485781n, 1n),\n new ProjectivePoint(2251563274489750535117886426533222435294046428347329203627021249169616184184n, 1798716007562728905295480679789526322175868328062420237419143593021674992973n, 1n),\n new ProjectivePoint(2138414695194151160943305727036575959195309218611738193261179310511854807447n, 113410276730064486255102093846540133784865286929052426931474106396135072156n, 1n),\n new ProjectivePoint(2379962749567351885752724891227938183011949129833673362440656643086021394946n, 776496453633298175483985398648758586525933812536653089401905292063708816422n, 1n),\n];\nfunction pedersenPrecompute(p1, p2) {\n const out = [];\n let p = p1;\n for (let i = 0; i < 248; i++) {\n out.push(p);\n p = p.double();\n }\n p = p2;\n for (let i = 0; i < 4; i++) {\n out.push(p);\n p = p.double();\n }\n return out;\n}\nconst PEDERSEN_POINTS1 = pedersenPrecompute(PEDERSEN_POINTS[1], PEDERSEN_POINTS[2]);\nconst PEDERSEN_POINTS2 = pedersenPrecompute(PEDERSEN_POINTS[3], PEDERSEN_POINTS[4]);\nfunction pedersenArg(arg) {\n let value;\n if (typeof arg === 'bigint') {\n value = arg;\n }\n else if (typeof arg === 'number') {\n if (!Number.isSafeInteger(arg))\n throw new Error(`Invalid pedersenArg: ${arg}`);\n value = BigInt(arg);\n }\n else {\n value = u.bytesToNumberBE(ensureBytes(arg));\n }\n if (!(0n <= value && value < curve.CURVE.Fp.ORDER))\n throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${value}`);\n return value;\n}\nfunction pedersenSingle(point, value, constants) {\n let x = pedersenArg(value);\n for (let j = 0; j < 252; j++) {\n const pt = constants[j];\n if (pt.equals(point))\n throw new Error('Same point');\n if ((x & 1n) !== 0n)\n point = point.add(pt);\n x >>= 1n;\n }\n return point;\n}\nexport function pedersen(x, y) {\n let point = PEDERSEN_POINTS[0];\n point = pedersenSingle(point, x, PEDERSEN_POINTS1);\n point = pedersenSingle(point, y, PEDERSEN_POINTS2);\n return extractX(point.toRawBytes(true));\n}\nexport function hashChain(data, fn = pedersen) {\n if (!Array.isArray(data) || data.length < 1)\n throw new Error('data should be array of at least 1 element');\n if (data.length === 1)\n return numberTo0x16(pedersenArg(data[0]));\n return Array.from(data)\n .reverse()\n .reduce((acc, i) => fn(i, acc));\n}\nexport const computeHashOnElements = (data, fn = pedersen) => [0, ...data, data.length].reduce((x, y) => fn(x, y));\nconst MASK_250 = u.bitMask(250);\nexport const keccak = (data) => u.bytesToNumberBE(keccak_256(data)) & MASK_250;\nconst sha256Num = (data) => u.bytesToNumberBE(sha256(data));\nexport const Fp253 = Field(BigInt('14474011154664525231415395255581126252639794253786371766033694892385558855681'));\nexport const Fp251 = Field(BigInt('3618502788666131213697322783095070105623107215331596699973092056135872020481'));\nfunction poseidonRoundConstant(Fp, name, idx) {\n const val = Fp.fromBytes(sha256(utf8ToBytes(`${name}${idx}`)));\n return Fp.create(val);\n}\nexport function _poseidonMDS(Fp, name, m, attempt = 0) {\n const x_values = [];\n const y_values = [];\n for (let i = 0; i < m; i++) {\n x_values.push(poseidonRoundConstant(Fp, `${name}x`, attempt * m + i));\n y_values.push(poseidonRoundConstant(Fp, `${name}y`, attempt * m + i));\n }\n if (new Set([...x_values, ...y_values]).size !== 2 * m)\n throw new Error('X and Y values are not distinct');\n return x_values.map((x) => y_values.map((y) => Fp.inv(Fp.sub(x, y))));\n}\nconst MDS_SMALL = [\n [3, 1, 1],\n [1, -1, 1],\n [1, 1, -2],\n].map((i) => i.map(BigInt));\nexport function poseidonBasic(opts, mds) {\n validateField(opts.Fp);\n if (!Number.isSafeInteger(opts.rate) || !Number.isSafeInteger(opts.capacity))\n throw new Error(`Wrong poseidon opts: ${opts}`);\n const m = opts.rate + opts.capacity;\n const rounds = opts.roundsFull + opts.roundsPartial;\n const roundConstants = [];\n for (let i = 0; i < rounds; i++) {\n const row = [];\n for (let j = 0; j < m; j++)\n row.push(poseidonRoundConstant(opts.Fp, 'Hades', m * i + j));\n roundConstants.push(row);\n }\n const res = poseidon({\n ...opts,\n t: m,\n sboxPower: 3,\n reversePartialPowIdx: true,\n mds,\n roundConstants,\n });\n res.m = m;\n res.rate = opts.rate;\n res.capacity = opts.capacity;\n return res;\n}\nexport function poseidonCreate(opts, mdsAttempt = 0) {\n const m = opts.rate + opts.capacity;\n if (!Number.isSafeInteger(mdsAttempt))\n throw new Error(`Wrong mdsAttempt=${mdsAttempt}`);\n return poseidonBasic(opts, _poseidonMDS(opts.Fp, 'HadesMDS', m, mdsAttempt));\n}\nexport const poseidonSmall = poseidonBasic({ Fp: Fp251, rate: 2, capacity: 1, roundsFull: 8, roundsPartial: 83 }, MDS_SMALL);\nexport function poseidonHash(x, y, fn = poseidonSmall) {\n return fn([x, y, 2n])[0];\n}\nexport function poseidonHashFunc(x, y, fn = poseidonSmall) {\n return u.numberToVarBytesBE(poseidonHash(u.bytesToNumberBE(x), u.bytesToNumberBE(y), fn));\n}\nexport function poseidonHashSingle(x, fn = poseidonSmall) {\n return fn([x, 0n, 1n])[0];\n}\nexport function poseidonHashMany(values, fn = poseidonSmall) {\n const { m, rate } = fn;\n if (!Array.isArray(values))\n throw new Error('bigint array expected in values');\n const padded = Array.from(values);\n padded.push(1n);\n while (padded.length % rate !== 0)\n padded.push(0n);\n let state = new Array(m).fill(0n);\n for (let i = 0; i < padded.length; i += rate) {\n for (let j = 0; j < rate; j++)\n state[j] += padded[i + j];\n state = fn(state);\n }\n return state[0];\n}\n","export function number(n: number) {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error(`Wrong positive integer: ${n}`);\n}\n\nexport function bool(b: boolean) {\n if (typeof b !== 'boolean') throw new Error(`Expected boolean, not ${b}`);\n}\n\nexport function bytes(b: Uint8Array | undefined, ...lengths: number[]) {\n if (!(b instanceof Uint8Array)) throw new TypeError('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\n\ntype Hash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\nexport function hash(hash: Hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\n\nexport function exists(instance: any, checkFinished = true) {\n if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');\n}\nexport function output(out: any, instance: any) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\n\nconst assert = {\n number,\n bool,\n bytes,\n hash,\n exists,\n output,\n};\n\nexport default assert;\n","const U32_MASK64 = BigInt(2 ** 32 - 1);\nconst _32n = BigInt(32);\n\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nexport function fromBig(n: bigint, le = false) {\n if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n\nexport function split(lst: bigint[], le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n\nexport const toBig = (h: number, l: number) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h: number, l: number, s: number) => h >>> s;\nconst shrSL = (h: number, l: number, s: number) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h: number, l: number, s: number) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h: number, l: number, s: number) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h: number, l: number, s: number) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h: number, l: number, s: number) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (h: number, l: number) => l;\nconst rotr32L = (h: number, l: number) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h: number, l: number, s: number) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h: number, l: number, s: number) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h: number, l: number, s: number) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h: number, l: number, s: number) => (h << (s - 32)) | (l >>> (64 - s));\n\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\n// Removing \"export\" has 5% perf penalty -_-\nexport function add(Ah: number, Al: number, Bh: number, Bl: number) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al: number, Bl: number, Cl: number) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low: number, Ah: number, Bh: number, Ch: number) =>\n (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al: number, Bl: number, Cl: number, Dl: number) =>\n (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number) =>\n (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number) =>\n (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) =>\n (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n","declare const globalThis: Record | undefined;\nexport const crypto =\n typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// We use `globalThis.crypto`, but node.js versions earlier than v19 don't\n// declare it in global scope. For node.js, package.json#exports field mapping\n// rewrites import from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n// Cast array to different type\nexport const u8 = (arr: TypedArray) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr: TypedArray) =>\n new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n\n// Cast array to view\nexport const createView = (arr: TypedArray) =>\n new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word: number, shift: number) => (word << (32 - shift)) | (word >>> shift);\n\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE) throw new Error('Non little-endian hardware is not supported');\n\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])) // 'deadbeef'\n */\nexport function bytesToHex(uint8a: Uint8Array): string {\n // pre-caching improves the speed 6x\n if (!(uint8a instanceof Uint8Array)) throw new Error('Uint8Array expected');\n let hex = '';\n for (let i = 0; i < uint8a.length; i++) {\n hex += hexes[uint8a[i]];\n }\n return hex;\n}\n\n/**\n * @example hexToBytes('deadbeef') // Uint8Array.from([0xde, 0xad, 0xbe, 0xef])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') {\n throw new TypeError('hexToBytes: expected string, got ' + typeof hex);\n }\n if (hex.length % 2) throw new Error('hexToBytes: received invalid unpadded hex');\n const array = new Uint8Array(hex.length / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0) throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => {};\n\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters: number, tick: number, cb: (i: number) => void) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick) continue;\n await nextTick();\n ts += diff;\n }\n}\n\n// Global symbols in both browsers and Node.js since v11\n// See https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\ndeclare const TextDecoder: any;\n\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') {\n throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`);\n }\n return new TextEncoder().encode(str);\n}\n\nexport type Input = Uint8Array | string;\nexport function toBytes(data: Input): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n if (!(data instanceof Uint8Array))\n throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`);\n return data;\n}\n\n/**\n * Concats Uint8Array-s into one; like `Buffer.concat([buf1, buf2])`\n * @example concatBytes(buf1, buf2)\n */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n if (!arrays.every((a) => a instanceof Uint8Array)) throw new Error('Uint8Array list expected');\n if (arrays.length === 1) return arrays[0];\n const length = arrays.reduce((a, arr) => a + arr.length, 0);\n const result = new Uint8Array(length);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const arr = arrays[i];\n result.set(arr, pad);\n pad += arr.length;\n }\n return result;\n}\n\n// For runtime check if class implements interface\nexport abstract class Hash> {\n abstract blockLen: number; // Bytes per block\n abstract outputLen: number; // Bytes in output\n abstract update(buf: Input): this;\n // Writes digest into buf\n abstract digestInto(buf: Uint8Array): void;\n abstract digest(): Uint8Array;\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n abstract destroy(): void;\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n abstract _cloneInto(to?: T): T;\n // Safe version that clones internal state\n clone(): T {\n return this._cloneInto();\n }\n}\n\n/**\n * XOF: streaming API to read digest in chunks.\n * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.\n * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot\n * destroy state, next call can require more bytes.\n */\nexport type HashXOF> = Hash & {\n xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream\n xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf\n};\n\n// Check if object doens't have custom constructor (like Uint8Array/Array)\nconst isPlainObject = (obj: any) =>\n Object.prototype.toString.call(obj) === '[object Object]' && obj.constructor === Object;\n\ntype EmptyObj = {};\nexport function checkOpts(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && (typeof opts !== 'object' || !isPlainObject(opts)))\n throw new TypeError('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged as T1 & T2;\n}\n\nexport type CHash = ReturnType;\n\nexport function wrapConstructor>(hashConstructor: () => Hash) {\n const hashC = (message: Input): Uint8Array => hashConstructor().update(toBytes(message)).digest();\n const tmp = hashConstructor();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashConstructor();\n return hashC;\n}\n\nexport function wrapConstructorWithOpts, T extends Object>(\n hashCons: (opts?: T) => Hash\n) {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts: T) => hashCons(opts);\n return hashC;\n}\n\n/**\n * Secure PRNG. Uses `globalThis.crypto` or node.js crypto module.\n */\nexport function randomBytes(bytesLength = 32): Uint8Array {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n","import assert from './_assert.js';\nimport u64 from './_u64.js';\nimport {\n Hash,\n u32,\n Input,\n toBytes,\n wrapConstructor,\n wrapConstructorWithOpts,\n HashXOF,\n} from './utils.js';\n\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA]: [number[], number[], bigint[]] = [[], [], []];\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\nconst _0x71n = BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n) t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = u64.split(_SHA3_IOTA, true);\n\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h: number, l: number, s: number) =>\n s > 32 ? u64.rotlBH(h, l, s) : u64.rotlSH(h, l, s);\nconst rotlL = (h: number, l: number, s: number) =>\n s > 32 ? u64.rotlBL(h, l, s) : u64.rotlSL(h, l, s);\n\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s: Uint32Array, rounds: number = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++) B[x] = s[y + x];\n for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\n\nexport class Keccak extends Hash implements HashXOF {\n protected state: Uint8Array;\n protected pos = 0;\n protected posOut = 0;\n protected finished = false;\n protected state32: Uint32Array;\n protected destroyed = false;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(\n public blockLen: number,\n public suffix: number,\n public outputLen: number,\n protected enableXOF = false,\n protected rounds: number = 24\n ) {\n super();\n // Can be passed from user as dkLen\n assert.number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n protected keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data: Input) {\n assert.exists(this);\n const { blockLen, state } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen) this.keccak();\n }\n return this;\n }\n protected finish() {\n if (this.finished) return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n protected writeInto(out: Uint8Array): Uint8Array {\n assert.exists(this, false);\n assert.bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len; ) {\n if (this.posOut >= blockLen) this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out: Uint8Array): Uint8Array {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF) throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes: number): Uint8Array {\n assert.number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out: Uint8Array) {\n assert.output(out, this);\n if (this.finished) throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to?: Keccak): Keccak {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\n\nconst gen = (suffix: number, blockLen: number, outputLen: number) =>\n wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\n\nexport const sha3_224 = gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = gen(0x06, 136, 256 / 8);\nexport const sha3_384 = gen(0x06, 104, 384 / 8);\nexport const sha3_512 = gen(0x06, 72, 512 / 8);\nexport const keccak_224 = gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = gen(0x01, 136, 256 / 8);\nexport const keccak_384 = gen(0x01, 104, 384 / 8);\nexport const keccak_512 = gen(0x01, 72, 512 / 8);\n\nexport type ShakeOpts = { dkLen?: number };\n\nconst genShake = (suffix: number, blockLen: number, outputLen: number) =>\n wrapConstructorWithOpts(\n (opts: ShakeOpts = {}) =>\n new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)\n );\n\nexport const shake128 = genShake(0x1f, 168, 128 / 8);\nexport const shake256 = genShake(0x1f, 136, 256 / 8);\n","import assert from './_assert.js';\nimport { Hash, createView, Input, toBytes } from './utils.js';\n\n// Polyfill for Safari 14\nfunction setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void {\n if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n\n// Base SHA2 class (RFC 6234)\nexport abstract class SHA2> extends Hash {\n protected abstract process(buf: DataView, offset: number): void;\n protected abstract get(): number[];\n protected abstract set(...args: number[]): void;\n abstract destroy(): void;\n protected abstract roundClean(): void;\n // For partial updates less than block size\n protected buffer: Uint8Array;\n protected view: DataView;\n protected finished = false;\n protected length = 0;\n protected pos = 0;\n protected destroyed = false;\n\n constructor(\n readonly blockLen: number,\n public outputLen: number,\n readonly padOffset: number,\n readonly isLE: boolean\n ) {\n super();\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data: Input): this {\n assert.exists(this);\n const { view, buffer, blockLen } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out: Uint8Array) {\n assert.exists(this);\n assert.output(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n this.buffer.subarray(pos).fill(0);\n // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++) buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to?: T): T {\n to ||= new (this.constructor as any)() as T;\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.length = length;\n to.pos = pos;\n to.finished = finished;\n to.destroyed = destroyed;\n if (length % blockLen) to.buffer.set(buffer);\n return to;\n }\n}\n","import { SHA2 } from './_sha2.js';\nimport { rotr, wrapConstructor } from './utils.js';\n\n// Choice: a ? b : c\nconst Chi = (a: number, b: number, c: number) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a: number, b: number, c: number) => (a & b) ^ (a & c) ^ (b & c);\n\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n// prettier-ignore\nconst IV = new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = new Uint32Array(64);\nclass SHA256 extends SHA2 {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n A = IV[0] | 0;\n B = IV[1] | 0;\n C = IV[2] | 0;\n D = IV[3] | 0;\n E = IV[4] | 0;\n F = IV[5] | 0;\n G = IV[6] | 0;\n H = IV[7] | 0;\n\n constructor() {\n super(64, 32, 8, false);\n }\n protected get(): [number, number, number, number, number, number, number, number] {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n protected set(\n A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number\n ) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n protected roundClean() {\n SHA256_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n A = 0xc1059ed8 | 0;\n B = 0x367cd507 | 0;\n C = 0x3070dd17 | 0;\n D = 0xf70e5939 | 0;\n E = 0xffc00b31 | 0;\n F = 0x68581511 | 0;\n G = 0x64f98fa7 | 0;\n H = 0xbefa4fa4 | 0;\n constructor() {\n super();\n this.outputLen = 28;\n }\n}\n\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = wrapConstructor(() => new SHA256());\nexport const sha224 = wrapConstructor(() => new SHA224());\n","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Utilities for modular arithmetics and finite fields\nimport {\n bitMask,\n numberToBytesBE,\n numberToBytesLE,\n bytesToNumberBE,\n bytesToNumberLE,\n ensureBytes,\n validateObject,\n} from './utils.js';\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n\n// Calculates a modulo b\nexport function mod(a: bigint, b: bigint): bigint {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently exponentiate num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * powMod(2n, 6n, 11n) // 64n % 11n == 9n\n */\n// TODO: use field version && remove\nexport function pow(num: bigint, power: bigint, modulo: bigint): bigint {\n if (modulo <= _0n || power < _0n) throw new Error('Expected power/modulo > 0');\n if (modulo === _1n) return _0n;\n let res = _1n;\n while (power > _0n) {\n if (power & _1n) res = (res * num) % modulo;\n num = (num * num) % modulo;\n power >>= _1n;\n }\n return res;\n}\n\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nexport function pow2(x: bigint, power: bigint, modulo: bigint): bigint {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n\n// Inverses number over modulo\nexport function invert(number: bigint, modulo: bigint): bigint {\n if (number === _0n || modulo <= _0n) {\n throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n }\n // Eucledian GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n) throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n\n// Tonelli-Shanks algorithm\n// Paper 1: https://eprint.iacr.org/2012/685.pdf (page 12)\n// Paper 2: Square Roots from 1; 24, 51, 10 to Dan Shanks\nexport function tonelliShanks(P: bigint) {\n // Legendre constant: used to calculate Legendre symbol (a | p),\n // which denotes the value of a^((p-1)/2) (mod p).\n // (a | p) ≡ 1 if a is a square (mod p)\n // (a | p) ≡ -1 if a is not a square (mod p)\n // (a | p) ≡ 0 if a ≡ 0 (mod p)\n const legendreC = (P - _1n) / _2n;\n\n let Q: bigint, S: number, Z: bigint;\n // Step 1: By factoring out powers of 2 from p - 1,\n // find q and s such that p - 1 = q*(2^s) with q odd\n for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++);\n\n // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq\n for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++);\n\n // Fast-path\n if (S === 1) {\n const p1div4 = (P + _1n) / _4n;\n return function tonelliFast(Fp: IField, n: T) {\n const root = Fp.pow(n, p1div4);\n if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root');\n return root;\n };\n }\n\n // Slow-path\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp: IField, n: T): T {\n // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1\n if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE)) throw new Error('Cannot find square root');\n let r = S;\n // TODO: will fail at Fp2/etc\n let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b\n let x = Fp.pow(n, Q1div2); // first guess at the square root\n let b = Fp.pow(n, Q); // first guess at the fudge factor\n\n while (!Fp.eql(b, Fp.ONE)) {\n if (Fp.eql(b, Fp.ZERO)) return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)\n // Find m such b^(2^m)==1\n let m = 1;\n for (let t2 = Fp.sqr(b); m < r; m++) {\n if (Fp.eql(t2, Fp.ONE)) break;\n t2 = Fp.sqr(t2); // t2 *= t2\n }\n // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow\n const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)\n g = Fp.sqr(ge); // g = ge * ge\n x = Fp.mul(x, ge); // x *= ge\n b = Fp.mul(b, g); // b *= g\n r = m;\n }\n return x;\n };\n}\n\nexport function FpSqrt(P: bigint) {\n // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.\n // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n\n // P ≡ 3 (mod 4)\n // √n = n^((P+1)/4)\n if (P % _4n === _3n) {\n // Not all roots possible!\n // const ORDER =\n // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;\n // const NUM = 72057594037927816n;\n const p1div4 = (P + _1n) / _4n;\n return function sqrt3mod4(Fp: IField, n: T) {\n const root = Fp.pow(n, p1div4);\n // Throw if root**2 != n\n if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root');\n return root;\n };\n }\n\n // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)\n if (P % _8n === _5n) {\n const c1 = (P - _5n) / _8n;\n return function sqrt5mod8(Fp: IField, n: T) {\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, c1);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n)) throw new Error('Cannot find square root');\n return root;\n };\n }\n\n // P ≡ 9 (mod 16)\n if (P % _16n === _9n) {\n // NOTE: tonelli is too slow for bls-Fp2 calculations even on start\n // Means we cannot use sqrt for constants at all!\n //\n // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n // sqrt = (x) => {\n // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4\n // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x\n // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x\n // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x\n // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n // }\n }\n\n // Other cases: Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num: bigint, modulo: bigint) => (mod(num, modulo) & _1n) === _1n;\n\n// Currently completly inconsistent naming:\n// - readable: add, mul, sqr, sqrt, inv, div, pow, eq, sub\n// - unreadable mess: addition, multiply, square, squareRoot, inversion, divide, power, equals, subtract\n\n// Field is not always over prime, Fp2 for example has ORDER(q)=p^m\nexport interface IField {\n ORDER: bigint;\n BYTES: number;\n BITS: number;\n MASK: bigint;\n ZERO: T;\n ONE: T;\n // 1-arg\n create: (num: T) => T;\n isValid: (num: T) => boolean;\n is0: (num: T) => boolean;\n neg(num: T): T;\n inv(num: T): T;\n sqrt(num: T): T;\n sqr(num: T): T;\n // 2-args\n eql(lhs: T, rhs: T): boolean;\n add(lhs: T, rhs: T): T;\n sub(lhs: T, rhs: T): T;\n mul(lhs: T, rhs: T | bigint): T;\n pow(lhs: T, power: bigint): T;\n div(lhs: T, rhs: T | bigint): T;\n // N for NonNormalized (for now)\n addN(lhs: T, rhs: T): T;\n subN(lhs: T, rhs: T): T;\n mulN(lhs: T, rhs: T | bigint): T;\n sqrN(num: T): T;\n\n // Optional\n // Should be same as sgn0 function in https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/\n // NOTE: sgn0 is 'negative in LE', which is same as odd. And negative in LE is kinda strange definition anyway.\n isOdd?(num: T): boolean; // Odd instead of even since we have it for Fp2\n // legendre?(num: T): T;\n pow(lhs: T, power: bigint): T;\n invertBatch: (lst: T[]) => T[];\n toBytes(num: T): Uint8Array;\n fromBytes(bytes: Uint8Array): T;\n // If c is False, CMOV returns a, otherwise it returns b.\n cmov(a: T, b: T, c: boolean): T;\n}\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n] as const;\nexport function validateField(field: IField) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n } as Record;\n const opts = FIELD_FIELDS.reduce((map, val: string) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n\n// Generic field functions\nexport function FpPow(f: IField, num: T, power: bigint): T {\n // Should have same speed as pow for bigints\n // TODO: benchmark!\n if (power < _0n) throw new Error('Expected power > 0');\n if (power === _0n) return f.ONE;\n if (power === _1n) return num;\n let p = f.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n) p = f.mul(p, d);\n d = f.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n\n// 0 is non-invertible: non-batched version will throw on 0\nexport function FpInvertBatch(f: IField, nums: T[]): T[] {\n const tmp = new Array(nums.length);\n // Walk from first to last, multiply them by each other MOD p\n const lastMultiplied = nums.reduce((acc, num, i) => {\n if (f.is0(num)) return acc;\n tmp[i] = acc;\n return f.mul(acc, num);\n }, f.ONE);\n // Invert last element\n const inverted = f.inv(lastMultiplied);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (f.is0(num)) return acc;\n tmp[i] = f.mul(acc, tmp[i]);\n return f.mul(acc, num);\n }, inverted);\n return tmp;\n}\n\nexport function FpDiv(f: IField, lhs: T, rhs: T | bigint): T {\n return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));\n}\n\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(f: IField) {\n const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic\n return (x: T): boolean => {\n const p = f.pow(x, legendreConst);\n return f.eql(p, f.ZERO) || f.eql(p, f.ONE);\n };\n}\n\n// CURVE.n lengths\nexport function nLength(n: bigint, nBitLength?: number) {\n // Bit size, byte size of CURVE.n\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n\ntype FpField = IField & Required, 'isOdd'>>;\n/**\n * Initializes a galois field over prime. Non-primes are not supported for now.\n * Do not init in loop: slow. Very fragile: always run a benchmark on change.\n * Major performance gains:\n * a) non-normalized operations like mulN instead of mul\n * b) `Object.freeze`\n * c) Same object shape: never add or remove keys\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(\n ORDER: bigint,\n bitLen?: number,\n isLE = false,\n redef: Partial> = {}\n): Readonly {\n if (ORDER <= _0n) throw new Error(`Expected Fp ORDER > 0, got ${ORDER}`);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048) throw new Error('Field lengths over 2048 bytes are not supported');\n const sqrtP = FpSqrt(ORDER);\n const f: Readonly = Object.freeze({\n ORDER,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt || ((n) => sqrtP(f, n)),\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // TODO: do we really need constant cmov?\n // We don't have const-time bigints anyway, so probably will be not very useful\n cmov: (a, b, c) => (c ? b : a),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n } as FpField);\n return Object.freeze(f);\n}\n\nexport function FpSqrtOdd(Fp: IField, elm: T) {\n if (!Fp.isOdd) throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\n\nexport function FpSqrtEven(Fp: IField, elm: T) {\n if (!Fp.isOdd) throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n\n/**\n * FIPS 186 B.4.1-compliant \"constant-time\" private key generation utility.\n * Can take (n+8) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being neglible.\n * Needs at least 40 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * @param hash hash output from SHA3 or a similar function\n * @returns valid private scalar\n */\nexport function hashToPrivateScalar(\n hash: string | Uint8Array,\n groupOrder: bigint,\n isLE = false\n): bigint {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Poseidon Hash: https://eprint.iacr.org/2019/458.pdf, https://www.poseidon-hash.info\nimport { IField, FpPow, validateField } from './modular.js';\n// We don't provide any constants, since different implementations use different constants.\n// For reference constants see './test/poseidon.test.js'.\nexport type PoseidonOpts = {\n Fp: IField;\n t: number;\n roundsFull: number;\n roundsPartial: number;\n sboxPower?: number;\n reversePartialPowIdx?: boolean; // Hack for stark\n mds: bigint[][];\n roundConstants: bigint[][];\n};\n\nexport function validateOpts(opts: PoseidonOpts) {\n const { Fp } = opts;\n validateField(Fp);\n for (const i of ['t', 'roundsFull', 'roundsPartial'] as const) {\n if (typeof opts[i] !== 'number' || !Number.isSafeInteger(opts[i]))\n throw new Error(`Poseidon: invalid param ${i}=${opts[i]} (${typeof opts[i]})`);\n }\n if (opts.reversePartialPowIdx !== undefined && typeof opts.reversePartialPowIdx !== 'boolean')\n throw new Error(`Poseidon: invalid param reversePartialPowIdx=${opts.reversePartialPowIdx}`);\n // Default is 5, but by some reasons stark uses 3\n let sboxPower = opts.sboxPower;\n if (sboxPower === undefined) sboxPower = 5;\n if (typeof sboxPower !== 'number' || !Number.isSafeInteger(sboxPower))\n throw new Error(`Poseidon wrong sboxPower=${sboxPower}`);\n\n const _sboxPower = BigInt(sboxPower);\n let sboxFn = (n: bigint) => FpPow(Fp, n, _sboxPower);\n // Unwrapped sbox power for common cases (195->142μs)\n if (sboxPower === 3) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(n), n);\n else if (sboxPower === 5) sboxFn = (n: bigint) => Fp.mul(Fp.sqrN(Fp.sqrN(n)), n);\n\n if (opts.roundsFull % 2 !== 0)\n throw new Error(`Poseidon roundsFull is not even: ${opts.roundsFull}`);\n const rounds = opts.roundsFull + opts.roundsPartial;\n\n if (!Array.isArray(opts.roundConstants) || opts.roundConstants.length !== rounds)\n throw new Error('Poseidon: wrong round constants');\n const roundConstants = opts.roundConstants.map((rc) => {\n if (!Array.isArray(rc) || rc.length !== opts.t)\n throw new Error(`Poseidon wrong round constants: ${rc}`);\n return rc.map((i) => {\n if (typeof i !== 'bigint' || !Fp.isValid(i))\n throw new Error(`Poseidon wrong round constant=${i}`);\n return Fp.create(i);\n });\n });\n // MDS is TxT matrix\n if (!Array.isArray(opts.mds) || opts.mds.length !== opts.t)\n throw new Error('Poseidon: wrong MDS matrix');\n const mds = opts.mds.map((mdsRow) => {\n if (!Array.isArray(mdsRow) || mdsRow.length !== opts.t)\n throw new Error(`Poseidon MDS matrix row: ${mdsRow}`);\n return mdsRow.map((i) => {\n if (typeof i !== 'bigint') throw new Error(`Poseidon MDS matrix value=${i}`);\n return Fp.create(i);\n });\n });\n return Object.freeze({ ...opts, rounds, sboxFn, roundConstants, mds });\n}\n\nexport function splitConstants(rc: bigint[], t: number) {\n if (typeof t !== 'number') throw new Error('poseidonSplitConstants: wrong t');\n if (!Array.isArray(rc) || rc.length % t) throw new Error('poseidonSplitConstants: wrong rc');\n const res = [];\n let tmp = [];\n for (let i = 0; i < rc.length; i++) {\n tmp.push(rc[i]);\n if (tmp.length === t) {\n res.push(tmp);\n tmp = [];\n }\n }\n return res;\n}\n\nexport function poseidon(opts: PoseidonOpts) {\n const { t, Fp, rounds, sboxFn, reversePartialPowIdx } = validateOpts(opts);\n const halfRoundsFull = Math.floor(opts.roundsFull / 2);\n const partialIdx = reversePartialPowIdx ? t - 1 : 0;\n const poseidonRound = (values: bigint[], isFull: boolean, idx: number) => {\n values = values.map((i, j) => Fp.add(i, opts.roundConstants[idx][j]));\n\n if (isFull) values = values.map((i) => sboxFn(i));\n else values[partialIdx] = sboxFn(values[partialIdx]);\n // Matrix multiplication\n values = opts.mds.map((i) =>\n i.reduce((acc, i, j) => Fp.add(acc, Fp.mulN(i, values[j])), Fp.ZERO)\n );\n return values;\n };\n const poseidonHash = function poseidonHash(values: bigint[]) {\n if (!Array.isArray(values) || values.length !== t)\n throw new Error(`Poseidon: wrong values (expected array of bigints with length ${t})`);\n values = values.map((i) => {\n if (typeof i !== 'bigint') throw new Error(`Poseidon: wrong value=${i} (${typeof i})`);\n return Fp.create(i);\n });\n let round = 0;\n // Apply r_f/2 full rounds.\n for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, round++);\n // Apply r_p partial rounds.\n for (let i = 0; i < opts.roundsPartial; i++) values = poseidonRound(values, false, round++);\n // Apply r_f/2 full rounds.\n for (let i = 0; i < halfRoundsFull; i++) values = poseidonRound(values, true, round++);\n\n if (round !== rounds)\n throw new Error(`Poseidon: wrong number of rounds: last round=${round}, total=${rounds}`);\n return values;\n };\n // For verification in tests\n poseidonHash.roundConstants = opts.roundConstants;\n return poseidonHash;\n}\n","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Short Weierstrass curve. The formula is: y² = x³ + ax + b\nimport * as mod from './modular.js';\nimport * as ut from './utils.js';\nimport { CHash, Hex, PrivKey, ensureBytes } from './utils.js';\nimport { Group, GroupConstructor, wNAF, BasicCurve, validateBasic, AffinePoint } from './curve.js';\n\nexport type { AffinePoint };\ntype HmacFnSync = (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;\ntype EndomorphismOpts = {\n beta: bigint;\n splitScalar: (k: bigint) => { k1neg: boolean; k1: bigint; k2neg: boolean; k2: bigint };\n};\nexport type BasicWCurve = BasicCurve & {\n // Params: a, b\n a: T;\n b: T;\n\n // Optional params\n allowedPrivateKeyLengths?: readonly number[]; // for P521\n wrapPrivateKey?: boolean; // bls12-381 requires mod(n) instead of rejecting keys >= n\n endo?: EndomorphismOpts; // Endomorphism options for Koblitz curves\n // When a cofactor != 1, there can be an effective methods to:\n // 1. Determine whether a point is torsion-free\n isTorsionFree?: (c: ProjConstructor, point: ProjPointType) => boolean;\n // 2. Clear torsion component\n clearCofactor?: (c: ProjConstructor, point: ProjPointType) => ProjPointType;\n};\n\ntype Entropy = Hex | true;\nexport type SignOpts = { lowS?: boolean; extraEntropy?: Entropy; prehash?: boolean };\nexport type VerOpts = { lowS?: boolean; prehash?: boolean };\n\n/**\n * ### Design rationale for types\n *\n * * Interaction between classes from different curves should fail:\n * `k256.Point.BASE.add(p256.Point.BASE)`\n * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime\n * * Different calls of `curve()` would return different classes -\n * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve,\n * it won't affect others\n *\n * TypeScript can't infer types for classes created inside a function. Classes is one instance of nominative types in TypeScript and interfaces only check for shape, so it's hard to create unique type for every function call.\n *\n * We can use generic types via some param, like curve opts, but that would:\n * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params)\n * which is hard to debug.\n * 2. Params can be generic and we can't enforce them to be constant value:\n * if somebody creates curve from non-constant params,\n * it would be allowed to interact with other curves with non-constant params\n *\n * TODO: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol\n */\n\n// Instance for 3d XYZ points\nexport interface ProjPointType extends Group> {\n readonly px: T;\n readonly py: T;\n readonly pz: T;\n get x(): T;\n get y(): T;\n multiply(scalar: bigint): ProjPointType;\n toAffine(iz?: T): AffinePoint;\n isTorsionFree(): boolean;\n clearCofactor(): ProjPointType;\n assertValidity(): void;\n hasEvenY(): boolean;\n toRawBytes(isCompressed?: boolean): Uint8Array;\n toHex(isCompressed?: boolean): string;\n\n multiplyUnsafe(scalar: bigint): ProjPointType;\n multiplyAndAddUnsafe(Q: ProjPointType, a: bigint, b: bigint): ProjPointType | undefined;\n _setWindowSize(windowSize: number): void;\n}\n// Static methods for 3d XYZ points\nexport interface ProjConstructor extends GroupConstructor> {\n new (x: T, y: T, z: T): ProjPointType;\n fromAffine(p: AffinePoint): ProjPointType;\n fromHex(hex: Hex): ProjPointType;\n fromPrivateKey(privateKey: PrivKey): ProjPointType;\n normalizeZ(points: ProjPointType[]): ProjPointType[];\n}\n\nexport type CurvePointsType = BasicWCurve & {\n // Bytes\n fromBytes?: (bytes: Uint8Array) => AffinePoint;\n toBytes?: (c: ProjConstructor, point: ProjPointType, isCompressed: boolean) => Uint8Array;\n};\n\nfunction validatePointOpts(curve: CurvePointsType) {\n const opts = validateBasic(curve);\n ut.validateObject(\n opts,\n {\n a: 'field',\n b: 'field',\n },\n {\n allowedPrivateKeyLengths: 'array',\n wrapPrivateKey: 'boolean',\n isTorsionFree: 'function',\n clearCofactor: 'function',\n allowInfinityPoint: 'boolean',\n fromBytes: 'function',\n toBytes: 'function',\n }\n );\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0');\n }\n if (\n typeof endo !== 'object' ||\n typeof endo.beta !== 'bigint' ||\n typeof endo.splitScalar !== 'function'\n ) {\n throw new Error('Expected endomorphism with beta: bigint and splitScalar: function');\n }\n }\n return Object.freeze({ ...opts } as const);\n}\n\nexport type CurvePointsRes = {\n ProjectivePoint: ProjConstructor;\n normPrivateKeyToScalar: (key: PrivKey) => bigint;\n weierstrassEquation: (x: T) => T;\n isWithinCurveOrder: (num: bigint) => boolean;\n};\n\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;\nexport const DER = {\n // asn.1 DER encoding utils\n Err: class DERErr extends Error {\n constructor(m = '') {\n super(m);\n }\n },\n _parseInt(data: Uint8Array): { d: bigint; l: Uint8Array } {\n const { Err: E } = DER;\n if (data.length < 2 || data[0] !== 0x02) throw new E('Invalid signature integer tag');\n const len = data[1];\n const res = data.subarray(2, len + 2);\n if (!len || res.length !== len) throw new E('Invalid signature integer: wrong length');\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n if (res[0] & 0b10000000) throw new E('Invalid signature integer: negative');\n if (res[0] === 0x00 && !(res[1] & 0b10000000))\n throw new E('Invalid signature integer: unnecessary leading zero');\n return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left\n },\n toSig(hex: string | Uint8Array): { r: bigint; s: bigint } {\n // parse DER signature\n const { Err: E } = DER;\n const data = typeof hex === 'string' ? h2b(hex) : hex;\n if (!(data instanceof Uint8Array)) throw new Error('ui8a expected');\n let l = data.length;\n if (l < 2 || data[0] != 0x30) throw new E('Invalid signature tag');\n if (data[1] !== l - 2) throw new E('Invalid signature: incorrect length');\n const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n if (rBytesLeft.length) throw new E('Invalid signature: left bytes after parsing');\n return { r, s };\n },\n hexFromSig(sig: { r: bigint; s: bigint }): string {\n // Add leading zero if first byte has negative bit enabled. More details in '_parseInt'\n const slice = (s: string): string => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s);\n const h = (num: number | bigint) => {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n };\n const s = slice(h(sig.s));\n const r = slice(h(sig.r));\n const shl = s.length / 2;\n const rhl = r.length / 2;\n const sl = h(shl);\n const rl = h(rhl);\n return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;\n },\n};\n\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\n\nexport function weierstrassPoints(opts: CurvePointsType) {\n const CURVE = validatePointOpts(opts);\n const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n\n const toBytes =\n CURVE.toBytes ||\n ((c: ProjConstructor, point: ProjPointType, isCompressed: boolean) => {\n const a = point.toAffine();\n return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n });\n const fromBytes =\n CURVE.fromBytes ||\n ((bytes: Uint8Array) => {\n // const head = bytes[0];\n const tail = bytes.subarray(1);\n // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n });\n\n /**\n * y² = x³ + ax + b: Short weierstrass curve formula\n * @returns y²\n */\n function weierstrassEquation(x: T): T {\n const { a, b } = CURVE;\n const x2 = Fp.sqr(x); // x * x\n const x3 = Fp.mul(x2, x); // x2 * x\n return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b\n }\n // Validate whether the passed curve params are valid.\n // We check if curve equation works for generator point.\n // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381.\n // ProjectivePoint class has not been initialized yet.\n if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))\n throw new Error('bad generator point: equation left != right');\n\n // Valid group elements reside in range 1..n-1\n function isWithinCurveOrder(num: bigint): boolean {\n return typeof num === 'bigint' && _0n < num && num < CURVE.n;\n }\n function assertGE(num: bigint) {\n if (!isWithinCurveOrder(num)) throw new Error('Expected valid bigint: 0 < bigint < curve.n');\n }\n // Validates if priv key is valid and converts it to bigint.\n // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n function normPrivateKeyToScalar(key: PrivKey): bigint {\n const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;\n if (lengths && typeof key !== 'bigint') {\n if (key instanceof Uint8Array) key = ut.bytesToHex(key);\n // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n if (typeof key !== 'string' || !lengths.includes(key.length)) throw new Error('Invalid key');\n key = key.padStart(nByteLength * 2, '0');\n }\n let num: bigint;\n try {\n num =\n typeof key === 'bigint'\n ? key\n : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n } catch (error) {\n throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);\n }\n if (wrapPrivateKey) num = mod.mod(num, n); // disabled by default, enabled for BLS\n assertGE(num); // num in range [1..N-1]\n return num;\n }\n\n const pointPrecomputes = new Map();\n function assertPrjPoint(other: unknown) {\n if (!(other instanceof Point)) throw new Error('ProjectivePoint expected');\n }\n /**\n * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)\n * Default Point works in 2d / affine coordinates: (x, y)\n * We're doing calculations in projective, because its operations don't require costly inversion.\n */\n class Point implements ProjPointType {\n static readonly BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n static readonly ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);\n\n constructor(readonly px: T, readonly py: T, readonly pz: T) {\n if (px == null || !Fp.isValid(px)) throw new Error('x required');\n if (py == null || !Fp.isValid(py)) throw new Error('y required');\n if (pz == null || !Fp.isValid(pz)) throw new Error('z required');\n }\n\n // Does not validate if the point is on-curve.\n // Use fromHex instead, or call assertValidity() later.\n static fromAffine(p: AffinePoint): Point {\n const { x, y } = p || {};\n if (!p || !Fp.isValid(x) || !Fp.isValid(y)) throw new Error('invalid affine point');\n if (p instanceof Point) throw new Error('projective point not allowed');\n const is0 = (i: T) => Fp.eql(i, Fp.ZERO);\n // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n if (is0(x) && is0(y)) return Point.ZERO;\n return new Point(x, y, Fp.ONE);\n }\n\n get x(): T {\n return this.toAffine().x;\n }\n get y(): T {\n return this.toAffine().y;\n }\n\n /**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\n static normalizeZ(points: Point[]): Point[] {\n const toInv = Fp.invertBatch(points.map((p) => p.pz));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n\n /**\n * Converts hash string or Uint8Array to Point.\n * @param hex short/long ECDSA hex\n */\n static fromHex(hex: Hex): Point {\n const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n P.assertValidity();\n return P;\n }\n\n // Multiplies generator point by privateKey.\n static fromPrivateKey(privateKey: PrivKey) {\n return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n }\n\n // We calculate precomputes for elliptic curve point multiplication\n // using windowed method. This specifies window size and\n // stores precomputed values. Usually only base point would be precomputed.\n _WINDOW_SIZE?: number;\n\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize: number) {\n this._WINDOW_SIZE = windowSize;\n pointPrecomputes.delete(this);\n }\n\n // A point on curve is valid if it conforms to equation.\n assertValidity(): void {\n // Zero is valid point too!\n if (this.is0()) {\n if (CURVE.allowInfinityPoint) return;\n throw new Error('bad point: ZERO');\n }\n // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n const { x, y } = this.toAffine();\n // Check if x, y are valid field elements\n if (!Fp.isValid(x) || !Fp.isValid(y)) throw new Error('bad point: x or y not FE');\n const left = Fp.sqr(y); // y²\n const right = weierstrassEquation(x); // x³ + ax + b\n if (!Fp.eql(left, right)) throw new Error('bad point: equation left != right');\n if (!this.isTorsionFree()) throw new Error('bad point: not in prime-order subgroup');\n }\n hasEvenY(): boolean {\n const { y } = this.toAffine();\n if (Fp.isOdd) return !Fp.isOdd(y);\n throw new Error(\"Field doesn't support isOdd\");\n }\n\n /**\n * Compare one point to another.\n */\n equals(other: Point): boolean {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n return U1 && U2;\n }\n\n /**\n * Flips point to one corresponding to (x, -y) in Affine coordinates.\n */\n negate(): Point {\n return new Point(this.px, Fp.neg(this.py), this.pz);\n }\n\n // Renes-Costello-Batina exception-free doubling formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 3\n // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n double() {\n const { a, b } = CURVE;\n const b3 = Fp.mul(b, _3n);\n const { px: X1, py: Y1, pz: Z1 } = this;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n let t0 = Fp.mul(X1, X1); // step 1\n let t1 = Fp.mul(Y1, Y1);\n let t2 = Fp.mul(Z1, Z1);\n let t3 = Fp.mul(X1, Y1);\n t3 = Fp.add(t3, t3); // step 5\n Z3 = Fp.mul(X1, Z1);\n Z3 = Fp.add(Z3, Z3);\n X3 = Fp.mul(a, Z3);\n Y3 = Fp.mul(b3, t2);\n Y3 = Fp.add(X3, Y3); // step 10\n X3 = Fp.sub(t1, Y3);\n Y3 = Fp.add(t1, Y3);\n Y3 = Fp.mul(X3, Y3);\n X3 = Fp.mul(t3, X3);\n Z3 = Fp.mul(b3, Z3); // step 15\n t2 = Fp.mul(a, t2);\n t3 = Fp.sub(t0, t2);\n t3 = Fp.mul(a, t3);\n t3 = Fp.add(t3, Z3);\n Z3 = Fp.add(t0, t0); // step 20\n t0 = Fp.add(Z3, t0);\n t0 = Fp.add(t0, t2);\n t0 = Fp.mul(t0, t3);\n Y3 = Fp.add(Y3, t0);\n t2 = Fp.mul(Y1, Z1); // step 25\n t2 = Fp.add(t2, t2);\n t0 = Fp.mul(t2, t3);\n X3 = Fp.sub(X3, t0);\n Z3 = Fp.mul(t2, t1);\n Z3 = Fp.add(Z3, Z3); // step 30\n Z3 = Fp.add(Z3, Z3);\n return new Point(X3, Y3, Z3);\n }\n\n // Renes-Costello-Batina exception-free addition formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 1\n // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n add(other: Point): Point {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n const a = CURVE.a;\n const b3 = Fp.mul(CURVE.b, _3n);\n let t0 = Fp.mul(X1, X2); // step 1\n let t1 = Fp.mul(Y1, Y2);\n let t2 = Fp.mul(Z1, Z2);\n let t3 = Fp.add(X1, Y1);\n let t4 = Fp.add(X2, Y2); // step 5\n t3 = Fp.mul(t3, t4);\n t4 = Fp.add(t0, t1);\n t3 = Fp.sub(t3, t4);\n t4 = Fp.add(X1, Z1);\n let t5 = Fp.add(X2, Z2); // step 10\n t4 = Fp.mul(t4, t5);\n t5 = Fp.add(t0, t2);\n t4 = Fp.sub(t4, t5);\n t5 = Fp.add(Y1, Z1);\n X3 = Fp.add(Y2, Z2); // step 15\n t5 = Fp.mul(t5, X3);\n X3 = Fp.add(t1, t2);\n t5 = Fp.sub(t5, X3);\n Z3 = Fp.mul(a, t4);\n X3 = Fp.mul(b3, t2); // step 20\n Z3 = Fp.add(X3, Z3);\n X3 = Fp.sub(t1, Z3);\n Z3 = Fp.add(t1, Z3);\n Y3 = Fp.mul(X3, Z3);\n t1 = Fp.add(t0, t0); // step 25\n t1 = Fp.add(t1, t0);\n t2 = Fp.mul(a, t2);\n t4 = Fp.mul(b3, t4);\n t1 = Fp.add(t1, t2);\n t2 = Fp.sub(t0, t2); // step 30\n t2 = Fp.mul(a, t2);\n t4 = Fp.add(t4, t2);\n t0 = Fp.mul(t1, t4);\n Y3 = Fp.add(Y3, t0);\n t0 = Fp.mul(t5, t4); // step 35\n X3 = Fp.mul(t3, X3);\n X3 = Fp.sub(X3, t0);\n t0 = Fp.mul(t3, t1);\n Z3 = Fp.mul(t5, Z3);\n Z3 = Fp.add(Z3, t0); // step 40\n return new Point(X3, Y3, Z3);\n }\n\n subtract(other: Point) {\n return this.add(other.negate());\n }\n\n private is0() {\n return this.equals(Point.ZERO);\n }\n private wNAF(n: bigint): { p: Point; f: Point } {\n return wnaf.wNAFCached(this, pointPrecomputes, n, (comp: Point[]) => {\n const toInv = Fp.invertBatch(comp.map((p) => p.pz));\n return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n });\n }\n\n /**\n * Non-constant-time multiplication. Uses double-and-add algorithm.\n * It's faster, but should only be used when you don't care about\n * an exposed private key e.g. sig verification, which works over *public* keys.\n */\n multiplyUnsafe(n: bigint): Point {\n const I = Point.ZERO;\n if (n === _0n) return I;\n assertGE(n); // Will throw on 0\n if (n === _1n) return this;\n const { endo } = CURVE;\n if (!endo) return wnaf.unsafeLadder(this, n);\n\n // Apply endomorphism\n let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let k1p = I;\n let k2p = I;\n let d: Point = this;\n while (k1 > _0n || k2 > _0n) {\n if (k1 & _1n) k1p = k1p.add(d);\n if (k2 & _1n) k2p = k2p.add(d);\n d = d.double();\n k1 >>= _1n;\n k2 >>= _1n;\n }\n if (k1neg) k1p = k1p.negate();\n if (k2neg) k2p = k2p.negate();\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n return k1p.add(k2p);\n }\n\n /**\n * Constant time multiplication.\n * Uses wNAF method. Windowed method may be 10% faster,\n * but takes 2x longer to generate and consumes 2x memory.\n * Uses precomputes when available.\n * Uses endomorphism for Koblitz curves.\n * @param scalar by which the point would be multiplied\n * @returns New point\n */\n multiply(scalar: bigint): Point {\n assertGE(scalar);\n let n = scalar;\n let point: Point, fake: Point; // Fake point is used to const-time mult\n const { endo } = CURVE;\n if (endo) {\n const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let { p: k1p, f: f1p } = this.wNAF(k1);\n let { p: k2p, f: f2p } = this.wNAF(k2);\n k1p = wnaf.constTimeNegate(k1neg, k1p);\n k2p = wnaf.constTimeNegate(k2neg, k2p);\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n point = k1p.add(k2p);\n fake = f1p.add(f2p);\n } else {\n const { p, f } = this.wNAF(n);\n point = p;\n fake = f;\n }\n // Normalize `z` for both points, but return only real one\n return Point.normalizeZ([point, fake])[0];\n }\n\n /**\n * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n * Not using Strauss-Shamir trick: precomputation tables are faster.\n * The trick could be useful if both P and Q are not G (not in our case).\n * @returns non-zero affine point\n */\n multiplyAndAddUnsafe(Q: Point, a: bigint, b: bigint): Point | undefined {\n const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n const mul = (\n P: Point,\n a: bigint // Select faster multiply() method\n ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n const sum = mul(this, a).add(mul(Q, b));\n return sum.is0() ? undefined : sum;\n }\n\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (x, y, z) ∋ (x=x/z, y=y/z)\n toAffine(iz?: T): AffinePoint {\n const { px: x, py: y, pz: z } = this;\n const is0 = this.is0();\n // If invZ was 0, we return zero point. However we still want to execute\n // all operations, so we replace invZ with a random number, 1.\n if (iz == null) iz = is0 ? Fp.ONE : Fp.inv(z);\n const ax = Fp.mul(x, iz);\n const ay = Fp.mul(y, iz);\n const zz = Fp.mul(z, iz);\n if (is0) return { x: Fp.ZERO, y: Fp.ZERO };\n if (!Fp.eql(zz, Fp.ONE)) throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n }\n isTorsionFree(): boolean {\n const { h: cofactor, isTorsionFree } = CURVE;\n if (cofactor === _1n) return true; // No subgroups, always torsion-free\n if (isTorsionFree) return isTorsionFree(Point, this);\n throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n }\n clearCofactor(): Point {\n const { h: cofactor, clearCofactor } = CURVE;\n if (cofactor === _1n) return this; // Fast-path\n if (clearCofactor) return clearCofactor(Point, this) as Point;\n return this.multiplyUnsafe(CURVE.h);\n }\n\n toRawBytes(isCompressed = true): Uint8Array {\n this.assertValidity();\n return toBytes(Point, this, isCompressed);\n }\n\n toHex(isCompressed = true): string {\n return ut.bytesToHex(this.toRawBytes(isCompressed));\n }\n }\n const _bits = CURVE.nBitLength;\n const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);\n // Validate if generator point is on curve\n return {\n CURVE,\n ProjectivePoint: Point as ProjConstructor,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n };\n}\n\n// Instance\nexport interface SignatureType {\n readonly r: bigint;\n readonly s: bigint;\n readonly recovery?: number;\n assertValidity(): void;\n addRecoveryBit(recovery: number): SignatureType;\n hasHighS(): boolean;\n normalizeS(): SignatureType;\n recoverPublicKey(msgHash: Hex): ProjPointType;\n toCompactRawBytes(): Uint8Array;\n toCompactHex(): string;\n // DER-encoded\n toDERRawBytes(isCompressed?: boolean): Uint8Array;\n toDERHex(isCompressed?: boolean): string;\n}\n// Static methods\nexport type SignatureConstructor = {\n new (r: bigint, s: bigint): SignatureType;\n fromCompact(hex: Hex): SignatureType;\n fromDER(hex: Hex): SignatureType;\n};\ntype SignatureLike = { r: bigint; s: bigint };\n\nexport type PubKey = Hex | ProjPointType;\n\nexport type CurveType = BasicWCurve & {\n hash: CHash; // CHash not FHash because we need outputLen for DRBG\n hmac: HmacFnSync;\n randomBytes: (bytesLength?: number) => Uint8Array;\n lowS?: boolean;\n bits2int?: (bytes: Uint8Array) => bigint;\n bits2int_modN?: (bytes: Uint8Array) => bigint;\n};\n\nfunction validateOpts(curve: CurveType) {\n const opts = validateBasic(curve);\n ut.validateObject(\n opts,\n {\n hash: 'hash',\n hmac: 'function',\n randomBytes: 'function',\n },\n {\n bits2int: 'function',\n bits2int_modN: 'function',\n lowS: 'boolean',\n }\n );\n return Object.freeze({ lowS: true, ...opts } as const);\n}\n\nexport type CurveFn = {\n CURVE: ReturnType;\n getPublicKey: (privateKey: PrivKey, isCompressed?: boolean) => Uint8Array;\n getSharedSecret: (privateA: PrivKey, publicB: Hex, isCompressed?: boolean) => Uint8Array;\n sign: (msgHash: Hex, privKey: PrivKey, opts?: SignOpts) => SignatureType;\n verify: (signature: Hex | SignatureLike, msgHash: Hex, publicKey: Hex, opts?: VerOpts) => boolean;\n ProjectivePoint: ProjConstructor;\n Signature: SignatureConstructor;\n utils: {\n normPrivateKeyToScalar: (key: PrivKey) => bigint;\n isValidPrivateKey(privateKey: PrivKey): boolean;\n randomPrivateKey: () => Uint8Array;\n precompute: (windowSize?: number, point?: ProjPointType) => ProjPointType;\n };\n};\n\nexport function weierstrass(curveDef: CurveType): CurveFn {\n const CURVE = validateOpts(curveDef) as ReturnType;\n const { Fp, n: CURVE_ORDER } = CURVE;\n const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n\n function isValidFieldElement(num: bigint): boolean {\n return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE\n }\n function modN(a: bigint) {\n return mod.mod(a, CURVE_ORDER);\n }\n function invN(a: bigint) {\n return mod.invert(a, CURVE_ORDER);\n }\n\n const {\n ProjectivePoint: Point,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n } = weierstrassPoints({\n ...CURVE,\n toBytes(c, point, isCompressed: boolean): Uint8Array {\n const a = point.toAffine();\n const x = Fp.toBytes(a.x);\n const cat = ut.concatBytes;\n if (isCompressed) {\n return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n } else {\n return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n }\n },\n fromBytes(bytes: Uint8Array) {\n const len = bytes.length;\n const head = bytes[0];\n const tail = bytes.subarray(1);\n // this.assertValidity() is done inside of fromHex\n if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n const x = ut.bytesToNumberBE(tail);\n if (!isValidFieldElement(x)) throw new Error('Point is not on curve');\n const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n const isYOdd = (y & _1n) === _1n;\n // ECDSA\n const isHeadOdd = (head & 1) === 1;\n if (isHeadOdd !== isYOdd) y = Fp.neg(y);\n return { x, y };\n } else if (len === uncompressedLen && head === 0x04) {\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n } else {\n throw new Error(\n `Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`\n );\n }\n },\n });\n const numToNByteStr = (num: bigint): string =>\n ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength));\n\n function isBiggerThanHalfOrder(number: bigint) {\n const HALF = CURVE_ORDER >> _1n;\n return number > HALF;\n }\n\n function normalizeS(s: bigint) {\n return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n }\n // slice bytes num\n const slcNum = (b: Uint8Array, from: number, to: number) => ut.bytesToNumberBE(b.slice(from, to));\n\n /**\n * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n */\n class Signature implements SignatureType {\n constructor(readonly r: bigint, readonly s: bigint, readonly recovery?: number) {\n this.assertValidity();\n }\n\n // pair (bytes of r, bytes of s)\n static fromCompact(hex: Hex) {\n const l = CURVE.nByteLength;\n hex = ensureBytes('compactSignature', hex, l * 2);\n return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n }\n\n // DER encoded ECDSA signature\n // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n static fromDER(hex: Hex) {\n const { r, s } = DER.toSig(ensureBytes('DER', hex));\n return new Signature(r, s);\n }\n\n assertValidity(): void {\n // can use assertGE here\n if (!isWithinCurveOrder(this.r)) throw new Error('r must be 0 < r < CURVE.n');\n if (!isWithinCurveOrder(this.s)) throw new Error('s must be 0 < s < CURVE.n');\n }\n\n addRecoveryBit(recovery: number) {\n return new Signature(this.r, this.s, recovery);\n }\n\n recoverPublicKey(msgHash: Hex): typeof Point.BASE {\n const { r, s, recovery: rec } = this;\n const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n if (rec == null || ![0, 1, 2, 3].includes(rec)) throw new Error('recovery id invalid');\n const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n if (radj >= Fp.ORDER) throw new Error('recovery id 2 or 3 invalid');\n const prefix = (rec & 1) === 0 ? '02' : '03';\n const R = Point.fromHex(prefix + numToNByteStr(radj));\n const ir = invN(radj); // r^-1\n const u1 = modN(-h * ir); // -hr^-1\n const u2 = modN(s * ir); // sr^-1\n const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n if (!Q) throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n Q.assertValidity();\n return Q;\n }\n\n // Signatures should be low-s, to prevent malleability.\n hasHighS(): boolean {\n return isBiggerThanHalfOrder(this.s);\n }\n\n normalizeS() {\n return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n }\n\n // DER-encoded\n toDERRawBytes() {\n return ut.hexToBytes(this.toDERHex());\n }\n toDERHex() {\n return DER.hexFromSig({ r: this.r, s: this.s });\n }\n\n // padded bytes of r, then padded bytes of s\n toCompactRawBytes() {\n return ut.hexToBytes(this.toCompactHex());\n }\n toCompactHex() {\n return numToNByteStr(this.r) + numToNByteStr(this.s);\n }\n }\n\n const utils = {\n isValidPrivateKey(privateKey: PrivKey) {\n try {\n normPrivateKeyToScalar(privateKey);\n return true;\n } catch (error) {\n return false;\n }\n },\n normPrivateKeyToScalar: normPrivateKeyToScalar,\n\n /**\n * Produces cryptographically secure private key from random of size (nBitLength+64)\n * as per FIPS 186 B.4.1 with modulo bias being neglible.\n */\n randomPrivateKey: (): Uint8Array => {\n const rand = CURVE.randomBytes(Fp.BYTES + 8);\n const num = mod.hashToPrivateScalar(rand, CURVE_ORDER);\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n },\n\n /**\n * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n * Allows to massively speed-up `point.multiply(scalar)`.\n * @returns cached point\n * @example\n * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n * fast.multiply(privKey); // much faster ECDH now\n */\n precompute(windowSize = 8, point = Point.BASE): typeof Point.BASE {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n return point;\n },\n };\n\n /**\n * Computes public key for a private key. Checks for validity of the private key.\n * @param privateKey private key\n * @param isCompressed whether to return compact (default), or full key\n * @returns Public key, full when isCompressed=false; short when isCompressed=true\n */\n function getPublicKey(privateKey: PrivKey, isCompressed = true): Uint8Array {\n return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n }\n\n /**\n * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n */\n function isProbPub(item: PrivKey | PubKey): boolean {\n const arr = item instanceof Uint8Array;\n const str = typeof item === 'string';\n const len = (arr || str) && (item as Hex).length;\n if (arr) return len === compressedLen || len === uncompressedLen;\n if (str) return len === 2 * compressedLen || len === 2 * uncompressedLen;\n if (item instanceof Point) return true;\n return false;\n }\n\n /**\n * ECDH (Elliptic Curve Diffie Hellman).\n * Computes shared public key from private key and public key.\n * Checks: 1) private key validity 2) shared key is on-curve.\n * Does NOT hash the result.\n * @param privateA private key\n * @param publicB different public key\n * @param isCompressed whether to return compact (default), or full key\n * @returns shared public key\n */\n function getSharedSecret(privateA: PrivKey, publicB: Hex, isCompressed = true): Uint8Array {\n if (isProbPub(privateA)) throw new Error('first arg must be private key');\n if (!isProbPub(publicB)) throw new Error('second arg must be public key');\n const b = Point.fromHex(publicB); // check for being on-curve\n return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n }\n\n // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n const bits2int =\n CURVE.bits2int ||\n function (bytes: Uint8Array): bigint {\n // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n // for some cases, since bytes.length * 8 is not actual bitLength.\n const num = ut.bytesToNumberBE(bytes); // check for == u8 done here\n const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits\n return delta > 0 ? num >> BigInt(delta) : num;\n };\n const bits2int_modN =\n CURVE.bits2int_modN ||\n function (bytes: Uint8Array): bigint {\n return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n };\n // NOTE: pads output with zero as per spec\n const ORDER_MASK = ut.bitMask(CURVE.nBitLength);\n /**\n * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n */\n function int2octets(num: bigint): Uint8Array {\n if (typeof num !== 'bigint') throw new Error('bigint expected');\n if (!(_0n <= num && num < ORDER_MASK))\n throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);\n // works with order, can have different size than numToField!\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n }\n\n // Steps A, D of RFC6979 3.2\n // Creates RFC6979 seed; converts msg/privKey to numbers.\n // Used only in sign, not in verify.\n // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521.\n // Also it can be bigger for P224 + SHA256\n function prepSig(msgHash: Hex, privateKey: PrivKey, opts = defaultSigOpts) {\n if (['recovered', 'canonical'].some((k) => k in opts))\n throw new Error('sign() legacy options not supported');\n const { hash, randomBytes } = CURVE;\n let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n if (lowS == null) lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n msgHash = ensureBytes('msgHash', msgHash);\n if (prehash) msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n\n // We can't later call bits2octets, since nested bits2int is broken for curves\n // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n const h1int = bits2int_modN(msgHash);\n const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n const seedArgs = [int2octets(d), int2octets(h1int)];\n // extraEntropy. RFC6979 3.6: additional k' (optional).\n if (ent != null) {\n // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n seedArgs.push(ensureBytes('extraEntropy', e, Fp.BYTES)); // check for being of size BYTES\n }\n const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2\n const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n // Converts signature params into point w r/s, checks result for validity.\n function k2sig(kBytes: Uint8Array): Signature | undefined {\n // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n if (!isWithinCurveOrder(k)) return; // Important: all mod() calls here must be done over N\n const ik = invN(k); // k^-1 mod n\n const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n const r = modN(q.x); // r = q.x mod n\n if (r === _0n) return;\n // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n const s = modN(ik * modN(m + r * d)); // Not using blinding here\n if (s === _0n) return;\n let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n let normS = s;\n if (lowS && isBiggerThanHalfOrder(s)) {\n normS = normalizeS(s); // if lowS was passed, ensure s is always\n recovery ^= 1; // // in the bottom half of N\n }\n return new Signature(r, normS, recovery); // use normS, not s\n }\n return { seed, k2sig };\n }\n const defaultSigOpts: SignOpts = { lowS: CURVE.lowS, prehash: false };\n const defaultVerOpts: VerOpts = { lowS: CURVE.lowS, prehash: false };\n\n /**\n * Signs message hash (not message: you need to hash it by yourself).\n * ```\n * sign(m, d, k) where\n * (x, y) = G × k\n * r = x mod n\n * s = (m + dr)/k mod n\n * ```\n * @param opts `lowS, extraEntropy, prehash`\n */\n function sign(msgHash: Hex, privKey: PrivKey, opts = defaultSigOpts): Signature {\n const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n const drbg = ut.createHmacDrbg(CURVE.hash.outputLen, CURVE.nByteLength, CURVE.hmac);\n return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n }\n\n // Enable precomputes. Slows down first publicKey computation by 20ms.\n Point.BASE._setWindowSize(8);\n // utils.precompute(8, ProjectivePoint.BASE)\n\n /**\n * Verifies a signature against message hash and public key.\n * Rejects lowS signatures by default: to override,\n * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n *\n * ```\n * verify(r, s, h, P) where\n * U1 = hs^-1 mod n\n * U2 = rs^-1 mod n\n * R = U1⋅G - U2⋅P\n * mod(R.x, n) == r\n * ```\n */\n function verify(\n signature: Hex | SignatureLike,\n msgHash: Hex,\n publicKey: Hex,\n opts = defaultVerOpts\n ): boolean {\n const sg = signature;\n msgHash = ensureBytes('msgHash', msgHash);\n publicKey = ensureBytes('publicKey', publicKey);\n if ('strict' in opts) throw new Error('options.strict was renamed to lowS');\n const { lowS, prehash } = opts;\n\n let _sig: Signature | undefined = undefined;\n let P: ProjPointType;\n try {\n if (typeof sg === 'string' || sg instanceof Uint8Array) {\n // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n // Since DER can also be 2*nByteLength bytes, we check for it first.\n try {\n _sig = Signature.fromDER(sg);\n } catch (derError) {\n if (!(derError instanceof DER.Err)) throw derError;\n _sig = Signature.fromCompact(sg);\n }\n } else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') {\n const { r, s } = sg;\n _sig = new Signature(r, s);\n } else {\n throw new Error('PARSE');\n }\n P = Point.fromHex(publicKey);\n } catch (error) {\n if ((error as Error).message === 'PARSE')\n throw new Error(`signature must be Signature instance, Uint8Array or hex string`);\n return false;\n }\n if (lowS && _sig.hasHighS()) return false;\n if (prehash) msgHash = CURVE.hash(msgHash);\n const { r, s } = _sig;\n const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n const is = invN(s); // s^-1\n const u1 = modN(h * is); // u1 = hs^-1 mod n\n const u2 = modN(r * is); // u2 = rs^-1 mod n\n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n if (!R) return false;\n const v = modN(R.x);\n return v === r;\n }\n return {\n CURVE,\n getPublicKey,\n getSharedSecret,\n sign,\n verify,\n ProjectivePoint: Point,\n Signature,\n utils,\n };\n}\n\n// Implementation of the Shallue and van de Woestijne method for any Weierstrass curve\n// TODO: check if there is a way to merge this with uvRatio in Edwards && move to modular?\n// b = True and y = sqrt(u / v) if (u / v) is square in F, and\n// b = False and y = sqrt(Z * (u / v)) otherwise.\nexport function SWUFpSqrtRatio(Fp: mod.IField, Z: T) {\n // Generic implementation\n const q = Fp.ORDER;\n let l = _0n;\n for (let o = q - _1n; o % _2n === _0n; o /= _2n) l += _1n;\n const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n const c2 = (q - _1n) / _2n ** c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic\n const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic\n const c4 = _2n ** c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic\n const c5 = _2n ** (c1 - _1n); // 5. c5 = 2^(c1 - 1) # Integer arithmetic\n const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n let sqrtRatio = (u: T, v: T): { isValid: boolean; value: T } => {\n let tv1 = c6; // 1. tv1 = c6\n let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n // 17. for i in (c1, c1 - 1, ..., 2):\n for (let i = c1; i > _1n; i--) {\n let tv5 = _2n ** (i - _2n); // 18. tv5 = i - 2; 19. tv5 = 2^tv5\n let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5\n const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1\n tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1\n tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1\n tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)\n tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)\n }\n return { isValid: isQR, value: tv3 };\n };\n if (Fp.ORDER % _4n === _3n) {\n // sqrt_ratio_3mod4(u, v)\n const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic\n const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n sqrtRatio = (u: T, v: T) => {\n let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n };\n }\n // No curves uses that\n // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n return sqrtRatio;\n}\n// From draft-irtf-cfrg-hash-to-curve-16\nexport function mapToCurveSimpleSWU(\n Fp: mod.IField,\n opts: {\n A: T;\n B: T;\n Z: T;\n }\n) {\n mod.validateField(Fp);\n if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n throw new Error('mapToCurveSimpleSWU: invalid opts');\n const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n if (!Fp.isOdd) throw new Error('Fp.isOdd is not implemented!');\n // Input: u, an element of F.\n // Output: (x, y), a point on E.\n return (u: T): { x: T; y: T } => {\n // prettier-ignore\n let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1\n tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2\n tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1\n tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1\n tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3\n tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)\n tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4\n tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2\n tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3\n const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1\n y = Fp.mul(y, value); // 20. y = y * y1\n x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)\n y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)\n const e1 = Fp.isOdd!(u) === Fp.isOdd!(y); // 23. e1 = sgn0(u) == sgn0(y)\n y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)\n x = Fp.div(x, tv4); // 25. x = x / tv4\n return { x, y };\n };\n}\n","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Abelian group utilities\nimport { IField, validateField, nLength } from './modular.js';\nimport { validateObject } from './utils.js';\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n\nexport type AffinePoint = {\n x: T;\n y: T;\n} & { z?: never; t?: never };\n\nexport interface Group> {\n double(): T;\n negate(): T;\n add(other: T): T;\n subtract(other: T): T;\n equals(other: T): boolean;\n multiply(scalar: bigint): T;\n}\n\nexport type GroupConstructor = {\n BASE: T;\n ZERO: T;\n};\nexport type Mapper = (i: T[]) => T[];\n\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nexport function wNAF>(c: GroupConstructor, bits: number) {\n const constTimeNegate = (condition: boolean, item: T): T => {\n const neg = item.negate();\n return condition ? neg : item;\n };\n const opts = (W: number) => {\n const windows = Math.ceil(bits / W) + 1; // +1, because\n const windowSize = 2 ** (W - 1); // -1 because we skip zero\n return { windows, windowSize };\n };\n return {\n constTimeNegate,\n // non-const time multiplication ladder\n unsafeLadder(elm: T, n: bigint) {\n let p = c.ZERO;\n let d: T = elm;\n while (n > _0n) {\n if (n & _1n) p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm: T, W: number): Group[] {\n const { windows, windowSize } = opts(W);\n const points: T[] = [];\n let p: T = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // =1, because we skip zero\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W: number, precomputes: T[], n: bigint): { p: T; f: T } {\n // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n // But need to carefully remove other checks before wNAF. ORDER == bits here\n const { windows, windowSize } = opts(W);\n\n let p = c.ZERO;\n let f = c.BASE;\n\n const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.\n const maxNumber = 2 ** W;\n const shiftBy = BigInt(W);\n\n for (let window = 0; window < windows; window++) {\n const offset = window * windowSize;\n // Extract W bits.\n let wbits = Number(n & mask);\n\n // Shift number by W bits.\n n >>= shiftBy;\n\n // If the bits are bigger than max size, we'll split those.\n // +224 => 256 - 32\n if (wbits > windowSize) {\n wbits -= maxNumber;\n n += _1n;\n }\n\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n\n // Check if we're onto Zero point.\n // Add random point inside current window to f.\n const offset1 = offset;\n const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero\n const cond1 = window % 2 !== 0;\n const cond2 = wbits < 0;\n if (wbits === 0) {\n // The most important part for const-time getPublicKey\n f = f.add(constTimeNegate(cond1, precomputes[offset1]));\n } else {\n p = p.add(constTimeNegate(cond2, precomputes[offset2]));\n }\n }\n // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()\n // Even if the variable is still unused, there are some checks which will\n // throw an exception, so compiler needs to prove they won't happen, which is hard.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n\n wNAFCached(P: T, precomputesMap: Map, n: bigint, transform: Mapper): { p: T; f: T } {\n // @ts-ignore\n const W: number = P._WINDOW_SIZE || 1;\n // Calculate precomputes on a first run, reuse them after\n let comp = precomputesMap.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W) as T[];\n if (W !== 1) {\n precomputesMap.set(P, transform(comp));\n }\n }\n return this.wNAF(W, comp, n);\n },\n };\n}\n\n// Generic BasicCurve interface: works even for polynomial fields (BLS): P, n, h would be ok.\n// Though generator can be different (Fp2 / Fp6 for BLS).\nexport type BasicCurve = {\n Fp: IField; // Field over which we'll do calculations (Fp)\n n: bigint; // Curve order, total count of valid points in the field\n nBitLength?: number; // bit length of curve order\n nByteLength?: number; // byte length of curve order\n h: bigint; // cofactor. we can assign default=1, but users will just ignore it w/o validation\n hEff?: bigint; // Number to multiply to clear cofactor\n Gx: T; // base point X coordinate\n Gy: T; // base point Y coordinate\n allowInfinityPoint?: boolean; // bls12-381 requires it. ZERO point is valid, but invalid pubkey\n};\n\nexport function validateBasic(curve: BasicCurve & T) {\n validateField(curve.Fp);\n validateObject(\n curve,\n {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n },\n {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n }\n );\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n } as const);\n}\n","import assert from './_assert.js';\nimport { Hash, CHash, Input, toBytes } from './utils.js';\n// HMAC (RFC 2104)\nclass HMAC> extends Hash> {\n oHash: T;\n iHash: T;\n blockLen: number;\n outputLen: number;\n private finished = false;\n private destroyed = false;\n\n constructor(hash: CHash, _key: Input) {\n super();\n assert.hash(hash);\n const key = toBytes(_key);\n this.iHash = hash.create() as T;\n if (typeof this.iHash.update !== 'function')\n throw new TypeError('Expected instance of class which extends utils.Hash');\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create() as T;\n // Undo internal XOR && apply outer XOR\n for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n pad.fill(0);\n }\n update(buf: Input) {\n assert.exists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out: Uint8Array) {\n assert.exists(this);\n assert.bytes(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to?: HMAC): HMAC {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to ||= Object.create(Object.getPrototypeOf(this), {});\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to as this;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */\nexport const hmac = (hash: CHash, key: Input, message: Input): Uint8Array =>\n new HMAC(hash, key).update(message).digest();\nhmac.create = (hash: CHash, key: Input) => new HMAC(hash, key);\n","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass, CurveType } from './abstract/weierstrass.js';\nimport { CHash } from './abstract/utils.js';\n\n// connects noble-curves to noble-hashes\nexport function getHash(hash: CHash) {\n return {\n hash,\n hmac: (key: Uint8Array, ...msgs: Uint8Array[]) => hmac(hash, key, concatBytes(...msgs)),\n randomBytes,\n };\n}\n// Same API as @noble/hashes, with ability to create curve with custom hash\ntype CurveDef = Readonly>;\nexport function createCurve(curveDef: CurveDef, defHash: CHash) {\n const create = (hash: CHash) => weierstrass({ ...curveDef, ...getHash(hash) });\n return Object.freeze({ ...create(defHash), create });\n}\n","import { addHexPrefix, removeHexPrefix } from './encode';\nimport { isHex, isStringWholeNumber } from './num';\n\nconst TEXT_TO_FELT_MAX_LEN = 31;\n\nexport function isASCII(str: string) {\n // eslint-disable-next-line no-control-regex\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\n// function to check if string has less or equal 31 characters\nexport function isShortString(str: string) {\n return str.length <= TEXT_TO_FELT_MAX_LEN;\n}\n\n// function to check if string is a decimal\nexport function isDecimalString(decim: string): boolean {\n return /^[0-9]*$/i.test(decim);\n}\n\n/**\n * check if value is string text, and not string-hex, string-number\n * @param val any\n * @returns boolean\n */\nexport function isText(val: any) {\n return typeof val === 'string' && !isHex(val) && !isStringWholeNumber(val);\n}\n\nexport const isShortText = (val: any) => isText(val) && isShortString(val);\nexport const isLongText = (val: any) => isText(val) && !isShortString(val);\n\nexport function splitLongString(longStr: string): string[] {\n const regex = RegExp(`[^]{1,${TEXT_TO_FELT_MAX_LEN}}`, 'g');\n return longStr.match(regex) || [];\n}\n\n/**\n * Convert an ASCII string to an hexadecimal string.\n * @param str - ASCII string -\n * 31 characters maxi. Ex : \"uri/item23.jpg\"\n * @returns a string representing an Hex number 248 bits max.\n * @Example\n * ```typescript\n * const myEncodedString: string = encodeShortString(\"uri/pict/t38.jpg\");\n * ```\n * returns : string : \"0x7572692f706963742f7433382e6a7067\"\n */\nexport function encodeShortString(str: string): string {\n if (!isASCII(str)) throw new Error(`${str} is not an ASCII string`);\n if (!isShortString(str)) throw new Error(`${str} is too long`);\n return addHexPrefix(str.replace(/./g, (char) => char.charCodeAt(0).toString(16)));\n}\n\n/**\n * Convert an hexadecimal or decimal string to an ASCII string.\n * @param str - string - representing a 248 bits max number.\n *\n * Ex : hex : \"0x1A4F64EA56\" or decimal : \"236942575435676423\"\n * @returns a string with 31 characters max.\n * @Example\n * ```typescript\n * const myDecodedString: string = decodeShortString(\"0x7572692f706963742f7433382e6a7067\");\n * ```\n * return : string : \"uri/pict/t38.jpg\"\n */\nexport function decodeShortString(str: string): string {\n if (!isASCII(str)) throw new Error(`${str} is not an ASCII string`);\n if (isHex(str)) {\n return removeHexPrefix(str).replace(/.{2}/g, (hex) => String.fromCharCode(parseInt(hex, 16)));\n }\n if (isDecimalString(str)) {\n return decodeShortString('0X'.concat(BigInt(str).toString(16)));\n }\n throw new Error(`${str} is not Hex or decimal`);\n}\n","import { Abi, AbiStructs, BigNumberish, Uint, Uint256 } from '../../types';\nimport { isBigInt, isHex, isStringWholeNumber } from '../num';\nimport { encodeShortString, isShortString, isText } from '../shortString';\nimport { UINT_128_MAX, isUint256 } from '../uint256';\n\nexport const isLen = (name: string) => /_len$/.test(name);\nexport const isTypeFelt = (type: string) => type === 'felt' || type === 'core::felt252';\nexport const isTypeArray = (type: string) =>\n /\\*/.test(type) || type.startsWith('core::array::Array::');\nexport const isTypeTuple = (type: string) => /^\\(.*\\)$/i.test(type);\nexport const isTypeNamedTuple = (type: string) => /\\(.*\\)/i.test(type) && type.includes(':');\nexport const isTypeStruct = (type: string, structs: AbiStructs) => type in structs;\nexport const isTypeUint = (type: string) => Object.values(Uint).includes(type as Uint);\nexport const isTypeUint256 = (type: string) => type === 'core::integer::u256';\nexport const isTypeBool = (type: string) => type === 'core::bool';\nexport const isTypeContractAddress = (type: string) =>\n type === 'core::starknet::contract_address::ContractAddress';\nexport const isCairo1Type = (type: string) => type.includes('core::');\n\nexport const getArrayType = (type: string) => {\n if (isCairo1Type(type)) {\n return type.substring(type.indexOf('<') + 1, type.lastIndexOf('>'));\n }\n return type.replace('*', '');\n};\n\n/**\n * tells if an ABI comes from a Cairo 1 contract\n *\n * @param abi representing the interface of a Cairo contract\n * @returns TRUE if it is an ABI from a Cairo1 contract\n * @example\n * ```typescript\n * const isCairo1: boolean = isCairo1Abi(myAbi: Abi);\n * ```\n */\nexport function isCairo1Abi(abi: Abi): boolean {\n const firstFunction = abi.find((entry) => entry.type === 'function');\n if (!firstFunction) {\n if (abi.find((it) => it.type === 'interface')) {\n // Expected in Cairo1 version 2\n return true;\n }\n throw new Error(`Error in ABI. No function in ABI.`);\n }\n if (firstFunction.inputs.length) {\n return isCairo1Type(firstFunction.inputs[0].type);\n }\n if (firstFunction.outputs.length) {\n return isCairo1Type(firstFunction.outputs[0].type);\n }\n throw new Error(`Error in ABI. No input/output in function ${firstFunction.name}`);\n}\n\n/**\n * named tuple are described as js object {}\n * struct types are described as js object {}\n * array types are described as js array []\n */\n\n/**\n * Uint256 cairo type (helper for common struct type)\n */\nexport const uint256 = (it: BigNumberish): Uint256 => {\n const bn = BigInt(it);\n if (!isUint256(bn)) throw new Error('Number is too large');\n return {\n // eslint-disable-next-line no-bitwise\n low: (bn & UINT_128_MAX).toString(10),\n // eslint-disable-next-line no-bitwise\n high: (bn >> 128n).toString(10),\n };\n};\n\n/**\n * unnamed tuple cairo type (helper same as common struct type)\n */\nexport const tuple = (\n ...args: (BigNumberish | object | boolean)[]\n): Record => ({ ...args });\n\n/**\n * felt cairo type\n */\nexport function felt(it: BigNumberish): string {\n // BN or number\n if (isBigInt(it) || (typeof it === 'number' && Number.isInteger(it))) {\n return it.toString();\n }\n // string text\n if (isText(it)) {\n if (!isShortString(it as string))\n throw new Error(\n `${it} is a long string > 31 chars, felt can store short strings, split it to array of short strings`\n );\n const encoded = encodeShortString(it as string);\n return BigInt(encoded).toString();\n }\n // hex string\n if (typeof it === 'string' && isHex(it)) {\n // toBN().toString\n return BigInt(it).toString();\n }\n // string number (already converted), or unhandled type\n if (typeof it === 'string' && isStringWholeNumber(it)) {\n return it;\n }\n // bool to felt\n if (typeof it === 'boolean') {\n return `${+it}`;\n }\n\n throw new Error(`${it} can't be computed by felt()`);\n}\n","/* eslint-disable no-bitwise */\nimport { BigNumberish, Uint256 } from '../types';\nimport { addHexPrefix } from './encode';\nimport { toBigInt } from './num';\n\n/** @deprecated prefer importing from 'types' over 'uint256' */\nexport type { Uint256 };\n\n// function to convert Uint256 to BN\nexport function uint256ToBN(uint256: Uint256) {\n return (toBigInt(uint256.high) << 128n) + toBigInt(uint256.low);\n}\n\nexport const UINT_128_MAX = (1n << 128n) - 1n;\nexport const UINT_256_MAX = (1n << 256n) - 1n;\n// function to check if BN is smaller or equal 2**256-1\nexport function isUint256(bn: BigNumberish): boolean {\n return toBigInt(bn) <= UINT_256_MAX;\n}\n\n// function to convert BN to Uint256 hex\nexport function bnToUint256(bignumber: BigNumberish): Uint256 {\n const bn = toBigInt(bignumber);\n if (!isUint256(bn)) throw new Error('Number is too large');\n return {\n low: addHexPrefix((bn & UINT_128_MAX).toString(16)),\n high: addHexPrefix((bn >> 128n).toString(16)),\n };\n}\n","import { isBigInt } from '../num';\nimport { decodeShortString } from '../shortString';\n\nconst guard = {\n isBN: (data: any, type: any, key: any) => {\n if (!isBigInt(data[key]))\n throw new Error(\n `Data and formatter mismatch on ${key}:${type[key]}, expected response data ${key}:${\n data[key]\n } to be BN instead it is ${typeof data[key]}`\n );\n },\n unknown: (data: any, type: any, key: any) => {\n throw new Error(`Unhandled formatter type on ${key}:${type[key]} for data ${key}:${data[key]}`);\n },\n};\n\nexport default function formatter(data: any, type: any, sameType?: any) {\n // match data element with type element\n return Object.entries(data).reduce((acc, [key, value]: [any, any]) => {\n const elType = sameType ?? type[key];\n\n if (!(key in type) && !sameType) {\n // no type definition for element return original element\n acc[key] = value;\n return acc;\n }\n\n if (elType === 'string') {\n if (Array.isArray(data[key])) {\n // long string (felt*)\n const arrayStr = formatter(\n data[key],\n data[key].map((_: any) => elType)\n );\n acc[key] = Object.values(arrayStr).join('');\n return acc;\n }\n guard.isBN(data, type, key);\n acc[key] = decodeShortString(value);\n return acc;\n }\n if (elType === 'number') {\n guard.isBN(data, type, key);\n acc[key] = Number(value);\n return acc;\n }\n if (typeof elType === 'function') {\n acc[key] = elType(value);\n return acc;\n }\n if (Array.isArray(elType)) {\n const arrayObj = formatter(data[key], elType, elType[0]);\n acc[key] = Object.values(arrayObj);\n return acc;\n }\n if (typeof elType === 'object') {\n acc[key] = formatter(data[key], elType);\n return acc;\n }\n\n guard.unknown(data, type, key);\n return acc;\n }, {} as any);\n}\n","import { Abi, FunctionAbi } from '../../../types';\nimport { isLen } from '../cairo';\nimport { AbiParserInterface } from './interface';\n\nexport class AbiParser1 implements AbiParserInterface {\n abi: Abi;\n\n constructor(abi: Abi) {\n this.abi = abi;\n }\n\n /**\n * abi method inputs length without '_len' inputs\n * cairo 0 reducer\n * @param abiMethod FunctionAbi\n * @returns number\n */\n public methodInputsLength(abiMethod: FunctionAbi) {\n return abiMethod.inputs.reduce((acc, input) => (!isLen(input.name) ? acc + 1 : acc), 0);\n }\n\n /**\n * get method definition from abi\n * @param name string\n * @returns FunctionAbi | undefined\n */\n public getMethod(name: string): FunctionAbi | undefined {\n return this.abi.find((it) => it.name === name);\n }\n\n /**\n * Get Abi in legacy format\n * @returns Abi\n */\n public getLegacyFormat() {\n return this.abi;\n }\n}\n","import { Abi, FunctionAbi } from '../../../types';\nimport { AbiParserInterface } from './interface';\n\nexport class AbiParser2 implements AbiParserInterface {\n abi: Abi;\n\n constructor(abi: Abi) {\n this.abi = abi;\n }\n\n /**\n * abi method inputs length\n * @param abiMethod FunctionAbi\n * @returns number\n */\n public methodInputsLength(abiMethod: FunctionAbi) {\n return abiMethod.inputs.length;\n }\n\n /**\n * get method definition from abi\n * @param name string\n * @returns FunctionAbi | undefined\n */\n public getMethod(name: string): FunctionAbi | undefined {\n const intf = this.abi.find((it) => it.type === 'interface');\n return intf.items.find((it: any) => it.name === name);\n }\n\n /**\n * Get Abi in legacy format\n * @returns Abi\n */\n public getLegacyFormat(): Abi {\n return this.abi.flatMap((e) => {\n if (e.type === 'interface') {\n return e.items;\n }\n return e;\n });\n }\n}\n","import { Abi, FunctionAbi, RawArgs } from '../../../types';\nimport { isCairo1Abi } from '../cairo';\nimport { AbiParserInterface } from './interface';\nimport { AbiParser1 } from './parser-0-1.1.0';\nimport { AbiParser2 } from './parser-2.0.0';\n\nexport function createAbiParser(abi: Abi): AbiParserInterface {\n const version = getAbiVersion(abi);\n if (version === 0 || version === 1) {\n return new AbiParser1(abi);\n }\n if (version === 2) {\n return new AbiParser2(abi);\n }\n throw Error(`Unsupported ABI version ${version}`);\n}\n\nexport function getAbiVersion(abi: Abi) {\n if (abi.find((it) => it.type === 'interface')) return 2;\n if (isCairo1Abi(abi)) return 1;\n return 0;\n}\n\nexport function isNoConstructorValid(\n method: string,\n argsCalldata: RawArgs,\n abiMethod?: FunctionAbi\n) {\n // No constructor in abi and validly empty args\n return method === 'constructor' && !abiMethod && !argsCalldata.length;\n}\n","/* eslint-disable no-plusplus */\nimport { isCairo1Type, isTypeNamedTuple } from './cairo';\n\nfunction parseNamedTuple(namedTuple: string): any {\n const name = namedTuple.substring(0, namedTuple.indexOf(':'));\n const type = namedTuple.substring(name.length + ':'.length);\n return { name, type };\n}\n\nfunction parseSubTuple(s: string) {\n if (!s.includes('(')) return { subTuple: [], result: s };\n const subTuple: string[] = [];\n let result = '';\n let i = 0;\n while (i < s.length) {\n if (s[i] === '(') {\n let counter = 1;\n const lBracket = i;\n i++;\n while (counter) {\n if (s[i] === ')') counter--;\n if (s[i] === '(') counter++;\n i++;\n }\n subTuple.push(s.substring(lBracket, i));\n result += ' ';\n i--;\n } else {\n result += s[i];\n }\n i++;\n }\n\n return {\n subTuple,\n result,\n };\n}\n\nfunction extractCairo0Tuple(type: string) {\n const cleanType = type.replace(/\\s/g, '').slice(1, -1); // remove first lvl () and spaces\n\n // Decompose subTuple\n const { subTuple, result } = parseSubTuple(cleanType);\n\n // Recompose subTuple\n let recomposed = result.split(',').map((it) => {\n return subTuple.length ? it.replace(' ', subTuple.shift() as string) : it;\n });\n\n // Parse named tuple\n if (isTypeNamedTuple(type)) {\n recomposed = recomposed.reduce((acc, it) => {\n return acc.concat(parseNamedTuple(it));\n }, []);\n }\n\n return recomposed;\n}\n\nfunction extractCairo1Tuple(type: string) {\n // un-named tuples support\n const cleanType = type.replace(/\\s/g, '').slice(1, -1); // remove first lvl () and spaces\n const { subTuple, result } = parseSubTuple(cleanType);\n const recomposed = result.split(',').map((it) => {\n return subTuple.length ? it.replace(' ', subTuple.shift() as string) : it;\n });\n return recomposed;\n}\n\n/**\n * Convert tuple string definition into object like definition\n * @param type tuple string definition\n * @returns object like tuple\n */\nexport default function extractTupleMemberTypes(type: string): (string | object)[] {\n if (isCairo1Type(type)) {\n return extractCairo1Tuple(type);\n }\n return extractCairo0Tuple(type);\n}\n","import { AbiEntry, AbiStructs, RawArgsObject, Uint } from '../../types';\nimport {\n getArrayType,\n isCairo1Type,\n isLen,\n isTypeArray,\n isTypeStruct,\n isTypeTuple,\n isTypeUint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\nfunction errorU256(key: string) {\n return Error(\n `Your object includes the property : ${key}, containing an Uint256 object without the 'low' and 'high' keys.`\n );\n}\nexport default function orderPropsByAbi(\n unorderedObject: RawArgsObject,\n abiOfObject: AbiEntry[],\n structs: AbiStructs\n): object {\n const orderStruct = (unorderedObject2: RawArgsObject, abiObject: AbiEntry[]): object => {\n const orderedObject2 = abiObject.reduce((orderedObject, abiParam) => {\n const setProperty = (value?: any) =>\n Object.defineProperty(orderedObject, abiParam.name, {\n enumerable: true,\n value: value ?? unorderedObject2[abiParam.name],\n });\n\n if (unorderedObject2[abiParam.name] === 'undefined') {\n if (isCairo1Type(abiParam.type) || !isLen(abiParam.name)) {\n throw Error(`Your object needs a property with key : ${abiParam.name} .`);\n }\n }\n switch (true) {\n case isTypeStruct(abiParam.type, structs):\n setProperty(\n orderStruct(\n unorderedObject2[abiParam.name] as RawArgsObject,\n structs[abiParam.type].members\n )\n );\n break;\n case isTypeUint256(abiParam.type): {\n const u256 = unorderedObject2[abiParam.name];\n if (typeof u256 !== 'object') {\n // BigNumberish --> just copy\n setProperty();\n break;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n setProperty({ low: u256.low, high: u256.high });\n break;\n }\n case isTypeTuple(abiParam.type):\n setProperty(orderTuple(unorderedObject2[abiParam.name] as RawArgsObject, abiParam));\n break;\n case isTypeArray(abiParam.type):\n setProperty(orderArray(unorderedObject2[abiParam.name] as Array, abiParam));\n break;\n case !isCairo1Type(abiParam.type) && isLen(abiParam.name):\n // Cairo 0 array_len. Nothing to do, go to next abi item\n break;\n default: // do not needs recursion --> just copy\n setProperty();\n }\n return orderedObject;\n }, {});\n return orderedObject2;\n };\n\n function orderArray(myArray: Array | string, abiParam: AbiEntry): Array | string {\n const typeInArray = getArrayType(abiParam.type);\n if (typeof myArray === 'string') {\n return myArray; // longstring\n }\n switch (true) {\n case typeInArray in structs:\n return myArray.map((myObj) => orderStruct(myObj, structs[typeInArray].members));\n case typeInArray === Uint.u256:\n return myArray.map((u256) => {\n if (typeof u256 !== 'object') {\n return u256;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n return { low: u256.low, high: u256.high };\n });\n case isTypeTuple(typeInArray):\n return myArray.map((myElem) => orderTuple(myElem, { name: '0', type: typeInArray }));\n case isTypeArray(typeInArray):\n return myArray.map((myElem) => orderArray(myElem, { name: '0', type: typeInArray }));\n default: // is an array of litterals\n return myArray;\n }\n }\n\n function orderTuple(unorderedObject2: RawArgsObject, abiParam: AbiEntry): object {\n const typeList = extractTupleMemberTypes(abiParam.type);\n const orderedObject2 = typeList.reduce((orderedObject: object, abiTypeCairoX: any, index) => {\n const myObjKeys: string[] = Object.keys(unorderedObject2);\n const setProperty = (value?: any) =>\n Object.defineProperty(orderedObject, index.toString(), {\n enumerable: true,\n value: value ?? unorderedObject2[myObjKeys[index]],\n });\n const abiType: string = abiTypeCairoX?.type ? abiTypeCairoX.type : abiTypeCairoX; // Named tuple, or tuple\n\n switch (true) {\n case isTypeStruct(abiType, structs):\n setProperty(\n orderStruct(\n unorderedObject2[myObjKeys[index]] as RawArgsObject,\n structs[abiType].members\n )\n );\n break;\n case isTypeUint256(abiType): {\n const u256 = unorderedObject2[myObjKeys[index]];\n if (typeof u256 !== 'object') {\n // BigNumberish --> just copy\n setProperty();\n break;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n setProperty({ low: u256.low, high: u256.high });\n break;\n }\n case isTypeTuple(abiType):\n setProperty(\n orderTuple(unorderedObject2[myObjKeys[index]] as RawArgsObject, {\n name: '0',\n type: abiType,\n })\n );\n break;\n case isTypeArray(abiType):\n setProperty(\n orderArray(unorderedObject2[myObjKeys[index]] as Array, {\n name: '0',\n type: abiType,\n })\n );\n break;\n default: // litterals, do not needs recursion --> just copy\n setProperty();\n }\n return orderedObject;\n }, {});\n return orderedObject2;\n }\n return orderStruct(unorderedObject, abiOfObject);\n}\n","import { AbiEntry, AbiStructs, BigNumberish, ParsedStruct, Tupled, Uint256 } from '../../types';\nimport { isText, splitLongString } from '../shortString';\nimport {\n felt,\n getArrayType,\n isTypeArray,\n isTypeStruct,\n isTypeTuple,\n isTypeUint256,\n uint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\n/**\n * parse base types\n * @param type type from abi\n * @param val value provided\n * @returns string | string[]\n */\nfunction parseBaseTypes(type: string, val: BigNumberish) {\n switch (true) {\n case isTypeUint256(type):\n // eslint-disable-next-line no-case-declarations\n const el_uint256 = uint256(val);\n return [felt(el_uint256.low), felt(el_uint256.high)];\n default:\n return felt(val);\n }\n}\n\n/**\n * Parse tuple type string to array of known objects\n * @param element request element\n * @param typeStr tuple type string\n * @returns Tupled[]\n */\nfunction parseTuple(element: object, typeStr: string): Tupled[] {\n const memberTypes = extractTupleMemberTypes(typeStr);\n const elements = Object.values(element);\n\n if (elements.length !== memberTypes.length) {\n throw Error(\n `ParseTuple: provided and expected abi tuple size do not match.\n provided: ${elements} \n expected: ${memberTypes}`\n );\n }\n\n return memberTypes.map((it: any, dx: number) => {\n return {\n element: elements[dx],\n type: it.type ?? it,\n };\n });\n}\n\nfunction parseUint256(element: object | BigNumberish) {\n if (typeof element === 'object') {\n const { low, high } = element as Uint256;\n return [felt(low as BigNumberish), felt(high as BigNumberish)];\n }\n const el_uint256 = uint256(element);\n return [felt(el_uint256.low), felt(el_uint256.high)];\n}\n\n/**\n * Deep parse of the object that has been passed to the method\n *\n * @param element - element that needs to be parsed\n * @param type - name of the method\n * @param structs - structs from abi\n * @return {string | string[]} - parsed arguments in format that contract is expecting\n */\nfunction parseCalldataValue(\n element: ParsedStruct | BigNumberish | BigNumberish[],\n type: string,\n structs: AbiStructs\n): string | string[] {\n if (element === undefined) {\n throw Error(`Missing parameter for type ${type}`);\n }\n\n // value is Array\n if (Array.isArray(element)) {\n const result: string[] = [];\n result.push(felt(element.length)); // Add length to array\n const arrayType = getArrayType(type);\n\n return element.reduce((acc, it) => {\n return acc.concat(parseCalldataValue(it, arrayType, structs));\n }, result);\n }\n\n // checking if the passed element is struct\n if (structs[type] && structs[type].members.length) {\n if (isTypeUint256(type)) {\n return parseUint256(element);\n }\n\n const { members } = structs[type];\n const subElement = element as any;\n\n return members.reduce((acc, it: AbiEntry) => {\n return acc.concat(parseCalldataValue(subElement[it.name], it.type, structs));\n }, [] as string[]);\n }\n // check if abi element is tuple\n if (isTypeTuple(type)) {\n const tupled = parseTuple(element as object, type);\n\n return tupled.reduce((acc, it: Tupled) => {\n const parsedData = parseCalldataValue(it.element, it.type, structs);\n return acc.concat(parsedData);\n }, [] as string[]);\n }\n // check if u256 C1v0\n if (isTypeUint256(type)) {\n return parseUint256(element);\n }\n if (typeof element === 'object') {\n throw Error(`Parameter ${element} do not align with abi parameter ${type}`);\n }\n return parseBaseTypes(type, element);\n}\n\n/**\n * Parse one field of the calldata by using input field from the abi for that method\n *\n * @param argsIterator - Iterator for value of the field\n * @param input - input(field) information from the abi that will be used to parse the data\n * @param structs - structs from abi\n * @return {string | string[]} - parsed arguments in format that contract is expecting\n */\nexport function parseCalldataField(\n argsIterator: Iterator,\n input: AbiEntry,\n structs: AbiStructs\n): string | string[] {\n const { name, type } = input;\n let { value } = argsIterator.next();\n\n switch (true) {\n // Array\n case isTypeArray(type):\n if (!Array.isArray(value) && !isText(value)) {\n throw Error(`ABI expected parameter ${name} to be array or long string, got ${value}`);\n }\n if (typeof value === 'string') {\n // long string match cairo felt*\n value = splitLongString(value);\n }\n return parseCalldataValue(value, input.type, structs);\n\n // Struct or Tuple\n case isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type):\n return parseCalldataValue(value as ParsedStruct | BigNumberish[], type, structs);\n\n // Felt or unhandled\n default:\n return parseBaseTypes(type, value);\n }\n}\n","/* eslint-disable no-case-declarations */\nimport { AbiEntry, AbiStructs, Args, BigNumberish, ParsedStruct } from '../../types';\nimport { uint256ToBN } from '../uint256';\nimport {\n getArrayType,\n isCairo1Type,\n isLen,\n isTypeArray,\n isTypeBool,\n isTypeTuple,\n isTypeUint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\n/**\n * Parse base types\n * @param type type of element\n * @param it iterator\n * @returns bigint | boolean\n */\nfunction parseBaseTypes(type: string, it: Iterator) {\n let temp;\n switch (true) {\n case isTypeBool(type):\n temp = it.next().value;\n return Boolean(BigInt(temp));\n case isTypeUint256(type):\n const low = it.next().value;\n const high = it.next().value;\n return uint256ToBN({ low, high });\n default:\n temp = it.next().value;\n return BigInt(temp);\n }\n}\n\n/**\n * Parse of the response elements that are converted to Object (Struct) by using the abi\n *\n * @param responseIterator - iterator of the response\n * @param element - element of the field {name: string, type: string}\n * @param structs - structs from abi\n * @return {any} - parsed arguments in format that contract is expecting\n */\nfunction parseResponseValue(\n responseIterator: Iterator,\n element: { name: string; type: string },\n structs: AbiStructs\n): BigNumberish | ParsedStruct | boolean | any[] {\n // type uint256 struct (c1v2)\n if (isTypeUint256(element.type)) {\n const low = responseIterator.next().value;\n const high = responseIterator.next().value;\n return uint256ToBN({ low, high });\n }\n\n // type struct\n if (element.type in structs && structs[element.type]) {\n return structs[element.type].members.reduce((acc, el) => {\n acc[el.name] = parseResponseValue(responseIterator, el, structs);\n return acc;\n }, {} as any);\n }\n\n // type tuple\n if (isTypeTuple(element.type)) {\n const memberTypes = extractTupleMemberTypes(element.type);\n return memberTypes.reduce((acc, it: any, idx) => {\n const name = it?.name ? it.name : idx;\n const type = it?.type ? it.type : it;\n const el = { name, type };\n acc[name] = parseResponseValue(responseIterator, el, structs);\n return acc;\n }, {} as any);\n }\n\n // type c1 array\n if (isTypeArray(element.type)) {\n // eslint-disable-next-line no-case-declarations\n const parsedDataArr: (BigNumberish | ParsedStruct | boolean | any[])[] = [];\n const el = { name: '', type: getArrayType(element.type) };\n const len = BigInt(responseIterator.next().value); // get length\n while (parsedDataArr.length < len) {\n parsedDataArr.push(parseResponseValue(responseIterator, el, structs));\n }\n return parsedDataArr;\n }\n\n // base type\n return parseBaseTypes(element.type, responseIterator);\n}\n\n/**\n * Parse elements of the response and structuring them into one field by using output property from the abi for that method\n *\n * @param responseIterator - iterator of the response\n * @param output - output(field) information from the abi that will be used to parse the data\n * @param structs - structs from abi\n * @param parsedResult\n * @return - parsed response corresponding to the abi structure of the field\n */\nexport default function responseParser(\n responseIterator: Iterator,\n output: AbiEntry,\n structs: AbiStructs,\n parsedResult?: Args\n): any {\n const { name, type } = output;\n let temp;\n\n switch (true) {\n case isLen(name):\n temp = responseIterator.next().value;\n return BigInt(temp);\n\n case type in structs || isTypeTuple(type):\n return parseResponseValue(responseIterator, output, structs);\n\n case isTypeArray(type):\n // C1 Array\n if (isCairo1Type(type)) {\n return parseResponseValue(responseIterator, output, structs);\n }\n // C0 Array\n // eslint-disable-next-line no-case-declarations\n const parsedDataArr: (BigNumberish | ParsedStruct | boolean | any[])[] = [];\n if (parsedResult && parsedResult[`${name}_len`]) {\n const arrLen = parsedResult[`${name}_len`] as number;\n while (parsedDataArr.length < arrLen) {\n parsedDataArr.push(\n parseResponseValue(\n responseIterator,\n { name, type: output.type.replace('*', '') },\n structs\n )\n );\n }\n }\n return parsedDataArr;\n\n default:\n return parseBaseTypes(type, responseIterator);\n }\n}\n","/**\n * Validate cairo contract method arguments\n * Flow: Determine type from abi and than validate against parameter\n */\nimport { AbiEntry, AbiStructs, BigNumberish, FunctionAbi, Uint } from '../../types';\nimport assert from '../assert';\nimport { toBigInt } from '../num';\nimport { isLongText } from '../shortString';\nimport { uint256ToBN } from '../uint256';\nimport {\n getArrayType,\n isLen,\n isTypeArray,\n isTypeBool,\n isTypeContractAddress,\n isTypeFelt,\n isTypeStruct,\n isTypeTuple,\n isTypeUint,\n} from './cairo';\n\nconst validateFelt = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'string' || typeof parameter === 'number' || typeof parameter === 'bigint',\n `Validate: arg ${input.name} should be a felt typed as (String, Number or BigInt)`\n );\n};\n\nconst validateUint = (parameter: any, input: AbiEntry) => {\n if (typeof parameter === 'number') {\n assert(\n parameter <= Number.MAX_SAFE_INTEGER,\n `Validation: Parameter is to large to be typed as Number use (BigInt or String)`\n );\n }\n assert(\n typeof parameter === 'string' ||\n typeof parameter === 'number' ||\n typeof parameter === 'bigint' ||\n (typeof parameter === 'object' && 'low' in parameter && 'high' in parameter),\n `Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)`\n );\n const param = typeof parameter === 'object' ? uint256ToBN(parameter) : toBigInt(parameter);\n\n switch (input.type) {\n case Uint.u8:\n assert(\n param >= 0n && param <= 255n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0 - 255]`\n );\n break;\n\n case Uint.u16:\n assert(\n param >= 0n && param <= 65535n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 65535]`\n );\n break;\n\n case Uint.u32:\n assert(\n param >= 0n && param <= 4294967295n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 4294967295]`\n );\n break;\n\n case Uint.u64:\n assert(\n param >= 0n && param <= 2n ** 64n - 1n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^64-1]`\n );\n break;\n\n case Uint.u128:\n assert(\n param >= 0n && param <= 2n ** 128n - 1n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^128-1]`\n );\n break;\n\n case Uint.u256:\n assert(\n param >= 0n && param <= 2n ** 256n - 1n,\n `Validate: arg ${input.name} is ${input.type} 0 - 2^256-1`\n );\n break;\n\n default:\n break;\n }\n};\n\nconst validateBool = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'boolean',\n `Validate: arg ${input.name} of cairo type ${input.type} should be type (Boolean)`\n );\n};\n\nconst validateStruct = (parameter: any, input: AbiEntry, structs: AbiStructs) => {\n // c1v2 uint256 in struct\n if (input.type === Uint.u256) {\n validateUint(parameter, input);\n return;\n }\n\n assert(\n typeof parameter === 'object' && !Array.isArray(parameter),\n `Validate: arg ${input.name} is cairo type struct (${input.type}), and should be defined as js object (not array)`\n );\n\n // shallow struct validation, only first depth level\n structs[input.type].members.forEach(({ name }) => {\n assert(\n Object.keys(parameter).includes(name),\n `Validate: arg ${input.name} should have a property ${name}`\n );\n });\n};\n\nconst validateTuple = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'object' && !Array.isArray(parameter),\n `Validate: arg ${input.name} should be a tuple (defined as object)`\n );\n // todo: skip tuple structural validation for now\n};\n\nconst validateArray = (parameter: any, input: AbiEntry, structs: AbiStructs) => {\n const baseType = getArrayType(input.type);\n\n // Long text (special case when parameter is not an array but long text)\n if (isTypeFelt(baseType) && isLongText(parameter)) return;\n\n assert(Array.isArray(parameter), `Validate: arg ${input.name} should be an Array`);\n\n switch (true) {\n case isTypeFelt(baseType):\n parameter.forEach((param: BigNumberish) => validateFelt(param, input));\n break;\n case isTypeTuple(baseType):\n parameter.forEach((it: any) => validateTuple(it, { name: input.name, type: baseType }));\n break;\n case isTypeStruct(baseType, structs):\n parameter.forEach((it: any) =>\n validateStruct(it, { name: input.name, type: baseType }, structs)\n );\n break;\n case isTypeUint(baseType):\n parameter.forEach((param: BigNumberish) => validateUint(param, input));\n break;\n case isTypeBool(baseType):\n parameter.forEach((param: BigNumberish) => validateBool(param, input));\n break;\n case isTypeArray(baseType):\n parameter.forEach((param: BigNumberish) =>\n validateArray(param, { name: '', type: baseType }, structs)\n );\n break;\n default:\n throw new Error(\n `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}`\n );\n }\n};\n\nexport default function validateFields(\n abiMethod: FunctionAbi,\n args: Array,\n structs: AbiStructs\n) {\n abiMethod.inputs.reduce((acc, input) => {\n const parameter = args[acc];\n\n switch (true) {\n case isLen(input.name):\n return acc;\n case isTypeFelt(input.type):\n validateFelt(parameter, input);\n break;\n case isTypeUint(input.type):\n validateUint(parameter, input);\n break;\n case isTypeBool(input.type):\n validateBool(parameter, input);\n break;\n case isTypeContractAddress(input.type):\n // TODO: ??\n break;\n case isTypeStruct(input.type, structs):\n validateStruct(parameter, input, structs);\n break;\n case isTypeTuple(input.type):\n validateTuple(parameter, input);\n break;\n case isTypeArray(input.type):\n validateArray(parameter, input, structs);\n break;\n default:\n throw new Error(\n `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}`\n );\n }\n\n return acc + 1;\n }, 0);\n}\n","/* eslint-disable no-plusplus */\nimport {\n Abi,\n AbiStructs,\n Args,\n ArgsOrCalldata,\n Calldata,\n FunctionAbi,\n HexCalldata,\n RawArgs,\n RawArgsArray,\n Result,\n ValidateType,\n} from '../../types';\nimport assert from '../assert';\nimport { isBigInt, toHex } from '../num';\nimport { getSelectorFromName } from '../selector';\nimport { isLongText, splitLongString } from '../shortString';\nimport { felt, isLen } from './cairo';\nimport formatter from './formatter';\nimport { createAbiParser, isNoConstructorValid } from './parser';\nimport { AbiParserInterface } from './parser/interface';\nimport orderPropsByAbi from './propertyOrder';\nimport { parseCalldataField } from './requestParser';\nimport responseParser from './responseParser';\nimport validateFields from './validate';\n\nexport * as cairo from './cairo';\n\nexport class CallData {\n abi: Abi;\n\n parser: AbiParserInterface;\n\n protected readonly structs: AbiStructs;\n\n constructor(abi: Abi) {\n this.structs = CallData.getAbiStruct(abi);\n this.parser = createAbiParser(abi);\n this.abi = this.parser.getLegacyFormat();\n }\n\n /**\n * Validate arguments passed to the method as corresponding to the ones in the abi\n * @param type ValidateType - type of the method\n * @param method string - name of the method\n * @param args ArgsOrCalldata - arguments that are passed to the method\n */\n public validate(type: ValidateType, method: string, args: ArgsOrCalldata = []) {\n // ensure provided method of type exists\n if (type !== ValidateType.DEPLOY) {\n const invocableFunctionNames = this.abi\n .filter((abi) => {\n if (abi.type !== 'function') return false;\n const isView = abi.stateMutability === 'view' || abi.state_mutability === 'view';\n return type === ValidateType.INVOKE ? !isView : isView;\n })\n .map((abi) => abi.name);\n assert(\n invocableFunctionNames.includes(method),\n `${type === ValidateType.INVOKE ? 'invocable' : 'viewable'} method not found in abi`\n );\n }\n\n // get requested method from abi\n const abiMethod = this.abi.find((abi) =>\n type === ValidateType.DEPLOY\n ? abi.name === method && abi.type === 'constructor'\n : abi.name === method && abi.type === 'function'\n ) as FunctionAbi;\n\n if (isNoConstructorValid(method, args, abiMethod)) {\n return;\n }\n\n // validate arguments length\n const inputsLength = this.parser.methodInputsLength(abiMethod);\n if (args.length !== inputsLength) {\n throw Error(\n `Invalid number of arguments, expected ${inputsLength} arguments, but got ${args.length}`\n );\n }\n\n // validate parameters\n validateFields(abiMethod, args, this.structs);\n }\n\n /**\n * Compile contract callData with abi\n * Parse the calldata by using input fields from the abi for that method\n * @param method string - method name\n * @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order).\n * @return Calldata - parsed arguments in format that contract is expecting\n * @example\n * ```typescript\n * const calldata = myCallData.compile(\"constructor\",[\"0x34a\",[1,3n]]);\n * ```\n * ```typescript\n * const calldata2 = myCallData.compile(\"constructor\",{list:[1,3n],balance:\"0x34\"}); // wrong order is valid\n * ```\n */\n public compile(method: string, argsCalldata: RawArgs): Calldata {\n const abiMethod = this.abi.find((abi) => abi.name === method) as FunctionAbi;\n\n if (isNoConstructorValid(method, argsCalldata, abiMethod)) {\n return [];\n }\n\n let args: RawArgsArray;\n if (Array.isArray(argsCalldata)) {\n args = argsCalldata;\n } else {\n // order the object\n const orderedObject = orderPropsByAbi(argsCalldata, abiMethod.inputs, this.structs);\n args = Object.values(orderedObject);\n // // validate array elements to abi\n validateFields(abiMethod, args, this.structs);\n }\n\n const argsIterator = args[Symbol.iterator]();\n\n const callArray = abiMethod.inputs.reduce(\n (acc, input) =>\n isLen(input.name) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs)),\n [] as Calldata\n );\n\n // add compiled property to array object\n Object.defineProperty(callArray, '__compiled__', {\n enumerable: false,\n writable: false,\n value: true,\n });\n return callArray;\n }\n\n /**\n * Compile contract callData without abi\n * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data\n * @returns Calldata\n */\n static compile(rawArgs: RawArgs): Calldata {\n const createTree = (obj: object) => {\n const getEntries = (o: object, prefix = ''): any => {\n const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o;\n return Object.entries(oe).flatMap(([k, v]) => {\n let value = v;\n if (isLongText(value)) value = splitLongString(value);\n if (k === 'entrypoint') value = getSelectorFromName(value);\n const kk = Array.isArray(oe) && k === '0' ? '$$len' : k;\n if (isBigInt(value)) return [[`${prefix}${kk}`, felt(value)]];\n return Object(value) === value\n ? getEntries(value, `${prefix}${kk}.`)\n : [[`${prefix}${kk}`, felt(value)]];\n });\n };\n return Object.fromEntries(getEntries(obj));\n };\n\n let callTreeArray;\n if (!Array.isArray(rawArgs)) {\n // flatten structs, tuples, add array length. Process leafs as Felt\n const callTree = createTree(rawArgs);\n // convert to array\n callTreeArray = Object.values(callTree);\n } else {\n // already compiled data but modified or raw args provided as array, recompile it\n // recreate tree\n const callObj = { ...rawArgs };\n const callTree = createTree(callObj);\n callTreeArray = Object.values(callTree);\n }\n\n // add compiled property to array object\n Object.defineProperty(callTreeArray, '__compiled__', {\n enumerable: false,\n writable: false,\n value: true,\n });\n return callTreeArray;\n }\n\n /**\n * Parse elements of the response array and structuring them into response object\n * @param method string - method name\n * @param response string[] - response from the method\n * @return Result - parsed response corresponding to the abi\n */\n public parse(method: string, response: string[]): Result {\n const { outputs } = this.abi.find((abi) => abi.name === method) as FunctionAbi;\n const responseIterator = response.flat()[Symbol.iterator]();\n\n const parsed = outputs.flat().reduce((acc, output, idx) => {\n const propName = output.name ?? idx;\n acc[propName] = responseParser(responseIterator, output, this.structs, acc);\n if (acc[propName] && acc[`${propName}_len`]) {\n delete acc[`${propName}_len`];\n }\n return acc;\n }, {} as Args);\n\n // Cairo1 avoid object.0 structure\n return Object.keys(parsed).length === 1 && 0 in parsed ? (parsed[0] as Result) : parsed;\n }\n\n /**\n * Format cairo method response data to native js values based on provided format schema\n * @param method string - cairo method name\n * @param response string[] - cairo method response\n * @param format object - formatter object schema\n * @returns Result - parsed and formatted response object\n */\n public format(method: string, response: string[], format: object): Result {\n const parsed = this.parse(method, response);\n return formatter(parsed, format);\n }\n\n /**\n * Helper to extract structs from abi\n * @param abi Abi\n * @returns AbiStructs - structs from abi\n */\n static getAbiStruct(abi: Abi): AbiStructs {\n return abi\n .filter((abiEntry) => abiEntry.type === 'struct')\n .reduce(\n (acc, abiEntry) => ({\n ...acc,\n [abiEntry.name]: abiEntry,\n }),\n {}\n );\n }\n\n /**\n * Helper: Compile HexCalldata | RawCalldata | RawArgs\n * @param rawCalldata HexCalldata | RawCalldata | RawArgs\n * @returns Calldata\n */\n static toCalldata(rawCalldata: RawArgs = []): Calldata {\n return CallData.compile(rawCalldata);\n }\n\n /**\n * Helper: Convert raw to HexCalldata\n * @param raw HexCalldata | RawCalldata | RawArgs\n * @returns HexCalldata\n */\n static toHex(raw: RawArgs = []): HexCalldata {\n const calldata = CallData.compile(raw);\n return calldata.map((it) => toHex(it));\n }\n}\n","/* eslint-disable no-param-reassign */\n/* eslint-disable import/extensions */\nimport { poseidonHashMany } from 'micro-starknet';\n\nimport { API_VERSION, StarknetChainId, TransactionHashPrefix } from '../constants';\nimport {\n BigNumberish,\n Builtins,\n CompiledContract,\n CompiledSierra,\n CompiledSierraCasm,\n ContractEntryPointFields,\n LegacyCompiledContract,\n RawArgs,\n RawCalldata,\n SierraContractEntryPointFields,\n} from '../types';\nimport { CallData } from './calldata';\nimport { felt } from './calldata/cairo';\nimport { starkCurve } from './ec';\nimport { addHexPrefix, utf8ToArray } from './encode';\nimport { parse, stringify } from './json';\nimport { toBigInt, toHex } from './num';\nimport { getSelectorFromName } from './selector';\nimport { encodeShortString } from './shortString';\n\nexport * as poseidon from '@noble/curves/abstract/poseidon';\nexport * from './selector'; // Preserve legacy export structure\n\nexport const transactionVersion = 1n;\nexport const transactionVersion_2 = 2n;\n// TODO: check do we need to use feeTransactionVersion at all for feeEstimation ?\n// export const feeTransactionVersion = 2n ** 128n + transactionVersion;\n// export const feeTransactionVersion_2 = 2n ** 128n + transactionVersion_2;\nexport const feeTransactionVersion = 1n;\nexport const feeTransactionVersion_2 = 2n;\n\n/**\n * Return versions based on version type, default transaction versions\n * @param versionType 'fee' | 'transaction'\n * @returns versions { v1: bigint; v2: bigint; }\n */\nexport function getVersionsByType(versionType?: 'fee' | 'transaction') {\n return versionType === 'fee'\n ? { v1: feeTransactionVersion, v2: feeTransactionVersion_2 }\n : { v1: transactionVersion, v2: transactionVersion_2 };\n}\n\nexport function computeHashOnElements(data: BigNumberish[]): string {\n return [...data, data.length]\n .reduce((x: BigNumberish, y: BigNumberish) => starkCurve.pedersen(toBigInt(x), toBigInt(y)), 0)\n .toString();\n}\n\n// following implementation is based on this python implementation:\n// https://github.com/starkware-libs/cairo-lang/blob/b614d1867c64f3fb2cf4a4879348cfcf87c3a5a7/src/starkware/starknet/core/os/transaction_hash/transaction_hash.py\n\nexport function calculateTransactionHashCommon(\n txHashPrefix: TransactionHashPrefix,\n version: BigNumberish,\n contractAddress: BigNumberish,\n entryPointSelector: BigNumberish,\n calldata: RawCalldata,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n additionalData: BigNumberish[] = []\n): string {\n const calldataHash = computeHashOnElements(calldata);\n const dataToHash = [\n txHashPrefix,\n version,\n contractAddress,\n entryPointSelector,\n calldataHash,\n maxFee,\n chainId,\n ...additionalData,\n ];\n return computeHashOnElements(dataToHash);\n}\n\nexport function calculateDeployTransactionHash(\n contractAddress: BigNumberish,\n constructorCalldata: RawCalldata,\n version: BigNumberish,\n chainId: StarknetChainId,\n constructorName: string = 'constructor'\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DEPLOY,\n version,\n contractAddress,\n getSelectorFromName(constructorName),\n constructorCalldata,\n 0,\n chainId\n );\n}\n\nexport function calculateDeclareTransactionHash(\n classHash: string,\n senderAddress: BigNumberish,\n version: BigNumberish,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish,\n compiledClassHash?: string\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DECLARE,\n version,\n senderAddress,\n 0,\n [classHash],\n maxFee,\n chainId,\n [nonce, ...(compiledClassHash ? [compiledClassHash] : [])]\n );\n}\n\nexport function calculateDeployAccountTransactionHash(\n contractAddress: BigNumberish,\n classHash: BigNumberish,\n constructorCalldata: RawCalldata,\n salt: BigNumberish,\n version: BigNumberish,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish\n) {\n const calldata = [classHash, salt, ...constructorCalldata];\n\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DEPLOY_ACCOUNT,\n version,\n contractAddress,\n 0,\n calldata,\n maxFee,\n chainId,\n [nonce]\n );\n}\n\nexport function calculateTransactionHash(\n contractAddress: BigNumberish,\n version: BigNumberish,\n calldata: RawCalldata,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.INVOKE,\n version,\n contractAddress,\n 0,\n calldata,\n maxFee,\n chainId,\n [nonce]\n );\n}\n\nexport function calculateContractAddressFromHash(\n salt: BigNumberish,\n classHash: BigNumberish,\n constructorCalldata: RawArgs,\n deployerAddress: BigNumberish\n) {\n const compiledCalldata = CallData.compile(constructorCalldata);\n const constructorCalldataHash = computeHashOnElements(compiledCalldata);\n\n const CONTRACT_ADDRESS_PREFIX = felt('0x535441524b4e45545f434f4e54524143545f41444452455353'); // Equivalent to 'STARKNET_CONTRACT_ADDRESS'\n\n return computeHashOnElements([\n CONTRACT_ADDRESS_PREFIX,\n deployerAddress,\n salt,\n classHash,\n constructorCalldataHash,\n ]);\n}\n\nfunction nullSkipReplacer(key: string, value: any) {\n if (key === 'attributes' || key === 'accessible_scopes') {\n return Array.isArray(value) && value.length === 0 ? undefined : value;\n }\n\n if (key === 'debug_info') {\n return null;\n }\n\n return value === null ? undefined : value;\n}\n\n// about 10x to 100x faster using array to build string\nexport function formatSpaces(json: string) {\n let insideQuotes = false;\n const newString = [];\n // eslint-disable-next-line no-restricted-syntax\n for (const char of json) {\n if (char === '\"' && (newString.length > 0 && newString.slice(-1)[0] === '\\\\') === false) {\n insideQuotes = !insideQuotes;\n }\n if (insideQuotes) {\n newString.push(char);\n } else {\n // eslint-disable-next-line no-nested-ternary\n newString.push(char === ':' ? ': ' : char === ',' ? ', ' : char);\n }\n }\n return newString.join('');\n}\n\nexport default function computeHintedClassHash(compiledContract: LegacyCompiledContract) {\n const { abi, program } = compiledContract;\n const contractClass = { abi, program };\n const serializedJson = formatSpaces(stringify(contractClass, nullSkipReplacer));\n\n return addHexPrefix(starkCurve.keccak(utf8ToArray(serializedJson)).toString(16));\n}\n\n// Computes the class hash of a given contract class\nexport function computeLegacyContractClassHash(contract: LegacyCompiledContract | string) {\n const compiledContract =\n typeof contract === 'string' ? (parse(contract) as LegacyCompiledContract) : contract;\n\n const apiVersion = toHex(API_VERSION);\n\n const externalEntryPointsHash = computeHashOnElements(\n compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset])\n );\n\n const l1HandlerEntryPointsHash = computeHashOnElements(\n compiledContract.entry_points_by_type.L1_HANDLER.flatMap((e) => [e.selector, e.offset])\n );\n\n const constructorEntryPointHash = computeHashOnElements(\n compiledContract.entry_points_by_type.CONSTRUCTOR.flatMap((e) => [e.selector, e.offset])\n );\n\n const builtinsHash = computeHashOnElements(\n compiledContract.program.builtins.map((s) => encodeShortString(s))\n );\n\n const hintedClassHash = computeHintedClassHash(compiledContract);\n\n const dataHash = computeHashOnElements(compiledContract.program.data);\n\n return computeHashOnElements([\n apiVersion,\n externalEntryPointsHash,\n l1HandlerEntryPointsHash,\n constructorEntryPointHash,\n builtinsHash,\n hintedClassHash,\n dataHash,\n ]);\n}\n\n// Cairo1 below\nfunction hashBuiltins(builtins: Builtins) {\n return poseidonHashMany(\n builtins.flatMap((it: any) => {\n return BigInt(encodeShortString(it));\n })\n );\n}\n\nfunction hashEntryPoint(data: ContractEntryPointFields[]) {\n const base = data.flatMap((it: any) => {\n return [BigInt(it.selector), BigInt(it.offset), hashBuiltins(it.builtins)];\n });\n return poseidonHashMany(base);\n}\n\nexport function computeCompiledClassHash(casm: CompiledSierraCasm) {\n const COMPILED_CLASS_VERSION = 'COMPILED_CLASS_V1';\n\n // Hash compiled class version\n const compiledClassVersion = BigInt(encodeShortString(COMPILED_CLASS_VERSION));\n\n // Hash external entry points.\n const externalEntryPointsHash = hashEntryPoint(casm.entry_points_by_type.EXTERNAL);\n\n // Hash L1 handler entry points.\n const l1Handlers = hashEntryPoint(casm.entry_points_by_type.L1_HANDLER);\n\n // Hash constructor entry points.\n const constructor = hashEntryPoint(casm.entry_points_by_type.CONSTRUCTOR);\n\n // Hash bytecode.\n const bytecode = poseidonHashMany(casm.bytecode.map((it: string) => BigInt(it)));\n\n return toHex(\n poseidonHashMany([\n compiledClassVersion,\n externalEntryPointsHash,\n l1Handlers,\n constructor,\n bytecode,\n ])\n );\n}\n\nfunction hashEntryPointSierra(data: SierraContractEntryPointFields[]) {\n const base = data.flatMap((it: any) => {\n return [BigInt(it.selector), BigInt(it.function_idx)];\n });\n return poseidonHashMany(base);\n}\n\nfunction hashAbi(sierra: CompiledSierra) {\n const indentString = formatSpaces(stringify(sierra.abi, null));\n return BigInt(addHexPrefix(starkCurve.keccak(utf8ToArray(indentString)).toString(16)));\n}\n\nexport function computeSierraContractClassHash(sierra: CompiledSierra) {\n const CONTRACT_CLASS_VERSION = 'CONTRACT_CLASS_V0.1.0';\n\n // Hash class version\n const compiledClassVersion = BigInt(encodeShortString(CONTRACT_CLASS_VERSION));\n\n // Hash external entry points.\n const externalEntryPointsHash = hashEntryPointSierra(sierra.entry_points_by_type.EXTERNAL);\n\n // Hash L1 handler entry points.\n const l1Handlers = hashEntryPointSierra(sierra.entry_points_by_type.L1_HANDLER);\n\n // Hash constructor entry points.\n const constructor = hashEntryPointSierra(sierra.entry_points_by_type.CONSTRUCTOR);\n\n // Hash abi_hash.\n const abiHash = hashAbi(sierra);\n\n // Hash Sierra program.\n const sierraProgram = poseidonHashMany(sierra.sierra_program.map((it: string) => BigInt(it)));\n\n return toHex(\n poseidonHashMany([\n compiledClassVersion,\n externalEntryPointsHash,\n l1Handlers,\n constructor,\n abiHash,\n sierraProgram,\n ])\n );\n}\n\n/**\n * Compute ClassHash (sierra or legacy) based on provided contract\n * @param contract CompiledContract | CompiledSierra | string\n * @returns HexString ClassHash\n */\nexport function computeContractClassHash(contract: CompiledContract | string) {\n const compiledContract = typeof contract === 'string' ? parse(contract) : contract;\n\n if ('sierra_program' in compiledContract) {\n return computeSierraContractClassHash(compiledContract as CompiledSierra);\n }\n\n return computeLegacyContractClassHash(compiledContract as LegacyCompiledContract);\n}\n","// TODO rename\nexport * as starkCurve from 'micro-starknet';\nexport * as weierstrass from '@noble/curves/abstract/weierstrass';\n","// the ts-ignore suppresses an esm to cjs import error that is resolved with bundling\n// @ts-ignore\nimport * as json from 'lossless-json';\n\nconst parseIntAsNumberOrBigInt = (x: string) => {\n if (!json.isInteger(x)) return parseFloat(x);\n const v = parseInt(x, 10);\n return Number.isSafeInteger(v) ? v : BigInt(x);\n};\n// NOTE: the String() wrapping is used so the behaviour conforms to JSON.parse()\n// which can accept simple data types but is not represented in the default typing\nexport const parse = (x: string): any => json.parse(String(x), undefined, parseIntAsNumberOrBigInt);\nexport const parseAlwaysAsBig = (x: string): any =>\n json.parse(String(x), undefined, json.parseNumberAndBigInt);\n\n// NOTE: the not-null assertion is used so the return type conforms to JSON.stringify()\n// which can also return undefined but is not represented in the default typing\nexport const stringify = (\n value: json.JavaScriptValue,\n replacer?: any,\n space?: string | number | undefined,\n numberStringifiers?: json.NumberStringifier[] | undefined\n): string => json.stringify(value, replacer, space, numberStringifiers)!;\n\n/** @deprecated equivalent to 'stringify', alias will be removed */\nexport const stringifyAlwaysAsBig = stringify;\n","/**\n * Test whether a string contains an integer number\n */\nexport function isInteger(value: string): boolean {\n return INTEGER_REGEX.test(value)\n}\n\nconst INTEGER_REGEX = /^-?[0-9]+$/\n\n/**\n * Test whether a string contains a number\n * http://stackoverflow.com/questions/13340717/json-numbers-regular-expression\n */\nexport function isNumber(value: string): boolean {\n return NUMBER_REGEX.test(value)\n}\n\nconst NUMBER_REGEX = /^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$/\n\n/**\n * Test whether a string can be safely represented with a number\n * without information.\n *\n * When approx is true, floating point numbers that lose a few digits but\n * are still approximately equal in value are considered safe too.\n * Integer numbers must still be exactly equal.\n */\nexport function isSafeNumber(\n value: string,\n config?: {\n approx: boolean\n }\n): boolean {\n const num = parseFloat(value)\n const str = String(num)\n\n const v = extractSignificantDigits(value)\n const s = extractSignificantDigits(str)\n\n if (v === s) {\n return true\n }\n\n if (config?.approx === true) {\n // A value is approximately equal when:\n // 1. it is a floating point number, not an integer\n // 2. it has at least 14 digits\n // 3. the first 14 digits are equal\n const requiredDigits = 14\n if (\n !isInteger(value) &&\n s.length >= requiredDigits &&\n v.startsWith(s.substring(0, requiredDigits))\n ) {\n return true\n }\n }\n\n return false\n}\n\nexport enum UnsafeNumberReason {\n underflow = 'underflow',\n overflow = 'overflow',\n truncate_integer = 'truncate_integer',\n truncate_float = 'truncate_float'\n}\n\n/**\n * When the provided value is an unsafe number, describe what the reason is:\n * overflow, underflow, truncate_integer, or truncate_float.\n * Returns undefined when the value is safe.\n */\nexport function getUnsafeNumberReason(value: string): UnsafeNumberReason | undefined {\n if (isSafeNumber(value, { approx: false })) {\n return undefined\n }\n\n if (isInteger(value)) {\n return UnsafeNumberReason.truncate_integer\n }\n\n const num = parseFloat(value)\n if (!isFinite(num)) {\n return UnsafeNumberReason.overflow\n }\n\n if (num === 0) {\n return UnsafeNumberReason.underflow\n }\n\n return UnsafeNumberReason.truncate_float\n}\n\n/**\n * Convert a string into a number when it is safe to do so.\n * Throws an error otherwise, explaining the reason.\n */\nexport function toSafeNumberOrThrow(\n value: string,\n config?: {\n approx: boolean\n }\n): number {\n const number = parseFloat(value)\n\n const unsafeReason = getUnsafeNumberReason(value)\n if (\n config?.approx === true\n ? unsafeReason && unsafeReason !== UnsafeNumberReason.truncate_float\n : unsafeReason\n ) {\n const unsafeReasonText = unsafeReason.replace(/_\\w+$/, '')\n throw new Error(\n 'Cannot safely convert to number: ' +\n `the value '${value}' would ${unsafeReasonText} and become ${number}`\n )\n }\n\n return number\n}\n\n/**\n * Get the significant digits of a number.\n *\n * For example:\n * '2.34' returns '234'\n * '-77' returns '77'\n * '0.003400' returns '34'\n * '120.5e+30' returns '1205'\n **/\nexport function extractSignificantDigits(value: string): string {\n return (\n value\n // from \"-0.250e+30\" to \"-0.250\"\n .replace(EXPONENTIAL_PART_REGEX, '')\n\n // from \"-0.250\" to \"-0250\"\n .replace(DOT_REGEX, '')\n\n // from \"-0250\" to \"-025\"\n .replace(TRAILING_ZEROS_REGEX, '')\n\n // from \"-025\" to \"25\"\n .replace(LEADING_MINUS_AND_ZEROS_REGEX, '')\n )\n}\n\nconst EXPONENTIAL_PART_REGEX = /[eE][+-]?\\d+$/\nconst LEADING_MINUS_AND_ZEROS_REGEX = /^-?(0*)?/\nconst DOT_REGEX = /\\./\nconst TRAILING_ZEROS_REGEX = /0+$/\n","import {\n extractSignificantDigits,\n getUnsafeNumberReason,\n isInteger,\n isNumber,\n UnsafeNumberReason\n} from './utils.js'\n\n/**\n * A lossless number. Stores its numeric value as string\n */\nexport class LosslessNumber {\n // numeric value as string\n value: string\n\n // type information\n isLosslessNumber = true\n\n constructor(value: string) {\n if (!isNumber(value)) {\n throw new Error('Invalid number (value: \"' + value + '\")')\n }\n\n this.value = value\n }\n\n /**\n * Get the value of the LosslessNumber as number or bigint.\n *\n * - a number is returned for safe numbers and decimal values that only lose some insignificant digits\n * - a bigint is returned for big integer numbers\n * - an Error is thrown for values that will overflow or underflow\n *\n * Note that you can implement your own strategy for conversion by just getting the value as string\n * via .toString(), and using util functions like isInteger, isSafeNumber, getUnsafeNumberReason,\n * and toSafeNumberOrThrow to convert it to a numeric value.\n */\n valueOf(): number | bigint {\n const unsafeReason = getUnsafeNumberReason(this.value)\n\n // safe or truncate_float\n if (unsafeReason === undefined || unsafeReason === UnsafeNumberReason.truncate_float) {\n return parseFloat(this.value)\n }\n\n // truncate_integer\n if (isInteger(this.value)) {\n return BigInt(this.value)\n }\n\n // overflow or underflow\n throw new Error(\n 'Cannot safely convert to number: ' +\n `the value '${this.value}' would ${unsafeReason} and become ${parseFloat(this.value)}`\n )\n }\n\n /**\n * Get the value of the LosslessNumber as string.\n */\n toString(): string {\n return this.value\n }\n\n // Note: we do NOT implement a .toJSON() method, and you should not implement\n // or use that, it cannot safely turn the numeric value in the string into\n // stringified JSON since it has to be parsed into a number first.\n}\n\n/**\n * Test whether a value is a LosslessNumber\n */\nexport function isLosslessNumber(value: unknown): value is LosslessNumber {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return (value && typeof value === 'object' && value.isLosslessNumber === true) || false\n}\n\n/**\n * Convert a number into a LosslessNumber if this is possible in a safe way\n * If the value has too many digits, or is NaN or Infinity, an error will be thrown\n */\nexport function toLosslessNumber(value: number): LosslessNumber {\n if (extractSignificantDigits(value + '').length > 15) {\n throw new Error(\n 'Invalid number: contains more than 15 digits and is most likely truncated and unsafe by itself ' +\n `(value: ${value})`\n )\n }\n\n if (isNaN(value)) {\n throw new Error('Invalid number: NaN')\n }\n\n if (!isFinite(value)) {\n throw new Error('Invalid number: ' + value)\n }\n\n return new LosslessNumber(String(value))\n}\n","import { LosslessNumber } from './LosslessNumber.js'\nimport { isInteger } from './utils.js'\n\nexport function parseLosslessNumber(value: string): LosslessNumber {\n return new LosslessNumber(value)\n}\n\nexport function parseNumberAndBigInt(value: string): number | bigint {\n return isInteger(value) ? BigInt(value) : parseFloat(value)\n}\n","import { isLosslessNumber } from './LosslessNumber.js'\nimport type { GenericObject, Reviver } from './types'\n\n/**\n * Revive a json object.\n * Applies the reviver function recursively on all values in the JSON object.\n * @param json A JSON Object, Array, or value\n * @param reviver\n * A reviver function invoked with arguments `key` and `value`,\n * which must return a replacement value. The function context\n * (`this`) is the Object or Array that contains the currently\n * handled value.\n */\nexport function revive(json: unknown, reviver: Reviver): unknown {\n return reviveValue({ '': json }, '', json, reviver)\n}\n\n/**\n * Revive a value\n */\nfunction reviveValue(\n context: GenericObject | Array,\n key: string,\n value: unknown,\n reviver: Reviver\n): unknown {\n if (Array.isArray(value)) {\n return reviver.call(context, key, reviveArray(value, reviver))\n } else if (value && typeof value === 'object' && !isLosslessNumber(value)) {\n // note the special case for LosslessNumber,\n // we don't want to iterate over the internals of a LosslessNumber\n return reviver.call(\n context,\n key,\n reviveObject(value as unknown as GenericObject, reviver)\n )\n } else {\n return reviver.call(context, key, value)\n }\n}\n\n/**\n * Revive the properties of an object\n */\nfunction reviveObject(object: GenericObject, reviver: Reviver) {\n Object.keys(object).forEach((key) => {\n const value = reviveValue(object, key, object[key], reviver)\n if (value !== undefined) {\n object[key] = value\n } else {\n delete object[key]\n }\n })\n\n return object\n}\n\n/**\n * Revive the properties of an Array\n */\nfunction reviveArray(array: Array, reviver: Reviver): Array {\n for (let i = 0; i < array.length; i++) {\n array[i] = reviveValue(array, i + '', array[i], reviver)\n }\n\n return array\n}\n","import { parseLosslessNumber } from './numberParsers.js'\nimport { revive } from './revive.js'\nimport type { NumberParser, Reviver } from './types'\nimport { GenericObject, JavaScriptValue } from './types'\n\n/**\n * The LosslessJSON.parse() method parses a string as JSON, optionally transforming\n * the value produced by parsing.\n *\n * The parser is based on the parser of Tan Li Hou shared in\n * https://lihautan.com/json-parser-with-javascript/\n *\n * @param text\n * The string to parse as JSON. See the JSON object for a description of JSON syntax.\n *\n * @param [reviver]\n * If a function, prescribes how the value originally produced by parsing is\n * transformed, before being returned.\n *\n * @param [parseNumber=parseLosslessNumber]\n * Pass a custom number parser. Input is a string, and the output can be unknown\n * numeric value: number, bigint, LosslessNumber, or a custom BigNumber library.\n *\n * @returns Returns the Object corresponding to the given JSON text.\n *\n * @throws Throws a SyntaxError exception if the string to parse is not valid JSON.\n */\nexport function parse(\n text: string,\n reviver?: Reviver,\n parseNumber: NumberParser = parseLosslessNumber\n): JavaScriptValue {\n let i = 0\n const value = parseValue()\n expectValue(value)\n expectEndOfInput()\n\n return reviver ? revive(value, reviver) : value\n\n function parseObject(): GenericObject | undefined {\n if (text.charCodeAt(i) === codeOpeningBrace) {\n i++\n skipWhitespace()\n\n const object: GenericObject = {}\n let initial = true\n while (i < text.length && text.charCodeAt(i) !== codeClosingBrace) {\n if (!initial) {\n eatComma()\n skipWhitespace()\n } else {\n initial = false\n }\n\n const start = i\n\n const key = parseString()\n if (key === undefined) {\n throwObjectKeyExpected()\n }\n\n skipWhitespace()\n eatColon()\n const value = parseValue()\n\n if (value === undefined) {\n throwObjectValueExpected()\n }\n\n // TODO: test deep equal instead of strict equal\n if (Object.prototype.hasOwnProperty.call(object, key) && !isDeepEqual(value, object[key])) {\n // Note that we could also test `if(key in object) {...}`\n // or `if (object[key] !== 'undefined') {...}`, but that is slower.\n throwDuplicateKey(key, start + 1)\n }\n\n object[key] = value\n }\n\n if (text.charCodeAt(i) !== codeClosingBrace) {\n throwObjectKeyOrEndExpected()\n }\n i++\n\n return object\n }\n }\n\n function parseArray(): Array | unknown {\n if (text.charCodeAt(i) === codeOpeningBracket) {\n i++\n skipWhitespace()\n\n const array = []\n let initial = true\n while (i < text.length && text.charCodeAt(i) !== codeClosingBracket) {\n if (!initial) {\n eatComma()\n } else {\n initial = false\n }\n\n const value = parseValue()\n expectArrayItem(value)\n array.push(value)\n }\n\n if (text.charCodeAt(i) !== codeClosingBracket) {\n throwArrayItemOrEndExpected()\n }\n i++\n\n return array\n }\n }\n\n function parseValue(): unknown {\n skipWhitespace()\n\n const value =\n parseString() ??\n parseNumeric() ??\n parseObject() ??\n parseArray() ??\n parseKeyword('true', true) ??\n parseKeyword('false', false) ??\n parseKeyword('null', null)\n\n skipWhitespace()\n\n return value\n }\n\n function parseKeyword(name: string, value: unknown): unknown | undefined {\n if (text.slice(i, i + name.length) === name) {\n i += name.length\n return value\n }\n }\n\n function skipWhitespace() {\n while (isWhitespace(text.charCodeAt(i))) {\n i++\n }\n }\n\n function parseString() {\n if (text.charCodeAt(i) === codeDoubleQuote) {\n i++\n let result = ''\n while (i < text.length && text.charCodeAt(i) !== codeDoubleQuote) {\n if (text.charCodeAt(i) === codeBackslash) {\n const char = text[i + 1]\n const escapeChar = escapeCharacters[char]\n if (escapeChar !== undefined) {\n result += escapeChar\n i++\n } else if (char === 'u') {\n if (\n isHex(text.charCodeAt(i + 2)) &&\n isHex(text.charCodeAt(i + 3)) &&\n isHex(text.charCodeAt(i + 4)) &&\n isHex(text.charCodeAt(i + 5))\n ) {\n result += String.fromCharCode(parseInt(text.slice(i + 2, i + 6), 16))\n i += 5\n } else {\n throwInvalidUnicodeCharacter(i)\n }\n } else {\n throwInvalidEscapeCharacter(i)\n }\n } else {\n if (isValidStringCharacter(text.charCodeAt(i))) {\n result += text[i]\n } else {\n throwInvalidCharacter(text[i])\n }\n }\n i++\n }\n expectEndOfString()\n i++\n return result\n }\n }\n\n function parseNumeric() {\n const start = i\n if (text.charCodeAt(i) === codeMinus) {\n i++\n expectDigit(start)\n }\n\n if (text.charCodeAt(i) === codeZero) {\n i++\n } else if (isNonZeroDigit(text.charCodeAt(i))) {\n i++\n while (isDigit(text.charCodeAt(i))) {\n i++\n }\n }\n\n if (text.charCodeAt(i) === codeDot) {\n i++\n expectDigit(start)\n while (isDigit(text.charCodeAt(i))) {\n i++\n }\n }\n\n if (text.charCodeAt(i) === codeLowercaseE || text.charCodeAt(i) === codeUppercaseE) {\n i++\n if (text.charCodeAt(i) === codeMinus || text.charCodeAt(i) === codePlus) {\n i++\n }\n expectDigit(start)\n while (isDigit(text.charCodeAt(i))) {\n i++\n }\n }\n\n if (i > start) {\n return parseNumber(text.slice(start, i))\n }\n }\n\n function eatComma() {\n if (text.charCodeAt(i) !== codeComma) {\n throw new SyntaxError(`Comma ',' expected after value ${gotAt()}`)\n }\n i++\n }\n\n function eatColon() {\n if (text.charCodeAt(i) !== codeColon) {\n throw new SyntaxError(`Colon ':' expected after property name ${gotAt()}`)\n }\n i++\n }\n\n function expectValue(value: unknown) {\n if (value === undefined) {\n throw new SyntaxError(`JSON value expected ${gotAt()}`)\n }\n }\n\n function expectArrayItem(value: unknown) {\n if (value === undefined) {\n throw new SyntaxError(`Array item expected ${gotAt()}`)\n }\n }\n\n function expectEndOfInput() {\n if (i < text.length) {\n throw new SyntaxError(`Expected end of input ${gotAt()}`)\n }\n }\n\n function expectDigit(start: number) {\n if (!isDigit(text.charCodeAt(i))) {\n const numSoFar = text.slice(start, i)\n throw new SyntaxError(`Invalid number '${numSoFar}', expecting a digit ${gotAt()}`)\n }\n }\n\n function expectEndOfString() {\n if (text.charCodeAt(i) !== codeDoubleQuote) {\n throw new SyntaxError(`End of string '\"' expected ${gotAt()}`)\n }\n }\n\n function throwObjectKeyExpected() {\n throw new SyntaxError(`Quoted object key expected ${gotAt()}`)\n }\n\n function throwDuplicateKey(key: string, pos: number) {\n throw new SyntaxError(`Duplicate key '${key}' encountered at position ${pos}`)\n }\n\n function throwObjectKeyOrEndExpected() {\n throw new SyntaxError(`Quoted object key or end of object '}' expected ${gotAt()}`)\n }\n\n function throwArrayItemOrEndExpected() {\n throw new SyntaxError(`Array item or end of array ']' expected ${gotAt()}`)\n }\n\n function throwInvalidCharacter(char: string) {\n throw new SyntaxError(`Invalid character '${char}' ${pos()}`)\n }\n\n function throwInvalidEscapeCharacter(start: number) {\n const chars = text.slice(start, start + 2)\n throw new SyntaxError(`Invalid escape character '${chars}' ${pos()}`)\n }\n\n function throwObjectValueExpected() {\n throw new SyntaxError(`Object value expected after ':' ${pos()}`)\n }\n\n function throwInvalidUnicodeCharacter(start: number) {\n let end = start + 2\n while (/\\w/.test(text[end])) {\n end++\n }\n const chars = text.slice(start, end)\n throw new SyntaxError(`Invalid unicode character '${chars}' ${pos()}`)\n }\n\n // zero based character position\n function pos(): string {\n return `at position ${i}`\n }\n\n function got(): string {\n return i < text.length ? `but got '${text[i]}'` : 'but reached end of input'\n }\n\n function gotAt(): string {\n return got() + ' ' + pos()\n }\n}\n\nfunction isWhitespace(code: number): boolean {\n return code === codeSpace || code === codeNewline || code === codeTab || code === codeReturn\n}\n\nfunction isHex(code: number): boolean {\n return (\n (code >= codeZero && code <= codeNine) ||\n (code >= codeUppercaseA && code <= codeUppercaseF) ||\n (code >= codeLowercaseA && code <= codeLowercaseF)\n )\n}\n\nfunction isDigit(code: number): boolean {\n return code >= codeZero && code <= codeNine\n}\n\nfunction isNonZeroDigit(code: number): boolean {\n return code >= codeOne && code <= codeNine\n}\n\nexport function isValidStringCharacter(code: number): boolean {\n return code >= 0x20 && code <= 0x10ffff\n}\n\nexport function isDeepEqual(a: unknown, b: unknown): boolean {\n if (a === b) {\n return true\n }\n\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, index) => isDeepEqual(item, b[index]))\n }\n\n if (isObject(a) && isObject(b)) {\n const keys = [...new Set([...Object.keys(a), ...Object.keys(b)])]\n return keys.every((key) => isDeepEqual(a[key], b[key]))\n }\n\n return false\n}\n\nfunction isObject(value: unknown): value is Record {\n return typeof value === 'object' && value !== null\n}\n\n// map with all escape characters\nconst escapeCharacters: GenericObject = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseString()\n}\n\nconst codeBackslash = 0x5c // \"\\\"\nconst codeOpeningBrace = 0x7b // \"{\"\nconst codeClosingBrace = 0x7d // \"}\"\nconst codeOpeningBracket = 0x5b // \"[\"\nconst codeClosingBracket = 0x5d // \"]\"\nconst codeSpace = 0x20 // \" \"\nconst codeNewline = 0xa // \"\\n\"\nconst codeTab = 0x9 // \"\\t\"\nconst codeReturn = 0xd // \"\\r\"\nconst codeDoubleQuote = 0x0022 // \"\nconst codePlus = 0x2b // \"+\"\nconst codeMinus = 0x2d // \"-\"\nconst codeZero = 0x30\nconst codeOne = 0x31\nconst codeNine = 0x39\nconst codeComma = 0x2c // \",\"\nconst codeDot = 0x2e // \".\" (dot, period)\nconst codeColon = 0x3a // \":\"\nexport const codeUppercaseA = 0x41 // \"A\"\nexport const codeLowercaseA = 0x61 // \"a\"\nexport const codeUppercaseE = 0x45 // \"E\"\nexport const codeLowercaseE = 0x65 // \"e\"\nexport const codeUppercaseF = 0x46 // \"F\"\nexport const codeLowercaseF = 0x66 // \"f\"\n","import type { GenericObject, Replacer, NumberStringifier, JavaScriptValue } from './types'\nimport { isNumber } from './utils.js'\n\n/**\n * The LosslessJSON.stringify() method converts a JavaScript value to a JSON string,\n * optionally replacing values if a replacer function is specified, or\n * optionally including only the specified properties if a replacer array is specified.\n *\n * @param value\n * The value to convert to a JSON string.\n *\n * @param [replacer]\n * A function that alters the behavior of the stringification process,\n * or an array of String and Number objects that serve as a whitelist for\n * selecting the properties of the value object to be included in the JSON string.\n * If this value is null or not provided, all properties of the object are\n * included in the resulting JSON string.\n *\n * @param [space]\n * A String or Number object that's used to insert white space into the output\n * JSON string for readability purposes. If this is a Number, it indicates the\n * number of space characters to use as white space; this number is capped at 10\n * if it's larger than that. Values less than 1 indicate that no space should be\n * used. If this is a String, the string (or the first 10 characters of the string,\n * if it's longer than that) is used as white space. If this parameter is not\n * provided (or is null), no white space is used.\n *\n * @param [numberStringifiers]\n * An optional list with additional number stringifiers, for example to serialize\n * a BigNumber. The output of the function must be valid stringified JSON.\n * When `undefined` is returned, the property will be deleted from the object.\n * The difference with using a `replacer` is that the output of a `replacer`\n * must be JSON and will be stringified afterwards, whereas the output of the\n * `numberStringifiers` is already stringified JSON.\n *\n * @returns Returns the string representation of the JSON object.\n */\nexport function stringify(\n value: JavaScriptValue,\n replacer?: Replacer,\n space?: number | string,\n numberStringifiers?: NumberStringifier[]\n): string | undefined {\n const resolvedSpace = resolveSpace(space)\n\n const replacedValue =\n typeof replacer === 'function' ? replacer.call({ '': value }, '', value) : value\n\n return stringifyValue(replacedValue, '')\n\n /**\n * Stringify a value\n */\n function stringifyValue(value: unknown, indent: string): string | undefined {\n if (Array.isArray(numberStringifiers)) {\n const stringifier = numberStringifiers.find((item) => item.test(value))\n if (stringifier) {\n const str = stringifier.stringify(value)\n if (typeof str !== 'string' || !isNumber(str)) {\n throw new Error(\n 'Invalid JSON number: ' +\n 'output of a number stringifier must be a string containing a JSON number ' +\n `(output: ${str})`\n )\n }\n return str\n }\n }\n\n // boolean, null, number, string, or date\n if (\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string' ||\n value === null ||\n value instanceof Date ||\n value instanceof Boolean ||\n value instanceof Number ||\n value instanceof String\n ) {\n return JSON.stringify(value)\n }\n\n // lossless number, the secret ingredient :)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (value && value.isLosslessNumber) {\n return value.toString()\n }\n\n // BigInt\n if (typeof value === 'bigint') {\n return value.toString()\n }\n\n // Array\n if (Array.isArray(value)) {\n return stringifyArray(value, indent)\n }\n\n // Object (test lastly!)\n if (value && typeof value === 'object') {\n return stringifyObject(value as GenericObject, indent)\n }\n\n return undefined\n }\n\n /**\n * Stringify an array\n */\n function stringifyArray(array: Array, indent: string): string {\n if (array.length === 0) {\n return '[]'\n }\n\n const childIndent = resolvedSpace ? indent + resolvedSpace : undefined\n let str = resolvedSpace ? '[\\n' : '['\n\n for (let i = 0; i < array.length; i++) {\n const item =\n typeof replacer === 'function' ? replacer.call(array, String(i), array[i]) : array[i]\n\n if (resolvedSpace) {\n str += childIndent\n }\n\n if (typeof item !== 'undefined' && typeof item !== 'function') {\n str += stringifyValue(item, childIndent)\n } else {\n str += 'null'\n }\n\n if (i < array.length - 1) {\n str += resolvedSpace ? ',\\n' : ','\n }\n }\n\n str += resolvedSpace ? '\\n' + indent + ']' : ']'\n return str\n }\n\n /**\n * Stringify an object\n */\n function stringifyObject(object: GenericObject, indent: string): string {\n if (typeof object.toJSON === 'function') {\n return stringify(object.toJSON(), replacer, space, undefined)\n }\n\n const keys: string[] = Array.isArray(replacer) ? replacer.map(String) : Object.keys(object)\n\n if (keys.length === 0) {\n return '{}'\n }\n\n const childIndent = resolvedSpace ? indent + resolvedSpace : undefined\n let first = true\n let str = resolvedSpace ? '{\\n' : '{'\n\n keys.forEach((key) => {\n const value =\n typeof replacer === 'function' ? replacer.call(object, key, object[key]) : object[key]\n\n if (includeProperty(key, value)) {\n if (first) {\n first = false\n } else {\n str += resolvedSpace ? ',\\n' : ','\n }\n\n const keyStr = JSON.stringify(key)\n str += resolvedSpace ? childIndent + keyStr + ': ' : keyStr + ':'\n\n str += stringifyValue(value, childIndent)\n }\n })\n\n str += resolvedSpace ? '\\n' + indent + '}' : '}'\n return str\n }\n\n /**\n * Test whether to include a property in a stringified object or not.\n */\n function includeProperty(key: string, value: unknown): boolean {\n return typeof value !== 'undefined' && typeof value !== 'function' && typeof value !== 'symbol'\n }\n}\n\n/**\n * Resolve a JSON stringify space:\n * replace a number with a string containing that number of spaces\n */\nfunction resolveSpace(space: number | string | undefined): string | undefined {\n if (typeof space === 'number') {\n return ' '.repeat(space)\n }\n\n if (typeof space === 'string' && space !== '') {\n return space\n }\n\n return undefined\n}\n","import { getStarkKey, utils } from 'micro-starknet';\nimport { gzip, ungzip } from 'pako';\n\nimport { ArraySignatureType, BigNumberish, CompressedProgram, Program, Signature } from '../types';\nimport { addHexPrefix, arrayBufferToString, atobUniversal, btoaUniversal } from './encode';\nimport { parse, stringify } from './json';\nimport {\n bigNumberishArrayToDecimalStringArray,\n bigNumberishArrayToHexadecimalStringArray,\n toBigInt,\n toHex,\n} from './num';\n\n/**\n * Function to compress compiled cairo program\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/services/api/gateway/transaction.py#L54-L58)\n * @param jsonProgram - json file representing the compiled cairo program\n * @returns Compressed cairo program\n */\nexport function compressProgram(jsonProgram: Program | string): CompressedProgram {\n const stringified = typeof jsonProgram === 'string' ? jsonProgram : stringify(jsonProgram);\n const compressedProgram = gzip(stringified);\n return btoaUniversal(compressedProgram);\n}\n\n/**\n * Function to decompress compressed compiled cairo program\n *\n * @param base64 CompressedProgram\n * @returns parsed decompressed compiled cairo program\n */\nexport function decompressProgram(base64: CompressedProgram) {\n if (Array.isArray(base64)) return base64;\n const decompressed = arrayBufferToString(ungzip(atobUniversal(base64)));\n return parse(decompressed);\n}\n\nexport function randomAddress(): string {\n const randomKeyPair = utils.randomPrivateKey();\n return getStarkKey(randomKeyPair);\n}\n\nexport function makeAddress(input: string): string {\n return addHexPrefix(input).toLowerCase();\n}\n\nexport function formatSignature(sig?: Signature): ArraySignatureType {\n if (!sig) throw Error('formatSignature: provided signature is undefined');\n if (Array.isArray(sig)) {\n return sig.map((it) => toHex(it));\n }\n try {\n const { r, s } = sig;\n return [toHex(r), toHex(s)];\n } catch (e) {\n throw new Error('Signature need to be weierstrass.SignatureType or an array for custom');\n }\n}\n\nexport function signatureToDecimalArray(sig?: Signature): ArraySignatureType {\n return bigNumberishArrayToDecimalStringArray(formatSignature(sig));\n}\n\nexport function signatureToHexArray(sig?: Signature): ArraySignatureType {\n return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig));\n}\n\nexport function estimatedFeeToMaxFee(estimatedFee: BigNumberish, overhead: number = 0.5): bigint {\n // BN can only handle Integers, so we need to do all calulations with integers\n const overHeadPercent = Math.round((1 + overhead) * 100);\n return (toBigInt(estimatedFee) * toBigInt(overHeadPercent)) / 100n;\n}\n","\n/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED$1 = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN$1 = 2;\n\n/*============================================================================*/\n\n\nfunction zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH$1 = 3;\nconst MAX_MATCH$1 = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES$1 = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS$1 = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES$1 = 30;\n/* number of distance codes */\n\nconst BL_CODES$1 = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE$1 = 2 * L_CODES$1 + 1;\n/* maximum heap size */\n\nconst MAX_BITS$1 = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES$1 + 2) * 2);\nzero$1(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES$1 * 2);\nzero$1(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero$1(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1);\nzero$1(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES$1);\nzero$1(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES$1);\nzero$1(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nconst d_code = (dist) => {\n\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n};\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nconst put_short = (s, w) => {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n};\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nconst send_bits = (s, value, length) => {\n\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n};\n\n\nconst send_code = (s, c, tree) => {\n\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n};\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nconst bi_reverse = (code, len) => {\n\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nconst bi_flush = (s) => {\n\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n};\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nconst gen_bitlen = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS$1; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Tracev((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Tracev((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n};\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nconst gen_codes = (tree, max_code, bl_count) => {\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n\n const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS$1; bits++) {\n code = (code + bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< {\n\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS$1 + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES$1 - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES$1; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS$1; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES$1 + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES$1; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS);\n\n //static_init_done = true;\n};\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nconst init_block = (s) => {\n\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.sym_next = s.matches = 0;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nconst bi_windup = (s) =>\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n};\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nconst smaller = (tree, n, m, depth) => {\n\n const _n2 = n * 2;\n const _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n};\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nconst pqdownheap = (s, tree, k) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n};\n\n\n// inlined manually\n// const SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nconst compress_block = (s, ltree, dtree) => {\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let sx = 0; /* running index in sym_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.sym_next !== 0) {\n do {\n dist = s.pending_buf[s.sym_buf + sx++] & 0xff;\n dist += (s.pending_buf[s.sym_buf + sx++] & 0xff) << 8;\n lc = s.pending_buf[s.sym_buf + sx++];\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and sym_buf is ok: */\n //Assert(s->pending < s->lit_bufsize + sx, \"pendingBuf overflow\");\n\n } while (sx < s.sym_next);\n }\n\n send_code(s, END_BLOCK, ltree);\n};\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nconst build_tree = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE$1;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n};\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nconst scan_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nconst send_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nconst build_bl_tree = (s) => {\n\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n};\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nconst send_all_trees = (s, lcodes, dcodes, blcodes) => {\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n};\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"block list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"allow list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nconst detect_data_type = (s) => {\n /* block_mask is the bit mask of block-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let block_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"block-listed\") bytes. */\n for (n = 0; n <= 31; n++, block_mask >>>= 1) {\n if ((block_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"allow-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS$1; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"block-listed\" or \"allow-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n};\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nconst _tr_init$1 = (s) =>\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n};\n\n\n/* ===========================================================================\n * Send a stored block\n */\nconst _tr_stored_block$1 = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n bi_windup(s); /* align on byte boundary */\n put_short(s, stored_len);\n put_short(s, ~stored_len);\n if (stored_len) {\n s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);\n }\n s.pending += stored_len;\n};\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nconst _tr_align$1 = (s) => {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n};\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and write out the encoded block.\n */\nconst _tr_flush_block$1 = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN$1) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->sym_next / 3));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block$1(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n};\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nconst _tr_tally$1 = (s, dist, lc) => {\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n\n s.pending_buf[s.sym_buf + s.sym_next++] = dist;\n s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;\n s.pending_buf[s.sym_buf + s.sym_next++] = lc;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n return (s.sym_next === s.sym_end);\n};\n\nvar _tr_init_1 = _tr_init$1;\nvar _tr_stored_block_1 = _tr_stored_block$1;\nvar _tr_flush_block_1 = _tr_flush_block$1;\nvar _tr_tally_1 = _tr_tally$1;\nvar _tr_align_1 = _tr_align$1;\n\nvar trees = {\n\t_tr_init: _tr_init_1,\n\t_tr_stored_block: _tr_stored_block_1,\n\t_tr_flush_block: _tr_flush_block_1,\n\t_tr_tally: _tr_tally_1,\n\t_tr_align: _tr_align_1\n};\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nvar adler32_1 = adler32;\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nvar crc32_1 = crc32;\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar messages = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar constants$2 = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees;\n\n\n\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH: Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$3, Z_BLOCK: Z_BLOCK$1,\n Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_BUF_ERROR: Z_BUF_ERROR$1,\n Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1,\n Z_UNKNOWN,\n Z_DEFLATED: Z_DEFLATED$2\n} = constants$2;\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS$1 = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42; /* zlib header -> BUSY_STATE */\n//#ifdef GZIP\nconst GZIP_STATE = 57; /* gzip header -> BUSY_STATE | EXTRA_STATE */\n//#endif\nconst EXTRA_STATE = 69; /* gzip extra block -> NAME_STATE */\nconst NAME_STATE = 73; /* gzip file name -> COMMENT_STATE */\nconst COMMENT_STATE = 91; /* gzip comment -> HCRC_STATE */\nconst HCRC_STATE = 103; /* gzip header CRC -> BUSY_STATE */\nconst BUSY_STATE = 113; /* deflate -> FINISH_STATE */\nconst FINISH_STATE = 666; /* stream complete */\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = messages[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) * 2) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n/* ===========================================================================\n * Slide the hash table when sliding the window down (could be avoided with 32\n * bit values at the expense of memory usage). We slide even when level == 0 to\n * keep the hash table consistent if we switch back to level > 0 later.\n */\nconst slide_hash = (s) => {\n let n, m;\n let p;\n let wsize = s.w_size;\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= wsize ? m - wsize : 0);\n } while (--n);\n n = wsize;\n//#ifndef FASTEST\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= wsize ? m - wsize : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n//#endif\n};\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\nlet HASH = HASH_ZLIB;\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output, except for\n * some deflate_stored() output, goes through this function so some\n * applications may wish to modify it to avoid allocating a large\n * strm->next_out buffer and copying into it. (See also read_buf()).\n */\nconst flush_pending = (strm) => {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n};\n\n\nconst flush_block_only = (s, last) => {\n _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n};\n\n\nconst put_byte = (s, b) => {\n s.pending_buf[s.pending++] = b;\n};\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nconst putShortMSB = (s, b) => {\n\n // put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n};\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nconst read_buf = (strm, buf, start, size) => {\n\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32_1(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32_1(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n};\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nconst longest_match = (s, cur_match) => {\n\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n};\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nconst fill_window = (s) => {\n\n const _w_size = s.w_size;\n let n, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n slide_hash(s);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// const curr = s.strstart + s.lookahead;\n// let init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n};\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n *\n * In case deflateParams() is used to later switch to a non-zero compression\n * level, s->matches (otherwise unused when storing) keeps track of the number\n * of hash table slides to perform. If s->matches is 1, then one hash table\n * slide will be done when switching. If s->matches is 2, the maximum value\n * allowed here, then the hash table will be cleared, since two or more slides\n * is the same as a clear.\n *\n * deflate_stored() is written to minimize the number of times an input byte is\n * copied. It is most efficient with large input and output buffers, which\n * maximizes the opportunites to have a single copy from next_in to next_out.\n */\nconst deflate_stored = (s, flush) => {\n\n /* Smallest worthy block size when not flushing or finishing. By default\n * this is 32K. This can be as small as 507 bytes for memLevel == 1. For\n * large input and output buffers, the stored block size will be larger.\n */\n let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;\n\n /* Copy as many min_block or larger stored blocks directly to next_out as\n * possible. If flushing, copy the remaining available input to next_out as\n * stored blocks, if there is enough space.\n */\n let len, left, have, last = 0;\n let used = s.strm.avail_in;\n do {\n /* Set len to the maximum size block that we can copy directly with the\n * available input data and output space. Set left to how much of that\n * would be copied from what's left in the window.\n */\n len = 65535/* MAX_STORED */; /* maximum deflate stored block length */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n if (s.strm.avail_out < have) { /* need room for header */\n break;\n }\n /* maximum stored block length that will fit in avail_out: */\n have = s.strm.avail_out - have;\n left = s.strstart - s.block_start; /* bytes left in window */\n if (len > left + s.strm.avail_in) {\n len = left + s.strm.avail_in; /* limit len to the input */\n }\n if (len > have) {\n len = have; /* limit len to the output */\n }\n\n /* If the stored block would be less than min_block in length, or if\n * unable to copy all of the available input when flushing, then try\n * copying to the window and the pending buffer instead. Also don't\n * write an empty block when flushing -- deflate() does that.\n */\n if (len < min_block && ((len === 0 && flush !== Z_FINISH$3) ||\n flush === Z_NO_FLUSH$2 ||\n len !== left + s.strm.avail_in)) {\n break;\n }\n\n /* Make a dummy stored block in pending to get the header bytes,\n * including any pending bits. This also updates the debugging counts.\n */\n last = flush === Z_FINISH$3 && len === left + s.strm.avail_in ? 1 : 0;\n _tr_stored_block(s, 0, 0, last);\n\n /* Replace the lengths in the dummy stored block with len. */\n s.pending_buf[s.pending - 4] = len;\n s.pending_buf[s.pending - 3] = len >> 8;\n s.pending_buf[s.pending - 2] = ~len;\n s.pending_buf[s.pending - 1] = ~len >> 8;\n\n /* Write the stored block header bytes. */\n flush_pending(s.strm);\n\n//#ifdef ZLIB_DEBUG\n// /* Update debugging counts for the data about to be copied. */\n// s->compressed_len += len << 3;\n// s->bits_sent += len << 3;\n//#endif\n\n /* Copy uncompressed bytes from the window to next_out. */\n if (left) {\n if (left > len) {\n left = len;\n }\n //zmemcpy(s->strm->next_out, s->window + s->block_start, left);\n s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);\n s.strm.next_out += left;\n s.strm.avail_out -= left;\n s.strm.total_out += left;\n s.block_start += left;\n len -= left;\n }\n\n /* Copy uncompressed bytes directly from next_in to next_out, updating\n * the check value.\n */\n if (len) {\n read_buf(s.strm, s.strm.output, s.strm.next_out, len);\n s.strm.next_out += len;\n s.strm.avail_out -= len;\n s.strm.total_out += len;\n }\n } while (last === 0);\n\n /* Update the sliding window with the last s->w_size bytes of the copied\n * data, or append all of the copied data to the existing window if less\n * than s->w_size bytes were copied. Also update the number of bytes to\n * insert in the hash tables, in the event that deflateParams() switches to\n * a non-zero compression level.\n */\n used -= s.strm.avail_in; /* number of input bytes directly copied */\n if (used) {\n /* If any input was used, then no unused input remains in the window,\n * therefore s->block_start == s->strstart.\n */\n if (used >= s.w_size) { /* supplant the previous history */\n s.matches = 2; /* clear hash */\n //zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);\n s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);\n s.strstart = s.w_size;\n s.insert = s.strstart;\n }\n else {\n if (s.window_size - s.strstart <= used) {\n /* Slide the window down. */\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n //zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);\n s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);\n s.strstart += used;\n s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;\n }\n s.block_start = s.strstart;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* If the last block was written to next_out, then done. */\n if (last) {\n return BS_FINISH_DONE;\n }\n\n /* If flushing and all input has been consumed, then done. */\n if (flush !== Z_NO_FLUSH$2 && flush !== Z_FINISH$3 &&\n s.strm.avail_in === 0 && s.strstart === s.block_start) {\n return BS_BLOCK_DONE;\n }\n\n /* Fill the window with any remaining input. */\n have = s.window_size - s.strstart;\n if (s.strm.avail_in > have && s.block_start >= s.w_size) {\n /* Slide the window down. */\n s.block_start -= s.w_size;\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n have += s.w_size; /* more space now */\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n if (have > s.strm.avail_in) {\n have = s.strm.avail_in;\n }\n if (have) {\n read_buf(s.strm, s.window, s.strstart, have);\n s.strstart += have;\n s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* There was not enough avail_out to write a complete worthy or flushed\n * stored block to next_out. Write a stored block to pending instead, if we\n * have enough input for a worthy block, or if flushing and there is enough\n * room for the remaining input as a stored block in the pending buffer.\n */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n /* maximum stored block length that will fit in pending: */\n have = s.pending_buf_size - have > 65535/* MAX_STORED */ ? 65535/* MAX_STORED */ : s.pending_buf_size - have;\n min_block = have > s.w_size ? s.w_size : have;\n left = s.strstart - s.block_start;\n if (left >= min_block ||\n ((left || flush === Z_FINISH$3) && flush !== Z_NO_FLUSH$2 &&\n s.strm.avail_in === 0 && left <= have)) {\n len = left > have ? have : left;\n last = flush === Z_FINISH$3 && s.strm.avail_in === 0 &&\n len === left ? 1 : 0;\n _tr_stored_block(s, s.block_start, len, last);\n s.block_start += len;\n flush_pending(s.strm);\n }\n\n /* We've done all we can with the available input and output. */\n return last ? BS_FINISH_STARTED : BS_NEED_MORE;\n};\n\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nconst deflate_fast = (s, flush) => {\n\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nconst deflate_slow = (s, flush) => {\n\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n};\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nconst deflate_rle = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nconst deflate_huff = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nconst lm_init = (s) => {\n\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n};\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED$2; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.sym_buf = 0; /* buffer for distances and literals/lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.sym_next = 0; /* running index in sym_buf */\n this.sym_end = 0; /* symbol table full when sym_next reaches this */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\n/* =========================================================================\n * Check for a valid deflate stream state. Return 0 if ok, 1 if not.\n */\nconst deflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const s = strm.state;\n if (!s || s.strm !== strm || (s.status !== INIT_STATE &&\n//#ifdef GZIP\n s.status !== GZIP_STATE &&\n//#endif\n s.status !== EXTRA_STATE &&\n s.status !== NAME_STATE &&\n s.status !== COMMENT_STATE &&\n s.status !== HCRC_STATE &&\n s.status !== BUSY_STATE &&\n s.status !== FINISH_STATE)) {\n return 1;\n }\n return 0;\n};\n\n\nconst deflateResetKeep = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return err(strm, Z_STREAM_ERROR$2);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n const s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status =\n//#ifdef GZIP\n s.wrap === 2 ? GZIP_STATE :\n//#endif\n s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = -2;\n _tr_init(s);\n return Z_OK$3;\n};\n\n\nconst deflateReset = (strm) => {\n\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK$3) {\n lm_init(strm.state);\n }\n return ret;\n};\n\n\nconst deflateSetHeader = (strm, head) => {\n\n if (deflateStateCheck(strm) || strm.state.wrap !== 2) {\n return Z_STREAM_ERROR$2;\n }\n strm.state.gzhead = head;\n return Z_OK$3;\n};\n\n\nconst deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {\n\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR$2;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION$1) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) {\n return err(strm, Z_STREAM_ERROR$2);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n s.status = INIT_STATE; /* to pass state test in deflateReset() */\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n /* We overlay pending_buf and sym_buf. This works since the average size\n * for length/distance pairs over any compressed block is assured to be 31\n * bits or less.\n *\n * Analysis: The longest fixed codes are a length code of 8 bits plus 5\n * extra bits, for lengths 131 to 257. The longest fixed distance codes are\n * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest\n * possible fixed-codes length/distance pair is then 31 bits total.\n *\n * sym_buf starts one-fourth of the way into pending_buf. So there are\n * three bytes in sym_buf for every four bytes in pending_buf. Each symbol\n * in sym_buf is three bytes -- two for the distance and one for the\n * literal/length. As each symbol is consumed, the pointer to the next\n * sym_buf value to read moves forward three bytes. From that symbol, up to\n * 31 bits are written to pending_buf. The closest the written pending_buf\n * bits gets to the next sym_buf symbol to read is just before the last\n * code is written. At that time, 31*(n-2) bits have been written, just\n * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at\n * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1\n * symbols are written.) The closest the writing gets to what is unread is\n * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and\n * can range from 128 to 32768.\n *\n * Therefore, at a minimum, there are 142 bits of space between what is\n * written and what is read in the overlain buffers, so the symbols cannot\n * be overwritten by the compressed data. That space is actually 139 bits,\n * due to the three-bit fixed-code block header.\n *\n * That covers the case where either Z_FIXED is specified, forcing fixed\n * codes, or when the use of fixed codes is chosen, because that choice\n * results in a smaller compressed block than dynamic codes. That latter\n * condition then assures that the above analysis also covers all dynamic\n * blocks. A dynamic-code block will only be chosen to be emitted if it has\n * fewer bits than a fixed-code block would for the same set of symbols.\n * Therefore its average symbol length is assured to be less than 31. So\n * the compressed data for a dynamic block also cannot overwrite the\n * symbols from which it is being constructed.\n */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->sym_buf = s->pending_buf + s->lit_bufsize;\n s.sym_buf = s.lit_bufsize;\n\n //s->sym_end = (s->lit_bufsize - 1) * 3;\n s.sym_end = (s.lit_bufsize - 1) * 3;\n /* We avoid equality with lit_bufsize*3 because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n};\n\nconst deflateInit = (strm, level) => {\n\n return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1);\n};\n\n\n/* ========================================================================= */\nconst deflate$2 = (strm, flush) => {\n\n if (deflateStateCheck(strm) || flush > Z_BLOCK$1 || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2;\n }\n\n const s = strm.state;\n\n if (!strm.output ||\n (strm.avail_in !== 0 && !strm.input) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH$3)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2);\n }\n\n const old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK$3;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH$3) {\n return err(strm, Z_BUF_ERROR$1);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR$1);\n }\n\n /* Write the header */\n if (s.status === INIT_STATE && s.wrap === 0) {\n s.status = BUSY_STATE;\n }\n if (s.status === INIT_STATE) {\n /* zlib header */\n let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n//#ifdef GZIP\n if (s.status === GZIP_STATE) {\n /* gzip header */\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let left = (s.gzhead.extra.length & 0xffff) - s.gzindex;\n while (s.pending + left > s.pending_buf_size) {\n let copy = s.pending_buf_size - s.pending;\n // zmemcpy(s.pending_buf + s.pending,\n // s.gzhead.extra + s.gzindex, copy);\n s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);\n s.pending = s.pending_buf_size;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex += copy;\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n left -= copy;\n }\n // JS specific: s.gzhead.extra may be TypedArray or Array for backward compatibility\n // TypedArray.slice and TypedArray.from don't exist in IE10-IE11\n let gzhead_extra = new Uint8Array(s.gzhead.extra);\n // zmemcpy(s->pending_buf + s->pending,\n // s->gzhead->extra + s->gzindex, left);\n s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);\n s.pending += left;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = NAME_STATE;\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = COMMENT_STATE;\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n }\n s.status = HCRC_STATE;\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n }\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n//#endif\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) {\n let bstate = s.level === 0 ? deflate_stored(s, flush) :\n s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK$3;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align(s);\n }\n else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */\n\n _tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH$1) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK$3;\n }\n }\n }\n\n if (flush !== Z_FINISH$3) { return Z_OK$3; }\n if (s.wrap <= 0) { return Z_STREAM_END$3; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3;\n};\n\n\nconst deflateEnd = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR$2;\n }\n\n const status = strm.state.status;\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3;\n};\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nconst deflateSetDictionary = (strm, dictionary) => {\n\n let dictLength = dictionary.length;\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR$2;\n }\n\n const s = strm.state;\n const wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR$2;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32_1(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n let tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n const avail = strm.avail_in;\n const next = strm.next_in;\n const input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n let str = s.strstart;\n let n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK$3;\n};\n\n\nvar deflateInit_1 = deflateInit;\nvar deflateInit2_1 = deflateInit2;\nvar deflateReset_1 = deflateReset;\nvar deflateResetKeep_1 = deflateResetKeep;\nvar deflateSetHeader_1 = deflateSetHeader;\nvar deflate_2$1 = deflate$2;\nvar deflateEnd_1 = deflateEnd;\nvar deflateSetDictionary_1 = deflateSetDictionary;\nvar deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.deflateBound = deflateBound;\nmodule.exports.deflateCopy = deflateCopy;\nmodule.exports.deflateGetDictionary = deflateGetDictionary;\nmodule.exports.deflateParams = deflateParams;\nmodule.exports.deflatePending = deflatePending;\nmodule.exports.deflatePrime = deflatePrime;\nmodule.exports.deflateTune = deflateTune;\n*/\n\nvar deflate_1$2 = {\n\tdeflateInit: deflateInit_1,\n\tdeflateInit2: deflateInit2_1,\n\tdeflateReset: deflateReset_1,\n\tdeflateResetKeep: deflateResetKeep_1,\n\tdeflateSetHeader: deflateSetHeader_1,\n\tdeflate: deflate_2$1,\n\tdeflateEnd: deflateEnd_1,\n\tdeflateSetDictionary: deflateSetDictionary_1,\n\tdeflateInfo: deflateInfo\n};\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nvar assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nvar flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n\nvar common = {\n\tassign: assign,\n\tflattenChunks: flattenChunks\n};\n\n// String encode/decode helpers\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nvar string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nvar buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nvar utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\nvar strings = {\n\tstring2buf: string2buf,\n\tbuf2string: buf2string,\n\tutf8border: utf8border\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nvar zstream = ZStream;\n\nconst toString$1 = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH: Z_FINISH$2,\n Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2,\n Z_DEFAULT_COMPRESSION,\n Z_DEFAULT_STRATEGY,\n Z_DEFLATED: Z_DEFLATED$1\n} = constants$2;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate$1(options) {\n this.options = common.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED$1,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new zstream();\n this.strm.avail_out = 0;\n\n let status = deflate_1$2.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK$2) {\n throw new Error(messages[status]);\n }\n\n if (opt.header) {\n deflate_1$2.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = deflate_1$2.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK$2) {\n throw new Error(messages[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate$1.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n let status, _flush_mode;\n\n if (this.ended) { return false; }\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString$1.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n status = deflate_1$2.deflate(strm, _flush_mode);\n\n // Ended => flush and finish\n if (status === Z_STREAM_END$2) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = deflate_1$2.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK$2;\n }\n\n // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n }\n\n // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate$1.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate$1.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK$2) {\n this.result = common.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const data = new Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate$1(input, options) {\n const deflator = new Deflate$1(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw$1(input, options) {\n options = options || {};\n options.raw = true;\n return deflate$1(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip$1(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate$1(input, options);\n}\n\n\nvar Deflate_1$1 = Deflate$1;\nvar deflate_2 = deflate$1;\nvar deflateRaw_1$1 = deflateRaw$1;\nvar gzip_1$1 = gzip$1;\nvar constants$1 = constants$2;\n\nvar deflate_1$1 = {\n\tDeflate: Deflate_1$1,\n\tdeflate: deflate_2,\n\tdeflateRaw: deflateRaw_1$1,\n\tgzip: gzip_1$1,\n\tconstants: constants$1\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD$1 = 16209; /* got a data error -- remain here until reset */\nconst TYPE$1 = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nvar inffast = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE$1;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS$1 = 852;\nconst ENOUGH_DISTS$1 = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES$1 = 0;\nconst LENS$1 = 1;\nconst DISTS$1 = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES$1 || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES$1) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS$1) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nvar inftrees = inflate_table;\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n\n\n\n\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES,\n Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR,\n Z_DEFLATED\n} = constants$2;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK$1;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR$1;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR$1; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK$1) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate$2 = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR$1;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK$1;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32_1(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT$1;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inffast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END$1;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR$1;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR$1;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR$1;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH$1))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ;\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR$1;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK$1;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR$1; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK$1;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR$1;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32_1(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR$1;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR$1;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK$1;\n};\n\n\nvar inflateReset_1 = inflateReset;\nvar inflateReset2_1 = inflateReset2;\nvar inflateResetKeep_1 = inflateResetKeep;\nvar inflateInit_1 = inflateInit;\nvar inflateInit2_1 = inflateInit2;\nvar inflate_2$1 = inflate$2;\nvar inflateEnd_1 = inflateEnd;\nvar inflateGetHeader_1 = inflateGetHeader;\nvar inflateSetDictionary_1 = inflateSetDictionary;\nvar inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n\nvar inflate_1$2 = {\n\tinflateReset: inflateReset_1,\n\tinflateReset2: inflateReset2_1,\n\tinflateResetKeep: inflateResetKeep_1,\n\tinflateInit: inflateInit_1,\n\tinflateInit2: inflateInit2_1,\n\tinflate: inflate_2$1,\n\tinflateEnd: inflateEnd_1,\n\tinflateGetHeader: inflateGetHeader_1,\n\tinflateSetDictionary: inflateSetDictionary_1,\n\tinflateInfo: inflateInfo\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nvar gzheader = GZheader;\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = constants$2;\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate$1(options) {\n this.options = common.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new zstream();\n this.strm.avail_out = 0;\n\n let status = inflate_1$2.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n\n this.header = new gzheader();\n\n inflate_1$2.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate$1.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = inflate_1$2.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = inflate_1$2.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = inflate_1$2.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n inflate_1$2.inflateReset(strm);\n status = inflate_1$2.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = inflate_1$2.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate$1.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate$1.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = common.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate$1(input, options) {\n const inflator = new Inflate$1(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || messages[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw$1(input, options) {\n options = options || {};\n options.raw = true;\n return inflate$1(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nvar Inflate_1$1 = Inflate$1;\nvar inflate_2 = inflate$1;\nvar inflateRaw_1$1 = inflateRaw$1;\nvar ungzip$1 = inflate$1;\nvar constants = constants$2;\n\nvar inflate_1$1 = {\n\tInflate: Inflate_1$1,\n\tinflate: inflate_2,\n\tinflateRaw: inflateRaw_1$1,\n\tungzip: ungzip$1,\n\tconstants: constants\n};\n\nconst { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;\n\nconst { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;\n\n\n\nvar Deflate_1 = Deflate;\nvar deflate_1 = deflate;\nvar deflateRaw_1 = deflateRaw;\nvar gzip_1 = gzip;\nvar Inflate_1 = Inflate;\nvar inflate_1 = inflate;\nvar inflateRaw_1 = inflateRaw;\nvar ungzip_1 = ungzip;\nvar constants_1 = constants$2;\n\nvar pako = {\n\tDeflate: Deflate_1,\n\tdeflate: deflate_1,\n\tdeflateRaw: deflateRaw_1,\n\tgzip: gzip_1,\n\tInflate: Inflate_1,\n\tinflate: inflate_1,\n\tinflateRaw: inflateRaw_1,\n\tungzip: ungzip_1,\n\tconstants: constants_1\n};\n\nexport { Deflate_1 as Deflate, Inflate_1 as Inflate, constants_1 as constants, pako as default, deflate_1 as deflate, deflateRaw_1 as deflateRaw, gzip_1 as gzip, inflate_1 as inflate, inflateRaw_1 as inflateRaw, ungzip_1 as ungzip };\n","import { ContractClassResponse } from '../types';\nimport {\n CairoContract,\n CompiledSierra,\n LegacyCompiledContract,\n LegacyContractClass,\n SierraContractClass,\n} from '../types/lib/contract/index';\nimport { CompleteDeclareContractPayload, DeclareContractPayload } from '../types/lib/index';\nimport { computeCompiledClassHash, computeContractClassHash } from './hash';\nimport { parse } from './json';\nimport { decompressProgram } from './stark';\n\nexport function isSierra(\n contract: CairoContract | string\n): contract is SierraContractClass | CompiledSierra {\n const compiledContract = typeof contract === 'string' ? parse(contract) : contract;\n return 'sierra_program' in compiledContract;\n}\n\nexport function extractContractHashes(\n payload: DeclareContractPayload\n): CompleteDeclareContractPayload {\n const response = { ...payload } as CompleteDeclareContractPayload;\n\n if (isSierra(payload.contract)) {\n if (!payload.compiledClassHash && payload.casm) {\n response.compiledClassHash = computeCompiledClassHash(payload.casm);\n }\n if (!response.compiledClassHash)\n throw new Error(\n 'Extract compiledClassHash failed, provide (CairoAssembly).casm file or compiledClassHash'\n );\n }\n\n response.classHash = payload.classHash ?? computeContractClassHash(payload.contract);\n if (!response.classHash)\n throw new Error('Extract classHash failed, provide (CompiledContract).json file or classHash');\n\n return response;\n}\n\n/**\n * Helper to redeclare response Cairo0 contract\n * @param ccr ContractClassResponse\n * @returns LegacyCompiledContract\n */\nexport function contractClassResponseToLegacyCompiledContract(ccr: ContractClassResponse) {\n if (isSierra(ccr)) {\n throw Error('ContractClassResponse need to be LegacyContractClass (cairo0 response class)');\n }\n const contract = ccr as LegacyContractClass;\n return { ...contract, program: decompressProgram(contract.program) } as LegacyCompiledContract;\n}\n","import isomorphicFetch from 'isomorphic-fetch';\n\nexport default (typeof window !== 'undefined' && window.fetch) || // use buildin fetch in browser if available\n (typeof global !== 'undefined' && global.fetch) || // use buildin fetch in node, react-native and service worker if available\n isomorphicFetch; // ponyfill fetch in node and browsers that don't have it\n","import {\n CompiledContract,\n CompiledSierra,\n ContractClass,\n LegacyContractClass,\n SierraContractClass,\n} from '../types';\nimport { isSierra } from './contract';\nimport { formatSpaces } from './hash';\nimport { parse, stringify } from './json';\nimport { compressProgram } from './stark';\n\nexport function wait(delay: number) {\n return new Promise((res) => {\n setTimeout(res, delay);\n });\n}\n\nexport function createSierraContractClass(contract: CompiledSierra): SierraContractClass {\n const result = { ...contract } as any;\n delete result.sierra_program_debug_info;\n result.abi = formatSpaces(stringify(contract.abi));\n result.sierra_program = formatSpaces(stringify(contract.sierra_program));\n result.sierra_program = compressProgram(result.sierra_program);\n return result;\n}\n\n// TODO: How can we receive string here ?\nexport function parseContract(contract: CompiledContract | string): ContractClass {\n const parsedContract =\n typeof contract === 'string' ? (parse(contract) as CompiledContract) : contract;\n\n if (!isSierra(contract)) {\n return {\n ...parsedContract,\n ...('program' in parsedContract && { program: compressProgram(parsedContract.program) }),\n } as LegacyContractClass;\n }\n\n return createSierraContractClass(parsedContract as CompiledSierra);\n}\n","/**\n * Map RPC Response to common interface response\n * Intersection (sequencer response ∩ (∪ rpc responses))\n */\nimport {\n CallContractResponse,\n ContractClassResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetTransactionResponse,\n RPC,\n SimulateTransactionResponse,\n} from '../../types';\nimport { toBigInt } from '../num';\nimport { estimatedFeeToMaxFee } from '../stark';\nimport { ResponseParser } from '.';\n\ntype RpcGetBlockResponse = RPC.GetBlockWithTxHashesResponse & {\n [key: string]: any;\n};\n\ntype GetTransactionByHashResponse = RPC.GetTransactionByHashResponse & {\n [key: string]: any;\n};\n\nexport class RPCResponseParser\n implements\n Omit<\n ResponseParser,\n | 'parseDeclareContractResponse'\n | 'parseDeployContractResponse'\n | 'parseInvokeFunctionResponse'\n | 'parseGetTransactionReceiptResponse'\n >\n{\n public parseGetBlockResponse(res: RpcGetBlockResponse): GetBlockResponse {\n return {\n timestamp: res.timestamp,\n block_hash: res.block_hash,\n block_number: res.block_number,\n new_root: res.new_root,\n parent_hash: res.parent_hash,\n status: res.status,\n transactions: res.transactions,\n };\n }\n\n public parseGetTransactionResponse(res: GetTransactionByHashResponse): GetTransactionResponse {\n return {\n calldata: res.calldata || [],\n contract_address: res.contract_address,\n sender_address: res.contract_address,\n max_fee: res.max_fee,\n nonce: res.nonce,\n signature: res.signature || [],\n transaction_hash: res.transaction_hash,\n version: res.version,\n };\n }\n\n public parseFeeEstimateResponse(res: Array): EstimateFeeResponse {\n return {\n overall_fee: toBigInt(res[0].overall_fee),\n gas_consumed: toBigInt(res[0].gas_consumed),\n gas_price: toBigInt(res[0].gas_price),\n };\n }\n\n public parseFeeEstimateBulkResponse(\n res: Array\n ): EstimateFeeResponseBulk {\n return res.map((val) => ({\n overall_fee: toBigInt(val.overall_fee),\n gas_consumed: toBigInt(val.gas_consumed),\n gas_price: toBigInt(val.gas_price),\n }));\n }\n\n public parseCallContractResponse(res: Array): CallContractResponse {\n return {\n result: res,\n };\n }\n\n public parseSimulateTransactionResponse(\n res: RPC.SimulateTransactionResponse\n ): SimulateTransactionResponse {\n return res.map((it) => {\n return {\n ...it,\n suggestedMaxFee: estimatedFeeToMaxFee(BigInt(it.fee_estimation.overall_fee)),\n };\n });\n }\n\n public parseContractClassResponse(res: RPC.ContractClass): ContractClassResponse {\n return {\n ...res,\n abi: typeof res.abi === 'string' ? JSON.parse(res.abi) : res.abi,\n };\n }\n}\n","// eslint-disable-next-line max-classes-per-file\nexport function fixStack(target: Error, fn: Function = target.constructor) {\n const { captureStackTrace } = Error as any;\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n captureStackTrace && captureStackTrace(target, fn);\n}\n\nexport function fixProto(target: Error, prototype: {}) {\n const { setPrototypeOf } = Object as any;\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-proto, no-param-reassign\n setPrototypeOf ? setPrototypeOf(target, prototype) : ((target as any).__proto__ = prototype);\n}\n\n/* eslint-disable max-classes-per-file */\nexport class CustomError extends Error {\n name!: string;\n\n constructor(message?: string) {\n super(message);\n // set error name as constructor name, make it not enumerable to keep native Error behavior\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target#new.target_in_constructors\n // see https://github.com/adriengibrat/ts-custom-error/issues/30\n Object.defineProperty(this, 'name', {\n value: new.target.name,\n enumerable: false,\n configurable: true,\n });\n // fix the extended error prototype chain\n // because typescript __extends implementation can't\n // see https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n fixProto(this, new.target.prototype);\n // try to remove contructor from stack trace\n fixStack(this);\n }\n}\n\nexport class LibraryError extends CustomError {}\n\nexport class GatewayError extends LibraryError {\n constructor(message: string, public errorCode: string) {\n super(message);\n }\n}\n\nexport class HttpError extends LibraryError {\n constructor(message: string, public errorCode: number) {\n super(message);\n }\n}\n","/* eslint-disable no-param-reassign */\nimport { StarknetChainId, ZERO } from '../constants';\n\nconst basicAlphabet = 'abcdefghijklmnopqrstuvwxyz0123456789-';\nconst basicSizePlusOne = BigInt(basicAlphabet.length + 1);\nconst bigAlphabet = '这来';\nconst basicAlphabetSize = BigInt(basicAlphabet.length);\nconst bigAlphabetSize = BigInt(bigAlphabet.length);\nconst bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1);\n\nfunction extractStars(str: string): [string, number] {\n let k = 0;\n while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) {\n str = str.substring(0, str.length - 1);\n k += 1;\n }\n return [str, k];\n}\n\nexport function useDecoded(encoded: bigint[]): string {\n let decoded = '';\n\n encoded.forEach((subdomain) => {\n while (subdomain !== ZERO) {\n const code = subdomain % basicSizePlusOne;\n subdomain /= basicSizePlusOne;\n if (code === BigInt(basicAlphabet.length)) {\n const nextSubdomain = subdomain / bigAlphabetSizePlusOne;\n if (nextSubdomain === ZERO) {\n const code2 = subdomain % bigAlphabetSizePlusOne;\n subdomain = nextSubdomain;\n if (code2 === ZERO) decoded += basicAlphabet[0];\n else decoded += bigAlphabet[Number(code2) - 1];\n } else {\n const code2 = subdomain % bigAlphabetSize;\n decoded += bigAlphabet[Number(code2)];\n subdomain /= bigAlphabetSize;\n }\n } else decoded += basicAlphabet[Number(code)];\n }\n\n const [str, k] = extractStars(decoded);\n if (k)\n decoded =\n str +\n (k % 2 === 0\n ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) +\n bigAlphabet[0] +\n basicAlphabet[1]\n : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1));\n decoded += '.';\n });\n\n if (!decoded) {\n return decoded;\n }\n\n return decoded.concat('stark');\n}\n\nexport function useEncoded(decoded: string): bigint {\n let encoded = BigInt(0);\n let multiplier = BigInt(1);\n\n if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) {\n const [str, k] = extractStars(decoded.substring(0, decoded.length - 2));\n decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1));\n } else {\n const [str, k] = extractStars(decoded);\n if (k) decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1));\n }\n\n for (let i = 0; i < decoded.length; i += 1) {\n const char = decoded[i];\n const index = basicAlphabet.indexOf(char);\n const bnIndex = BigInt(basicAlphabet.indexOf(char));\n\n if (index !== -1) {\n // add encoded + multiplier * index\n if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) {\n encoded += multiplier * basicAlphabetSize;\n multiplier *= basicSizePlusOne;\n // add 0\n multiplier *= basicSizePlusOne;\n } else {\n encoded += multiplier * bnIndex;\n multiplier *= basicSizePlusOne;\n }\n } else if (bigAlphabet.indexOf(char) !== -1) {\n // add encoded + multiplier * (basicAlphabetSize)\n encoded += multiplier * basicAlphabetSize;\n multiplier *= basicSizePlusOne;\n // add encoded + multiplier * index\n const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char);\n encoded += multiplier * BigInt(newid);\n multiplier *= bigAlphabetSize;\n }\n }\n\n return encoded;\n}\n\nexport const enum StarknetIdContract {\n MAINNET = '0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678',\n TESTNET = '0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce',\n}\n\nexport function getStarknetIdContract(chainId: StarknetChainId): string {\n switch (chainId) {\n case StarknetChainId.SN_MAIN:\n return StarknetIdContract.MAINNET;\n\n case StarknetChainId.SN_GOERLI:\n return StarknetIdContract.TESTNET;\n\n default:\n throw new Error('Starknet.id is not yet deployed on this network');\n }\n}\n","import { BigNumberish } from '../types';\nimport { CallData } from '../utils/calldata';\nimport { getStarknetIdContract, useDecoded, useEncoded } from '../utils/starknetId';\nimport { ProviderInterface } from './interface';\n\nexport async function getStarkName(\n provider: ProviderInterface,\n address: BigNumberish,\n StarknetIdContract?: string\n): Promise {\n const chainId = await provider.getChainId();\n const contract = StarknetIdContract ?? getStarknetIdContract(chainId);\n\n try {\n const hexDomain = await provider.callContract({\n contractAddress: contract,\n entrypoint: 'address_to_domain',\n calldata: CallData.compile({\n address,\n }),\n });\n const decimalDomain = hexDomain.result.map((element) => BigInt(element)).slice(1);\n\n const stringDomain = useDecoded(decimalDomain);\n\n if (!stringDomain) {\n throw Error('Starkname not found');\n }\n\n return stringDomain;\n } catch (e) {\n if (e instanceof Error && e.message === 'Starkname not found') {\n throw e;\n }\n throw Error('Could not get stark name');\n }\n}\n\nexport async function getAddressFromStarkName(\n provider: ProviderInterface,\n name: string,\n StarknetIdContract?: string\n): Promise {\n const chainId = await provider.getChainId();\n const contract = StarknetIdContract ?? getStarknetIdContract(chainId);\n\n try {\n const addressData = await provider.callContract({\n contractAddress: contract,\n entrypoint: 'domain_to_address',\n calldata: CallData.compile({\n domain: [useEncoded(name.replace('.stark', '')).toString(10)],\n }),\n });\n\n return addressData.result[0];\n } catch {\n throw Error('Could not get address from stark name');\n }\n}\n","/* eslint-disable max-classes-per-file */\nimport {\n BigNumberish,\n BlockIdentifier,\n BlockNumber,\n BlockTag,\n SequencerIdentifier,\n} from '../types';\nimport { isHex, toHex } from '../utils/num';\n\n/** @deprecated prefer importing from 'types' over 'provider/utils' */\nexport type { BlockIdentifier };\n\n/**\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L148-L153)\n *\n * @param hashValue\n * @param hashField\n */\nexport function formatHash(hashValue: BigNumberish): string {\n if (typeof hashValue === 'string') return hashValue;\n return toHex(hashValue);\n}\n\n/**\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L156-L161)\n * @param txHash\n * @param txId\n */\nexport function txIdentifier(txHash?: BigNumberish, txId?: BigNumberish): string {\n if (!txHash) {\n return `transactionId=${JSON.stringify(txId)}`;\n }\n const hashString = formatHash(txHash);\n\n return `transactionHash=${hashString}`;\n}\n\nexport const validBlockTags = Object.values(BlockTag);\n\nexport class Block {\n hash: BlockIdentifier = null;\n\n number: BlockIdentifier = null;\n\n tag: BlockIdentifier = null;\n\n private setIdentifier(__identifier: BlockIdentifier) {\n if (typeof __identifier === 'string' && isHex(__identifier)) {\n this.hash = __identifier;\n } else if (typeof __identifier === 'bigint') {\n this.hash = toHex(__identifier);\n } else if (typeof __identifier === 'number') {\n this.number = __identifier;\n } else if (\n typeof __identifier === 'string' &&\n validBlockTags.includes(__identifier as BlockTag)\n ) {\n this.tag = __identifier;\n } else {\n // default\n this.tag = BlockTag.pending;\n }\n }\n\n constructor(_identifier: BlockIdentifier) {\n this.setIdentifier(_identifier);\n }\n\n // TODO: fix any\n get queryIdentifier(): any {\n if (this.number !== null) {\n return `blockNumber=${this.number}`;\n }\n\n if (this.hash !== null) {\n return `blockHash=${this.hash}`;\n }\n\n return `blockNumber=${this.tag}`;\n }\n\n // TODO: fix any\n get identifier(): any {\n if (this.number !== null) {\n return { block_number: this.number };\n }\n\n if (this.hash !== null) {\n return { block_hash: this.hash };\n }\n\n return this.tag;\n }\n\n set identifier(_identifier: BlockIdentifier) {\n this.setIdentifier(_identifier);\n }\n\n valueOf = () => this.number;\n\n toString = () => this.hash;\n\n get sequencerIdentifier(): SequencerIdentifier {\n return this.hash !== null\n ? { blockHash: this.hash as string }\n : { blockNumber: (this.number ?? this.tag) as BlockNumber };\n }\n}\n","import { StarknetChainId } from '../constants';\nimport {\n AccountInvocationItem,\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n LegacyContractClass,\n RPC,\n RpcProviderOptions,\n SIMULATION_FLAG,\n SierraContractClass,\n SimulateTransactionResponse,\n TransactionStatus,\n TransactionType,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { isSierra } from '../utils/contract';\nimport fetch from '../utils/fetchPonyfill';\nimport {\n getSelectorFromName,\n getVersionsByType,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { stringify } from '../utils/json';\nimport { toHex, toStorageKey } from '../utils/num';\nimport { wait } from '../utils/provider';\nimport { RPCResponseParser } from '../utils/responseParser/rpc';\nimport { decompressProgram, signatureToHexArray } from '../utils/stark';\nimport { LibraryError } from './errors';\nimport { ProviderInterface } from './interface';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\nimport { Block } from './utils';\n\n// Default Pathfinder disabled pending block https://github.com/eqlabs/pathfinder/blob/main/README.md\n// Note that pending support is disabled by default and must be enabled by setting poll-pending=true in the configuration options.\nconst defaultOptions = {\n headers: { 'Content-Type': 'application/json' },\n blockIdentifier: 'latest',\n retries: 200,\n};\n\nexport class RpcProvider implements ProviderInterface {\n public nodeUrl: string;\n\n public headers: object;\n\n private responseParser = new RPCResponseParser();\n\n private retries: number;\n\n private blockIdentifier: BlockIdentifier;\n\n private chainId?: StarknetChainId;\n\n constructor(optionsOrProvider: RpcProviderOptions) {\n const { nodeUrl, retries, headers, blockIdentifier, chainId } = optionsOrProvider;\n this.nodeUrl = nodeUrl;\n this.retries = retries || defaultOptions.retries;\n this.headers = { ...defaultOptions.headers, ...headers };\n this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier;\n this.chainId = chainId;\n this.getChainId(); // internally skipped if chainId has value\n }\n\n public fetch(method: any, params: any): Promise {\n const body = stringify({ method, jsonrpc: '2.0', params, id: 0 });\n return fetch(this.nodeUrl, {\n method: 'POST',\n body,\n headers: this.headers as Record,\n });\n }\n\n protected errorHandler(error: any) {\n if (error) {\n const { code, message } = error;\n throw new LibraryError(`${code}: ${message}`);\n }\n }\n\n protected async fetchEndpoint(\n method: T,\n params?: RPC.Methods[T]['params']\n ): Promise {\n try {\n const rawResult = await this.fetch(method, params);\n const { error, result } = await rawResult.json();\n this.errorHandler(error);\n return result as RPC.Methods[T]['result'];\n } catch (error: any) {\n this.errorHandler(error?.response?.data);\n throw error;\n }\n }\n\n // Methods from Interface\n public async getChainId(): Promise {\n this.chainId ??= (await this.fetchEndpoint('starknet_chainId')) as StarknetChainId;\n return this.chainId;\n }\n\n public async getBlock(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.getBlockWithTxHashes(blockIdentifier).then(\n this.responseParser.parseGetBlockResponse\n );\n }\n\n public async getBlockHashAndNumber(): Promise {\n return this.fetchEndpoint('starknet_blockHashAndNumber');\n }\n\n public async getBlockWithTxHashes(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockWithTxHashes', { block_id });\n }\n\n public async getBlockWithTxs(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockWithTxs', { block_id });\n }\n\n public async getClassHashAt(\n contractAddress: RPC.ContractAddress,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClassHashAt', {\n block_id,\n contract_address: contractAddress,\n });\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getNonce', {\n contract_address: contractAddress,\n block_id,\n });\n }\n\n public async getPendingTransactions(): Promise {\n return this.fetchEndpoint('starknet_pendingTransactions');\n }\n\n public async getProtocolVersion(): Promise {\n throw new Error('Pathfinder does not implement this rpc 0.1.0 method');\n }\n\n public async getStateUpdate(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getStateUpdate', { block_id });\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const parsedKey = toStorageKey(key);\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getStorageAt', {\n contract_address: contractAddress,\n key: parsedKey,\n block_id,\n });\n }\n\n // Methods from Interface\n public async getTransaction(txHash: string): Promise {\n return this.getTransactionByHash(txHash).then(this.responseParser.parseGetTransactionResponse);\n }\n\n public async getTransactionByHash(txHash: string): Promise {\n return this.fetchEndpoint('starknet_getTransactionByHash', { transaction_hash: txHash });\n }\n\n public async getTransactionByBlockIdAndIndex(\n blockIdentifier: BlockIdentifier,\n index: number\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getTransactionByBlockIdAndIndex', { block_id, index });\n }\n\n public async getTransactionReceipt(txHash: string): Promise {\n return this.fetchEndpoint('starknet_getTransactionReceipt', { transaction_hash: txHash });\n }\n\n public async getClassByHash(classHash: RPC.Felt): Promise {\n return this.getClass(classHash);\n }\n\n public async getClass(\n classHash: RPC.Felt,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClass', {\n class_hash: classHash,\n block_id,\n }).then(this.responseParser.parseContractClassResponse);\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClassAt', {\n block_id,\n contract_address: contractAddress,\n }).then(this.responseParser.parseContractClassResponse);\n }\n\n public async getCode(\n _contractAddress: string,\n _blockIdentifier?: BlockIdentifier\n ): Promise {\n throw new Error('RPC does not implement getCode function');\n }\n\n public async getEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier);\n }\n\n public async getInvokeEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.INVOKE,\n ...invocation,\n ...invocationDetails,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getDeclareEstimateFee(\n invocation: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DECLARE,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getDeployAccountEstimateFee(\n invocation: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n { blockIdentifier = this.blockIdentifier, skipValidate = false }: getEstimateFeeBulkOptions\n ): Promise {\n if (skipValidate) {\n // eslint-disable-next-line no-console\n console.warn('getEstimateFeeBulk RPC does not support skipValidate');\n }\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_estimateFee', {\n request: invocations.map((it) => this.buildTransaction(it, 'fee')),\n block_id,\n }).then(this.responseParser.parseFeeEstimateBulkResponse);\n }\n\n public async declareContract(\n { contract, signature, senderAddress, compiledClassHash }: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n if (!isSierra(contract)) {\n return this.fetchEndpoint('starknet_addDeclareTransaction', {\n declare_transaction: {\n type: RPC.TransactionType.DECLARE,\n contract_class: {\n program: contract.program,\n entry_points_by_type: contract.entry_points_by_type,\n abi: contract.abi,\n },\n version: toHex(transactionVersion),\n max_fee: toHex(details.maxFee || 0),\n signature: signatureToHexArray(signature),\n sender_address: senderAddress,\n nonce: toHex(details.nonce),\n },\n });\n }\n return this.fetchEndpoint('starknet_addDeclareTransaction', {\n declare_transaction: {\n type: RPC.TransactionType.DECLARE,\n contract_class: {\n sierra_program: decompressProgram(contract.sierra_program),\n contract_class_version: contract.contract_class_version,\n entry_points_by_type: contract.entry_points_by_type,\n abi: contract.abi,\n },\n compiled_class_hash: compiledClassHash || '',\n version: toHex(transactionVersion_2),\n max_fee: toHex(details.maxFee || 0),\n signature: signatureToHexArray(signature),\n sender_address: senderAddress,\n nonce: toHex(details.nonce),\n },\n });\n }\n\n public async deployAccountContract(\n { classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('starknet_addDeployAccountTransaction', {\n deploy_account_transaction: {\n constructor_calldata: CallData.toHex(constructorCalldata || []),\n class_hash: toHex(classHash),\n contract_address_salt: toHex(addressSalt || 0),\n type: RPC.TransactionType.DEPLOY_ACCOUNT,\n max_fee: toHex(details.maxFee || 0),\n version: toHex(details.version || 0),\n signature: signatureToHexArray(signature),\n nonce: toHex(details.nonce),\n },\n });\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('starknet_addInvokeTransaction', {\n invoke_transaction: {\n sender_address: functionInvocation.contractAddress,\n calldata: CallData.toHex(functionInvocation.calldata),\n type: RPC.TransactionType.INVOKE,\n max_fee: toHex(details.maxFee || 0),\n version: '0x1',\n signature: signatureToHexArray(functionInvocation.signature),\n nonce: toHex(details.nonce),\n },\n });\n }\n\n // Methods from Interface\n public async callContract(\n call: Call,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const result = await this.fetchEndpoint('starknet_call', {\n request: {\n contract_address: call.contractAddress,\n entry_point_selector: getSelectorFromName(call.entrypoint),\n calldata: CallData.toHex(call.calldata),\n },\n block_id,\n });\n\n return this.responseParser.parseCallContractResponse(result);\n }\n\n public async traceTransaction(transactionHash: RPC.TransactionHash): Promise {\n return this.fetchEndpoint('starknet_traceTransaction', { transaction_hash: transactionHash });\n }\n\n public async traceBlockTransactions(blockHash: RPC.BlockHash): Promise {\n return this.fetchEndpoint('starknet_traceBlockTransactions', { block_hash: blockHash });\n }\n\n public async waitForTransaction(txHash: string, options?: waitForTransactionOptions) {\n const errorStates = [TransactionStatus.REJECTED, TransactionStatus.NOT_RECEIVED];\n let { retries } = this;\n let onchain = false;\n let txReceipt: any = {};\n\n const retryInterval = options?.retryInterval ?? 8000;\n const successStates = options?.successStates ?? [\n TransactionStatus.ACCEPTED_ON_L1,\n TransactionStatus.ACCEPTED_ON_L2,\n ];\n\n while (!onchain) {\n // eslint-disable-next-line no-await-in-loop\n await wait(retryInterval);\n try {\n // eslint-disable-next-line no-await-in-loop\n txReceipt = await this.getTransactionReceipt(txHash);\n\n if (!('status' in txReceipt)) {\n const error = new Error('transaction status');\n throw error;\n }\n\n if (txReceipt.status && successStates.includes(txReceipt.status)) {\n onchain = true;\n } else if (txReceipt.status && errorStates.includes(txReceipt.status)) {\n const message = txReceipt.status;\n const error = new Error(message) as Error & { response: any };\n error.response = txReceipt;\n throw error;\n }\n } catch (error: unknown) {\n if (error instanceof Error && errorStates.includes(error.message as TransactionStatus)) {\n throw error;\n }\n\n if (retries === 0) {\n throw new Error(`waitForTransaction timed-out with retries ${this.retries}`);\n }\n }\n\n retries -= 1;\n }\n\n await wait(retryInterval);\n return txReceipt;\n }\n\n /**\n * Gets the transaction count from a block.\n *\n *\n * @param blockIdentifier\n * @returns Number of transactions\n */\n public async getTransactionCount(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockTransactionCount', { block_id });\n }\n\n /**\n * Gets the latest block number\n *\n *\n * @returns Number of the latest block\n */\n public async getBlockNumber(): Promise {\n return this.fetchEndpoint('starknet_blockNumber');\n }\n\n /**\n * Gets syncing status of the node\n *\n *\n * @returns Object with the stats data\n */\n public async getSyncingStats(): Promise {\n return this.fetchEndpoint('starknet_syncing');\n }\n\n /**\n * Gets all the events filtered\n *\n *\n * @returns events and the pagination of the events\n */\n public async getEvents(eventFilter: RPC.EventFilter): Promise {\n return this.fetchEndpoint('starknet_getEvents', { filter: eventFilter });\n }\n\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n {\n blockIdentifier = this.blockIdentifier,\n skipValidate = false,\n skipExecute = false,\n }: getSimulateTransactionOptions\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n\n const simulationFlags = [];\n if (skipValidate) simulationFlags.push(SIMULATION_FLAG.SKIP_VALIDATE);\n if (skipExecute) simulationFlags.push(SIMULATION_FLAG.SKIP_EXECUTE);\n\n return this.fetchEndpoint('starknet_simulateTransaction', {\n block_id,\n transactions: invocations.map((it) => this.buildTransaction(it)), // TODO: Pathfinder 0.5.6 bug, should be transaction\n simulation_flags: simulationFlags,\n }).then(this.responseParser.parseSimulateTransactionResponse);\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n\n public buildTransaction(\n invocation: AccountInvocationItem,\n versionType?: 'fee' | 'transaction'\n ): RPC.BroadcastedTransaction {\n const defaultVersions = getVersionsByType(versionType);\n const details = {\n signature: signatureToHexArray(invocation.signature),\n nonce: toHex(invocation.nonce),\n max_fee: toHex(invocation.maxFee || 0),\n };\n\n if (invocation.type === TransactionType.INVOKE) {\n return {\n type: RPC.TransactionType.INVOKE, // Diff between sequencer and rpc invoke type\n sender_address: invocation.contractAddress,\n calldata: CallData.toHex(invocation.calldata),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n if (invocation.type === RPC.TransactionType.DECLARE) {\n if (!isSierra(invocation.contract)) {\n const legacyContract = invocation.contract as LegacyContractClass;\n return {\n type: invocation.type,\n contract_class: legacyContract,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n const sierraContract = invocation.contract as SierraContractClass;\n return {\n // compiled_class_hash\n type: invocation.type,\n contract_class: {\n ...sierraContract,\n sierra_program: decompressProgram(sierraContract.sierra_program),\n },\n compiled_class_hash: invocation.compiledClassHash || '',\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v2),\n ...details,\n };\n }\n if (invocation.type === TransactionType.DEPLOY_ACCOUNT) {\n return {\n type: invocation.type,\n constructor_calldata: CallData.toHex(invocation.constructorCalldata || []),\n class_hash: toHex(invocation.classHash),\n contract_address_salt: toHex(invocation.addressSalt || 0),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n throw Error('RPC buildTransaction received unknown TransactionType');\n }\n}\n","import urljoin from 'url-join';\n\nimport { BaseUrl, NetworkName, StarknetChainId } from '../constants';\nimport {\n AccountInvocationItem,\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n BlockTag,\n CairoAssembly,\n Call,\n CallContractResponse,\n CallL1Handler,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetContractAddressesResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n GetTransactionStatusResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Sequencer,\n SequencerHttpMethod,\n SequencerProviderOptions,\n SimulateTransactionResponse,\n StateUpdateResponse,\n TransactionStatus,\n TransactionType,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { isSierra } from '../utils/contract';\nimport fetch from '../utils/fetchPonyfill';\nimport {\n getSelector,\n getSelectorFromName,\n getVersionsByType,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { parse, parseAlwaysAsBig, stringify } from '../utils/json';\nimport { getDecimalString, getHexString, getHexStringArray, toBigInt, toHex } from '../utils/num';\nimport { wait } from '../utils/provider';\nimport { SequencerAPIResponseParser } from '../utils/responseParser/sequencer';\nimport { randomAddress, signatureToDecimalArray } from '../utils/stark';\nimport { buildUrl } from '../utils/url';\nimport { GatewayError, HttpError, LibraryError } from './errors';\nimport { ProviderInterface } from './interface';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\nimport { Block } from './utils';\n\nfunction isEmptyQueryObject(obj?: Record): obj is undefined {\n return (\n obj === undefined ||\n Object.keys(obj).length === 0 ||\n (Object.keys(obj).length === 1 &&\n Object.entries(obj).every(([k, v]) => k === 'blockIdentifier' && v === null))\n );\n}\n\nconst defaultOptions = {\n network: NetworkName.SN_GOERLI2,\n blockIdentifier: BlockTag.pending,\n};\n\nexport class SequencerProvider implements ProviderInterface {\n public baseUrl: string;\n\n public feederGatewayUrl: string;\n\n public gatewayUrl: string;\n\n public headers?: Record;\n\n private blockIdentifier: BlockIdentifier;\n\n private chainId: StarknetChainId;\n\n private responseParser = new SequencerAPIResponseParser();\n\n constructor(optionsOrProvider: SequencerProviderOptions = defaultOptions) {\n if ('network' in optionsOrProvider) {\n this.baseUrl = SequencerProvider.getNetworkFromName(optionsOrProvider.network);\n this.feederGatewayUrl = buildUrl(this.baseUrl, 'feeder_gateway');\n this.gatewayUrl = buildUrl(this.baseUrl, 'gateway');\n } else {\n this.baseUrl = optionsOrProvider.baseUrl;\n this.feederGatewayUrl = buildUrl(\n this.baseUrl,\n 'feeder_gateway',\n optionsOrProvider.feederGatewayUrl\n );\n this.gatewayUrl = buildUrl(this.baseUrl, 'gateway', optionsOrProvider.gatewayUrl);\n }\n this.chainId =\n optionsOrProvider?.chainId ?? SequencerProvider.getChainIdFromBaseUrl(this.baseUrl);\n this.headers = optionsOrProvider.headers;\n this.blockIdentifier = optionsOrProvider?.blockIdentifier || defaultOptions.blockIdentifier;\n }\n\n protected static getNetworkFromName(name: NetworkName | StarknetChainId) {\n switch (name) {\n case NetworkName.SN_MAIN || StarknetChainId.SN_MAIN:\n return BaseUrl.SN_MAIN;\n case NetworkName.SN_GOERLI || StarknetChainId.SN_GOERLI:\n return BaseUrl.SN_GOERLI;\n case NetworkName.SN_GOERLI2 || StarknetChainId.SN_GOERLI2:\n return BaseUrl.SN_GOERLI2;\n default:\n throw new Error('Could not detect base url from NetworkName');\n }\n }\n\n protected static getChainIdFromBaseUrl(baseUrl: string): StarknetChainId {\n try {\n const url = new URL(baseUrl);\n if (url.host.includes('mainnet.starknet.io')) {\n return StarknetChainId.SN_MAIN;\n }\n if (url.host.includes('alpha4-2.starknet.io')) {\n return StarknetChainId.SN_GOERLI2;\n }\n return StarknetChainId.SN_GOERLI;\n } catch {\n // eslint-disable-next-line no-console\n console.error(`Could not parse baseUrl: ${baseUrl}`);\n return StarknetChainId.SN_GOERLI;\n }\n }\n\n private getFetchUrl(endpoint: keyof Sequencer.Endpoints) {\n const gatewayUrlEndpoints = ['add_transaction'];\n return gatewayUrlEndpoints.includes(endpoint) ? this.gatewayUrl : this.feederGatewayUrl;\n }\n\n private getFetchMethod(endpoint: keyof Sequencer.Endpoints) {\n const postMethodEndpoints = [\n 'add_transaction',\n 'call_contract',\n 'estimate_fee',\n 'estimate_message_fee',\n 'estimate_fee_bulk',\n 'simulate_transaction',\n ];\n\n return postMethodEndpoints.includes(endpoint) ? 'POST' : 'GET';\n }\n\n private getQueryString(query?: Record): string {\n if (isEmptyQueryObject(query)) {\n return '';\n }\n const queryString = Object.entries(query)\n .map(([key, value]) => {\n if (key === 'blockIdentifier') {\n const block = new Block(value);\n return `${block.queryIdentifier}`;\n }\n return `${key}=${value}`;\n })\n .join('&');\n\n return `?${queryString}`;\n }\n\n private getHeaders(method: SequencerHttpMethod): Record | undefined {\n if (method === 'POST') {\n return {\n 'Content-Type': 'application/json',\n ...this.headers,\n };\n }\n return this.headers;\n }\n\n // typesafe fetch\n protected async fetchEndpoint(\n endpoint: T,\n // typescript type magic to create a nice fitting function interface\n ...[query, request]: Sequencer.Endpoints[T]['QUERY'] extends never\n ? Sequencer.Endpoints[T]['REQUEST'] extends never\n ? [] // when no query and no request is needed, we can omit the query and request parameters\n : [undefined, Sequencer.Endpoints[T]['REQUEST']]\n : Sequencer.Endpoints[T]['REQUEST'] extends never\n ? [Sequencer.Endpoints[T]['QUERY']] // when no request is needed, we can omit the request parameter\n : [Sequencer.Endpoints[T]['QUERY'], Sequencer.Endpoints[T]['REQUEST']] // when both query and request are needed, we cant omit anything\n ): Promise {\n const baseUrl = this.getFetchUrl(endpoint);\n const method = this.getFetchMethod(endpoint);\n const queryString = this.getQueryString(query);\n const url = urljoin(baseUrl, endpoint, queryString);\n\n return this.fetch(url, {\n method,\n body: request,\n });\n }\n\n public async fetch(\n endpoint: string,\n options?: {\n method?: SequencerHttpMethod;\n body?: any;\n parseAlwaysAsBigInt?: boolean;\n }\n ): Promise {\n const url = buildUrl(this.baseUrl, '', endpoint);\n const method = options?.method ?? 'GET';\n const headers = this.getHeaders(method);\n const body = stringify(options?.body);\n try {\n const response = await fetch(url, {\n method,\n body,\n headers,\n });\n const textResponse = await response.text();\n\n if (!response.ok) {\n // This will allow the user to handle contract errors\n let responseBody: any;\n try {\n responseBody = parse(textResponse);\n } catch {\n throw new HttpError(response.statusText, response.status);\n }\n throw new GatewayError(responseBody.message, responseBody.code);\n }\n\n const parseChoice = options?.parseAlwaysAsBigInt ? parseAlwaysAsBig : parse;\n return parseChoice(textResponse);\n } catch (error) {\n if (error instanceof Error && !(error instanceof LibraryError))\n throw Error(`Could not ${method} from endpoint \\`${url}\\`: ${error.message}`);\n\n throw error;\n }\n }\n\n public async getChainId(): Promise {\n return Promise.resolve(this.chainId);\n }\n\n public async callContract(\n { contractAddress, entrypoint: entryPointSelector, calldata = [] }: Call,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint(\n 'call_contract',\n { blockIdentifier },\n {\n // TODO - determine best choice once both are fully supported in devnet\n // signature: [],\n // sender_address: contractAddress,\n contract_address: contractAddress,\n entry_point_selector: getSelectorFromName(entryPointSelector),\n calldata: CallData.compile(calldata),\n }\n ).then(this.responseParser.parseCallContractResponse);\n }\n\n public async getBlock(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_block', { blockIdentifier }).then(\n this.responseParser.parseGetBlockResponse\n );\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_nonce', { contractAddress, blockIdentifier });\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const parsedKey = toBigInt(key).toString(10);\n return this.fetchEndpoint('get_storage_at', {\n blockIdentifier,\n contractAddress,\n key: parsedKey,\n });\n }\n\n public async getTransaction(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction', { transactionHash: txHashHex }).then((result) => {\n // throw for no matching transaction to unify behavior with RPC and avoid parsing errors\n if (Object.values(result).length === 1) throw new LibraryError(result.status);\n return this.responseParser.parseGetTransactionResponse(result);\n });\n }\n\n public async getTransactionReceipt(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_receipt', { transactionHash: txHashHex }).then(\n this.responseParser.parseGetTransactionReceiptResponse\n );\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_full_contract', { blockIdentifier, contractAddress }).then(\n this.responseParser.parseContractClassResponse\n );\n }\n\n public async getClassHashAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_class_hash_at', { blockIdentifier, contractAddress });\n }\n\n public async getClassByHash(\n classHash: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_class_by_hash', { classHash, blockIdentifier }).then(\n this.responseParser.parseContractClassResponse\n );\n }\n\n public async getCompiledClassByClassHash(\n classHash: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_compiled_class_by_class_hash', { classHash, blockIdentifier });\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.INVOKE,\n sender_address: functionInvocation.contractAddress,\n calldata: CallData.compile(functionInvocation.calldata ?? []),\n signature: signatureToDecimalArray(functionInvocation.signature),\n nonce: toHex(details.nonce),\n max_fee: toHex(details.maxFee || 0),\n version: '0x1',\n }).then(this.responseParser.parseInvokeFunctionResponse);\n }\n\n public async deployAccountContract(\n { classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DEPLOY_ACCOUNT,\n contract_address_salt: addressSalt ?? randomAddress(),\n constructor_calldata: CallData.compile(constructorCalldata ?? []),\n class_hash: toHex(classHash),\n max_fee: toHex(details.maxFee || 0),\n version: toHex(details.version || 0),\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n }).then(this.responseParser.parseDeployContractResponse);\n }\n\n public async declareContract(\n { senderAddress, contract, signature, compiledClassHash }: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n if (!isSierra(contract)) {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DECLARE,\n contract_class: contract,\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n sender_address: senderAddress,\n max_fee: toHex(details.maxFee || 0),\n version: toHex(transactionVersion),\n }).then(this.responseParser.parseDeclareContractResponse);\n }\n // Cairo 1\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DECLARE,\n sender_address: senderAddress,\n compiled_class_hash: compiledClassHash,\n contract_class: contract,\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n max_fee: toHex(details.maxFee || 0),\n version: toHex(transactionVersion_2),\n }).then(this.responseParser.parseDeclareContractResponse);\n }\n\n public async getEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier, skipValidate);\n }\n\n public async getInvokeEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.INVOKE,\n ...invocation,\n ...invocationDetails,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getDeclareEstimateFee(\n invocation: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DECLARE,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getDeployAccountEstimateFee(\n invocation: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n { blockIdentifier = this.blockIdentifier, skipValidate = false }: getEstimateFeeBulkOptions\n ): Promise {\n const transactions = invocations.map((it) => this.buildTransaction(it, 'fee'));\n return this.fetchEndpoint(\n 'estimate_fee_bulk',\n { blockIdentifier, skipValidate },\n transactions\n ).then(this.responseParser.parseFeeEstimateBulkResponse);\n }\n\n public async getCode(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_code', { contractAddress, blockIdentifier });\n }\n\n public async waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions) {\n const errorStates = [TransactionStatus.REJECTED, TransactionStatus.NOT_RECEIVED];\n let onchain = false;\n let res;\n const retryInterval = options?.retryInterval ?? 8000;\n const successStates = options?.successStates ?? [\n TransactionStatus.ACCEPTED_ON_L1,\n TransactionStatus.ACCEPTED_ON_L2,\n ];\n\n while (!onchain) {\n // eslint-disable-next-line no-await-in-loop\n await wait(retryInterval);\n // eslint-disable-next-line no-await-in-loop\n res = await this.getTransactionStatus(txHash);\n\n if (successStates.includes(res.tx_status)) {\n onchain = true;\n } else if (errorStates.includes(res.tx_status)) {\n const message = res.tx_failure_reason\n ? `${res.tx_status}: ${res.tx_failure_reason.code}\\n${res.tx_failure_reason.error_message}`\n : res.tx_status;\n const error = new Error(message) as Error & { response: GetTransactionStatusResponse };\n error.response = res;\n throw error;\n }\n }\n const txReceipt = await this.getTransactionReceipt(txHash);\n return txReceipt;\n }\n\n /**\n * Gets the status of a transaction.\n * @param txHash BigNumberish\n * @returns GetTransactionStatusResponse - the transaction status object\n */\n public async getTransactionStatus(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_status', { transactionHash: txHashHex });\n }\n\n /**\n * Gets the smart contract address on the goerli testnet.\n * @returns GetContractAddressesResponse - starknet smart contract addresses\n */\n public async getContractAddresses(): Promise {\n return this.fetchEndpoint('get_contract_addresses');\n }\n\n /**\n * Gets the transaction trace from a tx id.\n * @param txHash BigNumberish\n * @returns TransactionTraceResponse - the transaction trace\n */\n public async getTransactionTrace(\n txHash: BigNumberish\n ): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_trace', { transactionHash: txHashHex });\n }\n\n public async estimateMessageFee(\n { from_address, to_address, entry_point_selector, payload }: CallL1Handler,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const validCallL1Handler = {\n from_address: getDecimalString(from_address),\n to_address: getHexString(to_address),\n entry_point_selector: getSelector(entry_point_selector),\n payload: getHexStringArray(payload),\n };\n\n return this.fetchEndpoint('estimate_message_fee', { blockIdentifier }, validCallL1Handler);\n }\n\n /**\n * Simulate transaction using Sequencer provider\n * WARNING!: Sequencer will process only first element from invocations array\n *\n * @param invocations Array of invocations, but only first invocation will be processed\n * @param blockIdentifier block identifier, default 'latest'\n * @param skipValidate Skip Account __validate__ method\n * @returns\n */\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n {\n blockIdentifier = this.blockIdentifier,\n skipValidate = false,\n skipExecute = false,\n }: getSimulateTransactionOptions\n ): Promise {\n if (invocations.length > 1) {\n // eslint-disable-next-line no-console\n console.warn('Sequencer simulate process only first element from invocations list');\n }\n if (skipExecute) {\n // eslint-disable-next-line no-console\n console.warn(\"Sequencer can't skip account __execute__\");\n }\n const transaction = this.buildTransaction(invocations[0]);\n return this.fetchEndpoint(\n 'simulate_transaction',\n {\n blockIdentifier,\n skipValidate: skipValidate ?? false,\n },\n transaction\n ).then(this.responseParser.parseSimulateTransactionResponse);\n }\n\n public async getStateUpdate(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const args = new Block(blockIdentifier).sequencerIdentifier;\n return this.fetchEndpoint('get_state_update', { ...args }).then(\n this.responseParser.parseGetStateUpdateResponse\n );\n }\n\n // consider adding an optional trace retrieval parameter to the getBlock method\n public async getBlockTraces(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const args = new Block(blockIdentifier).sequencerIdentifier;\n return this.fetchEndpoint('get_block_traces', { ...args });\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n\n /**\n * Build Single AccountTransaction from Single AccountInvocation\n * @param invocation AccountInvocationItem\n * @param versionType 'fee' | 'transaction' - used to determine default versions\n * @returns AccountTransactionItem\n */\n public buildTransaction(\n invocation: AccountInvocationItem,\n versionType?: 'fee' | 'transaction'\n ): Sequencer.AccountTransactionItem {\n const defaultVersions = getVersionsByType(versionType);\n const details = {\n signature: signatureToDecimalArray(invocation.signature),\n nonce: toHex(invocation.nonce),\n };\n\n if (invocation.type === TransactionType.INVOKE) {\n return {\n type: invocation.type,\n sender_address: invocation.contractAddress,\n calldata: CallData.compile(invocation.calldata ?? []),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n if (invocation.type === TransactionType.DECLARE) {\n if (!isSierra(invocation.contract)) {\n return {\n type: invocation.type,\n contract_class: invocation.contract,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v1), // fee from getDeclareEstimateFee use t.v. instead of feet.v.\n ...details,\n };\n }\n return {\n type: invocation.type,\n contract_class: invocation.contract,\n compiled_class_hash: invocation.compiledClassHash,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v2), // fee on getDeclareEstimateFee use t.v. instead of feet.v.\n ...details,\n };\n }\n if (invocation.type === TransactionType.DEPLOY_ACCOUNT) {\n return {\n type: invocation.type,\n constructor_calldata: CallData.compile(invocation.constructorCalldata || []),\n class_hash: toHex(invocation.classHash),\n contract_address_salt: toHex(invocation.addressSalt || 0),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n throw Error('Sequencer buildTransaction received unknown TransactionType');\n }\n}\n","import {\n CallContractResponse,\n DeclareContractResponse,\n DeployContractResponse,\n EstimateFeeResponse,\n GetBlockResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n InvokeFunctionResponse,\n SimulateTransactionResponse,\n} from '../../types';\n\nexport abstract class ResponseParser {\n abstract parseGetBlockResponse(res: any): GetBlockResponse;\n\n abstract parseGetTransactionResponse(res: any): GetTransactionResponse;\n\n abstract parseGetTransactionReceiptResponse(res: any): GetTransactionReceiptResponse;\n\n abstract parseFeeEstimateResponse(res: any): EstimateFeeResponse;\n\n abstract parseCallContractResponse(res: any): CallContractResponse;\n\n abstract parseInvokeFunctionResponse(res: any): InvokeFunctionResponse;\n\n abstract parseDeployContractResponse(res: any): DeployContractResponse;\n\n abstract parseDeclareContractResponse(res: any): DeclareContractResponse;\n\n abstract parseSimulateTransactionResponse(res: any): SimulateTransactionResponse;\n}\n","/**\n * Map Sequencer Response to common interface response\n * Intersection (sequencer response ∩ (∪ rpc responses))\n */\n\nimport {\n CallContractResponse,\n CompiledContract,\n ContractClassResponse,\n DeclareContractResponse,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n HexCalldata,\n InvokeFunctionResponse,\n Sequencer,\n SimulateTransactionResponse,\n StateUpdateResponse,\n} from '../../types';\nimport { isSierra } from '../contract';\nimport { toBigInt } from '../num';\nimport { parseContract } from '../provider';\nimport { estimatedFeeToMaxFee } from '../stark';\nimport { ResponseParser } from '.';\n\nexport class SequencerAPIResponseParser extends ResponseParser {\n public parseGetBlockResponse(res: Sequencer.GetBlockResponse): GetBlockResponse {\n return {\n ...res,\n new_root: res.state_root,\n parent_hash: res.parent_block_hash,\n transactions: Object.values(res.transactions)\n .map((value) => 'transaction_hash' in value && value.transaction_hash)\n .filter(Boolean) as Array,\n };\n }\n\n public parseGetTransactionResponse(\n res: Sequencer.GetTransactionResponse\n ): GetTransactionResponse {\n return {\n ...res,\n calldata: 'calldata' in res.transaction ? (res.transaction.calldata as HexCalldata) : [],\n contract_class:\n 'contract_class' in res.transaction ? (res.transaction.contract_class as any) : undefined,\n entry_point_selector:\n 'entry_point_selector' in res.transaction\n ? res.transaction.entry_point_selector\n : undefined,\n max_fee: 'max_fee' in res.transaction ? (res.transaction.max_fee as string) : undefined,\n nonce: res.transaction.nonce as string,\n sender_address:\n 'sender_address' in res.transaction\n ? (res.transaction.sender_address as string)\n : undefined,\n signature: 'signature' in res.transaction ? res.transaction.signature : undefined,\n transaction_hash:\n 'transaction_hash' in res.transaction ? res.transaction.transaction_hash : undefined,\n version: 'version' in res.transaction ? (res.transaction.version as string) : undefined,\n };\n }\n\n public parseGetTransactionReceiptResponse(\n res: Sequencer.TransactionReceiptResponse\n ): GetTransactionReceiptResponse {\n return {\n transaction_hash: res.transaction_hash,\n status: res.status,\n messages_sent: res.l2_to_l1_messages as any, // TODO: parse\n events: res.events as any,\n ...('block_hash' in res && { block_hash: res.block_hash }),\n ...('block_number' in res && { block_number: res.block_number }),\n ...('actual_fee' in res && { actual_fee: res.actual_fee }),\n ...('transaction_index' in res && { transaction_index: res.transaction_index }),\n ...('execution_resources' in res && { execution_resources: res.execution_resources }),\n ...('l1_to_l2_consumed_message' in res && {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n l1_to_l2_consumed_message: res['l1_to_l2_consumed_message'],\n }),\n ...('transaction_failure_reason' in res && {\n transaction_failure_reason: res.transaction_failure_reason,\n }),\n };\n }\n\n public parseFeeEstimateResponse(res: Sequencer.EstimateFeeResponse): EstimateFeeResponse {\n if ('overall_fee' in res) {\n let gasInfo = {};\n\n try {\n gasInfo = {\n gas_consumed: toBigInt(res.gas_usage),\n gas_price: toBigInt(res.gas_price),\n };\n } catch {\n // do nothing\n }\n\n return {\n overall_fee: toBigInt(res.overall_fee),\n ...gasInfo,\n };\n }\n return {\n overall_fee: toBigInt(res.amount),\n };\n }\n\n public parseFeeEstimateBulkResponse(\n res: Sequencer.EstimateFeeResponseBulk\n ): EstimateFeeResponseBulk {\n return [].concat(res as []).map((item: Sequencer.EstimateFeeResponse) => {\n if ('overall_fee' in item) {\n let gasInfo = {};\n\n try {\n gasInfo = {\n gas_consumed: toBigInt(item.gas_usage),\n gas_price: toBigInt(item.gas_price),\n };\n } catch {\n // do nothing\n }\n\n return {\n overall_fee: toBigInt(item.overall_fee),\n ...gasInfo,\n };\n }\n return {\n overall_fee: toBigInt(item.amount),\n };\n });\n }\n\n public parseSimulateTransactionResponse(\n res: Sequencer.SimulateTransactionResponse\n ): SimulateTransactionResponse {\n const suggestedMaxFee =\n 'overall_fee' in res.fee_estimation\n ? res.fee_estimation.overall_fee\n : res.fee_estimation.amount;\n return [\n {\n transaction_trace: res.trace,\n fee_estimation: res.fee_estimation,\n suggestedMaxFee: estimatedFeeToMaxFee(BigInt(suggestedMaxFee)),\n },\n ];\n }\n\n public parseCallContractResponse(res: Sequencer.CallContractResponse): CallContractResponse {\n return {\n result: res.result,\n };\n }\n\n public parseInvokeFunctionResponse(\n res: Sequencer.AddTransactionResponse\n ): InvokeFunctionResponse {\n return {\n transaction_hash: res.transaction_hash,\n };\n }\n\n public parseDeployContractResponse(\n res: Sequencer.AddTransactionResponse\n ): DeployContractResponse {\n return {\n transaction_hash: res.transaction_hash,\n contract_address: res.address as string,\n };\n }\n\n public parseDeclareContractResponse(\n res: Sequencer.AddTransactionResponse\n ): DeclareContractResponse {\n return {\n transaction_hash: res.transaction_hash,\n class_hash: res.class_hash as string,\n };\n }\n\n public parseGetStateUpdateResponse(res: Sequencer.StateUpdateResponse): StateUpdateResponse {\n const nonces = Object.entries(res.state_diff.nonces).map(([contract_address, nonce]) => ({\n contract_address,\n nonce,\n }));\n const storage_diffs = Object.entries(res.state_diff.storage_diffs).map(\n ([address, storage_entries]) => ({ address, storage_entries })\n );\n\n return {\n ...res,\n state_diff: {\n ...res.state_diff,\n storage_diffs,\n nonces,\n },\n };\n }\n\n public parseContractClassResponse(res: CompiledContract): ContractClassResponse {\n const response = isSierra(res) ? res : parseContract(res);\n return {\n ...response,\n abi: typeof response.abi === 'string' ? JSON.parse(response.abi) : response.abi,\n };\n }\n}\n","import urljoin from 'url-join';\n\n/**\n * Inspired from https://github.com/segmentio/is-url\n */\n\n/**\n * RegExps.\n * A URL must match #1 and then at least one of #2/#3.\n * Use two levels of REs to avoid REDOS.\n */\nconst protocolAndDomainRE = /^(?:\\w+:)?\\/\\/(\\S+)$/;\n\nconst localhostDomainRE = /^localhost[:?\\d]*(?:[^:?\\d]\\S*)?$/;\nconst nonLocalhostDomainRE = /^[^\\s.]+\\.\\S{2,}$/;\n\n/**\n * Loosely validate a URL `string`.\n * @param {String} s\n * @return {Boolean}\n */\nexport function isUrl(s?: string): boolean {\n if (!s) {\n return false;\n }\n\n if (typeof s !== 'string') {\n return false;\n }\n\n const match = s.match(protocolAndDomainRE);\n if (!match) {\n return false;\n }\n\n const everythingAfterProtocol = match[1];\n if (!everythingAfterProtocol) {\n return false;\n }\n\n if (\n localhostDomainRE.test(everythingAfterProtocol) ||\n nonLocalhostDomainRE.test(everythingAfterProtocol)\n ) {\n return true;\n }\n\n return false;\n}\n\nexport function buildUrl(baseUrl: string, defaultPath: string, urlOrPath?: string) {\n return isUrl(urlOrPath) ? urlOrPath! : urljoin(baseUrl, urlOrPath ?? defaultPath);\n}\n","import { StarknetChainId } from '../constants';\nimport {\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Nonce,\n ProviderOptions,\n RpcProviderOptions,\n SequencerProviderOptions,\n SimulateTransactionResponse,\n StateUpdateResponse,\n Storage,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { ProviderInterface } from './interface';\nimport { RpcProvider } from './rpc';\nimport { SequencerProvider } from './sequencer';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\n\nexport class Provider implements ProviderInterface {\n private provider!: ProviderInterface;\n\n constructor(providerOrOptions?: ProviderOptions | ProviderInterface) {\n if (providerOrOptions instanceof Provider) {\n // providerOrOptions is Provider\n this.provider = providerOrOptions.provider;\n } else if (\n providerOrOptions instanceof RpcProvider ||\n providerOrOptions instanceof SequencerProvider\n ) {\n // providerOrOptions is SequencerProvider or RpcProvider\n this.provider = providerOrOptions;\n } else if (providerOrOptions && 'rpc' in providerOrOptions) {\n // providerOrOptions is rpc option\n this.provider = new RpcProvider(providerOrOptions.rpc);\n } else if (providerOrOptions && 'sequencer' in providerOrOptions) {\n // providerOrOptions is sequencer option\n this.provider = new SequencerProvider(providerOrOptions.sequencer);\n } else {\n // providerOrOptions is none, create SequencerProvider as default\n this.provider = new SequencerProvider();\n }\n }\n\n public async getChainId(): Promise {\n return this.provider.getChainId();\n }\n\n public async getBlock(blockIdentifier: BlockIdentifier): Promise {\n return this.provider.getBlock(blockIdentifier);\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getClassAt(contractAddress, blockIdentifier);\n }\n\n public async getClassHashAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getClassHashAt(contractAddress, blockIdentifier);\n }\n\n public getClassByHash(classHash: string): Promise {\n return this.provider.getClassByHash(classHash);\n }\n\n public async getEstimateFee(\n invocationWithTxType: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier\n ): Promise {\n return this.provider.getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier);\n }\n\n public async getInvokeEstimateFee(\n invocationWithTxType: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getInvokeEstimateFee(\n invocationWithTxType,\n invocationDetails,\n blockIdentifier,\n skipValidate\n );\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n options: getEstimateFeeBulkOptions\n ): Promise {\n return this.provider.getEstimateFeeBulk(invocations, options);\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getNonceForAddress(contractAddress, blockIdentifier);\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getStorageAt(contractAddress, key, blockIdentifier);\n }\n\n public async getTransaction(txHash: BigNumberish): Promise {\n return this.provider.getTransaction(txHash);\n }\n\n public async getTransactionReceipt(txHash: BigNumberish): Promise {\n return this.provider.getTransactionReceipt(txHash);\n }\n\n public async callContract(\n request: Call,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.callContract(request, blockIdentifier);\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.invokeFunction(functionInvocation, details);\n }\n\n public async deployAccountContract(\n payload: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.deployAccountContract(payload, details);\n }\n\n public async declareContract(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.declareContract(transaction, details);\n }\n\n public async getDeclareEstimateFee(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate);\n }\n\n public getDeployAccountEstimateFee(\n transaction: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getDeployAccountEstimateFee(\n transaction,\n details,\n blockIdentifier,\n skipValidate\n );\n }\n\n public async getCode(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getCode(contractAddress, blockIdentifier);\n }\n\n public async waitForTransaction(\n txHash: BigNumberish,\n options?: waitForTransactionOptions\n ): Promise {\n return this.provider.waitForTransaction(txHash, options);\n }\n\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n options?: getSimulateTransactionOptions\n ): Promise {\n return this.provider.getSimulateTransaction(invocations, options);\n }\n\n public async getStateUpdate(blockIdentifier?: BlockIdentifier): Promise {\n return this.provider.getStateUpdate(blockIdentifier);\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n}\n","import {\n Abi,\n Call,\n DeclareSignerDetails,\n DeployAccountSignerDetails,\n InvocationsSignerDetails,\n Signature,\n TypedData,\n} from '../types';\n\nexport abstract class SignerInterface {\n /**\n * Method to get the public key of the signer\n *\n * @returns public key of signer as hex string with 0x prefix\n */\n public abstract getPubKey(): Promise;\n\n /**\n * Sign an JSON object for off-chain usage with the starknet private key and return the signature\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param typedData - JSON object to be signed\n * @param accountAddress - account\n * @returns the signature of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract signMessage(typedData: TypedData, accountAddress: string): Promise;\n\n /**\n * Signs a transaction with the starknet private key and returns the signature\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * @param abi (optional) the abi of the contract for better displaying\n *\n * @returns signature\n */\n public abstract signTransaction(\n transactions: Call[],\n transactionsDetail: InvocationsSignerDetails,\n abis?: Abi[]\n ): Promise;\n\n /**\n * Signs a DEPLOY_ACCOUNT transaction with the starknet private key and returns the signature\n *\n * @param transaction\n * - contractAddress - the computed address of the contract\n * - constructorCalldata - calldata to be passed in deploy constructor\n * - addressSalt - contract address salt\n * - chainId - the chainId to declare contract on\n * - maxFee - maxFee for the declare transaction\n * - version - transaction version\n * - nonce - Nonce of the declare transaction\n * @returns signature\n */\n public abstract signDeployAccountTransaction(\n transaction: DeployAccountSignerDetails\n ): Promise;\n\n /**\n * Signs a DECLARE transaction with the starknet private key and returns the signature\n *\n * @param transaction\n * - classHash - computed class hash. Will be replaced by ContractClass in future once class hash is present in CompiledContract\n * - senderAddress - the address of the sender\n * - chainId - the chainId to declare contract on\n * - maxFee - maxFee for the declare transaction\n * - version - transaction version\n * - nonce - Nonce of the declare transaction\n * @returns signature\n */\n public abstract signDeclareTransaction(transaction: DeclareSignerDetails): Promise;\n}\n","import { BigNumberish, CairoVersion, Call, CallStruct, Calldata, ParsedStruct } from '../types';\nimport { CallData } from './calldata';\nimport { getSelectorFromName } from './hash';\nimport { toBigInt } from './num';\n\n/**\n * Transforms a list of Calls, each with their own calldata, into\n * two arrays: one with the entrypoints, and one with the concatenated calldata.\n * @param calls\n * @returns\n */\nexport const transformCallsToMulticallArrays = (calls: Call[]) => {\n const callArray: ParsedStruct[] = [];\n const calldata: BigNumberish[] = [];\n calls.forEach((call) => {\n const data = CallData.compile(call.calldata || []);\n callArray.push({\n to: toBigInt(call.contractAddress).toString(10),\n selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10),\n data_offset: calldata.length.toString(),\n data_len: data.length.toString(),\n });\n calldata.push(...data);\n });\n return {\n callArray,\n calldata: CallData.compile({ calldata }),\n };\n};\n\n/**\n * Transforms a list of calls in the full flattened calldata expected\n * by the __execute__ protocol.\n * @param calls\n * @returns\n */\nexport const fromCallsToExecuteCalldata = (calls: Call[]) => {\n const { callArray, calldata } = transformCallsToMulticallArrays(calls);\n const compiledCalls = CallData.compile({ callArray });\n return [...compiledCalls, ...calldata] as Calldata;\n};\n\nexport const fromCallsToExecuteCalldataWithNonce = (calls: Call[], nonce: BigNumberish) => {\n return [...fromCallsToExecuteCalldata(calls), toBigInt(nonce).toString()] as Calldata;\n};\n\n// TT: Can be removed ?\n/**\n * Format Data inside Calls\n * @param calls Call[]\n * @returns CallStruct\n */\nexport const transformCallsToMulticallArrays_cairo1 = (calls: Call[]) => {\n const callArray = calls.map((call) => ({\n to: toBigInt(call.contractAddress).toString(10),\n selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10),\n calldata: CallData.compile(call.calldata || []),\n }));\n return callArray;\n};\n\n/**\n * Transforms a list of calls in the full flattened calldata expected\n * by the __execute__ protocol.\n * @param calls\n * @returns Calldata\n */\nexport const fromCallsToExecuteCalldata_cairo1 = (calls: Call[]) => {\n // ensure property order\n const orderCalls = calls.map((call) => ({\n contractAddress: call.contractAddress,\n entrypoint: call.entrypoint,\n calldata: call.calldata,\n }));\n\n return CallData.compile({ orderCalls });\n};\n\n/**\n *\n * @param calls Call array\n * @param cairoVersion Defaults to 0\n * @returns string[] of calldata\n */\nexport const getExecuteCalldata = (calls: Call[], cairoVersion: CairoVersion = '0') => {\n if (cairoVersion === '1') {\n return fromCallsToExecuteCalldata_cairo1(calls);\n }\n return fromCallsToExecuteCalldata(calls);\n};\n","import { BigNumberish, StarkNetMerkleType, StarkNetType, TypedData } from '../types';\nimport { computeHashOnElements, getSelectorFromName } from './hash';\nimport { MerkleTree } from './merkle';\nimport { isHex, toHex } from './num';\nimport { encodeShortString } from './shortString';\n\n/** @deprecated prefer importing from 'types' over 'typedData' */\nexport * from '../types/typedData';\n\nfunction getHex(value: BigNumberish): string {\n try {\n return toHex(value);\n } catch (e) {\n if (typeof value === 'string') {\n return toHex(encodeShortString(value));\n }\n throw new Error(`Invalid BigNumberish: ${value}`);\n }\n}\n\n/**\n * Validates that `data` matches the EIP-712 JSON schema.\n *\n * @param {any} data\n * @return {boolean}\n */\nconst validateTypedData = (data: unknown): data is TypedData => {\n const typedData = data as TypedData;\n\n // Validate that the data matches the EIP-712 JSON schema\n const valid = Boolean(typedData.types && typedData.primaryType && typedData.message);\n\n return valid;\n};\n\nexport function prepareSelector(selector: string): string {\n return isHex(selector) ? selector : getSelectorFromName(selector);\n}\n\nexport function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType {\n return type.type === 'merkletree';\n}\n\ninterface Context {\n parent?: string;\n key?: string;\n}\n\n/**\n * Get the dependencies of a struct type. If a struct has the same dependency multiple times, it's only included once\n * in the resulting array.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {string[]} [dependencies]\n * @return {string[]}\n */\nexport const getDependencies = (\n types: TypedData['types'],\n type: string,\n dependencies: string[] = []\n): string[] => {\n // Include pointers (struct arrays)\n if (type[type.length - 1] === '*') {\n // eslint-disable-next-line no-param-reassign\n type = type.slice(0, -1);\n }\n\n if (dependencies.includes(type)) {\n return dependencies;\n }\n\n if (!types[type]) {\n return dependencies;\n }\n\n return [\n type,\n ...types[type].reduce(\n (previous, t) => [\n ...previous,\n ...getDependencies(types, t.type, previous).filter(\n (dependency) => !previous.includes(dependency)\n ),\n ],\n []\n ),\n ];\n};\n\nfunction getMerkleTreeType(types: TypedData['types'], ctx: Context) {\n if (ctx.parent && ctx.key) {\n const parentType = types[ctx.parent];\n const merkleType = parentType.find((t) => t.name === ctx.key)!;\n const isMerkleTree = isMerkleTreeType(merkleType);\n if (!isMerkleTree) {\n throw new Error(`${ctx.key} is not a merkle tree`);\n }\n if (merkleType.contains.endsWith('*')) {\n throw new Error(`Merkle tree contain property must not be an array but was given ${ctx.key}`);\n }\n return merkleType.contains;\n }\n return 'raw';\n}\n\n/**\n * Encode a type to a string. All dependant types are alphabetically sorted.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @return {string}\n */\nexport const encodeType = (types: TypedData['types'], type: string): string => {\n const [primary, ...dependencies] = getDependencies(types, type);\n const newTypes = !primary ? [] : [primary, ...dependencies.sort()];\n\n return newTypes\n .map((dependency) => {\n return `${dependency}(${types[dependency].map((t) => `${t.name}:${t.type}`)})`;\n })\n .join('');\n};\n\n/**\n * Get a type string as hash.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @return {string}\n */\nexport const getTypeHash = (types: TypedData['types'], type: string): string => {\n return getSelectorFromName(encodeType(types, type));\n};\n\n/**\n * Encodes a single value to an ABI serialisable string, number or Buffer. Returns the data as tuple, which consists of\n * an array of ABI compatible types, and an array of corresponding values.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {any} data\n * @returns {[string, string]}\n */\nexport const encodeValue = (\n types: TypedData['types'],\n type: string,\n data: unknown,\n ctx: Context = {}\n): [string, string] => {\n if (types[type]) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return [type, getStructHash(types, type, data as Record)];\n }\n\n if (\n Object.keys(types)\n .map((x) => `${x}*`)\n .includes(type)\n ) {\n const structHashes: string[] = (data as unknown[]).map((struct) => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return getStructHash(types, type.slice(0, -1), struct as Record);\n });\n return [type, computeHashOnElements(structHashes)];\n }\n\n if (type === 'merkletree') {\n const merkleTreeType = getMerkleTreeType(types, ctx);\n const structHashes: string[] = (data as unknown[]).map((struct) => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return encodeValue(types, merkleTreeType, struct as Record)[1];\n });\n const { root } = new MerkleTree(structHashes as string[]);\n return ['felt', root];\n }\n\n if (type === 'felt*') {\n return ['felt*', computeHashOnElements(data as string[])];\n }\n\n if (type === 'selector') {\n return ['felt', prepareSelector(data as string)];\n }\n\n return [type, getHex(data as string)];\n};\n\n/**\n * Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values. All\n * dependant types are automatically encoded.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {Record} data\n */\nexport const encodeData = (\n types: T['types'],\n type: string,\n data: T['message']\n) => {\n const [returnTypes, values] = types[type].reduce<[string[], string[]]>(\n ([ts, vs], field) => {\n if (data[field.name] === undefined || data[field.name] === null) {\n throw new Error(`Cannot encode data: missing data for '${field.name}'`);\n }\n\n const value = data[field.name];\n const [t, encodedValue] = encodeValue(types, field.type, value, {\n parent: type,\n key: field.name,\n });\n\n return [\n [...ts, t],\n [...vs, encodedValue],\n ];\n },\n [['felt'], [getTypeHash(types, type)]]\n );\n\n return [returnTypes, values];\n};\n\n/**\n * Get encoded data as a hash. The data should be a key -> value object with all the required values. All dependant\n * types are automatically encoded.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {Record} data\n * @return {Buffer}\n */\nexport const getStructHash = (\n types: T['types'],\n type: string,\n data: T['message']\n) => {\n return computeHashOnElements(encodeData(types, type, data)[1]);\n};\n\n/**\n * Get the EIP-191 encoded message to sign, from the typedData object.\n *\n * @param {TypedData} typedData\n * @param {BigNumberish} account\n * @return {string}\n */\nexport const getMessageHash = (typedData: TypedData, account: BigNumberish): string => {\n if (!validateTypedData(typedData)) {\n throw new Error('Typed data does not match JSON schema');\n }\n\n const message = [\n encodeShortString('StarkNet Message'),\n getStructHash(typedData.types, 'StarkNetDomain', typedData.domain),\n account,\n getStructHash(typedData.types, typedData.primaryType, typedData.message),\n ];\n\n return computeHashOnElements(message);\n};\n","import { starkCurve } from './ec';\nimport { toBigInt } from './num';\n\nexport class MerkleTree {\n public leaves: string[];\n\n public branches: string[][] = [];\n\n public root: string;\n\n constructor(leafHashes: string[]) {\n this.leaves = leafHashes;\n this.root = this.build(leafHashes);\n }\n\n private build(leaves: string[]): string {\n if (leaves.length === 1) {\n return leaves[0];\n }\n if (leaves.length !== this.leaves.length) {\n this.branches.push(leaves);\n }\n const newLeaves: string[] = [];\n for (let i = 0; i < leaves.length; i += 2) {\n if (i + 1 === leaves.length) {\n newLeaves.push(MerkleTree.hash(leaves[i], '0x0'));\n } else {\n newLeaves.push(MerkleTree.hash(leaves[i], leaves[i + 1]));\n }\n }\n return this.build(newLeaves);\n }\n\n static hash(a: string, b: string) {\n const [aSorted, bSorted] = [toBigInt(a), toBigInt(b)].sort((x, y) => (x >= y ? 1 : -1));\n return starkCurve.pedersen(aSorted, bSorted);\n }\n\n public getProof(leaf: string, branch = this.leaves, hashPath: string[] = []): string[] {\n const index = branch.indexOf(leaf);\n if (index === -1) {\n throw new Error('leaf not found');\n }\n if (branch.length === 1) {\n return hashPath;\n }\n const isLeft = index % 2 === 0;\n const neededBranch = (isLeft ? branch[index + 1] : branch[index - 1]) ?? '0x0';\n const newHashPath = [...hashPath, neededBranch];\n const currentBranchLevelIndex =\n this.leaves.length === branch.length\n ? -1\n : this.branches.findIndex((b) => b.length === branch.length);\n const nextBranch = this.branches[currentBranchLevelIndex + 1] ?? [this.root];\n return this.getProof(\n MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf),\n nextBranch,\n newHashPath\n );\n }\n}\n\nexport function proofMerklePath(root: string, leaf: string, path: string[]): boolean {\n if (path.length === 0) {\n return root === leaf;\n }\n const [next, ...rest] = path;\n return proofMerklePath(root, MerkleTree.hash(leaf, next), rest);\n}\n","import {\n Abi,\n Call,\n DeclareSignerDetails,\n DeployAccountSignerDetails,\n InvocationsSignerDetails,\n Signature,\n TypedData,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { starkCurve } from '../utils/ec';\nimport { buf2hex } from '../utils/encode';\nimport {\n calculateDeclareTransactionHash,\n calculateDeployAccountTransactionHash,\n calculateTransactionHash,\n} from '../utils/hash';\nimport { toHex } from '../utils/num';\nimport { getExecuteCalldata } from '../utils/transaction';\nimport { getMessageHash } from '../utils/typedData';\nimport { SignerInterface } from './interface';\n\nexport class Signer implements SignerInterface {\n protected pk: Uint8Array | string;\n\n constructor(pk: Uint8Array | string = starkCurve.utils.randomPrivateKey()) {\n this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk);\n }\n\n public async getPubKey(): Promise {\n return starkCurve.getStarkKey(this.pk);\n }\n\n public async signMessage(typedData: TypedData, accountAddress: string): Promise {\n const msgHash = getMessageHash(typedData, accountAddress);\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signTransaction(\n transactions: Call[],\n transactionsDetail: InvocationsSignerDetails,\n abis?: Abi[]\n ): Promise {\n if (abis && abis.length !== transactions.length) {\n throw new Error('ABI must be provided for each transaction or no transaction');\n }\n // now use abi to display decoded data somewhere, but as this signer is headless, we can't do that\n\n const calldata = getExecuteCalldata(transactions, transactionsDetail.cairoVersion);\n\n const msgHash = calculateTransactionHash(\n transactionsDetail.walletAddress,\n transactionsDetail.version,\n calldata,\n transactionsDetail.maxFee,\n transactionsDetail.chainId,\n transactionsDetail.nonce\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signDeployAccountTransaction({\n classHash,\n contractAddress,\n constructorCalldata,\n addressSalt,\n maxFee,\n version,\n chainId,\n nonce,\n }: DeployAccountSignerDetails): Promise {\n const msgHash = calculateDeployAccountTransactionHash(\n contractAddress,\n classHash,\n CallData.compile(constructorCalldata),\n addressSalt,\n version,\n maxFee,\n chainId,\n nonce\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signDeclareTransaction(\n // contractClass: ContractClass, // Should be used once class hash is present in ContractClass\n {\n classHash,\n senderAddress,\n chainId,\n maxFee,\n version,\n nonce,\n compiledClassHash,\n }: DeclareSignerDetails\n ): Promise {\n const msgHash = calculateDeclareTransactionHash(\n classHash,\n senderAddress,\n version,\n maxFee,\n chainId,\n nonce,\n compiledClassHash\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n}\n","import { UDC } from '../constants';\nimport { InvokeTransactionReceiptResponse } from '../types/provider';\nimport { cleanHex } from './num';\n\n/**\n * Parse Transaction Receipt Event from UDC invoke transaction and\n * create DeployContractResponse compatibile response with adition of UDC Event data\n *\n * @param txReceipt\n * @returns DeployContractResponse | UDC Event Response data\n */\nexport function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse) {\n if (!txReceipt.events) {\n throw new Error('UDC emited event is empty');\n }\n const event = txReceipt.events.find(\n (it) => cleanHex(it.from_address) === cleanHex(UDC.ADDRESS)\n ) || {\n data: [],\n };\n return {\n transaction_hash: txReceipt.transaction_hash,\n contract_address: event.data[0],\n address: event.data[0],\n deployer: event.data[1],\n unique: event.data[2],\n classHash: event.data[3],\n calldata_len: event.data[4],\n calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)),\n salt: event.data[event.data.length - 1],\n };\n}\n","import { UDC, ZERO } from '../constants';\nimport { ProviderInterface } from '../provider';\nimport { Provider } from '../provider/default';\nimport { Signer, SignerInterface } from '../signer';\nimport {\n Abi,\n AccountInvocationItem,\n AccountInvocations,\n AccountInvocationsFactoryDetails,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n CairoVersion,\n Call,\n DeclareAndDeployContractPayload,\n DeclareContractPayload,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeclareDeployUDCResponse,\n DeployAccountContractPayload,\n DeployAccountContractTransaction,\n DeployContractResponse,\n DeployContractUDCResponse,\n Details,\n EstimateFee,\n EstimateFeeAction,\n EstimateFeeBulk,\n EstimateFeeDetails,\n Invocation,\n Invocations,\n InvocationsDetails,\n InvocationsSignerDetails,\n InvokeFunctionResponse,\n MultiDeployContractResponse,\n Nonce,\n ProviderOptions,\n Signature,\n SimulateTransactionDetails,\n SimulateTransactionResponse,\n TransactionType,\n TypedData,\n UniversalDeployerContractPayload,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { extractContractHashes, isSierra } from '../utils/contract';\nimport { starkCurve } from '../utils/ec';\nimport { parseUDCEvent } from '../utils/events';\nimport {\n calculateContractAddressFromHash,\n feeTransactionVersion,\n feeTransactionVersion_2,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { toBigInt, toCairoBool } from '../utils/num';\nimport { parseContract } from '../utils/provider';\nimport { estimatedFeeToMaxFee, formatSignature, randomAddress } from '../utils/stark';\nimport { getExecuteCalldata } from '../utils/transaction';\nimport { getMessageHash } from '../utils/typedData';\nimport { AccountInterface } from './interface';\n\nexport class Account extends Provider implements AccountInterface {\n public signer: SignerInterface;\n\n public address: string;\n\n public cairoVersion: CairoVersion;\n\n constructor(\n providerOrOptions: ProviderOptions | ProviderInterface,\n address: string,\n pkOrSigner: Uint8Array | string | SignerInterface,\n cairoVersion: CairoVersion = '0'\n ) {\n super(providerOrOptions);\n this.address = address.toLowerCase();\n this.signer =\n typeof pkOrSigner === 'string' || pkOrSigner instanceof Uint8Array\n ? new Signer(pkOrSigner)\n : pkOrSigner;\n\n this.cairoVersion = cairoVersion;\n }\n\n public async getNonce(blockIdentifier?: BlockIdentifier): Promise {\n return super.getNonceForAddress(this.address, blockIdentifier);\n }\n\n private async getNonceSafe(nonce?: BigNumberish) {\n // Patch DEPLOY_ACCOUNT: RPC getNonce for non-existing address will result in error, on Sequencer it is '0x0'\n try {\n return toBigInt(nonce ?? (await this.getNonce()));\n } catch (error) {\n return 0n;\n }\n }\n\n public async estimateFee(\n calls: AllowArray,\n estimateFeeDetails?: EstimateFeeDetails | undefined\n ): Promise {\n return this.estimateInvokeFee(calls, estimateFeeDetails);\n }\n\n public async estimateInvokeFee(\n calls: AllowArray,\n { nonce: providedNonce, blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const transactions = Array.isArray(calls) ? calls : [calls];\n const nonce = toBigInt(providedNonce ?? (await this.getNonce()));\n const version = toBigInt(feeTransactionVersion);\n const chainId = await this.getChainId();\n\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce,\n maxFee: ZERO,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n\n const invocation = await this.buildInvocation(transactions, signerDetails);\n const response = await super.getInvokeEstimateFee(\n { ...invocation },\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateDeclareFee(\n { contract, classHash: providedClassHash, casm, compiledClassHash }: DeclareContractPayload,\n { blockIdentifier, nonce: providedNonce, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const nonce = toBigInt(providedNonce ?? (await this.getNonce()));\n const version = !isSierra(contract) ? feeTransactionVersion : feeTransactionVersion_2;\n const chainId = await this.getChainId();\n\n const declareContractTransaction = await this.buildDeclarePayload(\n { classHash: providedClassHash, contract, casm, compiledClassHash },\n {\n nonce,\n chainId,\n version,\n walletAddress: this.address,\n maxFee: ZERO,\n cairoVersion: this.cairoVersion,\n }\n );\n\n const response = await super.getDeclareEstimateFee(\n declareContractTransaction,\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateAccountDeployFee(\n {\n classHash,\n addressSalt = 0,\n constructorCalldata = [],\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n { blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const version = toBigInt(feeTransactionVersion);\n const nonce = ZERO; // DEPLOY_ACCOUNT transaction will have a nonce zero as it is the first transaction in the account\n const chainId = await this.getChainId();\n\n const payload = await this.buildAccountDeployPayload(\n { classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress },\n {\n nonce,\n chainId,\n version,\n walletAddress: this.address,\n maxFee: ZERO,\n cairoVersion: this.cairoVersion,\n }\n );\n\n const response = await super.getDeployAccountEstimateFee(\n { ...payload },\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateDeployFee(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n transactionsDetail?: InvocationsDetails | undefined\n ): Promise {\n const calls = this.buildUDCContractPayload(payload);\n return this.estimateInvokeFee(calls, transactionsDetail);\n }\n\n public async estimateFeeBulk(\n invocations: Invocations,\n { nonce, blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const accountInvocations = await this.accountInvocationsFactory(invocations, {\n versions: [feeTransactionVersion, feeTransactionVersion_2],\n nonce,\n blockIdentifier,\n });\n\n const response = await super.getEstimateFeeBulk(accountInvocations, {\n blockIdentifier,\n skipValidate,\n });\n\n return [].concat(response as []).map((elem: any) => {\n const suggestedMaxFee = estimatedFeeToMaxFee(elem.overall_fee);\n return {\n ...elem,\n suggestedMaxFee,\n };\n });\n }\n\n public async buildInvocation(\n call: Array,\n signerDetails: InvocationsSignerDetails\n ): Promise {\n const calldata = getExecuteCalldata(call, this.cairoVersion);\n const signature = await this.signer.signTransaction(call, signerDetails);\n\n return {\n contractAddress: this.address,\n calldata,\n signature,\n };\n }\n\n public async execute(\n calls: AllowArray,\n abis: Abi[] | undefined = undefined,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const transactions = Array.isArray(calls) ? calls : [calls];\n const nonce = toBigInt(transactionsDetail.nonce ?? (await this.getNonce()));\n const maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n { type: TransactionType.INVOKE, payload: calls },\n transactionsDetail\n ));\n const version = toBigInt(transactionVersion);\n const chainId = await this.getChainId();\n\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce,\n maxFee,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n\n const signature = await this.signer.signTransaction(transactions, signerDetails, abis);\n\n const calldata = getExecuteCalldata(transactions, this.cairoVersion);\n\n return this.invokeFunction(\n { contractAddress: this.address, calldata, signature },\n {\n nonce,\n maxFee,\n version,\n }\n );\n }\n\n /**\n * First check if contract is already declared, if not declare it\n * If contract already declared returned transaction_hash is ''.\n * Method will pass even if contract is already declared\n * @param payload DeclareContractPayload\n * @param transactionsDetail (optional) InvocationsDetails = \\{\\}\n * @returns DeclareContractResponse\n */\n public async declareIfNot(\n payload: DeclareContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const declareContractPayload = extractContractHashes(payload);\n try {\n await this.getClassByHash(declareContractPayload.classHash);\n } catch (error) {\n return this.declare(payload, transactionsDetail);\n }\n return {\n transaction_hash: '',\n class_hash: declareContractPayload.classHash,\n };\n }\n\n public async declare(\n payload: DeclareContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const declareContractPayload = extractContractHashes(payload);\n const details = {} as Details;\n\n details.nonce = toBigInt(transactionsDetail.nonce ?? (await this.getNonce()));\n details.maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n {\n type: TransactionType.DECLARE,\n payload: declareContractPayload,\n },\n transactionsDetail\n ));\n details.version = !isSierra(payload.contract) ? transactionVersion : transactionVersion_2;\n details.chainId = await this.getChainId();\n\n const declareContractTransaction = await this.buildDeclarePayload(declareContractPayload, {\n ...details,\n walletAddress: this.address,\n cairoVersion: this.cairoVersion,\n });\n\n return this.declareContract(declareContractTransaction, details);\n }\n\n public async deploy(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise {\n const params = [].concat(payload as []).map((it) => {\n const {\n classHash,\n salt,\n unique = true,\n constructorCalldata = [],\n } = it as UniversalDeployerContractPayload;\n\n const compiledConstructorCallData = CallData.compile(constructorCalldata);\n const deploySalt = salt ?? randomAddress();\n\n return {\n call: {\n contractAddress: UDC.ADDRESS,\n entrypoint: UDC.ENTRYPOINT,\n calldata: [\n classHash,\n deploySalt,\n toCairoBool(unique),\n compiledConstructorCallData.length,\n ...compiledConstructorCallData,\n ],\n },\n address: calculateContractAddressFromHash(\n unique ? starkCurve.pedersen(this.address, deploySalt) : deploySalt,\n classHash,\n compiledConstructorCallData,\n unique ? UDC.ADDRESS : 0\n ),\n };\n });\n\n const calls = params.map((it) => it.call);\n const addresses = params.map((it) => it.address);\n const invokeResponse = await this.execute(calls, undefined, details);\n\n return {\n ...invokeResponse,\n contract_address: addresses,\n };\n }\n\n public async deployContract(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise {\n const deployTx = await this.deploy(payload, details);\n const txReceipt = await this.waitForTransaction(deployTx.transaction_hash);\n return parseUDCEvent(txReceipt);\n }\n\n public async declareAndDeploy(\n payload: DeclareAndDeployContractPayload,\n details?: InvocationsDetails | undefined\n ): Promise {\n const { constructorCalldata, salt, unique } = payload;\n let declare = await this.declareIfNot(payload, details);\n if (declare.transaction_hash !== '') {\n const tx = await this.waitForTransaction(declare.transaction_hash);\n declare = { ...declare, ...tx };\n }\n const deploy = await this.deployContract(\n { classHash: declare.class_hash, salt, unique, constructorCalldata },\n details\n );\n return { declare: { ...declare }, deploy };\n }\n\n public deploySelf = this.deployAccount;\n\n public async deployAccount(\n {\n classHash,\n constructorCalldata = [],\n addressSalt = 0,\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const version = toBigInt(transactionVersion);\n const nonce = ZERO; // DEPLOY_ACCOUNT transaction will have a nonce zero as it is the first transaction in the account\n const chainId = await this.getChainId();\n\n const compiledCalldata = CallData.compile(constructorCalldata);\n const contractAddress =\n providedContractAddress ??\n calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);\n\n const maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n payload: {\n classHash,\n constructorCalldata: compiledCalldata,\n addressSalt,\n contractAddress,\n },\n },\n transactionsDetail\n ));\n\n const signature = await this.signer.signDeployAccountTransaction({\n classHash,\n constructorCalldata: compiledCalldata,\n contractAddress,\n addressSalt,\n chainId,\n maxFee,\n version,\n nonce,\n });\n\n return this.deployAccountContract(\n { classHash, addressSalt, constructorCalldata, signature },\n {\n nonce,\n maxFee,\n version,\n }\n );\n }\n\n public async signMessage(typedData: TypedData): Promise {\n return this.signer.signMessage(typedData, this.address);\n }\n\n public async hashMessage(typedData: TypedData): Promise {\n return getMessageHash(typedData, this.address);\n }\n\n public async verifyMessageHash(hash: BigNumberish, signature: Signature): Promise {\n try {\n await this.callContract({\n contractAddress: this.address,\n entrypoint: 'isValidSignature',\n calldata: CallData.compile({\n hash: toBigInt(hash).toString(),\n signature: formatSignature(signature),\n }),\n });\n return true;\n } catch {\n return false;\n }\n }\n\n public async verifyMessage(typedData: TypedData, signature: Signature): Promise {\n const hash = await this.hashMessage(typedData);\n return this.verifyMessageHash(hash, signature);\n }\n\n public async getSuggestedMaxFee(\n { type, payload }: EstimateFeeAction,\n details: EstimateFeeDetails\n ) {\n let feeEstimate: EstimateFee;\n\n switch (type) {\n case TransactionType.INVOKE:\n feeEstimate = await this.estimateInvokeFee(payload, details);\n break;\n\n case TransactionType.DECLARE:\n feeEstimate = await this.estimateDeclareFee(payload, details);\n break;\n\n case TransactionType.DEPLOY_ACCOUNT:\n feeEstimate = await this.estimateAccountDeployFee(payload, details);\n break;\n\n case TransactionType.DEPLOY:\n feeEstimate = await this.estimateDeployFee(payload, details);\n break;\n\n default:\n feeEstimate = { suggestedMaxFee: ZERO, overall_fee: ZERO };\n break;\n }\n\n return feeEstimate.suggestedMaxFee;\n }\n\n /**\n * will be renamed to buildDeclareContractTransaction\n */\n public async buildDeclarePayload(\n payload: DeclareContractPayload,\n { nonce, chainId, version, walletAddress, maxFee }: InvocationsSignerDetails\n ): Promise {\n const { classHash, contract, compiledClassHash } = extractContractHashes(payload);\n const compressedCompiledContract = parseContract(contract);\n const signature = await this.signer.signDeclareTransaction({\n classHash,\n compiledClassHash,\n senderAddress: walletAddress,\n chainId,\n maxFee,\n version,\n nonce,\n });\n\n return {\n senderAddress: walletAddress,\n signature,\n contract: compressedCompiledContract,\n compiledClassHash,\n };\n }\n\n public async buildAccountDeployPayload(\n {\n classHash,\n addressSalt = 0,\n constructorCalldata = [],\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n { nonce, chainId, version, maxFee }: InvocationsSignerDetails\n ): Promise {\n const compiledCalldata = CallData.compile(constructorCalldata);\n const contractAddress =\n providedContractAddress ??\n calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);\n\n const signature = await this.signer.signDeployAccountTransaction({\n classHash,\n contractAddress,\n chainId,\n maxFee,\n version,\n nonce,\n addressSalt,\n constructorCalldata: compiledCalldata,\n });\n\n return {\n classHash,\n addressSalt,\n constructorCalldata: compiledCalldata,\n signature,\n };\n }\n\n public buildUDCContractPayload(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]\n ): Call[] {\n const calls = [].concat(payload as []).map((it) => {\n const {\n classHash,\n salt = '0',\n unique = true,\n constructorCalldata = [],\n } = it as UniversalDeployerContractPayload;\n const compiledConstructorCallData = CallData.compile(constructorCalldata);\n\n return {\n contractAddress: UDC.ADDRESS,\n entrypoint: UDC.ENTRYPOINT,\n calldata: [\n classHash,\n salt,\n toCairoBool(unique),\n compiledConstructorCallData.length,\n ...compiledConstructorCallData,\n ],\n };\n });\n return calls;\n }\n\n public async simulateTransaction(\n invocations: Invocations,\n { nonce, blockIdentifier, skipValidate, skipExecute }: SimulateTransactionDetails = {}\n ): Promise {\n const accountInvocations = await this.accountInvocationsFactory(invocations, {\n versions: [transactionVersion, transactionVersion_2],\n nonce,\n blockIdentifier,\n });\n\n return super.getSimulateTransaction(accountInvocations, {\n blockIdentifier,\n skipValidate,\n skipExecute,\n });\n }\n\n public async accountInvocationsFactory(\n invocations: Invocations,\n { versions, nonce, blockIdentifier }: AccountInvocationsFactoryDetails\n ) {\n const version = versions[0];\n const safeNonce = await this.getNonceSafe(nonce);\n const chainId = await this.getChainId();\n\n return Promise.all(\n ([] as Invocations).concat(invocations).map(async (transaction, index: number) => {\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce: toBigInt(Number(safeNonce) + index),\n maxFee: ZERO,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n const txPayload: any = 'payload' in transaction ? transaction.payload : transaction;\n const common = {\n type: transaction.type,\n version,\n nonce: toBigInt(Number(safeNonce) + index),\n blockIdentifier,\n };\n\n if (transaction.type === TransactionType.INVOKE) {\n const payload = await this.buildInvocation(\n ([] as Call[]).concat(txPayload),\n signerDetails\n );\n return {\n ...common,\n ...payload,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DECLARE) {\n signerDetails.version = !isSierra(txPayload.contract)\n ? toBigInt(versions[0])\n : toBigInt(versions[1]);\n const payload = await this.buildDeclarePayload(txPayload, signerDetails);\n return {\n ...common,\n ...payload,\n version: signerDetails.version,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DEPLOY_ACCOUNT) {\n const payload = await this.buildAccountDeployPayload(txPayload, signerDetails);\n return {\n ...common,\n ...payload,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DEPLOY) {\n const calls = this.buildUDCContractPayload(txPayload);\n const payload = await this.buildInvocation(calls, signerDetails);\n return {\n ...common,\n ...payload,\n type: TransactionType.INVOKE,\n } as AccountInvocationItem;\n }\n throw Error(`accountInvocationsFactory: unsupported transaction type: ${transaction}`);\n })\n ) as Promise;\n }\n\n public override async getStarkName(\n address: BigNumberish = this.address, // default to the wallet address\n StarknetIdContract?: string\n ): Promise {\n return super.getStarkName(address, StarknetIdContract);\n }\n}\n","import { StarknetChainId } from '../constants';\nimport type {\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractPayload,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Nonce,\n SimulateTransactionResponse,\n StateUpdateResponse,\n Storage,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\n\nexport abstract class ProviderInterface {\n /**\n * Gets the Starknet chain Id\n *\n * @returns the chain Id\n */\n public abstract getChainId(): Promise;\n\n /**\n * Calls a function on the Starknet contract.\n *\n * @param call transaction to be called\n * @param blockIdentifier block identifier\n * @returns the result of the function on the smart contract.\n */\n public abstract callContract(\n call: Call,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the block information\n *\n * @param blockIdentifier block identifier\n * @returns the block object\n */\n public abstract getBlock(blockIdentifier: BlockIdentifier): Promise;\n\n /**\n * @deprecated The method should not be used\n */\n public abstract getCode(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the contract class of the deployed contract.\n *\n * @param contractAddress - contract address\n * @param blockIdentifier - block identifier\n * @returns Contract class of compiled contract\n */\n public abstract getClassAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Returns the class hash deployed under the given address.\n *\n * @param contractAddress - contract address\n * @param blockIdentifier - block identifier\n * @returns Class hash\n */\n public abstract getClassHashAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Returns the contract class deployed under the given class hash.\n *\n * @param classHash - class hash\n * @returns Contract class of compiled contract\n */\n public abstract getClassByHash(classHash: string): Promise;\n\n /**\n * Gets the nonce of a contract with respect to a specific block\n *\n * @param contractAddress - contract address\n * @returns the hex nonce\n */\n public abstract getNonceForAddress(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the contract's storage variable at a specific key.\n *\n * @param contractAddress\n * @param key - from getStorageVarAddress('') (WIP)\n * @param blockIdentifier - block identifier\n * @returns the value of the storage variable\n */\n public abstract getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the transaction information from a tx id.\n *\n * @param txHash\n * @returns the transaction object \\{ transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? \\}\n */\n public abstract getTransaction(transactionHash: BigNumberish): Promise;\n\n /**\n * Gets the transaction receipt from a tx hash.\n *\n * @param txHash\n * @returns the transaction receipt object\n */\n public abstract getTransactionReceipt(\n transactionHash: BigNumberish\n ): Promise;\n\n /**\n * Deploys a given compiled Account contract (json) to starknet\n *\n * @param payload payload to be deployed containing:\n * - compiled contract code\n * - constructor calldata\n * - address salt\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract deployAccountContract(\n payload: DeployAccountContractPayload,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Invokes a function on starknet\n * @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * - maxFee - optional maxFee\n * @returns response from addTransaction\n */\n public abstract invokeFunction(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Declares a given compiled contract (json) to starknet\n * @param transaction transaction payload to be deployed containing:\n * - compiled contract code\n * - sender address\n * - signature\n * @param details Invocation Details containing:\n * - nonce\n * - optional version\n * - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract declareContract(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Estimates the fee for a given INVOKE transaction\n * @deprecated Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getEstimateFee(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given INVOKE transaction\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getInvokeEstimateFee(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given DECLARE transaction\n *\n * @param transaction transaction payload to be declared containing:\n * - compiled contract code\n * - sender address\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce\n * - version - optional version\n * - optional maxFee\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getDeclareEstimateFee(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given DEPLOY_ACCOUNT transaction\n *\n * @param transaction transaction payload to be deployed containing:\n * - classHash\n * - constructorCalldata\n * - addressSalt\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce\n * - version - optional version\n * - optional maxFee\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getDeployAccountEstimateFee(\n transaction: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a list of INVOKE transaction\n *\n * @param invocations AccountInvocations - Complete invocations array with account details\n * @param options getEstimateFeeBulkOptions\n * - (optional) blockIdentifier - BlockIdentifier\n * - (optional) skipValidate - boolean (default false)\n * @returns the estimated fee\n */\n public abstract getEstimateFeeBulk(\n invocations: AccountInvocations,\n options?: getEstimateFeeBulkOptions\n ): Promise;\n\n /**\n * Wait for the transaction to be accepted\n * @param txHash - transaction hash\n * @param options waitForTransactionOptions\n * - (optional) retryInterval: number | undefined;\n * - (optional) successStates: TransactionStatus[] | undefined;\n * @return GetTransactionReceiptResponse\n */\n public abstract waitForTransaction(\n txHash: BigNumberish,\n options?: waitForTransactionOptions\n ): Promise;\n\n /**\n * Simulates the transaction and returns the transaction trace and estimated fee.\n *\n * @param invocations AccountInvocations - Complete invocations array with account details\n * @param options - getSimulateTransactionOptions\n * - (optional) blockIdentifier - block identifier\n * - (optional) skipValidate - skip cairo __validate__ method\n * - (optional) skipExecute - skip cairo __execute__ method\n * @returns an array of transaction trace and estimated fee\n */\n public abstract getSimulateTransaction(\n invocations: AccountInvocations,\n options?: getSimulateTransactionOptions\n ): Promise;\n\n /**\n * Gets the state changes in a specific block\n *\n * @param blockIdentifier - block identifier\n * @returns StateUpdateResponse\n */\n public abstract getStateUpdate(blockIdentifier?: BlockIdentifier): Promise;\n}\n","import { Provider } from './default';\n\nexport * from './default';\nexport * from './errors';\nexport * from './sequencer';\nexport * from './interface';\nexport * from './rpc';\n\nexport const defaultProvider = new Provider();\n","import { ProviderInterface } from '../provider';\nimport { SignerInterface } from '../signer';\nimport {\n Abi,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n CairoVersion,\n Call,\n DeclareAndDeployContractPayload,\n DeclareContractPayload,\n DeclareContractResponse,\n DeclareDeployUDCResponse,\n DeployAccountContractPayload,\n DeployContractResponse,\n DeployContractUDCResponse,\n EstimateFeeAction,\n EstimateFeeDetails,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n Invocations,\n InvocationsDetails,\n InvokeFunctionResponse,\n MultiDeployContractResponse,\n Nonce,\n Signature,\n SimulateTransactionDetails,\n SimulateTransactionResponse,\n TypedData,\n UniversalDeployerContractPayload,\n} from '../types';\n\nexport abstract class AccountInterface extends ProviderInterface {\n public abstract address: string;\n\n public abstract signer: SignerInterface;\n\n public abstract cairoVersion: CairoVersion;\n\n /**\n * Estimate Fee for executing an INVOKE transaction on starknet\n *\n * @param calls the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n *\n * @returns response from estimate_fee\n */\n public abstract estimateInvokeFee(\n calls: AllowArray,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a DECLARE transaction on starknet\n *\n * @param contractPayload the payload object containing:\n * - contract - the compiled contract to be declared\n * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.\n *\n * @returns response from estimate_fee\n */\n public abstract estimateDeclareFee(\n contractPayload: DeclareContractPayload,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet\n *\n * @param contractPayload -\n * - contract - the compiled contract to be deployed\n * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.\n * @param estimateFeeDetails -\n * - optional blockIdentifier\n * - constant nonce = 0\n * @returns response from estimate_fee\n */\n public abstract estimateAccountDeployFee(\n contractPayload: DeployAccountContractPayload,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a UDC DEPLOY transaction on starknet\n * This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC)\n \n * @param deployContractPayload containing\n * - classHash: computed class hash of compiled contract\n * - salt: address salt\n * - unique: bool if true ensure unique salt\n * - calldata: constructor calldata\n * \n * @param transactionsDetail Invocation Details containing:\n * - optional nonce\n * - optional version\n * - optional maxFee\n */\n public abstract estimateDeployFee(\n deployContractPayload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a list of transactions on starknet\n * Contract must be deployed for fee estimation to be possible\n *\n * @param transactions array of transaction object containing :\n * - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT'\n * - payload - the payload of the transaction\n *\n * @returns response from estimate_fee\n */\n public abstract estimateFeeBulk(\n invocations: Invocations,\n details?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Invoke execute function in account contract\n *\n * @param transactions the invocation object or an array of them, containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param abi (optional) the abi of the contract for better displaying\n *\n * @returns response from addTransaction\n */\n public abstract execute(\n transactions: AllowArray,\n abis?: Abi[],\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Declares a given compiled contract (json) to starknet\n * \n * @param contractPayload transaction payload to be deployed containing:\n - contract: compiled contract code\n - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution.\n - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string;\n - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution.\n * @param transactionsDetail Invocation Details containing:\n - optional nonce\n - optional version\n - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract declare(\n contractPayload: DeclareContractPayload,\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Deploys a declared contract to starknet - using Universal Deployer Contract (UDC)\n * support multicall\n *\n * @param payload -\n * - classHash: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details -\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - contract_address[]\n * - transaction_hash\n */\n public abstract deploy(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Simplify deploy simulating old DeployContract with same response + UDC specific response\n * Internal wait for L2 transaction, support multicall\n *\n * @param payload -\n * - classHash: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details -\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - contract_address\n * - transaction_hash\n * - address\n * - deployer\n * - unique\n * - classHash\n * - calldata_len\n * - calldata\n * - salt\n */\n public abstract deployContract(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Declares and Deploy a given compiled contract (json) to starknet using UDC\n * Internal wait for L2 transaction, do not support multicall\n * Method will pass even if contract is already declared (internal using DeclareIfNot)\n *\n * @param payload\n * - contract: compiled contract code\n * - [casm=cairo1]: CairoAssembly | undefined;\n * - [compiledClassHash]: string | undefined;\n * - [classHash]: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - declare\n * - transaction_hash\n * - deploy\n * - contract_address\n * - transaction_hash\n * - address\n * - deployer\n * - unique\n * - classHash\n * - calldata_len\n * - calldata\n * - salt\n */\n public abstract declareAndDeploy(\n payload: DeclareAndDeployContractPayload,\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Deploy the account on Starknet\n * \n * @param contractPayload transaction payload to be deployed containing:\n - classHash: computed class hash of compiled contract\n - optional constructor calldata\n - optional address salt \n - optional contractAddress\n * @param transactionsDetail Invocation Details containing:\n - constant nonce = 0\n - optional version\n - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract deployAccount(\n contractPayload: DeployAccountContractPayload,\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Sign an JSON object for off-chain usage with the starknet private key and return the signature\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param json - JSON object to be signed\n * @returns the signature of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract signMessage(typedData: TypedData): Promise;\n\n /**\n * Hash a JSON object with pederson hash and return the hash\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param json - JSON object to be hashed\n * @returns the hash of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract hashMessage(typedData: TypedData): Promise;\n\n /**\n * Verify a signature of a JSON object\n *\n * @param typedData - JSON object to be verified\n * @param signature - signature of the JSON object\n * @returns true if the signature is valid, false otherwise\n * @throws {Error} if the JSON object is not a valid JSON or the signature is not a valid signature\n */\n public abstract verifyMessage(typedData: TypedData, signature: Signature): Promise;\n\n /**\n * Verify a signature of a given hash\n * @warning This method is not recommended, use verifyMessage instead\n *\n * @param hash - hash to be verified\n * @param signature - signature of the hash\n * @returns true if the signature is valid, false otherwise\n * @throws {Error} if the signature is not a valid signature\n */\n public abstract verifyMessageHash(hash: BigNumberish, signature: Signature): Promise;\n\n /**\n * Gets the nonce of the account with respect to a specific block\n *\n * @param {BlockIdentifier} blockIdentifier - optional blockIdentifier. Defaults to 'pending'\n * @returns nonce of the account\n */\n public abstract getNonce(blockIdentifier?: BlockIdentifier): Promise;\n\n /**\n * Gets Suggested Max Fee based on the transaction type\n *\n * @param {EstimateFeeAction} estimateFeeAction\n * @param {EstimateFeeDetails} details\n * @returns suggestedMaxFee\n */\n public abstract getSuggestedMaxFee(\n estimateFeeAction: EstimateFeeAction,\n details: EstimateFeeDetails\n ): Promise;\n\n /**\n * Simulates an array of transaction and returns an array of transaction trace and estimated fee.\n *\n * @param invocations Invocations containing:\n * - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION\n * @param details SimulateTransactionDetails\n *\n * @returns response from simulate_transaction\n */\n public abstract simulateTransaction(\n invocations: Invocations,\n details?: SimulateTransactionDetails\n ): Promise;\n}\n","import { AccountInterface } from '../account';\nimport { ProviderInterface, defaultProvider } from '../provider';\nimport {\n Abi,\n ArgsOrCalldata,\n ArgsOrCalldataWithOptions,\n AsyncContractFunction,\n Call,\n CallOptions,\n Calldata,\n ContractFunction,\n ContractOptions,\n EstimateFeeResponse,\n FunctionAbi,\n InvokeFunctionResponse,\n InvokeOptions,\n RawArgs,\n Result,\n StructAbi,\n ValidateType,\n} from '../types';\nimport assert from '../utils/assert';\nimport { CallData, cairo } from '../utils/calldata';\nimport { createAbiParser } from '../utils/calldata/parser';\nimport { ContractInterface } from './interface';\n\nexport const splitArgsAndOptions = (args: ArgsOrCalldataWithOptions) => {\n const options = [\n 'blockIdentifier',\n 'parseRequest',\n 'parseResponse',\n 'formatResponse',\n 'maxFee',\n 'nonce',\n 'signature',\n 'addressSalt',\n ];\n const lastArg = args[args.length - 1];\n if (typeof lastArg === 'object' && options.some((x) => x in lastArg)) {\n return { args: args as ArgsOrCalldata, options: args.pop() as ContractOptions };\n }\n return { args: args as ArgsOrCalldata };\n};\n\n/**\n * Adds call methods to the contract\n */\nfunction buildCall(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n return async function (...args: ArgsOrCalldataWithOptions): Promise {\n const params = splitArgsAndOptions(args);\n return contract.call(functionAbi.name, params.args, {\n parseRequest: true,\n parseResponse: true,\n ...params.options,\n });\n };\n}\n\n/**\n * Adds invoke methods to the contract\n */\nfunction buildInvoke(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n return async function (...args: Array): Promise {\n const params = splitArgsAndOptions(args);\n return contract.invoke(functionAbi.name, params.args, {\n parseRequest: true,\n ...params.options,\n });\n };\n}\n\n/**\n * Adds call/invoke methods to the contract\n */\nfunction buildDefault(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n if (functionAbi.stateMutability === 'view' || functionAbi.state_mutability === 'view') {\n return buildCall(contract, functionAbi);\n }\n return buildInvoke(contract, functionAbi);\n}\n\n/**\n * Adds populate for methods to the contract\n */\nfunction buildPopulate(contract: Contract, functionAbi: FunctionAbi): ContractFunction {\n return function (...args: Array): any {\n return contract.populate(functionAbi.name, args);\n };\n}\n\n/**\n * Adds estimateFee for methods to the contract\n */\nfunction buildEstimate(contract: Contract, functionAbi: FunctionAbi): ContractFunction {\n return function (...args: Array): any {\n return contract.estimate(functionAbi.name, args);\n };\n}\n\nexport function getCalldata(args: RawArgs, callback: Function): Calldata {\n // Check if Calldata in args or args[0] else compile\n if (Array.isArray(args) && '__compiled__' in args) return args as Calldata;\n if (Array.isArray(args) && Array.isArray(args[0]) && '__compiled__' in args[0])\n return args[0] as Calldata;\n return callback();\n}\n\n/**\n * Not used at the moment\n */\n/* const detectCairoVersion = (abi: Abi) => {\n if (!abi) return '0';\n return abi.find((it) => 'state_mutability' in it) ? '1' : '0';\n}; */\n\nexport class Contract implements ContractInterface {\n abi: Abi;\n\n address: string;\n\n providerOrAccount: ProviderInterface | AccountInterface;\n\n deployTransactionHash?: string;\n\n protected readonly structs: { [name: string]: StructAbi };\n\n readonly functions!: { [name: string]: AsyncContractFunction };\n\n readonly callStatic!: { [name: string]: AsyncContractFunction };\n\n readonly populateTransaction!: { [name: string]: ContractFunction };\n\n readonly estimateFee!: { [name: string]: ContractFunction };\n\n readonly [key: string]: AsyncContractFunction | any;\n\n private callData: CallData;\n\n /**\n * Contract class to handle contract methods\n *\n * @param abi - Abi of the contract object\n * @param address (optional) - address to connect to\n * @param providerOrAccount (optional) - Provider or Account to attach to\n */\n constructor(\n abi: Abi,\n address: string,\n providerOrAccount: ProviderInterface | AccountInterface = defaultProvider\n ) {\n this.address = address && address.toLowerCase();\n this.providerOrAccount = providerOrAccount;\n this.callData = new CallData(abi);\n this.structs = CallData.getAbiStruct(abi);\n const parser = createAbiParser(abi);\n this.abi = parser.getLegacyFormat();\n\n const options = { enumerable: true, value: {}, writable: false };\n Object.defineProperties(this, {\n functions: { enumerable: true, value: {}, writable: false },\n callStatic: { enumerable: true, value: {}, writable: false },\n populateTransaction: { enumerable: true, value: {}, writable: false },\n estimateFee: { enumerable: true, value: {}, writable: false },\n });\n this.abi.forEach((abiElement) => {\n if (abiElement.type !== 'function') return;\n const signature = abiElement.name;\n if (!this[signature]) {\n Object.defineProperty(this, signature, {\n ...options,\n value: buildDefault(this, abiElement),\n });\n }\n if (!this.functions[signature]) {\n Object.defineProperty(this.functions, signature, {\n ...options,\n value: buildDefault(this, abiElement),\n });\n }\n if (!this.callStatic[signature]) {\n Object.defineProperty(this.callStatic, signature, {\n ...options,\n value: buildCall(this, abiElement),\n });\n }\n if (!this.populateTransaction[signature]) {\n Object.defineProperty(this.populateTransaction, signature, {\n ...options,\n value: buildPopulate(this, abiElement),\n });\n }\n if (!this.estimateFee[signature]) {\n Object.defineProperty(this.estimateFee, signature, {\n ...options,\n value: buildEstimate(this, abiElement),\n });\n }\n });\n }\n\n public attach(address: string): void {\n this.address = address;\n }\n\n public connect(providerOrAccount: ProviderInterface | AccountInterface) {\n this.providerOrAccount = providerOrAccount;\n }\n\n public async deployed(): Promise {\n if (this.deployTransactionHash) {\n await this.providerOrAccount.waitForTransaction(this.deployTransactionHash);\n this.deployTransactionHash = undefined;\n }\n return this;\n }\n\n public async call(\n method: string,\n args: ArgsOrCalldata = [],\n {\n parseRequest = true,\n parseResponse = true,\n formatResponse = undefined,\n blockIdentifier = undefined,\n }: CallOptions = {}\n ): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n const calldata = getCalldata(args, () => {\n if (parseRequest) {\n this.callData.validate(ValidateType.CALL, method, args);\n return this.callData.compile(method, args);\n }\n // eslint-disable-next-line no-console\n console.warn('Call skipped parsing but provided rawArgs, possible malfunction request');\n return args;\n });\n\n return this.providerOrAccount\n .callContract(\n {\n contractAddress: this.address,\n calldata,\n entrypoint: method,\n },\n blockIdentifier\n )\n .then((x) => {\n if (!parseResponse) {\n return x.result;\n }\n if (formatResponse) {\n return this.callData.format(method, x.result, formatResponse);\n }\n return this.callData.parse(method, x.result);\n });\n }\n\n public invoke(\n method: string,\n args: ArgsOrCalldata = [],\n { parseRequest = true, maxFee, nonce, signature }: InvokeOptions = {}\n ): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n const calldata = getCalldata(args, () => {\n if (parseRequest) {\n this.callData.validate(ValidateType.INVOKE, method, args);\n return this.callData.compile(method, args);\n }\n // eslint-disable-next-line no-console\n console.warn('Invoke skipped parsing but provided rawArgs, possible malfunction request');\n return args;\n });\n\n const invocation = {\n contractAddress: this.address,\n calldata,\n entrypoint: method,\n };\n if ('execute' in this.providerOrAccount) {\n return this.providerOrAccount.execute(invocation, undefined, {\n maxFee,\n nonce,\n });\n }\n\n if (!nonce) throw new Error(`Nonce is required when invoking a function without an account`);\n // eslint-disable-next-line no-console\n console.warn(`Invoking ${method} without an account. This will not work on a public node.`);\n\n return this.providerOrAccount.invokeFunction(\n {\n ...invocation,\n signature,\n },\n {\n nonce,\n }\n );\n }\n\n public async estimate(method: string, args: ArgsOrCalldata = []): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n if (!getCalldata(args, () => false)) {\n this.callData.validate(ValidateType.INVOKE, method, args);\n }\n\n const invocation = this.populate(method, args);\n if ('estimateInvokeFee' in this.providerOrAccount) {\n return this.providerOrAccount.estimateInvokeFee(invocation);\n }\n throw Error('Contract must be connected to the account contract to estimate');\n }\n\n public populate(method: string, args: RawArgs = []): Call {\n const calldata: Calldata = getCalldata(args, () => this.callData.compile(method, args));\n return {\n contractAddress: this.address,\n entrypoint: method,\n calldata,\n };\n }\n\n public isCairo1(): boolean {\n return cairo.isCairo1Abi(this.abi);\n }\n}\n","import { AccountInterface } from '../account';\nimport { ProviderInterface } from '../provider';\nimport {\n Abi,\n ArgsOrCalldata,\n AsyncContractFunction,\n BlockIdentifier,\n CallOptions,\n ContractFunction,\n EstimateFeeResponse,\n Invocation,\n InvokeFunctionResponse,\n InvokeOptions,\n Result,\n} from '../types';\n\nexport abstract class ContractInterface {\n public abstract abi: Abi;\n\n public abstract address: string;\n\n public abstract providerOrAccount: ProviderInterface | AccountInterface;\n\n public abstract deployTransactionHash?: string;\n\n readonly functions!: { [name: string]: AsyncContractFunction };\n\n readonly callStatic!: { [name: string]: AsyncContractFunction };\n\n readonly populateTransaction!: { [name: string]: ContractFunction };\n\n readonly estimateFee!: { [name: string]: ContractFunction };\n\n readonly [key: string]: AsyncContractFunction | any;\n\n /**\n * Saves the address of the contract deployed on network that will be used for interaction\n *\n * @param address - address of the contract\n */\n public abstract attach(address: string): void;\n\n /**\n * Attaches to new Provider or Account\n *\n * @param providerOrAccount - new Provider or Account to attach to\n */\n public abstract connect(providerOrAccount: ProviderInterface | AccountInterface): void;\n\n /**\n * Resolves when contract is deployed on the network or when no deployment transaction is found\n *\n * @returns Promise that resolves when contract is deployed on the network or when no deployment transaction is found\n * @throws When deployment fails\n */\n public abstract deployed(): Promise;\n\n /**\n * Calls a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call\n * @param options optional blockIdentifier\n * @returns Result of the call as an array with key value pars\n */\n public abstract call(\n method: string,\n args?: ArgsOrCalldata,\n options?: CallOptions\n ): Promise;\n\n /**\n * Invokes a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the invoke or Calldata\n * @param options\n * @returns Add Transaction Response\n */\n public abstract invoke(\n method: string,\n args?: ArgsOrCalldata,\n options?: InvokeOptions\n ): Promise;\n\n /**\n * Estimates a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call or Calldata\n * @param options optional blockIdentifier\n */\n public abstract estimate(\n method: string,\n args?: ArgsOrCalldata,\n options?: {\n blockIdentifier?: BlockIdentifier;\n }\n ): Promise;\n\n /**\n * Calls a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call or Calldata\n * @returns Invocation object\n */\n public abstract populate(method: string, args?: ArgsOrCalldata): Invocation;\n\n /**\n * tells if the contract comes from a Cairo 1 contract\n *\n * @returns TRUE if the contract comes from a Cairo1 contract\n * @example\n * ```typescript\n * const isCairo1: boolean = myContract.isCairo1();\n * ```\n */\n public abstract isCairo1(): boolean;\n}\n","import { AccountInterface } from '../account';\nimport {\n Abi,\n ArgsOrCalldataWithOptions,\n CairoAssembly,\n CompiledContract,\n ValidateType,\n} from '../types';\nimport assert from '../utils/assert';\nimport { CallData } from '../utils/calldata';\nimport { Contract, getCalldata, splitArgsAndOptions } from './default';\n\nexport type ContractFactoryParams = {\n compiledContract: CompiledContract;\n account: any;\n casm?: CairoAssembly;\n classHash?: string;\n compiledClassHash?: string;\n abi?: Abi;\n};\n\nexport class ContractFactory {\n compiledContract: CompiledContract;\n\n account: AccountInterface;\n\n abi: Abi;\n\n classHash?: string;\n\n casm?: CairoAssembly;\n\n compiledClassHash?: string;\n\n private CallData: CallData;\n\n /**\n * @param params CFParams\n * - compiledContract: CompiledContract;\n * - account: AccountInterface;\n * - casm?: CairoAssembly;\n * - classHash?: string;\n * - compiledClassHash?: string;\n * - abi?: Abi;\n */\n constructor(params: ContractFactoryParams) {\n this.compiledContract = params.compiledContract;\n this.account = params.account;\n this.casm = params.casm;\n this.abi = params.abi ?? params.compiledContract.abi;\n this.classHash = params.classHash;\n this.compiledClassHash = params.compiledClassHash;\n this.CallData = new CallData(this.abi);\n }\n\n /**\n * Deploys contract and returns new instance of the Contract\n * If contract is not declared it will first declare it, and then deploy\n *\n * @param args - Array of the constructor arguments for deployment\n * @param options (optional) Object - parseRequest, parseResponse, addressSalt\n * @returns deployed Contract\n */\n public async deploy(...args: ArgsOrCalldataWithOptions): Promise {\n const { args: param, options = { parseRequest: true } } = splitArgsAndOptions(args);\n\n const constructorCalldata = getCalldata(param, () => {\n if (options.parseRequest) {\n this.CallData.validate(ValidateType.DEPLOY, 'constructor', param);\n return this.CallData.compile('constructor', param);\n }\n // eslint-disable-next-line no-console\n console.warn('Call skipped parsing but provided rawArgs, possible malfunction request');\n return param;\n });\n\n const {\n deploy: { contract_address, transaction_hash },\n } = await this.account.declareAndDeploy({\n contract: this.compiledContract,\n casm: this.casm,\n classHash: this.classHash,\n compiledClassHash: this.compiledClassHash,\n constructorCalldata,\n salt: options.addressSalt,\n });\n assert(Boolean(contract_address), 'Deployment of the contract failed');\n\n const contractInstance = new Contract(\n this.compiledContract.abi,\n contract_address!,\n this.account\n );\n contractInstance.deployTransactionHash = transaction_hash;\n\n return contractInstance;\n }\n\n /**\n * Attaches to new Account\n *\n * @param account - new Provider or Account to attach to\n * @returns ContractFactory\n */\n connect(account: AccountInterface): ContractFactory {\n this.account = account;\n return this;\n }\n\n /**\n * Attaches current abi and account to the new address\n *\n * @param address - Contract address\n * @returns Contract\n */\n attach(address: string): Contract {\n return new Contract(this.abi, address, this.account);\n }\n\n // ethers.js' getDeployTransaction cant be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation\n}\n","/* eslint-disable no-bitwise */\nimport { hexToBytes } from '@noble/curves/abstract/utils';\n\nimport { MASK_251, ZERO } from '../constants';\nimport { BigNumberish } from '../types';\nimport { addHexPrefix, removeHexPrefix } from './encode';\nimport { keccakBn } from './hash';\nimport { assertInRange, toHex } from './num';\n\nexport function addAddressPadding(address: BigNumberish): string {\n return addHexPrefix(removeHexPrefix(toHex(address)).padStart(64, '0'));\n}\n\nexport function validateAndParseAddress(address: BigNumberish): string {\n assertInRange(address, ZERO, MASK_251, 'Starknet Address');\n\n const result = addAddressPadding(address);\n\n if (!result.match(/^(0x)?[0-9a-fA-F]{64}$/)) {\n throw new Error('Invalid Address Format');\n }\n\n return result;\n}\n\n// from https://github.com/ethers-io/ethers.js/blob/fc1e006575d59792fa97b4efb9ea2f8cca1944cf/packages/address/src.ts/index.ts#L12\nexport function getChecksumAddress(address: BigNumberish): string {\n const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split('');\n const hex = removeHexPrefix(keccakBn(address));\n const hashed = hexToBytes(hex.padStart(64, '0'));\n\n for (let i = 0; i < chars.length; i += 2) {\n if (hashed[i >> 1] >> 4 >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n\n return addHexPrefix(chars.join(''));\n}\n\nexport function validateChecksumAddress(address: string): boolean {\n return getChecksumAddress(address) === address;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBA,WAAS,WAAW,KAAK;AACvB,WAAO,OAAO,SAAS,UAAU,cAAc,GAAG;AAAA,EACpD;AAsBA,WAAS,cAAc,MAAM;AAC3B,QAAI,OAAO,SAAS,UAAU;AAC5B,aAAO,OAAO,IAAI;AAAA,IACpB;AACA,QAAI,6BAA6B,KAAK,IAAI,KAAK,SAAS,IAAI;AAC1D,YAAM,IAAI,UAAU,8CAA8C,OAAO,GAAG;AAAA,IAC9E;AACA,WAAO,KAAK,YAAY;AAAA,EAC1B;AAEA,WAAS,eAAe,OAAO;AAC7B,QAAI,OAAO,UAAU,UAAU;AAC7B,cAAQ,OAAO,KAAK;AAAA,IACtB;AACA,WAAO;AAAA,EACT;AAGA,WAAS,YAAY,OAAO;AAC1B,QAAI,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AA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA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KAAK,CAAC,KAAK,KAAK,GAAG;AAC5B,cAAM,CAAC,IAAI,MAAM,CAAC,EAAE,YAAY;AAAA,MAClC;AACA,WAAK,OAAO,KAAK,CAAC,IAAI,OAAS,GAAG;AAChC,cAAM,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,YAAY;AAAA,MAC1C;AAAA,IACF;AAEA,WAAO,aAAa,MAAM,KAAK,EAAE,CAAC;AAAA,EACpC;AAEO,WAAS,wBAAwB,SAA0B;AAChE,WAAO,mBAAmB,OAAO,MAAM;AAAA,EACzC;;;A/EFO,MAAMC,UAAS;","names":["bytes","split","global","err","number","BaseUrl","NetworkName","StarknetChainId","TransactionHashPrefix","SIMULATION_FLAG","ValidateType","Uint","EntryPointType","TransactionType","TransactionStatus","BlockStatus","BlockTag","TransactionType","hexToBytes","bytes","gen","number","hexToBytes","hash","assert","hexes","utf8ToBytes","concatBytes","_0n","_1n","_2n","bytes","isLE","_32n","_0n","_1n","_2n","number","_0n","_1n","_2n","_0n","_1n","nBitLength","bitLen","isLE","_0n","_1n","bytes","hash","isLE","_1n","i","poseidonHash","_0n","_1n","window","curve","curve","s","_0n","_1n","_2n","_3n","_4n","CURVE","toBytes","bytes","a","validateOpts","CURVE_ORDER","number","Signature","utils","getPublicKey","getSharedSecret","bits2int","hash","randomBytes","sign","verify","r","tv5","c1","c2","hash","hash","concatBytes","bytes","ensureBytes","bytes","ensureBytes","constants","MASK_250","utf8ToBytes","hexToBytes","hash","uint256","parseBaseTypes","output","output","computeHashOnElements","parse","stringify","isInteger","value","INTEGER_REGEX","test","isNumber","NUMBER_REGEX","isSafeNumber","config","num","parseFloat","str","String","v","extractSignificantDigits","s","approx","requiredDigits","length","startsWith","substring","UnsafeNumberReason","getUnsafeNumberReason","undefined","truncate_integer","isFinite","overflow","underflow","truncate_float","extractSignificantDigits","value","replace","EXPONENTIAL_PART_REGEX","DOT_REGEX","TRAILING_ZEROS_REGEX","LEADING_MINUS_AND_ZEROS_REGEX","LosslessNumber","value","_classCallCheck","_defineProperty","isNumber","Error","_createClass","key","valueOf","unsafeReason","getUnsafeNumberReason","undefined","UnsafeNumberReason","truncate_float","parseFloat","isInteger","BigInt","concat","toString","isLosslessNumber","_typeof","parseLosslessNumber","value","LosslessNumber","parseNumberAndBigInt","isInteger","BigInt","parseFloat","revive","json","reviver","reviveValue","context","key","value","Array","isArray","call","reviveArray","_typeof","isLosslessNumber","reviveObject","object","Object","keys","forEach","undefined","array","i","length","parse","text","reviver","parseNumber","arguments","length","undefined","parseLosslessNumber","i","value","parseValue","expectValue","expectEndOfInput","revive","parseObject","charCodeAt","codeOpeningBrace","skipWhitespace","object","initial","codeClosingBrace","eatComma","start","key","parseString","throwObjectKeyExpected","eatColon","throwObjectValueExpected","Object","prototype","hasOwnProperty","call","isDeepEqual","throwDuplicateKey","throwObjectKeyOrEndExpected","parseArray","codeOpeningBracket","array","codeClosingBracket","expectArrayItem","push","throwArrayItemOrEndExpected","_ref","_ref2","_ref3","_ref4","_ref5","_parseString","parseNumeric","parseKeyword","name","slice","isWhitespace","codeDoubleQuote","result","codeBackslash","char","escapeChar","escapeCharacters","isHex","String","fromCharCode","parseInt","throwInvalidUnicodeCharacter","throwInvalidEscapeCharacter","isValidStringCharacter","throwInvalidCharacter","expectEndOfString","codeMinus","expectDigit","codeZero","isNonZeroDigit","isDigit","codeDot","codeLowercaseE","codeUppercaseE","codePlus","codeComma","SyntaxError","concat","gotAt","codeColon","numSoFar","pos","chars","end","test","got","code","codeSpace","codeNewline","codeTab","codeReturn","codeNine","codeUppercaseA","codeUppercaseF","codeLowercaseA","codeLowercaseF","codeOne","a","b","Array","isArray","every","item","index","isObject","keys","_toConsumableArray","Set","_typeof","f","n","r","t","stringify","value","replacer","space","numberStringifiers","resolvedSpace","resolveSpace","replacedValue","call","stringifyValue","indent","Array","isArray","stringifier","find","item","test","str","isNumber","Error","concat","Date","Boolean","Number","String","JSON","isLosslessNumber","toString","stringifyArray","_typeof","stringifyObject","undefined","array","length","childIndent","i","object","toJSON","keys","map","Object","first","forEach","key","includeProperty","keyStr","repeat","parse","stringify","computeHashOnElements","stringify","parse","rank","output","stringify","parse","parse","isomorphicFetch","stringify","parse","StarknetIdContract","StarknetIdContract","stringify","StarknetIdContract","import_url_join","urljoin","defaultOptions","urljoin","stringify","parse","StarknetIdContract","StarknetIdContract","computeHashOnElements","hash","common","StarknetIdContract","number"]} \ No newline at end of file diff --git a/web/lib/starknet-estfee-tx-ver/dist/index.js b/web/lib/starknet-estfee-tx-ver/dist/index.js new file mode 100644 index 000000000..85fdfde5d --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/dist/index.js @@ -0,0 +1,6625 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Account: () => Account, + AccountInterface: () => AccountInterface, + BlockStatus: () => BlockStatus, + BlockTag: () => BlockTag, + CallData: () => CallData, + Contract: () => Contract, + ContractFactory: () => ContractFactory, + ContractInterface: () => ContractInterface, + CustomError: () => CustomError, + EntryPointType: () => EntryPointType, + GatewayError: () => GatewayError, + HttpError: () => HttpError, + LibraryError: () => LibraryError, + Provider: () => Provider, + ProviderInterface: () => ProviderInterface, + RPC: () => rpc_exports, + RpcProvider: () => RpcProvider, + SIMULATION_FLAG: () => SIMULATION_FLAG, + Sequencer: () => sequencer_exports, + SequencerProvider: () => SequencerProvider, + Signer: () => Signer, + SignerInterface: () => SignerInterface, + TransactionStatus: () => TransactionStatus, + TransactionType: () => TransactionType, + Uint: () => Uint, + ValidateType: () => ValidateType, + addAddressPadding: () => addAddressPadding, + buildUrl: () => buildUrl, + cairo: () => cairo_exports, + constants: () => constants_exports, + contractClassResponseToLegacyCompiledContract: () => contractClassResponseToLegacyCompiledContract, + defaultProvider: () => defaultProvider, + ec: () => ec_exports, + encode: () => encode_exports, + extractContractHashes: () => extractContractHashes, + fixProto: () => fixProto, + fixStack: () => fixStack, + getCalldata: () => getCalldata, + getChecksumAddress: () => getChecksumAddress, + hash: () => hash_exports, + isSierra: () => isSierra, + isUrl: () => isUrl, + json: () => json_exports, + merkle: () => merkle_exports, + num: () => num_exports, + number: () => number, + parseUDCEvent: () => parseUDCEvent, + provider: () => provider_exports, + selector: () => selector_exports, + shortString: () => shortString_exports, + splitArgsAndOptions: () => splitArgsAndOptions, + stark: () => stark_exports, + starknetId: () => starknetId_exports, + transaction: () => transaction_exports, + typedData: () => typedData_exports, + types: () => types_exports, + uint256: () => uint256_exports, + validateAndParseAddress: () => validateAndParseAddress, + validateChecksumAddress: () => validateChecksumAddress +}); +module.exports = __toCommonJS(src_exports); + +// src/constants.ts +var constants_exports = {}; +__export(constants_exports, { + ALPHA: () => ALPHA, + API_VERSION: () => API_VERSION, + BETA: () => BETA, + BaseUrl: () => BaseUrl, + CONSTANT_POINTS: () => CONSTANT_POINTS, + EC_ORDER: () => EC_ORDER, + FIELD_GEN: () => FIELD_GEN, + FIELD_PRIME: () => FIELD_PRIME, + FIELD_SIZE: () => FIELD_SIZE, + IS_BROWSER: () => IS_BROWSER, + MASK_250: () => MASK_250, + MASK_251: () => MASK_251, + MAX_ECDSA_VAL: () => MAX_ECDSA_VAL, + NetworkName: () => NetworkName, + StarknetChainId: () => StarknetChainId, + TransactionHashPrefix: () => TransactionHashPrefix, + UDC: () => UDC, + ZERO: () => ZERO +}); + +// src/utils/encode.ts +var encode_exports = {}; +__export(encode_exports, { + IS_BROWSER: () => IS_BROWSER, + addHexPrefix: () => addHexPrefix, + arrayBufferToString: () => arrayBufferToString, + atobUniversal: () => atobUniversal, + btoaUniversal: () => btoaUniversal, + buf2hex: () => buf2hex, + calcByteLength: () => calcByteLength, + padLeft: () => padLeft, + removeHexPrefix: () => removeHexPrefix, + sanitizeBytes: () => sanitizeBytes, + sanitizeHex: () => sanitizeHex, + stringToArrayBuffer: () => stringToArrayBuffer, + utf8ToArray: () => utf8ToArray +}); +var IS_BROWSER = typeof window !== "undefined"; +var STRING_ZERO = "0"; +function arrayBufferToString(array) { + return new Uint8Array(array).reduce((data, byte) => data + String.fromCharCode(byte), ""); +} +function stringToArrayBuffer(s) { + return Uint8Array.from(s, (c) => c.charCodeAt(0)); +} +function atobUniversal(a) { + return IS_BROWSER ? stringToArrayBuffer(atob(a)) : Buffer.from(a, "base64"); +} +function btoaUniversal(b) { + return IS_BROWSER ? btoa(arrayBufferToString(b)) : Buffer.from(b).toString("base64"); +} +function buf2hex(buffer) { + return [...buffer].map((x) => x.toString(16).padStart(2, "0")).join(""); +} +function removeHexPrefix(hex) { + return hex.replace(/^0x/i, ""); +} +function addHexPrefix(hex) { + return `0x${removeHexPrefix(hex)}`; +} +function padString(str, length, left, padding = STRING_ZERO) { + const diff = length - str.length; + let result = str; + if (diff > 0) { + const pad = padding.repeat(diff); + result = left ? pad + str : str + pad; + } + return result; +} +function padLeft(str, length, padding = STRING_ZERO) { + return padString(str, length, true, padding); +} +function calcByteLength(length, byteSize = 8) { + const remainder = length % byteSize; + return remainder ? (length - remainder) / byteSize * byteSize + byteSize : length; +} +function sanitizeBytes(str, byteSize = 8, padding = STRING_ZERO) { + return padLeft(str, calcByteLength(str.length, byteSize), padding); +} +function sanitizeHex(hex) { + hex = removeHexPrefix(hex); + hex = sanitizeBytes(hex, 2); + if (hex) { + hex = addHexPrefix(hex); + } + return hex; +} +function utf8ToArray(str) { + return new TextEncoder().encode(str); +} + +// src/constants.ts +var ZERO = 0n; +var MASK_250 = 2n ** 250n - 1n; +var MASK_251 = 2n ** 251n; +var API_VERSION = ZERO; +var BaseUrl = /* @__PURE__ */ ((BaseUrl2) => { + BaseUrl2["SN_MAIN"] = "https://alpha-mainnet.starknet.io"; + BaseUrl2["SN_GOERLI"] = "https://alpha4.starknet.io"; + BaseUrl2["SN_GOERLI2"] = "https://alpha4-2.starknet.io"; + return BaseUrl2; +})(BaseUrl || {}); +var NetworkName = /* @__PURE__ */ ((NetworkName2) => { + NetworkName2["SN_MAIN"] = "SN_MAIN"; + NetworkName2["SN_GOERLI"] = "SN_GOERLI"; + NetworkName2["SN_GOERLI2"] = "SN_GOERLI2"; + return NetworkName2; +})(NetworkName || {}); +var StarknetChainId = /* @__PURE__ */ ((StarknetChainId3) => { + StarknetChainId3["SN_MAIN"] = "0x534e5f4d41494e"; + StarknetChainId3["SN_GOERLI"] = "0x534e5f474f45524c49"; + StarknetChainId3["SN_GOERLI2"] = "0x534e5f474f45524c4932"; + return StarknetChainId3; +})(StarknetChainId || {}); +var TransactionHashPrefix = /* @__PURE__ */ ((TransactionHashPrefix2) => { + TransactionHashPrefix2["DECLARE"] = "0x6465636c617265"; + TransactionHashPrefix2["DEPLOY"] = "0x6465706c6f79"; + TransactionHashPrefix2["DEPLOY_ACCOUNT"] = "0x6465706c6f795f6163636f756e74"; + TransactionHashPrefix2["INVOKE"] = "0x696e766f6b65"; + TransactionHashPrefix2["L1_HANDLER"] = "0x6c315f68616e646c6572"; + return TransactionHashPrefix2; +})(TransactionHashPrefix || {}); +var UDC = { + ADDRESS: "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", + ENTRYPOINT: "deployContract" +}; +var FIELD_PRIME = "800000000000011000000000000000000000000000000000000000000000001"; +var FIELD_GEN = "3"; +var FIELD_SIZE = 251; +var EC_ORDER = "800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F"; +var ALPHA = "1"; +var BETA = "6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89"; +var MAX_ECDSA_VAL = "800000000000000000000000000000000000000000000000000000000000000"; +var CONSTANT_POINTS = [ + [ + "49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804", + "3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a" + ], + [ + "1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca", + "5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f" + ], + [ + "234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b", + "3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615" + ], + [ + "3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476", + "7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19" + ], + [ + "40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c", + "109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740" + ], + [ + "2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b", + "6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26" + ], + [ + "6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674", + "606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2" + ], + [ + "7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62", + "a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae" + ], + [ + "3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec", + "45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9" + ], + [ + "1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e", + "30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a" + ], + [ + "6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26", + "31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2" + ], + [ + "54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4", + "c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5" + ], + [ + "35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6", + "5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d" + ], + [ + "4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23", + "5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820" + ], + [ + "648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf", + "72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c" + ], + [ + "bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b", + "6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6" + ], + [ + "35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357", + "3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14" + ], + [ + "36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643", + "7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c" + ], + [ + "5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661", + "9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753" + ], + [ + "21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6", + "51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c" + ], + [ + "19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9", + "515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa" + ], + [ + "888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24", + "730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea" + ], + [ + "75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977", + "4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8" + ], + [ + "640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5", + "3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c" + ], + [ + "6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96", + "7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645" + ], + [ + "5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876", + "518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200" + ], + [ + "6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4", + "2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc" + ], + [ + "542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18", + "5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c" + ], + [ + "299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de", + "1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958" + ], + [ + "628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73", + "ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d" + ], + [ + "6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933", + "6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db" + ], + [ + "28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a", + "7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba" + ], + [ + "619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02", + "2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308" + ], + [ + "641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96", + "6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837" + ], + [ + "58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2", + "124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9" + ], + [ + "a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74", + "1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8" + ], + [ + "744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b", + "7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f" + ], + [ + "434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c", + "7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39" + ], + [ + "7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73", + "56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431" + ], + [ + "4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7", + "ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e" + ], + [ + "250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe", + "1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04" + ], + [ + "2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2", + "55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63" + ], + [ + "249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245", + "7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e" + ], + [ + "6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb", + "640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8" + ], + [ + "2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9", + "636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be" + ], + [ + "4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea", + "1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff" + ], + [ + "46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca", + "1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f" + ], + [ + "2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152", + "1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7" + ], + [ + "386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b", + "2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5" + ], + [ + "407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90", + "436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f" + ], + [ + "1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f", + "69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec" + ], + [ + "7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e", + "34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69" + ], + [ + "299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913", + "b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675" + ], + [ + "551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5", + "5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e" + ], + [ + "7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2", + "3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6" + ], + [ + "28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504", + "7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b" + ], + [ + "1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b", + "4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4" + ], + [ + "2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b", + "9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911" + ], + [ + "770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed", + "42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd" + ], + [ + "5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9", + "3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d" + ], + [ + "6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825", + "1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177" + ], + [ + "404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1", + "3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb" + ], + [ + "20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc", + "106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7" + ], + [ + "119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa", + "1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773" + ], + [ + "45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749", + "ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965" + ], + [ + "1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38", + "593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f" + ], + [ + "186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3", + "55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c" + ], + [ + "58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9", + "6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0" + ], + [ + "13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b", + "3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4" + ], + [ + "48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676", + "4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1" + ], + [ + "4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158", + "620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef" + ], + [ + "4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b", + "4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8" + ], + [ + "7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9", + "2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de" + ], + [ + "65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f", + "3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6" + ], + [ + "1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d", + "21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a" + ], + [ + "3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b", + "5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f" + ], + [ + "4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4", + "5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b" + ], + [ + "6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8", + "e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9" + ], + [ + "748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5", + "3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93" + ], + [ + "7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3", + "5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4" + ], + [ + "6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f", + "32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039" + ], + [ + "1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309", + "56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4" + ], + [ + "1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd", + "431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c" + ], + [ + "6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162", + "14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3" + ], + [ + "738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e", + "33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47" + ], + [ + "2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8", + "92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc" + ], + [ + "181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe", + "5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff" + ], + [ + "1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a", + "4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f" + ], + [ + "e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873", + "34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f" + ], + [ + "4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45", + "3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af" + ], + [ + "37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed", + "37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6" + ], + [ + "27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c", + "6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d" + ], + [ + "2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf", + "306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413" + ], + [ + "307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72", + "3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995" + ], + [ + "79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc", + "40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2" + ], + [ + "4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292", + "7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717" + ], + [ + "645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2", + "15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab" + ], + [ + "1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f", + "583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c" + ], + [ + "66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca", + "505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4" + ], + [ + "5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1", + "bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323" + ], + [ + "a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194", + "4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689" + ], + [ + "1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c", + "7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf" + ], + [ + "48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f", + "781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3" + ], + [ + "17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd", + "6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223" + ], + [ + "5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89", + "1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff" + ], + [ + "6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58", + "436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e" + ], + [ + "7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6", + "484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4" + ], + [ + "17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d", + "7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f" + ], + [ + "7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf", + "33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78" + ], + [ + "7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d", + "6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb" + ], + [ + "273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128", + "653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f" + ], + [ + "3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212", + "65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e" + ], + [ + "5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee", + "3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22" + ], + [ + "7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9", + "71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e" + ], + [ + "40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62", + "499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42" + ], + [ + "6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465", + "35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37" + ], + [ + "604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6", + "68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457" + ], + [ + "73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4", + "4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb" + ], + [ + "3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1", + "677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0" + ], + [ + "39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f", + "20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952" + ], + [ + "326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c", + "7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1" + ], + [ + "53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632", + "2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1" + ], + [ + "6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e", + "beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63" + ], + [ + "3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332", + "529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7" + ], + [ + "3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e", + "3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740" + ], + [ + "7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a", + "68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400" + ], + [ + "1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb", + "5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9" + ], + [ + "3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344", + "52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590" + ], + [ + "44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa", + "6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940" + ], + [ + "7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e", + "78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9" + ], + [ + "7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d", + "4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62" + ], + [ + "7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c", + "636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84" + ], + [ + "758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2", + "1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245" + ], + [ + "7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e", + "229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470" + ], + [ + "78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614", + "246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675" + ], + [ + "6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647", + "599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4" + ], + [ + "4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e", + "1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad" + ], + [ + "3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d", + "617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c" + ], + [ + "5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287", + "1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d" + ], + [ + "3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004", + "7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232" + ], + [ + "3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb", + "563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6" + ], + [ + "16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52", + "7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e" + ], + [ + "75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4", + "35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0" + ], + [ + "3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8", + "6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd" + ], + [ + "54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579", + "7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0" + ], + [ + "d1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0", + "2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45" + ], + [ + "2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d", + "70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b" + ], + [ + "752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3", + "3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef" + ], + [ + "63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e", + "37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e" + ], + [ + "d6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b", + "5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018" + ], + [ + "12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557", + "6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613" + ], + [ + "46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c", + "76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df" + ], + [ + "4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516", + "5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29" + ], + [ + "71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833", + "85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346" + ], + [ + "5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61", + "3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950" + ], + [ + "161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941", + "78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b" + ], + [ + "1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1", + "66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d" + ], + [ + "56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44", + "47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e" + ], + [ + "4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491", + "430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4" + ], + [ + "7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606", + "312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295" + ], + [ + "16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe", + "7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24" + ], + [ + "323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b", + "4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265" + ], + [ + "624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d", + "261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430" + ], + [ + "f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d", + "b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6" + ], + [ + "686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec", + "7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6" + ], + [ + "3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e", + "634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af" + ], + [ + "484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b", + "34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8" + ], + [ + "203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a", + "2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2" + ], + [ + "2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d", + "6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6" + ], + [ + "5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef", + "30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d" + ], + [ + "57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741", + "7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad" + ], + [ + "611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1", + "3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4" + ], + [ + "1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31", + "3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527" + ], + [ + "275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234", + "2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521" + ], + [ + "6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95", + "5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e" + ], + [ + "44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c", + "3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e" + ], + [ + "fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966", + "110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9" + ], + [ + "9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef", + "4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51" + ], + [ + "71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7", + "7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9" + ], + [ + "1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345", + "4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc" + ], + [ + "3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115", + "a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24" + ], + [ + "c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d", + "729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d" + ], + [ + "44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d", + "212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8" + ], + [ + "35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f", + "74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62" + ], + [ + "e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03", + "3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357" + ], + [ + "3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a", + "5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df" + ], + [ + "222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c", + "72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42" + ], + [ + "3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764", + "480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c" + ], + [ + "adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187", + "60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8" + ], + [ + "3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9", + "7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996" + ], + [ + "12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32", + "6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1" + ], + [ + "27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b", + "c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917" + ], + [ + "431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6", + "30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197" + ], + [ + "4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33", + "627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c" + ], + [ + "2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8", + "1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f" + ], + [ + "e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc", + "58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9" + ], + [ + "7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5", + "74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1" + ], + [ + "62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b", + "1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315" + ], + [ + "1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938", + "44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b" + ], + [ + "78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea", + "6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41" + ], + [ + "5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d", + "1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb" + ], + [ + "62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04", + "6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f" + ], + [ + "4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f", + "941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494" + ], + [ + "52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1", + "987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782" + ], + [ + "1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f", + "38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b" + ], + [ + "4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232", + "7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c" + ], + [ + "69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73", + "a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897" + ], + [ + "b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62", + "24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915" + ], + [ + "5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb", + "6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9" + ], + [ + "1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0", + "23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699" + ], + [ + "2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5", + "1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862" + ], + [ + "d26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3", + "34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a" + ], + [ + "91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563", + "e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a" + ], + [ + "1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7", + "7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd" + ], + [ + "4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f", + "47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e" + ], + [ + "3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069", + "47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc" + ], + [ + "758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657", + "3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83" + ], + [ + "19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8", + "5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709" + ], + [ + "28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855", + "14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2" + ], + [ + "3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f", + "69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d" + ], + [ + "77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b", + "7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df" + ], + [ + "97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6", + "2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223" + ], + [ + "a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647", + "37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2" + ], + [ + "e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc", + "1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a" + ], + [ + "2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de", + "6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591" + ], + [ + "744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f", + "685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d" + ], + [ + "40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd", + "2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e" + ], + [ + "5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc", + "2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2" + ], + [ + "5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985", + "49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183" + ], + [ + "2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649", + "61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d" + ], + [ + "ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381", + "190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60" + ], + [ + "233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c", + "7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef" + ], + [ + "42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce", + "12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65" + ], + [ + "30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44", + "5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a" + ], + [ + "4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a", + "4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93" + ], + [ + "62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466", + "5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0" + ], + [ + "5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f", + "5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94" + ], + [ + "670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728", + "26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0" + ], + [ + "3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5", + "56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015" + ], + [ + "4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3", + "1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e" + ], + [ + "4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0", + "97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09" + ], + [ + "574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219", + "49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8" + ], + [ + "7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554", + "47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba" + ], + [ + "67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6", + "39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8" + ], + [ + "63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b", + "60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9" + ], + [ + "3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543", + "56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628" + ], + [ + "758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129", + "622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746" + ], + [ + "38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c", + "145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e" + ], + [ + "206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad", + "6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8" + ], + [ + "56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d", + "526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6" + ], + [ + "4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378", + "3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d" + ], + [ + "450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58", + "1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7" + ], + [ + "6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d", + "28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2" + ], + [ + "1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf", + "fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb" + ], + [ + "4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997", + "40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c" + ], + [ + "21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef", + "4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f" + ], + [ + "350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046", + "5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b" + ], + [ + "529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6", + "3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491" + ], + [ + "55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d", + "159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9" + ], + [ + "405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f", + "4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d" + ], + [ + "376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe", + "5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba" + ], + [ + "2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38", + "7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089" + ], + [ + "3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed", + "5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5" + ], + [ + "7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4", + "3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe" + ], + [ + "4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d", + "204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89" + ], + [ + "79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72", + "3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb" + ], + [ + "297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c", + "6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993" + ], + [ + "44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7", + "1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc" + ], + [ + "6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26", + "64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd" + ], + [ + "14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24", + "5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1" + ], + [ + "95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83", + "1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1" + ], + [ + "2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5", + "5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67" + ], + [ + "61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d", + "23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795" + ], + [ + "79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf", + "2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6" + ], + [ + "45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b", + "2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd" + ], + [ + "37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007", + "50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c" + ], + [ + "71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b", + "3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6" + ], + [ + "78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06", + "5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256" + ], + [ + "b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15", + "653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83" + ], + [ + "441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc", + "4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59" + ], + [ + "2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa", + "4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0" + ], + [ + "3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f", + "4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c" + ], + [ + "5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092", + "5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56" + ], + [ + "3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771", + "459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999" + ], + [ + "5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f", + "56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49" + ], + [ + "1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281", + "5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a" + ], + [ + "1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40", + "6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488" + ], + [ + "61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b", + "27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad" + ], + [ + "7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e", + "481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf" + ], + [ + "124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316", + "33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987" + ], + [ + "61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c", + "5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb" + ], + [ + "70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d", + "3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc" + ], + [ + "41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f", + "7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce" + ], + [ + "62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8", + "1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771" + ], + [ + "441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a", + "29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086" + ], + [ + "2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee", + "11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77" + ], + [ + "5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea", + "63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc" + ], + [ + "3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7", + "7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092" + ], + [ + "95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922", + "159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9" + ], + [ + "621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c", + "65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd" + ], + [ + "54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e", + "680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313" + ], + [ + "21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d", + "7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8" + ], + [ + "3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3", + "12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801" + ], + [ + "befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392", + "6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8" + ], + [ + "15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6", + "30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df" + ], + [ + "38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8", + "786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13" + ], + [ + "6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72", + "1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a" + ], + [ + "5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30", + "1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea" + ], + [ + "309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1", + "505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851" + ], + [ + "89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc", + "1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540" + ], + [ + "480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84", + "511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570" + ], + [ + "3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb", + "49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920" + ], + [ + "66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd", + "4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b" + ], + [ + "373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3", + "5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c" + ], + [ + "26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7", + "157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc" + ], + [ + "ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f", + "517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7" + ], + [ + "25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66", + "10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8" + ], + [ + "243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742", + "1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f" + ], + [ + "48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562", + "3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264" + ], + [ + "592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca", + "48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc" + ], + [ + "31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d", + "a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5" + ], + [ + "4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc", + "512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47" + ], + [ + "26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc", + "75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e" + ], + [ + "3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe", + "20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d" + ], + [ + "483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97", + "2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d" + ], + [ + "65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9", + "562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373" + ], + [ + "284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35", + "5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02" + ], + [ + "32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85", + "7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd" + ], + [ + "1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a", + "478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742" + ], + [ + "270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf", + "3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b" + ], + [ + "6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d", + "5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33" + ], + [ + "48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1", + "2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0" + ], + [ + "e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5", + "36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997" + ], + [ + "5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8", + "6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c" + ], + [ + "15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6", + "69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903" + ], + [ + "274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50", + "6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656" + ], + [ + "4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123", + "116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba" + ], + [ + "4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a", + "2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f" + ], + [ + "5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3", + "4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b" + ], + [ + "11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483", + "36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8" + ], + [ + "4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3", + "e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64" + ], + [ + "2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3", + "527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d" + ], + [ + "52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf", + "19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41" + ], + [ + "541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961", + "78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2" + ], + [ + "5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd", + "137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc" + ], + [ + "15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4", + "4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549" + ], + [ + "68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4", + "7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f" + ], + [ + "67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df", + "7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01" + ], + [ + "596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334", + "49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0" + ], + [ + "567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395", + "6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd" + ], + [ + "cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7", + "4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7" + ], + [ + "4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06", + "2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566" + ], + [ + "760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359", + "1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e" + ], + [ + "6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2", + "3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd" + ], + [ + "4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b", + "2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f" + ], + [ + "5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7", + "76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39" + ], + [ + "2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7", + "62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e" + ], + [ + "5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00", + "14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1" + ], + [ + "7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c", + "bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970" + ], + [ + "37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843", + "672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb" + ], + [ + "5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114", + "7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e" + ], + [ + "25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63", + "3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb" + ], + [ + "32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0", + "bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459" + ], + [ + "49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f", + "57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8" + ], + [ + "10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd", + "8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0" + ], + [ + "79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36", + "146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c" + ], + [ + "6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439", + "68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82" + ], + [ + "71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097", + "54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c" + ], + [ + "27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b", + "14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3" + ], + [ + "6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c", + "5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048" + ], + [ + "32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9", + "518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4" + ], + [ + "4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e", + "3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4" + ], + [ + "4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10", + "20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918" + ], + [ + "87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a", + "112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb" + ], + [ + "6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae", + "54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1" + ], + [ + "19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a", + "1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510" + ], + [ + "12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d", + "4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7" + ], + [ + "13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2", + "40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1" + ], + [ + "255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d", + "3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc" + ], + [ + "7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31", + "4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6" + ], + [ + "2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35", + "44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf" + ], + [ + "750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b", + "54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c" + ], + [ + "3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72", + "7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359" + ], + [ + "4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb", + "63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235" + ], + [ + "1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f", + "4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d" + ], + [ + "2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087", + "2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d" + ], + [ + "4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3", + "5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621" + ], + [ + "2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05", + "1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19" + ], + [ + "4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c", + "33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614" + ], + [ + "7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b", + "5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722" + ], + [ + "7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51", + "26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056" + ], + [ + "36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881", + "33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5" + ], + [ + "403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd", + "47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5" + ], + [ + "3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb", + "2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e" + ], + [ + "3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537", + "f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4" + ], + [ + "235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65", + "37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5" + ], + [ + "3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b", + "4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe" + ], + [ + "48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518", + "73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee" + ], + [ + "48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0", + "3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903" + ], + [ + "2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097", + "19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541" + ], + [ + "1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676", + "36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7" + ], + [ + "2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b", + "7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b" + ], + [ + "348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a", + "3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969" + ], + [ + "7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31", + "42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd" + ], + [ + "2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a", + "5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83" + ], + [ + "1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2", + "dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d" + ], + [ + "54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e", + "16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089" + ], + [ + "525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b", + "58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea" + ], + [ + "54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd", + "53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76" + ], + [ + "4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae", + "2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17" + ], + [ + "21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708", + "59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c" + ], + [ + "167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66", + "22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a" + ], + [ + "31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843", + "1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c" + ], + [ + "1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b", + "2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b" + ], + [ + "c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0", + "45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327" + ], + [ + "394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6", + "1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd" + ], + [ + "410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27", + "361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa" + ], + [ + "38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734", + "624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1" + ], + [ + "78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608", + "19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198" + ], + [ + "6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867", + "7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb" + ], + [ + "32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602", + "3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377" + ], + [ + "49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5", + "1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d" + ], + [ + "2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5", + "759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96" + ], + [ + "3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70", + "22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6" + ], + [ + "5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab", + "715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8" + ], + [ + "19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a", + "896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5" + ], + [ + "61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc", + "38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8" + ], + [ + "2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df", + "1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb" + ], + [ + "7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54", + "21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b" + ], + [ + "b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed", + "5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf" + ], + [ + "e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc", + "550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a" + ], + [ + "7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4", + "2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f" + ], + [ + "7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c", + "410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e" + ], + [ + "225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5", + "411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e" + ], + [ + "1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1", + "3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8" + ], + [ + "59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335", + "1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8" + ], + [ + "2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3", + "62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535" + ], + [ + "6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb", + "7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f" + ], + [ + "34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88", + "3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d" + ], + [ + "436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d", + "67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044" + ], + [ + "592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4", + "27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5" + ], + [ + "89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009", + "557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b" + ], + [ + "1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e", + "72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a" + ], + [ + "574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03", + "5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3" + ], + [ + "513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1", + "687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5" + ], + [ + "53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9", + "35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be" + ], + [ + "213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44", + "744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89" + ], + [ + "735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c", + "7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9" + ], + [ + "3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001", + "79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8" + ], + [ + "51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74", + "10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad" + ], + [ + "c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc", + "53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a" + ], + [ + "5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece", + "39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f" + ], + [ + "3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299", + "15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975" + ], + [ + "6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0", + "11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744" + ], + [ + "7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65", + "3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb" + ], + [ + "2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6", + "461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d" + ], + [ + "34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f", + "33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44" + ], + [ + "6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441", + "6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693" + ], + [ + "17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce", + "3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7" + ], + [ + "70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27", + "d18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8" + ], + [ + "2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf", + "5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1" + ], + [ + "5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1", + "eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487" + ], + [ + "6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61", + "911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984" + ], + [ + "74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293", + "761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92" + ], + [ + "44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9", + "249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0" + ], + [ + "2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc", + "6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5" + ], + [ + "3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb", + "6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb" + ], + [ + "284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677", + "516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7" + ], + [ + "2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32", + "7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec" + ], + [ + "5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7", + "6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece" + ], + [ + "74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f", + "156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531" + ], + [ + "334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45", + "221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2" + ], + [ + "7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30", + "3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86" + ], + [ + "4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8", + "6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749" + ], + [ + "1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7", + "3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583" + ], + [ + "294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1", + "d837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad" + ], + [ + "753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39", + "6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75" + ], + [ + "5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e", + "7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8" + ], + [ + "4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f", + "21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e" + ], + [ + "726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8", + "15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12" + ], + [ + "38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2", + "73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b" + ], + [ + "6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291", + "4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75" + ], + [ + "6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f", + "26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05" + ], + [ + "2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155", + "5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244" + ], + [ + "4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7", + "5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1" + ], + [ + "110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3", + "7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43" + ], + [ + "5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096", + "7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2" + ], + [ + "2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d", + "62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b" + ], + [ + "1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d", + "309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4" + ], + [ + "2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d", + "3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf" + ], + [ + "376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543", + "6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547" + ], + [ + "a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066", + "6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471" + ], + [ + "223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed", + "c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa" + ], + [ + "102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2", + "6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65" + ], + [ + "891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2", + "5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37" + ], + [ + "215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203", + "10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266" + ], + [ + "21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36", + "3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3" + ], + [ + "60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae", + "e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879" + ], + [ + "1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5", + "69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3" + ], + [ + "5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e", + "134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec" + ], + [ + "626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8", + "7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0" + ], + [ + "23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd", + "7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf" + ], + [ + "54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202", + "1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426" + ], + [ + "13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c", + "62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9" + ], + [ + "47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98", + "75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb" + ], + [ + "2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585", + "5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c" + ] +]; + +// src/types/index.ts +var types_exports = {}; +__export(types_exports, { + BlockStatus: () => BlockStatus, + BlockTag: () => BlockTag, + EntryPointType: () => EntryPointType, + RPC: () => rpc_exports, + SIMULATION_FLAG: () => SIMULATION_FLAG, + Sequencer: () => sequencer_exports, + TransactionStatus: () => TransactionStatus, + TransactionType: () => TransactionType, + Uint: () => Uint, + ValidateType: () => ValidateType +}); + +// src/types/account.ts +var SIMULATION_FLAG = /* @__PURE__ */ ((SIMULATION_FLAG2) => { + SIMULATION_FLAG2[SIMULATION_FLAG2["SKIP_VALIDATE"] = 0] = "SKIP_VALIDATE"; + SIMULATION_FLAG2[SIMULATION_FLAG2["SKIP_EXECUTE"] = 1] = "SKIP_EXECUTE"; + return SIMULATION_FLAG2; +})(SIMULATION_FLAG || {}); + +// src/types/calldata.ts +var ValidateType = /* @__PURE__ */ ((ValidateType2) => { + ValidateType2["DEPLOY"] = "DEPLOY"; + ValidateType2["CALL"] = "CALL"; + ValidateType2["INVOKE"] = "INVOKE"; + return ValidateType2; +})(ValidateType || {}); +var Uint = /* @__PURE__ */ ((Uint2) => { + Uint2["u8"] = "core::integer::u8"; + Uint2["u16"] = "core::integer::u16"; + Uint2["u32"] = "core::integer::u32"; + Uint2["u64"] = "core::integer::u64"; + Uint2["u128"] = "core::integer::u128"; + Uint2["u256"] = "core::integer::u256"; + return Uint2; +})(Uint || {}); + +// src/types/lib/contract/index.ts +var EntryPointType = /* @__PURE__ */ ((EntryPointType2) => { + EntryPointType2["EXTERNAL"] = "EXTERNAL"; + EntryPointType2["L1_HANDLER"] = "L1_HANDLER"; + EntryPointType2["CONSTRUCTOR"] = "CONSTRUCTOR"; + return EntryPointType2; +})(EntryPointType || {}); + +// src/types/lib/index.ts +var TransactionType = /* @__PURE__ */ ((TransactionType3) => { + TransactionType3["DECLARE"] = "DECLARE"; + TransactionType3["DEPLOY"] = "DEPLOY"; + TransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT"; + TransactionType3["INVOKE"] = "INVOKE_FUNCTION"; + return TransactionType3; +})(TransactionType || {}); +var TransactionStatus = /* @__PURE__ */ ((TransactionStatus2) => { + TransactionStatus2["NOT_RECEIVED"] = "NOT_RECEIVED"; + TransactionStatus2["RECEIVED"] = "RECEIVED"; + TransactionStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2"; + TransactionStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1"; + TransactionStatus2["REJECTED"] = "REJECTED"; + return TransactionStatus2; +})(TransactionStatus || {}); +var BlockStatus = /* @__PURE__ */ ((BlockStatus2) => { + BlockStatus2["PENDING"] = "PENDING"; + BlockStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1"; + BlockStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2"; + BlockStatus2["REJECTED"] = "REJECTED"; + return BlockStatus2; +})(BlockStatus || {}); +var BlockTag = /* @__PURE__ */ ((BlockTag2) => { + BlockTag2["pending"] = "pending"; + BlockTag2["latest"] = "latest"; + return BlockTag2; +})(BlockTag || {}); + +// src/types/api/rpc.ts +var rpc_exports = {}; +__export(rpc_exports, { + TransactionType: () => TransactionType2 +}); +var TransactionType2 = /* @__PURE__ */ ((TransactionType3) => { + TransactionType3["DECLARE"] = "DECLARE"; + TransactionType3["DEPLOY"] = "DEPLOY"; + TransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT"; + TransactionType3["INVOKE"] = "INVOKE"; + TransactionType3["L1_HANDLER"] = "L1_HANDLER"; + return TransactionType3; +})(TransactionType2 || {}); + +// src/types/api/sequencer.ts +var sequencer_exports = {}; + +// src/utils/assert.ts +function assert(condition, message) { + if (!condition) { + throw new Error(message || "Assertion failure"); + } +} + +// src/utils/num.ts +var num_exports = {}; +__export(num_exports, { + assertInRange: () => assertInRange, + bigNumberishArrayToDecimalStringArray: () => bigNumberishArrayToDecimalStringArray, + bigNumberishArrayToHexadecimalStringArray: () => bigNumberishArrayToHexadecimalStringArray, + cleanHex: () => cleanHex, + getDecimalString: () => getDecimalString, + getHexString: () => getHexString, + getHexStringArray: () => getHexStringArray, + hexToBytes: () => hexToBytes, + hexToDecimalString: () => hexToDecimalString, + isBigInt: () => isBigInt, + isHex: () => isHex, + isStringWholeNumber: () => isStringWholeNumber, + toBigInt: () => toBigInt, + toCairoBool: () => toCairoBool, + toHex: () => toHex, + toHexString: () => toHexString, + toStorageKey: () => toStorageKey +}); +var import_utils = require("@noble/curves/abstract/utils"); +function isHex(hex) { + return /^0x[0-9a-f]*$/i.test(hex); +} +function toBigInt(value) { + return BigInt(value); +} +function isBigInt(value) { + return typeof value === "bigint"; +} +function toHex(number2) { + return addHexPrefix(toBigInt(number2).toString(16)); +} +function toStorageKey(number2) { + const res = addHexPrefix(toBigInt(number2).toString(16).padStart(64, "0")); + return res; +} +function hexToDecimalString(hex) { + return BigInt(addHexPrefix(hex)).toString(10); +} +var cleanHex = (hex) => hex.toLowerCase().replace(/^(0x)0+/, "$1"); +function assertInRange(input, lowerBound, upperBound, inputName = "") { + const messageSuffix = inputName === "" ? "invalid length" : `invalid ${inputName} length`; + const inputBigInt = BigInt(input); + const lowerBoundBigInt = BigInt(lowerBound); + const upperBoundBigInt = BigInt(upperBound); + assert( + inputBigInt >= lowerBoundBigInt && inputBigInt <= upperBoundBigInt, + `Message not signable, ${messageSuffix}.` + ); +} +function bigNumberishArrayToDecimalStringArray(rawCalldata) { + return rawCalldata.map((x) => toBigInt(x).toString(10)); +} +function bigNumberishArrayToHexadecimalStringArray(rawCalldata) { + return rawCalldata.map((x) => toHex(x)); +} +var isStringWholeNumber = (value) => /^\d+$/.test(value); +var toHexString = (value) => toHex(value); +function getDecimalString(value) { + if (isHex(value)) { + return hexToDecimalString(value); + } + if (isStringWholeNumber(value)) { + return value; + } + throw new Error(`${value} need to be hex-string or whole-number-string`); +} +function getHexString(value) { + if (isHex(value)) { + return value; + } + if (isStringWholeNumber(value)) { + return toHexString(value); + } + throw new Error(`${value} need to be hex-string or whole-number-string`); +} +function getHexStringArray(value) { + return value.map((el) => getHexString(el)); +} +var toCairoBool = (value) => (+value).toString(); +function hexToBytes(value) { + if (!isHex(value)) + throw new Error(`${value} need to be a hex-string`); + let adaptedValue = removeHexPrefix(value); + if (adaptedValue.length % 2 !== 0) { + adaptedValue = `0${adaptedValue}`; + } + return (0, import_utils.hexToBytes)(adaptedValue); +} + +// src/utils/selector.ts +var selector_exports = {}; +__export(selector_exports, { + getSelector: () => getSelector, + getSelectorFromName: () => getSelectorFromName, + keccakBn: () => keccakBn, + starknetKeccak: () => starknetKeccak +}); +var import_micro_starknet = require("micro-starknet"); +function keccakBn(value) { + const hexWithoutPrefix = removeHexPrefix(toHex(BigInt(value))); + const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`; + return addHexPrefix((0, import_micro_starknet.keccak)(hexToBytes(addHexPrefix(evenHex))).toString(16)); +} +function keccakHex(value) { + return addHexPrefix((0, import_micro_starknet.keccak)(utf8ToArray(value)).toString(16)); +} +function starknetKeccak(value) { + const hash = BigInt(keccakHex(value)); + return hash & MASK_250; +} +function getSelectorFromName(funcName) { + return toHex(starknetKeccak(funcName)); +} +function getSelector(value) { + if (isHex(value)) { + return value; + } + if (isStringWholeNumber(value)) { + return toHexString(value); + } + return getSelectorFromName(value); +} + +// src/utils/shortString.ts +var shortString_exports = {}; +__export(shortString_exports, { + decodeShortString: () => decodeShortString, + encodeShortString: () => encodeShortString, + isASCII: () => isASCII, + isDecimalString: () => isDecimalString, + isLongText: () => isLongText, + isShortString: () => isShortString, + isShortText: () => isShortText, + isText: () => isText, + splitLongString: () => splitLongString +}); +var TEXT_TO_FELT_MAX_LEN = 31; +function isASCII(str) { + return /^[\x00-\x7F]*$/.test(str); +} +function isShortString(str) { + return str.length <= TEXT_TO_FELT_MAX_LEN; +} +function isDecimalString(decim) { + return /^[0-9]*$/i.test(decim); +} +function isText(val) { + return typeof val === "string" && !isHex(val) && !isStringWholeNumber(val); +} +var isShortText = (val) => isText(val) && isShortString(val); +var isLongText = (val) => isText(val) && !isShortString(val); +function splitLongString(longStr) { + const regex = RegExp(`[^]{1,${TEXT_TO_FELT_MAX_LEN}}`, "g"); + return longStr.match(regex) || []; +} +function encodeShortString(str) { + if (!isASCII(str)) + throw new Error(`${str} is not an ASCII string`); + if (!isShortString(str)) + throw new Error(`${str} is too long`); + return addHexPrefix(str.replace(/./g, (char) => char.charCodeAt(0).toString(16))); +} +function decodeShortString(str) { + if (!isASCII(str)) + throw new Error(`${str} is not an ASCII string`); + if (isHex(str)) { + return removeHexPrefix(str).replace(/.{2}/g, (hex) => String.fromCharCode(parseInt(hex, 16))); + } + if (isDecimalString(str)) { + return decodeShortString("0X".concat(BigInt(str).toString(16))); + } + throw new Error(`${str} is not Hex or decimal`); +} + +// src/utils/calldata/cairo.ts +var cairo_exports = {}; +__export(cairo_exports, { + felt: () => felt, + getArrayType: () => getArrayType, + isCairo1Abi: () => isCairo1Abi, + isCairo1Type: () => isCairo1Type, + isLen: () => isLen, + isTypeArray: () => isTypeArray, + isTypeBool: () => isTypeBool, + isTypeContractAddress: () => isTypeContractAddress, + isTypeFelt: () => isTypeFelt, + isTypeNamedTuple: () => isTypeNamedTuple, + isTypeStruct: () => isTypeStruct, + isTypeTuple: () => isTypeTuple, + isTypeUint: () => isTypeUint, + isTypeUint256: () => isTypeUint256, + tuple: () => tuple, + uint256: () => uint256 +}); + +// src/utils/uint256.ts +var uint256_exports = {}; +__export(uint256_exports, { + UINT_128_MAX: () => UINT_128_MAX, + UINT_256_MAX: () => UINT_256_MAX, + bnToUint256: () => bnToUint256, + isUint256: () => isUint256, + uint256ToBN: () => uint256ToBN +}); +function uint256ToBN(uint2562) { + return (toBigInt(uint2562.high) << 128n) + toBigInt(uint2562.low); +} +var UINT_128_MAX = (1n << 128n) - 1n; +var UINT_256_MAX = (1n << 256n) - 1n; +function isUint256(bn) { + return toBigInt(bn) <= UINT_256_MAX; +} +function bnToUint256(bignumber) { + const bn = toBigInt(bignumber); + if (!isUint256(bn)) + throw new Error("Number is too large"); + return { + low: addHexPrefix((bn & UINT_128_MAX).toString(16)), + high: addHexPrefix((bn >> 128n).toString(16)) + }; +} + +// src/utils/calldata/cairo.ts +var isLen = (name) => /_len$/.test(name); +var isTypeFelt = (type) => type === "felt" || type === "core::felt252"; +var isTypeArray = (type) => /\*/.test(type) || type.startsWith("core::array::Array::"); +var isTypeTuple = (type) => /^\(.*\)$/i.test(type); +var isTypeNamedTuple = (type) => /\(.*\)/i.test(type) && type.includes(":"); +var isTypeStruct = (type, structs) => type in structs; +var isTypeUint = (type) => Object.values(Uint).includes(type); +var isTypeUint256 = (type) => type === "core::integer::u256"; +var isTypeBool = (type) => type === "core::bool"; +var isTypeContractAddress = (type) => type === "core::starknet::contract_address::ContractAddress"; +var isCairo1Type = (type) => type.includes("core::"); +var getArrayType = (type) => { + if (isCairo1Type(type)) { + return type.substring(type.indexOf("<") + 1, type.lastIndexOf(">")); + } + return type.replace("*", ""); +}; +function isCairo1Abi(abi) { + const firstFunction = abi.find((entry) => entry.type === "function"); + if (!firstFunction) { + if (abi.find((it) => it.type === "interface")) { + return true; + } + throw new Error(`Error in ABI. No function in ABI.`); + } + if (firstFunction.inputs.length) { + return isCairo1Type(firstFunction.inputs[0].type); + } + if (firstFunction.outputs.length) { + return isCairo1Type(firstFunction.outputs[0].type); + } + throw new Error(`Error in ABI. No input/output in function ${firstFunction.name}`); +} +var uint256 = (it) => { + const bn = BigInt(it); + if (!isUint256(bn)) + throw new Error("Number is too large"); + return { + // eslint-disable-next-line no-bitwise + low: (bn & UINT_128_MAX).toString(10), + // eslint-disable-next-line no-bitwise + high: (bn >> 128n).toString(10) + }; +}; +var tuple = (...args) => ({ ...args }); +function felt(it) { + if (isBigInt(it) || typeof it === "number" && Number.isInteger(it)) { + return it.toString(); + } + if (isText(it)) { + if (!isShortString(it)) + throw new Error( + `${it} is a long string > 31 chars, felt can store short strings, split it to array of short strings` + ); + const encoded = encodeShortString(it); + return BigInt(encoded).toString(); + } + if (typeof it === "string" && isHex(it)) { + return BigInt(it).toString(); + } + if (typeof it === "string" && isStringWholeNumber(it)) { + return it; + } + if (typeof it === "boolean") { + return `${+it}`; + } + throw new Error(`${it} can't be computed by felt()`); +} + +// src/utils/calldata/formatter.ts +var guard = { + isBN: (data, type, key) => { + if (!isBigInt(data[key])) + throw new Error( + `Data and formatter mismatch on ${key}:${type[key]}, expected response data ${key}:${data[key]} to be BN instead it is ${typeof data[key]}` + ); + }, + unknown: (data, type, key) => { + throw new Error(`Unhandled formatter type on ${key}:${type[key]} for data ${key}:${data[key]}`); + } +}; +function formatter(data, type, sameType) { + return Object.entries(data).reduce((acc, [key, value]) => { + const elType = sameType ?? type[key]; + if (!(key in type) && !sameType) { + acc[key] = value; + return acc; + } + if (elType === "string") { + if (Array.isArray(data[key])) { + const arrayStr = formatter( + data[key], + data[key].map((_) => elType) + ); + acc[key] = Object.values(arrayStr).join(""); + return acc; + } + guard.isBN(data, type, key); + acc[key] = decodeShortString(value); + return acc; + } + if (elType === "number") { + guard.isBN(data, type, key); + acc[key] = Number(value); + return acc; + } + if (typeof elType === "function") { + acc[key] = elType(value); + return acc; + } + if (Array.isArray(elType)) { + const arrayObj = formatter(data[key], elType, elType[0]); + acc[key] = Object.values(arrayObj); + return acc; + } + if (typeof elType === "object") { + acc[key] = formatter(data[key], elType); + return acc; + } + guard.unknown(data, type, key); + return acc; + }, {}); +} + +// src/utils/calldata/parser/parser-0-1.1.0.ts +var AbiParser1 = class { + constructor(abi) { + this.abi = abi; + } + /** + * abi method inputs length without '_len' inputs + * cairo 0 reducer + * @param abiMethod FunctionAbi + * @returns number + */ + methodInputsLength(abiMethod) { + return abiMethod.inputs.reduce((acc, input) => !isLen(input.name) ? acc + 1 : acc, 0); + } + /** + * get method definition from abi + * @param name string + * @returns FunctionAbi | undefined + */ + getMethod(name) { + return this.abi.find((it) => it.name === name); + } + /** + * Get Abi in legacy format + * @returns Abi + */ + getLegacyFormat() { + return this.abi; + } +}; + +// src/utils/calldata/parser/parser-2.0.0.ts +var AbiParser2 = class { + constructor(abi) { + this.abi = abi; + } + /** + * abi method inputs length + * @param abiMethod FunctionAbi + * @returns number + */ + methodInputsLength(abiMethod) { + return abiMethod.inputs.length; + } + /** + * get method definition from abi + * @param name string + * @returns FunctionAbi | undefined + */ + getMethod(name) { + const intf = this.abi.find((it) => it.type === "interface"); + return intf.items.find((it) => it.name === name); + } + /** + * Get Abi in legacy format + * @returns Abi + */ + getLegacyFormat() { + return this.abi.flatMap((e) => { + if (e.type === "interface") { + return e.items; + } + return e; + }); + } +}; + +// src/utils/calldata/parser/index.ts +function createAbiParser(abi) { + const version = getAbiVersion(abi); + if (version === 0 || version === 1) { + return new AbiParser1(abi); + } + if (version === 2) { + return new AbiParser2(abi); + } + throw Error(`Unsupported ABI version ${version}`); +} +function getAbiVersion(abi) { + if (abi.find((it) => it.type === "interface")) + return 2; + if (isCairo1Abi(abi)) + return 1; + return 0; +} +function isNoConstructorValid(method, argsCalldata, abiMethod) { + return method === "constructor" && !abiMethod && !argsCalldata.length; +} + +// src/utils/calldata/tuple.ts +function parseNamedTuple(namedTuple) { + const name = namedTuple.substring(0, namedTuple.indexOf(":")); + const type = namedTuple.substring(name.length + ":".length); + return { name, type }; +} +function parseSubTuple(s) { + if (!s.includes("(")) + return { subTuple: [], result: s }; + const subTuple = []; + let result = ""; + let i = 0; + while (i < s.length) { + if (s[i] === "(") { + let counter = 1; + const lBracket = i; + i++; + while (counter) { + if (s[i] === ")") + counter--; + if (s[i] === "(") + counter++; + i++; + } + subTuple.push(s.substring(lBracket, i)); + result += " "; + i--; + } else { + result += s[i]; + } + i++; + } + return { + subTuple, + result + }; +} +function extractCairo0Tuple(type) { + const cleanType = type.replace(/\s/g, "").slice(1, -1); + const { subTuple, result } = parseSubTuple(cleanType); + let recomposed = result.split(",").map((it) => { + return subTuple.length ? it.replace(" ", subTuple.shift()) : it; + }); + if (isTypeNamedTuple(type)) { + recomposed = recomposed.reduce((acc, it) => { + return acc.concat(parseNamedTuple(it)); + }, []); + } + return recomposed; +} +function extractCairo1Tuple(type) { + const cleanType = type.replace(/\s/g, "").slice(1, -1); + const { subTuple, result } = parseSubTuple(cleanType); + const recomposed = result.split(",").map((it) => { + return subTuple.length ? it.replace(" ", subTuple.shift()) : it; + }); + return recomposed; +} +function extractTupleMemberTypes(type) { + if (isCairo1Type(type)) { + return extractCairo1Tuple(type); + } + return extractCairo0Tuple(type); +} + +// src/utils/calldata/propertyOrder.ts +function errorU256(key) { + return Error( + `Your object includes the property : ${key}, containing an Uint256 object without the 'low' and 'high' keys.` + ); +} +function orderPropsByAbi(unorderedObject, abiOfObject, structs) { + const orderStruct = (unorderedObject2, abiObject) => { + const orderedObject2 = abiObject.reduce((orderedObject, abiParam) => { + const setProperty = (value) => Object.defineProperty(orderedObject, abiParam.name, { + enumerable: true, + value: value ?? unorderedObject2[abiParam.name] + }); + if (unorderedObject2[abiParam.name] === "undefined") { + if (isCairo1Type(abiParam.type) || !isLen(abiParam.name)) { + throw Error(`Your object needs a property with key : ${abiParam.name} .`); + } + } + switch (true) { + case isTypeStruct(abiParam.type, structs): + setProperty( + orderStruct( + unorderedObject2[abiParam.name], + structs[abiParam.type].members + ) + ); + break; + case isTypeUint256(abiParam.type): { + const u256 = unorderedObject2[abiParam.name]; + if (typeof u256 !== "object") { + setProperty(); + break; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + setProperty({ low: u256.low, high: u256.high }); + break; + } + case isTypeTuple(abiParam.type): + setProperty(orderTuple(unorderedObject2[abiParam.name], abiParam)); + break; + case isTypeArray(abiParam.type): + setProperty(orderArray(unorderedObject2[abiParam.name], abiParam)); + break; + case (!isCairo1Type(abiParam.type) && isLen(abiParam.name)): + break; + default: + setProperty(); + } + return orderedObject; + }, {}); + return orderedObject2; + }; + function orderArray(myArray, abiParam) { + const typeInArray = getArrayType(abiParam.type); + if (typeof myArray === "string") { + return myArray; + } + switch (true) { + case typeInArray in structs: + return myArray.map((myObj) => orderStruct(myObj, structs[typeInArray].members)); + case typeInArray === "core::integer::u256" /* u256 */: + return myArray.map((u256) => { + if (typeof u256 !== "object") { + return u256; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + return { low: u256.low, high: u256.high }; + }); + case isTypeTuple(typeInArray): + return myArray.map((myElem) => orderTuple(myElem, { name: "0", type: typeInArray })); + case isTypeArray(typeInArray): + return myArray.map((myElem) => orderArray(myElem, { name: "0", type: typeInArray })); + default: + return myArray; + } + } + function orderTuple(unorderedObject2, abiParam) { + const typeList = extractTupleMemberTypes(abiParam.type); + const orderedObject2 = typeList.reduce((orderedObject, abiTypeCairoX, index) => { + const myObjKeys = Object.keys(unorderedObject2); + const setProperty = (value) => Object.defineProperty(orderedObject, index.toString(), { + enumerable: true, + value: value ?? unorderedObject2[myObjKeys[index]] + }); + const abiType = abiTypeCairoX?.type ? abiTypeCairoX.type : abiTypeCairoX; + switch (true) { + case isTypeStruct(abiType, structs): + setProperty( + orderStruct( + unorderedObject2[myObjKeys[index]], + structs[abiType].members + ) + ); + break; + case isTypeUint256(abiType): { + const u256 = unorderedObject2[myObjKeys[index]]; + if (typeof u256 !== "object") { + setProperty(); + break; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + setProperty({ low: u256.low, high: u256.high }); + break; + } + case isTypeTuple(abiType): + setProperty( + orderTuple(unorderedObject2[myObjKeys[index]], { + name: "0", + type: abiType + }) + ); + break; + case isTypeArray(abiType): + setProperty( + orderArray(unorderedObject2[myObjKeys[index]], { + name: "0", + type: abiType + }) + ); + break; + default: + setProperty(); + } + return orderedObject; + }, {}); + return orderedObject2; + } + return orderStruct(unorderedObject, abiOfObject); +} + +// src/utils/calldata/requestParser.ts +function parseBaseTypes(type, val) { + switch (true) { + case isTypeUint256(type): + const el_uint256 = uint256(val); + return [felt(el_uint256.low), felt(el_uint256.high)]; + default: + return felt(val); + } +} +function parseTuple(element, typeStr) { + const memberTypes = extractTupleMemberTypes(typeStr); + const elements = Object.values(element); + if (elements.length !== memberTypes.length) { + throw Error( + `ParseTuple: provided and expected abi tuple size do not match. + provided: ${elements} + expected: ${memberTypes}` + ); + } + return memberTypes.map((it, dx) => { + return { + element: elements[dx], + type: it.type ?? it + }; + }); +} +function parseUint256(element) { + if (typeof element === "object") { + const { low, high } = element; + return [felt(low), felt(high)]; + } + const el_uint256 = uint256(element); + return [felt(el_uint256.low), felt(el_uint256.high)]; +} +function parseCalldataValue(element, type, structs) { + if (element === void 0) { + throw Error(`Missing parameter for type ${type}`); + } + if (Array.isArray(element)) { + const result = []; + result.push(felt(element.length)); + const arrayType = getArrayType(type); + return element.reduce((acc, it) => { + return acc.concat(parseCalldataValue(it, arrayType, structs)); + }, result); + } + if (structs[type] && structs[type].members.length) { + if (isTypeUint256(type)) { + return parseUint256(element); + } + const { members } = structs[type]; + const subElement = element; + return members.reduce((acc, it) => { + return acc.concat(parseCalldataValue(subElement[it.name], it.type, structs)); + }, []); + } + if (isTypeTuple(type)) { + const tupled = parseTuple(element, type); + return tupled.reduce((acc, it) => { + const parsedData = parseCalldataValue(it.element, it.type, structs); + return acc.concat(parsedData); + }, []); + } + if (isTypeUint256(type)) { + return parseUint256(element); + } + if (typeof element === "object") { + throw Error(`Parameter ${element} do not align with abi parameter ${type}`); + } + return parseBaseTypes(type, element); +} +function parseCalldataField(argsIterator, input, structs) { + const { name, type } = input; + let { value } = argsIterator.next(); + switch (true) { + case isTypeArray(type): + if (!Array.isArray(value) && !isText(value)) { + throw Error(`ABI expected parameter ${name} to be array or long string, got ${value}`); + } + if (typeof value === "string") { + value = splitLongString(value); + } + return parseCalldataValue(value, input.type, structs); + case (isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type)): + return parseCalldataValue(value, type, structs); + default: + return parseBaseTypes(type, value); + } +} + +// src/utils/calldata/responseParser.ts +function parseBaseTypes2(type, it) { + let temp; + switch (true) { + case isTypeBool(type): + temp = it.next().value; + return Boolean(BigInt(temp)); + case isTypeUint256(type): + const low = it.next().value; + const high = it.next().value; + return uint256ToBN({ low, high }); + default: + temp = it.next().value; + return BigInt(temp); + } +} +function parseResponseValue(responseIterator, element, structs) { + if (isTypeUint256(element.type)) { + const low = responseIterator.next().value; + const high = responseIterator.next().value; + return uint256ToBN({ low, high }); + } + if (element.type in structs && structs[element.type]) { + return structs[element.type].members.reduce((acc, el) => { + acc[el.name] = parseResponseValue(responseIterator, el, structs); + return acc; + }, {}); + } + if (isTypeTuple(element.type)) { + const memberTypes = extractTupleMemberTypes(element.type); + return memberTypes.reduce((acc, it, idx) => { + const name = it?.name ? it.name : idx; + const type = it?.type ? it.type : it; + const el = { name, type }; + acc[name] = parseResponseValue(responseIterator, el, structs); + return acc; + }, {}); + } + if (isTypeArray(element.type)) { + const parsedDataArr = []; + const el = { name: "", type: getArrayType(element.type) }; + const len = BigInt(responseIterator.next().value); + while (parsedDataArr.length < len) { + parsedDataArr.push(parseResponseValue(responseIterator, el, structs)); + } + return parsedDataArr; + } + return parseBaseTypes2(element.type, responseIterator); +} +function responseParser(responseIterator, output, structs, parsedResult) { + const { name, type } = output; + let temp; + switch (true) { + case isLen(name): + temp = responseIterator.next().value; + return BigInt(temp); + case (type in structs || isTypeTuple(type)): + return parseResponseValue(responseIterator, output, structs); + case isTypeArray(type): + if (isCairo1Type(type)) { + return parseResponseValue(responseIterator, output, structs); + } + const parsedDataArr = []; + if (parsedResult && parsedResult[`${name}_len`]) { + const arrLen = parsedResult[`${name}_len`]; + while (parsedDataArr.length < arrLen) { + parsedDataArr.push( + parseResponseValue( + responseIterator, + { name, type: output.type.replace("*", "") }, + structs + ) + ); + } + } + return parsedDataArr; + default: + return parseBaseTypes2(type, responseIterator); + } +} + +// src/utils/calldata/validate.ts +var validateFelt = (parameter, input) => { + assert( + typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint", + `Validate: arg ${input.name} should be a felt typed as (String, Number or BigInt)` + ); +}; +var validateUint = (parameter, input) => { + if (typeof parameter === "number") { + assert( + parameter <= Number.MAX_SAFE_INTEGER, + `Validation: Parameter is to large to be typed as Number use (BigInt or String)` + ); + } + assert( + typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint" || typeof parameter === "object" && "low" in parameter && "high" in parameter, + `Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)` + ); + const param = typeof parameter === "object" ? uint256ToBN(parameter) : toBigInt(parameter); + switch (input.type) { + case "core::integer::u8" /* u8 */: + assert( + param >= 0n && param <= 255n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0 - 255]` + ); + break; + case "core::integer::u16" /* u16 */: + assert( + param >= 0n && param <= 65535n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 65535]` + ); + break; + case "core::integer::u32" /* u32 */: + assert( + param >= 0n && param <= 4294967295n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 4294967295]` + ); + break; + case "core::integer::u64" /* u64 */: + assert( + param >= 0n && param <= 2n ** 64n - 1n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^64-1]` + ); + break; + case "core::integer::u128" /* u128 */: + assert( + param >= 0n && param <= 2n ** 128n - 1n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^128-1]` + ); + break; + case "core::integer::u256" /* u256 */: + assert( + param >= 0n && param <= 2n ** 256n - 1n, + `Validate: arg ${input.name} is ${input.type} 0 - 2^256-1` + ); + break; + default: + break; + } +}; +var validateBool = (parameter, input) => { + assert( + typeof parameter === "boolean", + `Validate: arg ${input.name} of cairo type ${input.type} should be type (Boolean)` + ); +}; +var validateStruct = (parameter, input, structs) => { + if (input.type === "core::integer::u256" /* u256 */) { + validateUint(parameter, input); + return; + } + assert( + typeof parameter === "object" && !Array.isArray(parameter), + `Validate: arg ${input.name} is cairo type struct (${input.type}), and should be defined as js object (not array)` + ); + structs[input.type].members.forEach(({ name }) => { + assert( + Object.keys(parameter).includes(name), + `Validate: arg ${input.name} should have a property ${name}` + ); + }); +}; +var validateTuple = (parameter, input) => { + assert( + typeof parameter === "object" && !Array.isArray(parameter), + `Validate: arg ${input.name} should be a tuple (defined as object)` + ); +}; +var validateArray = (parameter, input, structs) => { + const baseType = getArrayType(input.type); + if (isTypeFelt(baseType) && isLongText(parameter)) + return; + assert(Array.isArray(parameter), `Validate: arg ${input.name} should be an Array`); + switch (true) { + case isTypeFelt(baseType): + parameter.forEach((param) => validateFelt(param, input)); + break; + case isTypeTuple(baseType): + parameter.forEach((it) => validateTuple(it, { name: input.name, type: baseType })); + break; + case isTypeStruct(baseType, structs): + parameter.forEach( + (it) => validateStruct(it, { name: input.name, type: baseType }, structs) + ); + break; + case isTypeUint(baseType): + parameter.forEach((param) => validateUint(param, input)); + break; + case isTypeBool(baseType): + parameter.forEach((param) => validateBool(param, input)); + break; + case isTypeArray(baseType): + parameter.forEach( + (param) => validateArray(param, { name: "", type: baseType }, structs) + ); + break; + default: + throw new Error( + `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}` + ); + } +}; +function validateFields(abiMethod, args, structs) { + abiMethod.inputs.reduce((acc, input) => { + const parameter = args[acc]; + switch (true) { + case isLen(input.name): + return acc; + case isTypeFelt(input.type): + validateFelt(parameter, input); + break; + case isTypeUint(input.type): + validateUint(parameter, input); + break; + case isTypeBool(input.type): + validateBool(parameter, input); + break; + case isTypeContractAddress(input.type): + break; + case isTypeStruct(input.type, structs): + validateStruct(parameter, input, structs); + break; + case isTypeTuple(input.type): + validateTuple(parameter, input); + break; + case isTypeArray(input.type): + validateArray(parameter, input, structs); + break; + default: + throw new Error( + `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}` + ); + } + return acc + 1; + }, 0); +} + +// src/utils/calldata/index.ts +var CallData = class { + constructor(abi) { + this.structs = CallData.getAbiStruct(abi); + this.parser = createAbiParser(abi); + this.abi = this.parser.getLegacyFormat(); + } + /** + * Validate arguments passed to the method as corresponding to the ones in the abi + * @param type ValidateType - type of the method + * @param method string - name of the method + * @param args ArgsOrCalldata - arguments that are passed to the method + */ + validate(type, method, args = []) { + if (type !== "DEPLOY" /* DEPLOY */) { + const invocableFunctionNames = this.abi.filter((abi) => { + if (abi.type !== "function") + return false; + const isView = abi.stateMutability === "view" || abi.state_mutability === "view"; + return type === "INVOKE" /* INVOKE */ ? !isView : isView; + }).map((abi) => abi.name); + assert( + invocableFunctionNames.includes(method), + `${type === "INVOKE" /* INVOKE */ ? "invocable" : "viewable"} method not found in abi` + ); + } + const abiMethod = this.abi.find( + (abi) => type === "DEPLOY" /* DEPLOY */ ? abi.name === method && abi.type === "constructor" : abi.name === method && abi.type === "function" + ); + if (isNoConstructorValid(method, args, abiMethod)) { + return; + } + const inputsLength = this.parser.methodInputsLength(abiMethod); + if (args.length !== inputsLength) { + throw Error( + `Invalid number of arguments, expected ${inputsLength} arguments, but got ${args.length}` + ); + } + validateFields(abiMethod, args, this.structs); + } + /** + * Compile contract callData with abi + * Parse the calldata by using input fields from the abi for that method + * @param method string - method name + * @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order). + * @return Calldata - parsed arguments in format that contract is expecting + * @example + * ```typescript + * const calldata = myCallData.compile("constructor",["0x34a",[1,3n]]); + * ``` + * ```typescript + * const calldata2 = myCallData.compile("constructor",{list:[1,3n],balance:"0x34"}); // wrong order is valid + * ``` + */ + compile(method, argsCalldata) { + const abiMethod = this.abi.find((abi) => abi.name === method); + if (isNoConstructorValid(method, argsCalldata, abiMethod)) { + return []; + } + let args; + if (Array.isArray(argsCalldata)) { + args = argsCalldata; + } else { + const orderedObject = orderPropsByAbi(argsCalldata, abiMethod.inputs, this.structs); + args = Object.values(orderedObject); + validateFields(abiMethod, args, this.structs); + } + const argsIterator = args[Symbol.iterator](); + const callArray = abiMethod.inputs.reduce( + (acc, input) => isLen(input.name) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs)), + [] + ); + Object.defineProperty(callArray, "__compiled__", { + enumerable: false, + writable: false, + value: true + }); + return callArray; + } + /** + * Compile contract callData without abi + * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data + * @returns Calldata + */ + static compile(rawArgs) { + const createTree = (obj) => { + const getEntries = (o, prefix = "") => { + const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o; + return Object.entries(oe).flatMap(([k, v]) => { + let value = v; + if (isLongText(value)) + value = splitLongString(value); + if (k === "entrypoint") + value = getSelectorFromName(value); + const kk = Array.isArray(oe) && k === "0" ? "$$len" : k; + if (isBigInt(value)) + return [[`${prefix}${kk}`, felt(value)]]; + return Object(value) === value ? getEntries(value, `${prefix}${kk}.`) : [[`${prefix}${kk}`, felt(value)]]; + }); + }; + return Object.fromEntries(getEntries(obj)); + }; + let callTreeArray; + if (!Array.isArray(rawArgs)) { + const callTree = createTree(rawArgs); + callTreeArray = Object.values(callTree); + } else { + const callObj = { ...rawArgs }; + const callTree = createTree(callObj); + callTreeArray = Object.values(callTree); + } + Object.defineProperty(callTreeArray, "__compiled__", { + enumerable: false, + writable: false, + value: true + }); + return callTreeArray; + } + /** + * Parse elements of the response array and structuring them into response object + * @param method string - method name + * @param response string[] - response from the method + * @return Result - parsed response corresponding to the abi + */ + parse(method, response) { + const { outputs } = this.abi.find((abi) => abi.name === method); + const responseIterator = response.flat()[Symbol.iterator](); + const parsed = outputs.flat().reduce((acc, output, idx) => { + const propName = output.name ?? idx; + acc[propName] = responseParser(responseIterator, output, this.structs, acc); + if (acc[propName] && acc[`${propName}_len`]) { + delete acc[`${propName}_len`]; + } + return acc; + }, {}); + return Object.keys(parsed).length === 1 && 0 in parsed ? parsed[0] : parsed; + } + /** + * Format cairo method response data to native js values based on provided format schema + * @param method string - cairo method name + * @param response string[] - cairo method response + * @param format object - formatter object schema + * @returns Result - parsed and formatted response object + */ + format(method, response, format) { + const parsed = this.parse(method, response); + return formatter(parsed, format); + } + /** + * Helper to extract structs from abi + * @param abi Abi + * @returns AbiStructs - structs from abi + */ + static getAbiStruct(abi) { + return abi.filter((abiEntry) => abiEntry.type === "struct").reduce( + (acc, abiEntry) => ({ + ...acc, + [abiEntry.name]: abiEntry + }), + {} + ); + } + /** + * Helper: Compile HexCalldata | RawCalldata | RawArgs + * @param rawCalldata HexCalldata | RawCalldata | RawArgs + * @returns Calldata + */ + static toCalldata(rawCalldata = []) { + return CallData.compile(rawCalldata); + } + /** + * Helper: Convert raw to HexCalldata + * @param raw HexCalldata | RawCalldata | RawArgs + * @returns HexCalldata + */ + static toHex(raw = []) { + const calldata = CallData.compile(raw); + return calldata.map((it) => toHex(it)); + } +}; + +// src/utils/hash.ts +var hash_exports = {}; +__export(hash_exports, { + calculateContractAddressFromHash: () => calculateContractAddressFromHash, + calculateDeclareTransactionHash: () => calculateDeclareTransactionHash, + calculateDeployAccountTransactionHash: () => calculateDeployAccountTransactionHash, + calculateDeployTransactionHash: () => calculateDeployTransactionHash, + calculateTransactionHash: () => calculateTransactionHash, + calculateTransactionHashCommon: () => calculateTransactionHashCommon, + computeCompiledClassHash: () => computeCompiledClassHash, + computeContractClassHash: () => computeContractClassHash, + computeHashOnElements: () => computeHashOnElements, + computeLegacyContractClassHash: () => computeLegacyContractClassHash, + computeSierraContractClassHash: () => computeSierraContractClassHash, + default: () => computeHintedClassHash, + feeTransactionVersion: () => feeTransactionVersion, + feeTransactionVersion_2: () => feeTransactionVersion_2, + formatSpaces: () => formatSpaces, + getSelector: () => getSelector, + getSelectorFromName: () => getSelectorFromName, + getVersionsByType: () => getVersionsByType, + keccakBn: () => keccakBn, + poseidon: () => poseidon, + starknetKeccak: () => starknetKeccak, + transactionVersion: () => transactionVersion, + transactionVersion_2: () => transactionVersion_2 +}); +var import_micro_starknet2 = require("micro-starknet"); + +// src/utils/ec.ts +var ec_exports = {}; +__export(ec_exports, { + starkCurve: () => starkCurve, + weierstrass: () => weierstrass +}); +var starkCurve = __toESM(require("micro-starknet")); +var weierstrass = __toESM(require("@noble/curves/abstract/weierstrass")); + +// src/utils/json.ts +var json_exports = {}; +__export(json_exports, { + parse: () => parse2, + parseAlwaysAsBig: () => parseAlwaysAsBig, + stringify: () => stringify2, + stringifyAlwaysAsBig: () => stringifyAlwaysAsBig +}); +var json = __toESM(require("lossless-json")); +var parseIntAsNumberOrBigInt = (x) => { + if (!json.isInteger(x)) + return parseFloat(x); + const v = parseInt(x, 10); + return Number.isSafeInteger(v) ? v : BigInt(x); +}; +var parse2 = (x) => json.parse(String(x), void 0, parseIntAsNumberOrBigInt); +var parseAlwaysAsBig = (x) => json.parse(String(x), void 0, json.parseNumberAndBigInt); +var stringify2 = (value, replacer, space, numberStringifiers) => json.stringify(value, replacer, space, numberStringifiers); +var stringifyAlwaysAsBig = stringify2; + +// src/utils/hash.ts +var poseidon = __toESM(require("@noble/curves/abstract/poseidon")); +var transactionVersion = 1n; +var transactionVersion_2 = 2n; +var feeTransactionVersion = 1n; +var feeTransactionVersion_2 = 2n; +function getVersionsByType(versionType) { + return versionType === "fee" ? { v1: feeTransactionVersion, v2: feeTransactionVersion_2 } : { v1: transactionVersion, v2: transactionVersion_2 }; +} +function computeHashOnElements(data) { + return [...data, data.length].reduce((x, y) => starkCurve.pedersen(toBigInt(x), toBigInt(y)), 0).toString(); +} +function calculateTransactionHashCommon(txHashPrefix, version, contractAddress, entryPointSelector, calldata, maxFee, chainId, additionalData = []) { + const calldataHash = computeHashOnElements(calldata); + const dataToHash = [ + txHashPrefix, + version, + contractAddress, + entryPointSelector, + calldataHash, + maxFee, + chainId, + ...additionalData + ]; + return computeHashOnElements(dataToHash); +} +function calculateDeployTransactionHash(contractAddress, constructorCalldata, version, chainId, constructorName = "constructor") { + return calculateTransactionHashCommon( + "0x6465706c6f79" /* DEPLOY */, + version, + contractAddress, + getSelectorFromName(constructorName), + constructorCalldata, + 0, + chainId + ); +} +function calculateDeclareTransactionHash(classHash, senderAddress, version, maxFee, chainId, nonce, compiledClassHash) { + return calculateTransactionHashCommon( + "0x6465636c617265" /* DECLARE */, + version, + senderAddress, + 0, + [classHash], + maxFee, + chainId, + [nonce, ...compiledClassHash ? [compiledClassHash] : []] + ); +} +function calculateDeployAccountTransactionHash(contractAddress, classHash, constructorCalldata, salt, version, maxFee, chainId, nonce) { + const calldata = [classHash, salt, ...constructorCalldata]; + return calculateTransactionHashCommon( + "0x6465706c6f795f6163636f756e74" /* DEPLOY_ACCOUNT */, + version, + contractAddress, + 0, + calldata, + maxFee, + chainId, + [nonce] + ); +} +function calculateTransactionHash(contractAddress, version, calldata, maxFee, chainId, nonce) { + return calculateTransactionHashCommon( + "0x696e766f6b65" /* INVOKE */, + version, + contractAddress, + 0, + calldata, + maxFee, + chainId, + [nonce] + ); +} +function calculateContractAddressFromHash(salt, classHash, constructorCalldata, deployerAddress) { + const compiledCalldata = CallData.compile(constructorCalldata); + const constructorCalldataHash = computeHashOnElements(compiledCalldata); + const CONTRACT_ADDRESS_PREFIX = felt("0x535441524b4e45545f434f4e54524143545f41444452455353"); + return computeHashOnElements([ + CONTRACT_ADDRESS_PREFIX, + deployerAddress, + salt, + classHash, + constructorCalldataHash + ]); +} +function nullSkipReplacer(key, value) { + if (key === "attributes" || key === "accessible_scopes") { + return Array.isArray(value) && value.length === 0 ? void 0 : value; + } + if (key === "debug_info") { + return null; + } + return value === null ? void 0 : value; +} +function formatSpaces(json2) { + let insideQuotes = false; + const newString = []; + for (const char of json2) { + if (char === '"' && (newString.length > 0 && newString.slice(-1)[0] === "\\") === false) { + insideQuotes = !insideQuotes; + } + if (insideQuotes) { + newString.push(char); + } else { + newString.push(char === ":" ? ": " : char === "," ? ", " : char); + } + } + return newString.join(""); +} +function computeHintedClassHash(compiledContract) { + const { abi, program } = compiledContract; + const contractClass = { abi, program }; + const serializedJson = formatSpaces(stringify2(contractClass, nullSkipReplacer)); + return addHexPrefix(starkCurve.keccak(utf8ToArray(serializedJson)).toString(16)); +} +function computeLegacyContractClassHash(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + const apiVersion = toHex(API_VERSION); + const externalEntryPointsHash = computeHashOnElements( + compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset]) + ); + const l1HandlerEntryPointsHash = computeHashOnElements( + compiledContract.entry_points_by_type.L1_HANDLER.flatMap((e) => [e.selector, e.offset]) + ); + const constructorEntryPointHash = computeHashOnElements( + compiledContract.entry_points_by_type.CONSTRUCTOR.flatMap((e) => [e.selector, e.offset]) + ); + const builtinsHash = computeHashOnElements( + compiledContract.program.builtins.map((s) => encodeShortString(s)) + ); + const hintedClassHash = computeHintedClassHash(compiledContract); + const dataHash = computeHashOnElements(compiledContract.program.data); + return computeHashOnElements([ + apiVersion, + externalEntryPointsHash, + l1HandlerEntryPointsHash, + constructorEntryPointHash, + builtinsHash, + hintedClassHash, + dataHash + ]); +} +function hashBuiltins(builtins) { + return (0, import_micro_starknet2.poseidonHashMany)( + builtins.flatMap((it) => { + return BigInt(encodeShortString(it)); + }) + ); +} +function hashEntryPoint(data) { + const base = data.flatMap((it) => { + return [BigInt(it.selector), BigInt(it.offset), hashBuiltins(it.builtins)]; + }); + return (0, import_micro_starknet2.poseidonHashMany)(base); +} +function computeCompiledClassHash(casm) { + const COMPILED_CLASS_VERSION = "COMPILED_CLASS_V1"; + const compiledClassVersion = BigInt(encodeShortString(COMPILED_CLASS_VERSION)); + const externalEntryPointsHash = hashEntryPoint(casm.entry_points_by_type.EXTERNAL); + const l1Handlers = hashEntryPoint(casm.entry_points_by_type.L1_HANDLER); + const constructor = hashEntryPoint(casm.entry_points_by_type.CONSTRUCTOR); + const bytecode = (0, import_micro_starknet2.poseidonHashMany)(casm.bytecode.map((it) => BigInt(it))); + return toHex( + (0, import_micro_starknet2.poseidonHashMany)([ + compiledClassVersion, + externalEntryPointsHash, + l1Handlers, + constructor, + bytecode + ]) + ); +} +function hashEntryPointSierra(data) { + const base = data.flatMap((it) => { + return [BigInt(it.selector), BigInt(it.function_idx)]; + }); + return (0, import_micro_starknet2.poseidonHashMany)(base); +} +function hashAbi(sierra) { + const indentString = formatSpaces(stringify2(sierra.abi, null)); + return BigInt(addHexPrefix(starkCurve.keccak(utf8ToArray(indentString)).toString(16))); +} +function computeSierraContractClassHash(sierra) { + const CONTRACT_CLASS_VERSION = "CONTRACT_CLASS_V0.1.0"; + const compiledClassVersion = BigInt(encodeShortString(CONTRACT_CLASS_VERSION)); + const externalEntryPointsHash = hashEntryPointSierra(sierra.entry_points_by_type.EXTERNAL); + const l1Handlers = hashEntryPointSierra(sierra.entry_points_by_type.L1_HANDLER); + const constructor = hashEntryPointSierra(sierra.entry_points_by_type.CONSTRUCTOR); + const abiHash = hashAbi(sierra); + const sierraProgram = (0, import_micro_starknet2.poseidonHashMany)(sierra.sierra_program.map((it) => BigInt(it))); + return toHex( + (0, import_micro_starknet2.poseidonHashMany)([ + compiledClassVersion, + externalEntryPointsHash, + l1Handlers, + constructor, + abiHash, + sierraProgram + ]) + ); +} +function computeContractClassHash(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + if ("sierra_program" in compiledContract) { + return computeSierraContractClassHash(compiledContract); + } + return computeLegacyContractClassHash(compiledContract); +} + +// src/utils/stark.ts +var stark_exports = {}; +__export(stark_exports, { + compressProgram: () => compressProgram, + decompressProgram: () => decompressProgram, + estimatedFeeToMaxFee: () => estimatedFeeToMaxFee, + formatSignature: () => formatSignature, + makeAddress: () => makeAddress, + randomAddress: () => randomAddress, + signatureToDecimalArray: () => signatureToDecimalArray, + signatureToHexArray: () => signatureToHexArray +}); +var import_micro_starknet3 = require("micro-starknet"); +var import_pako = require("pako"); +function compressProgram(jsonProgram) { + const stringified = typeof jsonProgram === "string" ? jsonProgram : stringify2(jsonProgram); + const compressedProgram = (0, import_pako.gzip)(stringified); + return btoaUniversal(compressedProgram); +} +function decompressProgram(base64) { + if (Array.isArray(base64)) + return base64; + const decompressed = arrayBufferToString((0, import_pako.ungzip)(atobUniversal(base64))); + return parse2(decompressed); +} +function randomAddress() { + const randomKeyPair = import_micro_starknet3.utils.randomPrivateKey(); + return (0, import_micro_starknet3.getStarkKey)(randomKeyPair); +} +function makeAddress(input) { + return addHexPrefix(input).toLowerCase(); +} +function formatSignature(sig) { + if (!sig) + throw Error("formatSignature: provided signature is undefined"); + if (Array.isArray(sig)) { + return sig.map((it) => toHex(it)); + } + try { + const { r, s } = sig; + return [toHex(r), toHex(s)]; + } catch (e) { + throw new Error("Signature need to be weierstrass.SignatureType or an array for custom"); + } +} +function signatureToDecimalArray(sig) { + return bigNumberishArrayToDecimalStringArray(formatSignature(sig)); +} +function signatureToHexArray(sig) { + return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig)); +} +function estimatedFeeToMaxFee(estimatedFee, overhead = 0.5) { + const overHeadPercent = Math.round((1 + overhead) * 100); + return toBigInt(estimatedFee) * toBigInt(overHeadPercent) / 100n; +} + +// src/utils/contract.ts +function isSierra(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + return "sierra_program" in compiledContract; +} +function extractContractHashes(payload) { + const response = { ...payload }; + if (isSierra(payload.contract)) { + if (!payload.compiledClassHash && payload.casm) { + response.compiledClassHash = computeCompiledClassHash(payload.casm); + } + if (!response.compiledClassHash) + throw new Error( + "Extract compiledClassHash failed, provide (CairoAssembly).casm file or compiledClassHash" + ); + } + response.classHash = payload.classHash ?? computeContractClassHash(payload.contract); + if (!response.classHash) + throw new Error("Extract classHash failed, provide (CompiledContract).json file or classHash"); + return response; +} +function contractClassResponseToLegacyCompiledContract(ccr) { + if (isSierra(ccr)) { + throw Error("ContractClassResponse need to be LegacyContractClass (cairo0 response class)"); + } + const contract = ccr; + return { ...contract, program: decompressProgram(contract.program) }; +} + +// src/utils/fetchPonyfill.ts +var import_isomorphic_fetch = __toESM(require("isomorphic-fetch")); +var fetchPonyfill_default = typeof window !== "undefined" && window.fetch || // use buildin fetch in browser if available +typeof global !== "undefined" && global.fetch || // use buildin fetch in node, react-native and service worker if available +import_isomorphic_fetch.default; + +// src/utils/provider.ts +var provider_exports = {}; +__export(provider_exports, { + createSierraContractClass: () => createSierraContractClass, + parseContract: () => parseContract, + wait: () => wait +}); +function wait(delay) { + return new Promise((res) => { + setTimeout(res, delay); + }); +} +function createSierraContractClass(contract) { + const result = { ...contract }; + delete result.sierra_program_debug_info; + result.abi = formatSpaces(stringify2(contract.abi)); + result.sierra_program = formatSpaces(stringify2(contract.sierra_program)); + result.sierra_program = compressProgram(result.sierra_program); + return result; +} +function parseContract(contract) { + const parsedContract = typeof contract === "string" ? parse2(contract) : contract; + if (!isSierra(contract)) { + return { + ...parsedContract, + ..."program" in parsedContract && { program: compressProgram(parsedContract.program) } + }; + } + return createSierraContractClass(parsedContract); +} + +// src/utils/responseParser/rpc.ts +var RPCResponseParser = class { + parseGetBlockResponse(res) { + return { + timestamp: res.timestamp, + block_hash: res.block_hash, + block_number: res.block_number, + new_root: res.new_root, + parent_hash: res.parent_hash, + status: res.status, + transactions: res.transactions + }; + } + parseGetTransactionResponse(res) { + return { + calldata: res.calldata || [], + contract_address: res.contract_address, + sender_address: res.contract_address, + max_fee: res.max_fee, + nonce: res.nonce, + signature: res.signature || [], + transaction_hash: res.transaction_hash, + version: res.version + }; + } + parseFeeEstimateResponse(res) { + return { + overall_fee: toBigInt(res[0].overall_fee), + gas_consumed: toBigInt(res[0].gas_consumed), + gas_price: toBigInt(res[0].gas_price) + }; + } + parseFeeEstimateBulkResponse(res) { + return res.map((val) => ({ + overall_fee: toBigInt(val.overall_fee), + gas_consumed: toBigInt(val.gas_consumed), + gas_price: toBigInt(val.gas_price) + })); + } + parseCallContractResponse(res) { + return { + result: res + }; + } + parseSimulateTransactionResponse(res) { + return res.map((it) => { + return { + ...it, + suggestedMaxFee: estimatedFeeToMaxFee(BigInt(it.fee_estimation.overall_fee)) + }; + }); + } + parseContractClassResponse(res) { + return { + ...res, + abi: typeof res.abi === "string" ? JSON.parse(res.abi) : res.abi + }; + } +}; + +// src/provider/errors.ts +function fixStack(target, fn = target.constructor) { + const { captureStackTrace } = Error; + captureStackTrace && captureStackTrace(target, fn); +} +function fixProto(target, prototype) { + const { setPrototypeOf } = Object; + setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype; +} +var CustomError = class extends Error { + constructor(message) { + super(message); + Object.defineProperty(this, "name", { + value: new.target.name, + enumerable: false, + configurable: true + }); + fixProto(this, new.target.prototype); + fixStack(this); + } +}; +var LibraryError = class extends CustomError { +}; +var GatewayError = class extends LibraryError { + constructor(message, errorCode) { + super(message); + this.errorCode = errorCode; + } +}; +var HttpError = class extends LibraryError { + constructor(message, errorCode) { + super(message); + this.errorCode = errorCode; + } +}; + +// src/utils/starknetId.ts +var starknetId_exports = {}; +__export(starknetId_exports, { + StarknetIdContract: () => StarknetIdContract, + getStarknetIdContract: () => getStarknetIdContract, + useDecoded: () => useDecoded, + useEncoded: () => useEncoded +}); +var basicAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789-"; +var basicSizePlusOne = BigInt(basicAlphabet.length + 1); +var bigAlphabet = "\u8FD9\u6765"; +var basicAlphabetSize = BigInt(basicAlphabet.length); +var bigAlphabetSize = BigInt(bigAlphabet.length); +var bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1); +function extractStars(str) { + let k = 0; + while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) { + str = str.substring(0, str.length - 1); + k += 1; + } + return [str, k]; +} +function useDecoded(encoded) { + let decoded = ""; + encoded.forEach((subdomain) => { + while (subdomain !== ZERO) { + const code = subdomain % basicSizePlusOne; + subdomain /= basicSizePlusOne; + if (code === BigInt(basicAlphabet.length)) { + const nextSubdomain = subdomain / bigAlphabetSizePlusOne; + if (nextSubdomain === ZERO) { + const code2 = subdomain % bigAlphabetSizePlusOne; + subdomain = nextSubdomain; + if (code2 === ZERO) + decoded += basicAlphabet[0]; + else + decoded += bigAlphabet[Number(code2) - 1]; + } else { + const code2 = subdomain % bigAlphabetSize; + decoded += bigAlphabet[Number(code2)]; + subdomain /= bigAlphabetSize; + } + } else + decoded += basicAlphabet[Number(code)]; + } + const [str, k] = extractStars(decoded); + if (k) + decoded = str + (k % 2 === 0 ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) + bigAlphabet[0] + basicAlphabet[1] : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1)); + decoded += "."; + }); + if (!decoded) { + return decoded; + } + return decoded.concat("stark"); +} +function useEncoded(decoded) { + let encoded = BigInt(0); + let multiplier = BigInt(1); + if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) { + const [str, k] = extractStars(decoded.substring(0, decoded.length - 2)); + decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1)); + } else { + const [str, k] = extractStars(decoded); + if (k) + decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1)); + } + for (let i = 0; i < decoded.length; i += 1) { + const char = decoded[i]; + const index = basicAlphabet.indexOf(char); + const bnIndex = BigInt(basicAlphabet.indexOf(char)); + if (index !== -1) { + if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) { + encoded += multiplier * basicAlphabetSize; + multiplier *= basicSizePlusOne; + multiplier *= basicSizePlusOne; + } else { + encoded += multiplier * bnIndex; + multiplier *= basicSizePlusOne; + } + } else if (bigAlphabet.indexOf(char) !== -1) { + encoded += multiplier * basicAlphabetSize; + multiplier *= basicSizePlusOne; + const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char); + encoded += multiplier * BigInt(newid); + multiplier *= bigAlphabetSize; + } + } + return encoded; +} +var StarknetIdContract = /* @__PURE__ */ ((StarknetIdContract2) => { + StarknetIdContract2["MAINNET"] = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678"; + StarknetIdContract2["TESTNET"] = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce"; + return StarknetIdContract2; +})(StarknetIdContract || {}); +function getStarknetIdContract(chainId) { + switch (chainId) { + case "0x534e5f4d41494e" /* SN_MAIN */: + return "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678" /* MAINNET */; + case "0x534e5f474f45524c49" /* SN_GOERLI */: + return "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce" /* TESTNET */; + default: + throw new Error("Starknet.id is not yet deployed on this network"); + } +} + +// src/provider/starknetId.ts +async function getStarkName(provider, address, StarknetIdContract2) { + const chainId = await provider.getChainId(); + const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId); + try { + const hexDomain = await provider.callContract({ + contractAddress: contract, + entrypoint: "address_to_domain", + calldata: CallData.compile({ + address + }) + }); + const decimalDomain = hexDomain.result.map((element) => BigInt(element)).slice(1); + const stringDomain = useDecoded(decimalDomain); + if (!stringDomain) { + throw Error("Starkname not found"); + } + return stringDomain; + } catch (e) { + if (e instanceof Error && e.message === "Starkname not found") { + throw e; + } + throw Error("Could not get stark name"); + } +} +async function getAddressFromStarkName(provider, name, StarknetIdContract2) { + const chainId = await provider.getChainId(); + const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId); + try { + const addressData = await provider.callContract({ + contractAddress: contract, + entrypoint: "domain_to_address", + calldata: CallData.compile({ + domain: [useEncoded(name.replace(".stark", "")).toString(10)] + }) + }); + return addressData.result[0]; + } catch { + throw Error("Could not get address from stark name"); + } +} + +// src/provider/utils.ts +var validBlockTags = Object.values(BlockTag); +var Block = class { + constructor(_identifier) { + this.hash = null; + this.number = null; + this.tag = null; + this.valueOf = () => this.number; + this.toString = () => this.hash; + this.setIdentifier(_identifier); + } + setIdentifier(__identifier) { + if (typeof __identifier === "string" && isHex(__identifier)) { + this.hash = __identifier; + } else if (typeof __identifier === "bigint") { + this.hash = toHex(__identifier); + } else if (typeof __identifier === "number") { + this.number = __identifier; + } else if (typeof __identifier === "string" && validBlockTags.includes(__identifier)) { + this.tag = __identifier; + } else { + this.tag = "pending" /* pending */; + } + } + // TODO: fix any + get queryIdentifier() { + if (this.number !== null) { + return `blockNumber=${this.number}`; + } + if (this.hash !== null) { + return `blockHash=${this.hash}`; + } + return `blockNumber=${this.tag}`; + } + // TODO: fix any + get identifier() { + if (this.number !== null) { + return { block_number: this.number }; + } + if (this.hash !== null) { + return { block_hash: this.hash }; + } + return this.tag; + } + set identifier(_identifier) { + this.setIdentifier(_identifier); + } + get sequencerIdentifier() { + return this.hash !== null ? { blockHash: this.hash } : { blockNumber: this.number ?? this.tag }; + } +}; + +// src/provider/rpc.ts +var defaultOptions = { + headers: { "Content-Type": "application/json" }, + blockIdentifier: "latest", + retries: 200 +}; +var RpcProvider = class { + constructor(optionsOrProvider) { + this.responseParser = new RPCResponseParser(); + const { nodeUrl, retries, headers, blockIdentifier, chainId } = optionsOrProvider; + this.nodeUrl = nodeUrl; + this.retries = retries || defaultOptions.retries; + this.headers = { ...defaultOptions.headers, ...headers }; + this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier; + this.chainId = chainId; + this.getChainId(); + } + fetch(method, params) { + const body = stringify2({ method, jsonrpc: "2.0", params, id: 0 }); + return fetchPonyfill_default(this.nodeUrl, { + method: "POST", + body, + headers: this.headers + }); + } + errorHandler(error) { + if (error) { + const { code, message } = error; + throw new LibraryError(`${code}: ${message}`); + } + } + async fetchEndpoint(method, params) { + try { + const rawResult = await this.fetch(method, params); + const { error, result } = await rawResult.json(); + this.errorHandler(error); + return result; + } catch (error) { + this.errorHandler(error?.response?.data); + throw error; + } + } + // Methods from Interface + async getChainId() { + this.chainId ?? (this.chainId = await this.fetchEndpoint("starknet_chainId")); + return this.chainId; + } + async getBlock(blockIdentifier = this.blockIdentifier) { + return this.getBlockWithTxHashes(blockIdentifier).then( + this.responseParser.parseGetBlockResponse + ); + } + async getBlockHashAndNumber() { + return this.fetchEndpoint("starknet_blockHashAndNumber"); + } + async getBlockWithTxHashes(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockWithTxHashes", { block_id }); + } + async getBlockWithTxs(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockWithTxs", { block_id }); + } + async getClassHashAt(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClassHashAt", { + block_id, + contract_address: contractAddress + }); + } + async getNonceForAddress(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getNonce", { + contract_address: contractAddress, + block_id + }); + } + async getPendingTransactions() { + return this.fetchEndpoint("starknet_pendingTransactions"); + } + async getProtocolVersion() { + throw new Error("Pathfinder does not implement this rpc 0.1.0 method"); + } + async getStateUpdate(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getStateUpdate", { block_id }); + } + async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) { + const parsedKey = toStorageKey(key); + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getStorageAt", { + contract_address: contractAddress, + key: parsedKey, + block_id + }); + } + // Methods from Interface + async getTransaction(txHash) { + return this.getTransactionByHash(txHash).then(this.responseParser.parseGetTransactionResponse); + } + async getTransactionByHash(txHash) { + return this.fetchEndpoint("starknet_getTransactionByHash", { transaction_hash: txHash }); + } + async getTransactionByBlockIdAndIndex(blockIdentifier, index) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex", { block_id, index }); + } + async getTransactionReceipt(txHash) { + return this.fetchEndpoint("starknet_getTransactionReceipt", { transaction_hash: txHash }); + } + async getClassByHash(classHash) { + return this.getClass(classHash); + } + async getClass(classHash, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClass", { + class_hash: classHash, + block_id + }).then(this.responseParser.parseContractClassResponse); + } + async getClassAt(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClassAt", { + block_id, + contract_address: contractAddress + }).then(this.responseParser.parseContractClassResponse); + } + async getCode(_contractAddress, _blockIdentifier) { + throw new Error("RPC does not implement getCode function"); + } + async getEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier) { + return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier); + } + async getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "INVOKE_FUNCTION" /* INVOKE */, + ...invocation, + ...invocationDetails + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getDeclareEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "DECLARE" /* DECLARE */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getDeployAccountEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getEstimateFeeBulk(invocations, { blockIdentifier = this.blockIdentifier, skipValidate = false }) { + if (skipValidate) { + console.warn("getEstimateFeeBulk RPC does not support skipValidate"); + } + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_estimateFee", { + request: invocations.map((it) => this.buildTransaction(it, "fee")), + block_id + }).then(this.responseParser.parseFeeEstimateBulkResponse); + } + async declareContract({ contract, signature, senderAddress, compiledClassHash }, details) { + if (!isSierra(contract)) { + return this.fetchEndpoint("starknet_addDeclareTransaction", { + declare_transaction: { + type: rpc_exports.TransactionType.DECLARE, + contract_class: { + program: contract.program, + entry_points_by_type: contract.entry_points_by_type, + abi: contract.abi + }, + version: toHex(transactionVersion), + max_fee: toHex(details.maxFee || 0), + signature: signatureToHexArray(signature), + sender_address: senderAddress, + nonce: toHex(details.nonce) + } + }); + } + return this.fetchEndpoint("starknet_addDeclareTransaction", { + declare_transaction: { + type: rpc_exports.TransactionType.DECLARE, + contract_class: { + sierra_program: decompressProgram(contract.sierra_program), + contract_class_version: contract.contract_class_version, + entry_points_by_type: contract.entry_points_by_type, + abi: contract.abi + }, + compiled_class_hash: compiledClassHash || "", + version: toHex(transactionVersion_2), + max_fee: toHex(details.maxFee || 0), + signature: signatureToHexArray(signature), + sender_address: senderAddress, + nonce: toHex(details.nonce) + } + }); + } + async deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }, details) { + return this.fetchEndpoint("starknet_addDeployAccountTransaction", { + deploy_account_transaction: { + constructor_calldata: CallData.toHex(constructorCalldata || []), + class_hash: toHex(classHash), + contract_address_salt: toHex(addressSalt || 0), + type: rpc_exports.TransactionType.DEPLOY_ACCOUNT, + max_fee: toHex(details.maxFee || 0), + version: toHex(details.version || 0), + signature: signatureToHexArray(signature), + nonce: toHex(details.nonce) + } + }); + } + async invokeFunction(functionInvocation, details) { + return this.fetchEndpoint("starknet_addInvokeTransaction", { + invoke_transaction: { + sender_address: functionInvocation.contractAddress, + calldata: CallData.toHex(functionInvocation.calldata), + type: rpc_exports.TransactionType.INVOKE, + max_fee: toHex(details.maxFee || 0), + version: "0x1", + signature: signatureToHexArray(functionInvocation.signature), + nonce: toHex(details.nonce) + } + }); + } + // Methods from Interface + async callContract(call, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const result = await this.fetchEndpoint("starknet_call", { + request: { + contract_address: call.contractAddress, + entry_point_selector: getSelectorFromName(call.entrypoint), + calldata: CallData.toHex(call.calldata) + }, + block_id + }); + return this.responseParser.parseCallContractResponse(result); + } + async traceTransaction(transactionHash) { + return this.fetchEndpoint("starknet_traceTransaction", { transaction_hash: transactionHash }); + } + async traceBlockTransactions(blockHash) { + return this.fetchEndpoint("starknet_traceBlockTransactions", { block_hash: blockHash }); + } + async waitForTransaction(txHash, options) { + const errorStates = ["REJECTED" /* REJECTED */, "NOT_RECEIVED" /* NOT_RECEIVED */]; + let { retries } = this; + let onchain = false; + let txReceipt = {}; + const retryInterval = options?.retryInterval ?? 8e3; + const successStates = options?.successStates ?? [ + "ACCEPTED_ON_L1" /* ACCEPTED_ON_L1 */, + "ACCEPTED_ON_L2" /* ACCEPTED_ON_L2 */ + ]; + while (!onchain) { + await wait(retryInterval); + try { + txReceipt = await this.getTransactionReceipt(txHash); + if (!("status" in txReceipt)) { + const error = new Error("transaction status"); + throw error; + } + if (txReceipt.status && successStates.includes(txReceipt.status)) { + onchain = true; + } else if (txReceipt.status && errorStates.includes(txReceipt.status)) { + const message = txReceipt.status; + const error = new Error(message); + error.response = txReceipt; + throw error; + } + } catch (error) { + if (error instanceof Error && errorStates.includes(error.message)) { + throw error; + } + if (retries === 0) { + throw new Error(`waitForTransaction timed-out with retries ${this.retries}`); + } + } + retries -= 1; + } + await wait(retryInterval); + return txReceipt; + } + /** + * Gets the transaction count from a block. + * + * + * @param blockIdentifier + * @returns Number of transactions + */ + async getTransactionCount(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockTransactionCount", { block_id }); + } + /** + * Gets the latest block number + * + * + * @returns Number of the latest block + */ + async getBlockNumber() { + return this.fetchEndpoint("starknet_blockNumber"); + } + /** + * Gets syncing status of the node + * + * + * @returns Object with the stats data + */ + async getSyncingStats() { + return this.fetchEndpoint("starknet_syncing"); + } + /** + * Gets all the events filtered + * + * + * @returns events and the pagination of the events + */ + async getEvents(eventFilter) { + return this.fetchEndpoint("starknet_getEvents", { filter: eventFilter }); + } + async getSimulateTransaction(invocations, { + blockIdentifier = this.blockIdentifier, + skipValidate = false, + skipExecute = false + }) { + const block_id = new Block(blockIdentifier).identifier; + const simulationFlags = []; + if (skipValidate) + simulationFlags.push(0 /* SKIP_VALIDATE */); + if (skipExecute) + simulationFlags.push(1 /* SKIP_EXECUTE */); + return this.fetchEndpoint("starknet_simulateTransaction", { + block_id, + transactions: invocations.map((it) => this.buildTransaction(it)), + // TODO: Pathfinder 0.5.6 bug, should be transaction + simulation_flags: simulationFlags + }).then(this.responseParser.parseSimulateTransactionResponse); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } + buildTransaction(invocation, versionType) { + const defaultVersions = getVersionsByType(versionType); + const details = { + signature: signatureToHexArray(invocation.signature), + nonce: toHex(invocation.nonce), + max_fee: toHex(invocation.maxFee || 0) + }; + if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) { + return { + type: rpc_exports.TransactionType.INVOKE, + // Diff between sequencer and rpc invoke type + sender_address: invocation.contractAddress, + calldata: CallData.toHex(invocation.calldata), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + if (invocation.type === rpc_exports.TransactionType.DECLARE) { + if (!isSierra(invocation.contract)) { + const legacyContract = invocation.contract; + return { + type: invocation.type, + contract_class: legacyContract, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + const sierraContract = invocation.contract; + return { + // compiled_class_hash + type: invocation.type, + contract_class: { + ...sierraContract, + sierra_program: decompressProgram(sierraContract.sierra_program) + }, + compiled_class_hash: invocation.compiledClassHash || "", + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v2), + ...details + }; + } + if (invocation.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + return { + type: invocation.type, + constructor_calldata: CallData.toHex(invocation.constructorCalldata || []), + class_hash: toHex(invocation.classHash), + contract_address_salt: toHex(invocation.addressSalt || 0), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + throw Error("RPC buildTransaction received unknown TransactionType"); + } +}; + +// src/provider/sequencer.ts +var import_url_join2 = __toESM(require("url-join")); + +// src/utils/responseParser/index.ts +var ResponseParser = class { +}; + +// src/utils/responseParser/sequencer.ts +var SequencerAPIResponseParser = class extends ResponseParser { + parseGetBlockResponse(res) { + return { + ...res, + new_root: res.state_root, + parent_hash: res.parent_block_hash, + transactions: Object.values(res.transactions).map((value) => "transaction_hash" in value && value.transaction_hash).filter(Boolean) + }; + } + parseGetTransactionResponse(res) { + return { + ...res, + calldata: "calldata" in res.transaction ? res.transaction.calldata : [], + contract_class: "contract_class" in res.transaction ? res.transaction.contract_class : void 0, + entry_point_selector: "entry_point_selector" in res.transaction ? res.transaction.entry_point_selector : void 0, + max_fee: "max_fee" in res.transaction ? res.transaction.max_fee : void 0, + nonce: res.transaction.nonce, + sender_address: "sender_address" in res.transaction ? res.transaction.sender_address : void 0, + signature: "signature" in res.transaction ? res.transaction.signature : void 0, + transaction_hash: "transaction_hash" in res.transaction ? res.transaction.transaction_hash : void 0, + version: "version" in res.transaction ? res.transaction.version : void 0 + }; + } + parseGetTransactionReceiptResponse(res) { + return { + transaction_hash: res.transaction_hash, + status: res.status, + messages_sent: res.l2_to_l1_messages, + // TODO: parse + events: res.events, + ..."block_hash" in res && { block_hash: res.block_hash }, + ..."block_number" in res && { block_number: res.block_number }, + ..."actual_fee" in res && { actual_fee: res.actual_fee }, + ..."transaction_index" in res && { transaction_index: res.transaction_index }, + ..."execution_resources" in res && { execution_resources: res.execution_resources }, + ..."l1_to_l2_consumed_message" in res && { + // eslint-disable-next-line @typescript-eslint/dot-notation + l1_to_l2_consumed_message: res["l1_to_l2_consumed_message"] + }, + ..."transaction_failure_reason" in res && { + transaction_failure_reason: res.transaction_failure_reason + } + }; + } + parseFeeEstimateResponse(res) { + if ("overall_fee" in res) { + let gasInfo = {}; + try { + gasInfo = { + gas_consumed: toBigInt(res.gas_usage), + gas_price: toBigInt(res.gas_price) + }; + } catch { + } + return { + overall_fee: toBigInt(res.overall_fee), + ...gasInfo + }; + } + return { + overall_fee: toBigInt(res.amount) + }; + } + parseFeeEstimateBulkResponse(res) { + return [].concat(res).map((item) => { + if ("overall_fee" in item) { + let gasInfo = {}; + try { + gasInfo = { + gas_consumed: toBigInt(item.gas_usage), + gas_price: toBigInt(item.gas_price) + }; + } catch { + } + return { + overall_fee: toBigInt(item.overall_fee), + ...gasInfo + }; + } + return { + overall_fee: toBigInt(item.amount) + }; + }); + } + parseSimulateTransactionResponse(res) { + const suggestedMaxFee = "overall_fee" in res.fee_estimation ? res.fee_estimation.overall_fee : res.fee_estimation.amount; + return [ + { + transaction_trace: res.trace, + fee_estimation: res.fee_estimation, + suggestedMaxFee: estimatedFeeToMaxFee(BigInt(suggestedMaxFee)) + } + ]; + } + parseCallContractResponse(res) { + return { + result: res.result + }; + } + parseInvokeFunctionResponse(res) { + return { + transaction_hash: res.transaction_hash + }; + } + parseDeployContractResponse(res) { + return { + transaction_hash: res.transaction_hash, + contract_address: res.address + }; + } + parseDeclareContractResponse(res) { + return { + transaction_hash: res.transaction_hash, + class_hash: res.class_hash + }; + } + parseGetStateUpdateResponse(res) { + const nonces = Object.entries(res.state_diff.nonces).map(([contract_address, nonce]) => ({ + contract_address, + nonce + })); + const storage_diffs = Object.entries(res.state_diff.storage_diffs).map( + ([address, storage_entries]) => ({ address, storage_entries }) + ); + return { + ...res, + state_diff: { + ...res.state_diff, + storage_diffs, + nonces + } + }; + } + parseContractClassResponse(res) { + const response = isSierra(res) ? res : parseContract(res); + return { + ...response, + abi: typeof response.abi === "string" ? JSON.parse(response.abi) : response.abi + }; + } +}; + +// src/utils/url.ts +var import_url_join = __toESM(require("url-join")); +var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/; +var localhostDomainRE = /^localhost[:?\d]*(?:[^:?\d]\S*)?$/; +var nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/; +function isUrl(s) { + if (!s) { + return false; + } + if (typeof s !== "string") { + return false; + } + const match = s.match(protocolAndDomainRE); + if (!match) { + return false; + } + const everythingAfterProtocol = match[1]; + if (!everythingAfterProtocol) { + return false; + } + if (localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol)) { + return true; + } + return false; +} +function buildUrl(baseUrl, defaultPath, urlOrPath) { + return isUrl(urlOrPath) ? urlOrPath : (0, import_url_join.default)(baseUrl, urlOrPath ?? defaultPath); +} + +// src/provider/sequencer.ts +function isEmptyQueryObject(obj) { + return obj === void 0 || Object.keys(obj).length === 0 || Object.keys(obj).length === 1 && Object.entries(obj).every(([k, v]) => k === "blockIdentifier" && v === null); +} +var defaultOptions2 = { + network: "SN_GOERLI2" /* SN_GOERLI2 */, + blockIdentifier: "pending" /* pending */ +}; +var SequencerProvider = class { + constructor(optionsOrProvider = defaultOptions2) { + this.responseParser = new SequencerAPIResponseParser(); + if ("network" in optionsOrProvider) { + this.baseUrl = SequencerProvider.getNetworkFromName(optionsOrProvider.network); + this.feederGatewayUrl = buildUrl(this.baseUrl, "feeder_gateway"); + this.gatewayUrl = buildUrl(this.baseUrl, "gateway"); + } else { + this.baseUrl = optionsOrProvider.baseUrl; + this.feederGatewayUrl = buildUrl( + this.baseUrl, + "feeder_gateway", + optionsOrProvider.feederGatewayUrl + ); + this.gatewayUrl = buildUrl(this.baseUrl, "gateway", optionsOrProvider.gatewayUrl); + } + this.chainId = optionsOrProvider?.chainId ?? SequencerProvider.getChainIdFromBaseUrl(this.baseUrl); + this.headers = optionsOrProvider.headers; + this.blockIdentifier = optionsOrProvider?.blockIdentifier || defaultOptions2.blockIdentifier; + } + static getNetworkFromName(name) { + switch (name) { + case ("SN_MAIN" /* SN_MAIN */ || "0x534e5f4d41494e" /* SN_MAIN */): + return "https://alpha-mainnet.starknet.io" /* SN_MAIN */; + case ("SN_GOERLI" /* SN_GOERLI */ || "0x534e5f474f45524c49" /* SN_GOERLI */): + return "https://alpha4.starknet.io" /* SN_GOERLI */; + case ("SN_GOERLI2" /* SN_GOERLI2 */ || "0x534e5f474f45524c4932" /* SN_GOERLI2 */): + return "https://alpha4-2.starknet.io" /* SN_GOERLI2 */; + default: + throw new Error("Could not detect base url from NetworkName"); + } + } + static getChainIdFromBaseUrl(baseUrl) { + try { + const url = new URL(baseUrl); + if (url.host.includes("mainnet.starknet.io")) { + return "0x534e5f4d41494e" /* SN_MAIN */; + } + if (url.host.includes("alpha4-2.starknet.io")) { + return "0x534e5f474f45524c4932" /* SN_GOERLI2 */; + } + return "0x534e5f474f45524c49" /* SN_GOERLI */; + } catch { + console.error(`Could not parse baseUrl: ${baseUrl}`); + return "0x534e5f474f45524c49" /* SN_GOERLI */; + } + } + getFetchUrl(endpoint) { + const gatewayUrlEndpoints = ["add_transaction"]; + return gatewayUrlEndpoints.includes(endpoint) ? this.gatewayUrl : this.feederGatewayUrl; + } + getFetchMethod(endpoint) { + const postMethodEndpoints = [ + "add_transaction", + "call_contract", + "estimate_fee", + "estimate_message_fee", + "estimate_fee_bulk", + "simulate_transaction" + ]; + return postMethodEndpoints.includes(endpoint) ? "POST" : "GET"; + } + getQueryString(query) { + if (isEmptyQueryObject(query)) { + return ""; + } + const queryString = Object.entries(query).map(([key, value]) => { + if (key === "blockIdentifier") { + const block = new Block(value); + return `${block.queryIdentifier}`; + } + return `${key}=${value}`; + }).join("&"); + return `?${queryString}`; + } + getHeaders(method) { + if (method === "POST") { + return { + "Content-Type": "application/json", + ...this.headers + }; + } + return this.headers; + } + // typesafe fetch + async fetchEndpoint(endpoint, ...[query, request]) { + const baseUrl = this.getFetchUrl(endpoint); + const method = this.getFetchMethod(endpoint); + const queryString = this.getQueryString(query); + const url = (0, import_url_join2.default)(baseUrl, endpoint, queryString); + return this.fetch(url, { + method, + body: request + }); + } + async fetch(endpoint, options) { + const url = buildUrl(this.baseUrl, "", endpoint); + const method = options?.method ?? "GET"; + const headers = this.getHeaders(method); + const body = stringify2(options?.body); + try { + const response = await fetchPonyfill_default(url, { + method, + body, + headers + }); + const textResponse = await response.text(); + if (!response.ok) { + let responseBody; + try { + responseBody = parse2(textResponse); + } catch { + throw new HttpError(response.statusText, response.status); + } + throw new GatewayError(responseBody.message, responseBody.code); + } + const parseChoice = options?.parseAlwaysAsBigInt ? parseAlwaysAsBig : parse2; + return parseChoice(textResponse); + } catch (error) { + if (error instanceof Error && !(error instanceof LibraryError)) + throw Error(`Could not ${method} from endpoint \`${url}\`: ${error.message}`); + throw error; + } + } + async getChainId() { + return Promise.resolve(this.chainId); + } + async callContract({ contractAddress, entrypoint: entryPointSelector, calldata = [] }, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint( + "call_contract", + { blockIdentifier }, + { + // TODO - determine best choice once both are fully supported in devnet + // signature: [], + // sender_address: contractAddress, + contract_address: contractAddress, + entry_point_selector: getSelectorFromName(entryPointSelector), + calldata: CallData.compile(calldata) + } + ).then(this.responseParser.parseCallContractResponse); + } + async getBlock(blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_block", { blockIdentifier }).then( + this.responseParser.parseGetBlockResponse + ); + } + async getNonceForAddress(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_nonce", { contractAddress, blockIdentifier }); + } + async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) { + const parsedKey = toBigInt(key).toString(10); + return this.fetchEndpoint("get_storage_at", { + blockIdentifier, + contractAddress, + key: parsedKey + }); + } + async getTransaction(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction", { transactionHash: txHashHex }).then((result) => { + if (Object.values(result).length === 1) + throw new LibraryError(result.status); + return this.responseParser.parseGetTransactionResponse(result); + }); + } + async getTransactionReceipt(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_receipt", { transactionHash: txHashHex }).then( + this.responseParser.parseGetTransactionReceiptResponse + ); + } + async getClassAt(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_full_contract", { blockIdentifier, contractAddress }).then( + this.responseParser.parseContractClassResponse + ); + } + async getClassHashAt(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_class_hash_at", { blockIdentifier, contractAddress }); + } + async getClassByHash(classHash, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_class_by_hash", { classHash, blockIdentifier }).then( + this.responseParser.parseContractClassResponse + ); + } + async getCompiledClassByClassHash(classHash, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_compiled_class_by_class_hash", { classHash, blockIdentifier }); + } + async invokeFunction(functionInvocation, details) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "INVOKE_FUNCTION" /* INVOKE */, + sender_address: functionInvocation.contractAddress, + calldata: CallData.compile(functionInvocation.calldata ?? []), + signature: signatureToDecimalArray(functionInvocation.signature), + nonce: toHex(details.nonce), + max_fee: toHex(details.maxFee || 0), + version: "0x1" + }).then(this.responseParser.parseInvokeFunctionResponse); + } + async deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }, details) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + contract_address_salt: addressSalt ?? randomAddress(), + constructor_calldata: CallData.compile(constructorCalldata ?? []), + class_hash: toHex(classHash), + max_fee: toHex(details.maxFee || 0), + version: toHex(details.version || 0), + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature) + }).then(this.responseParser.parseDeployContractResponse); + } + async declareContract({ senderAddress, contract, signature, compiledClassHash }, details) { + if (!isSierra(contract)) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "DECLARE" /* DECLARE */, + contract_class: contract, + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature), + sender_address: senderAddress, + max_fee: toHex(details.maxFee || 0), + version: toHex(transactionVersion) + }).then(this.responseParser.parseDeclareContractResponse); + } + return this.fetchEndpoint("add_transaction", void 0, { + type: "DECLARE" /* DECLARE */, + sender_address: senderAddress, + compiled_class_hash: compiledClassHash, + contract_class: contract, + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature), + max_fee: toHex(details.maxFee || 0), + version: toHex(transactionVersion_2) + }).then(this.responseParser.parseDeclareContractResponse); + } + async getEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier, skipValidate = false) { + return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier, skipValidate); + } + async getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "INVOKE_FUNCTION" /* INVOKE */, + ...invocation, + ...invocationDetails + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getDeclareEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "DECLARE" /* DECLARE */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getDeployAccountEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getEstimateFeeBulk(invocations, { blockIdentifier = this.blockIdentifier, skipValidate = false }) { + const transactions = invocations.map((it) => this.buildTransaction(it, "fee")); + return this.fetchEndpoint( + "estimate_fee_bulk", + { blockIdentifier, skipValidate }, + transactions + ).then(this.responseParser.parseFeeEstimateBulkResponse); + } + async getCode(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_code", { contractAddress, blockIdentifier }); + } + async waitForTransaction(txHash, options) { + const errorStates = ["REJECTED" /* REJECTED */, "NOT_RECEIVED" /* NOT_RECEIVED */]; + let onchain = false; + let res; + const retryInterval = options?.retryInterval ?? 8e3; + const successStates = options?.successStates ?? [ + "ACCEPTED_ON_L1" /* ACCEPTED_ON_L1 */, + "ACCEPTED_ON_L2" /* ACCEPTED_ON_L2 */ + ]; + while (!onchain) { + await wait(retryInterval); + res = await this.getTransactionStatus(txHash); + if (successStates.includes(res.tx_status)) { + onchain = true; + } else if (errorStates.includes(res.tx_status)) { + const message = res.tx_failure_reason ? `${res.tx_status}: ${res.tx_failure_reason.code} +${res.tx_failure_reason.error_message}` : res.tx_status; + const error = new Error(message); + error.response = res; + throw error; + } + } + const txReceipt = await this.getTransactionReceipt(txHash); + return txReceipt; + } + /** + * Gets the status of a transaction. + * @param txHash BigNumberish + * @returns GetTransactionStatusResponse - the transaction status object + */ + async getTransactionStatus(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_status", { transactionHash: txHashHex }); + } + /** + * Gets the smart contract address on the goerli testnet. + * @returns GetContractAddressesResponse - starknet smart contract addresses + */ + async getContractAddresses() { + return this.fetchEndpoint("get_contract_addresses"); + } + /** + * Gets the transaction trace from a tx id. + * @param txHash BigNumberish + * @returns TransactionTraceResponse - the transaction trace + */ + async getTransactionTrace(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_trace", { transactionHash: txHashHex }); + } + async estimateMessageFee({ from_address, to_address, entry_point_selector, payload }, blockIdentifier = this.blockIdentifier) { + const validCallL1Handler = { + from_address: getDecimalString(from_address), + to_address: getHexString(to_address), + entry_point_selector: getSelector(entry_point_selector), + payload: getHexStringArray(payload) + }; + return this.fetchEndpoint("estimate_message_fee", { blockIdentifier }, validCallL1Handler); + } + /** + * Simulate transaction using Sequencer provider + * WARNING!: Sequencer will process only first element from invocations array + * + * @param invocations Array of invocations, but only first invocation will be processed + * @param blockIdentifier block identifier, default 'latest' + * @param skipValidate Skip Account __validate__ method + * @returns + */ + async getSimulateTransaction(invocations, { + blockIdentifier = this.blockIdentifier, + skipValidate = false, + skipExecute = false + }) { + if (invocations.length > 1) { + console.warn("Sequencer simulate process only first element from invocations list"); + } + if (skipExecute) { + console.warn("Sequencer can't skip account __execute__"); + } + const transaction = this.buildTransaction(invocations[0]); + return this.fetchEndpoint( + "simulate_transaction", + { + blockIdentifier, + skipValidate: skipValidate ?? false + }, + transaction + ).then(this.responseParser.parseSimulateTransactionResponse); + } + async getStateUpdate(blockIdentifier = this.blockIdentifier) { + const args = new Block(blockIdentifier).sequencerIdentifier; + return this.fetchEndpoint("get_state_update", { ...args }).then( + this.responseParser.parseGetStateUpdateResponse + ); + } + // consider adding an optional trace retrieval parameter to the getBlock method + async getBlockTraces(blockIdentifier = this.blockIdentifier) { + const args = new Block(blockIdentifier).sequencerIdentifier; + return this.fetchEndpoint("get_block_traces", { ...args }); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } + /** + * Build Single AccountTransaction from Single AccountInvocation + * @param invocation AccountInvocationItem + * @param versionType 'fee' | 'transaction' - used to determine default versions + * @returns AccountTransactionItem + */ + buildTransaction(invocation, versionType) { + const defaultVersions = getVersionsByType(versionType); + const details = { + signature: signatureToDecimalArray(invocation.signature), + nonce: toHex(invocation.nonce) + }; + if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) { + return { + type: invocation.type, + sender_address: invocation.contractAddress, + calldata: CallData.compile(invocation.calldata ?? []), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + if (invocation.type === "DECLARE" /* DECLARE */) { + if (!isSierra(invocation.contract)) { + return { + type: invocation.type, + contract_class: invocation.contract, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v1), + // fee from getDeclareEstimateFee use t.v. instead of feet.v. + ...details + }; + } + return { + type: invocation.type, + contract_class: invocation.contract, + compiled_class_hash: invocation.compiledClassHash, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v2), + // fee on getDeclareEstimateFee use t.v. instead of feet.v. + ...details + }; + } + if (invocation.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + return { + type: invocation.type, + constructor_calldata: CallData.compile(invocation.constructorCalldata || []), + class_hash: toHex(invocation.classHash), + contract_address_salt: toHex(invocation.addressSalt || 0), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + throw Error("Sequencer buildTransaction received unknown TransactionType"); + } +}; + +// src/provider/default.ts +var Provider = class { + constructor(providerOrOptions) { + if (providerOrOptions instanceof Provider) { + this.provider = providerOrOptions.provider; + } else if (providerOrOptions instanceof RpcProvider || providerOrOptions instanceof SequencerProvider) { + this.provider = providerOrOptions; + } else if (providerOrOptions && "rpc" in providerOrOptions) { + this.provider = new RpcProvider(providerOrOptions.rpc); + } else if (providerOrOptions && "sequencer" in providerOrOptions) { + this.provider = new SequencerProvider(providerOrOptions.sequencer); + } else { + this.provider = new SequencerProvider(); + } + } + async getChainId() { + return this.provider.getChainId(); + } + async getBlock(blockIdentifier) { + return this.provider.getBlock(blockIdentifier); + } + async getClassAt(contractAddress, blockIdentifier) { + return this.provider.getClassAt(contractAddress, blockIdentifier); + } + async getClassHashAt(contractAddress, blockIdentifier) { + return this.provider.getClassHashAt(contractAddress, blockIdentifier); + } + getClassByHash(classHash) { + return this.provider.getClassByHash(classHash); + } + async getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier) { + return this.provider.getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier); + } + async getInvokeEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier, skipValidate) { + return this.provider.getInvokeEstimateFee( + invocationWithTxType, + invocationDetails, + blockIdentifier, + skipValidate + ); + } + async getEstimateFeeBulk(invocations, options) { + return this.provider.getEstimateFeeBulk(invocations, options); + } + async getNonceForAddress(contractAddress, blockIdentifier) { + return this.provider.getNonceForAddress(contractAddress, blockIdentifier); + } + async getStorageAt(contractAddress, key, blockIdentifier) { + return this.provider.getStorageAt(contractAddress, key, blockIdentifier); + } + async getTransaction(txHash) { + return this.provider.getTransaction(txHash); + } + async getTransactionReceipt(txHash) { + return this.provider.getTransactionReceipt(txHash); + } + async callContract(request, blockIdentifier) { + return this.provider.callContract(request, blockIdentifier); + } + async invokeFunction(functionInvocation, details) { + return this.provider.invokeFunction(functionInvocation, details); + } + async deployAccountContract(payload, details) { + return this.provider.deployAccountContract(payload, details); + } + async declareContract(transaction, details) { + return this.provider.declareContract(transaction, details); + } + async getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate) { + return this.provider.getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate); + } + getDeployAccountEstimateFee(transaction, details, blockIdentifier, skipValidate) { + return this.provider.getDeployAccountEstimateFee( + transaction, + details, + blockIdentifier, + skipValidate + ); + } + async getCode(contractAddress, blockIdentifier) { + return this.provider.getCode(contractAddress, blockIdentifier); + } + async waitForTransaction(txHash, options) { + return this.provider.waitForTransaction(txHash, options); + } + async getSimulateTransaction(invocations, options) { + return this.provider.getSimulateTransaction(invocations, options); + } + async getStateUpdate(blockIdentifier) { + return this.provider.getStateUpdate(blockIdentifier); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } +}; + +// src/signer/interface.ts +var SignerInterface = class { +}; + +// src/utils/transaction.ts +var transaction_exports = {}; +__export(transaction_exports, { + fromCallsToExecuteCalldata: () => fromCallsToExecuteCalldata, + fromCallsToExecuteCalldataWithNonce: () => fromCallsToExecuteCalldataWithNonce, + fromCallsToExecuteCalldata_cairo1: () => fromCallsToExecuteCalldata_cairo1, + getExecuteCalldata: () => getExecuteCalldata, + transformCallsToMulticallArrays: () => transformCallsToMulticallArrays, + transformCallsToMulticallArrays_cairo1: () => transformCallsToMulticallArrays_cairo1 +}); +var transformCallsToMulticallArrays = (calls) => { + const callArray = []; + const calldata = []; + calls.forEach((call) => { + const data = CallData.compile(call.calldata || []); + callArray.push({ + to: toBigInt(call.contractAddress).toString(10), + selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10), + data_offset: calldata.length.toString(), + data_len: data.length.toString() + }); + calldata.push(...data); + }); + return { + callArray, + calldata: CallData.compile({ calldata }) + }; +}; +var fromCallsToExecuteCalldata = (calls) => { + const { callArray, calldata } = transformCallsToMulticallArrays(calls); + const compiledCalls = CallData.compile({ callArray }); + return [...compiledCalls, ...calldata]; +}; +var fromCallsToExecuteCalldataWithNonce = (calls, nonce) => { + return [...fromCallsToExecuteCalldata(calls), toBigInt(nonce).toString()]; +}; +var transformCallsToMulticallArrays_cairo1 = (calls) => { + const callArray = calls.map((call) => ({ + to: toBigInt(call.contractAddress).toString(10), + selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10), + calldata: CallData.compile(call.calldata || []) + })); + return callArray; +}; +var fromCallsToExecuteCalldata_cairo1 = (calls) => { + const orderCalls = calls.map((call) => ({ + contractAddress: call.contractAddress, + entrypoint: call.entrypoint, + calldata: call.calldata + })); + return CallData.compile({ orderCalls }); +}; +var getExecuteCalldata = (calls, cairoVersion = "0") => { + if (cairoVersion === "1") { + return fromCallsToExecuteCalldata_cairo1(calls); + } + return fromCallsToExecuteCalldata(calls); +}; + +// src/utils/typedData.ts +var typedData_exports = {}; +__export(typedData_exports, { + encodeData: () => encodeData, + encodeType: () => encodeType, + encodeValue: () => encodeValue, + getDependencies: () => getDependencies, + getMessageHash: () => getMessageHash, + getStructHash: () => getStructHash, + getTypeHash: () => getTypeHash, + isMerkleTreeType: () => isMerkleTreeType, + prepareSelector: () => prepareSelector +}); + +// src/utils/merkle.ts +var merkle_exports = {}; +__export(merkle_exports, { + MerkleTree: () => MerkleTree, + proofMerklePath: () => proofMerklePath +}); +var MerkleTree = class { + constructor(leafHashes) { + this.branches = []; + this.leaves = leafHashes; + this.root = this.build(leafHashes); + } + build(leaves) { + if (leaves.length === 1) { + return leaves[0]; + } + if (leaves.length !== this.leaves.length) { + this.branches.push(leaves); + } + const newLeaves = []; + for (let i = 0; i < leaves.length; i += 2) { + if (i + 1 === leaves.length) { + newLeaves.push(MerkleTree.hash(leaves[i], "0x0")); + } else { + newLeaves.push(MerkleTree.hash(leaves[i], leaves[i + 1])); + } + } + return this.build(newLeaves); + } + static hash(a, b) { + const [aSorted, bSorted] = [toBigInt(a), toBigInt(b)].sort((x, y) => x >= y ? 1 : -1); + return starkCurve.pedersen(aSorted, bSorted); + } + getProof(leaf, branch = this.leaves, hashPath = []) { + const index = branch.indexOf(leaf); + if (index === -1) { + throw new Error("leaf not found"); + } + if (branch.length === 1) { + return hashPath; + } + const isLeft = index % 2 === 0; + const neededBranch = (isLeft ? branch[index + 1] : branch[index - 1]) ?? "0x0"; + const newHashPath = [...hashPath, neededBranch]; + const currentBranchLevelIndex = this.leaves.length === branch.length ? -1 : this.branches.findIndex((b) => b.length === branch.length); + const nextBranch = this.branches[currentBranchLevelIndex + 1] ?? [this.root]; + return this.getProof( + MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf), + nextBranch, + newHashPath + ); + } +}; +function proofMerklePath(root, leaf, path) { + if (path.length === 0) { + return root === leaf; + } + const [next, ...rest] = path; + return proofMerklePath(root, MerkleTree.hash(leaf, next), rest); +} + +// src/utils/typedData.ts +function getHex(value) { + try { + return toHex(value); + } catch (e) { + if (typeof value === "string") { + return toHex(encodeShortString(value)); + } + throw new Error(`Invalid BigNumberish: ${value}`); + } +} +var validateTypedData = (data) => { + const typedData = data; + const valid = Boolean(typedData.types && typedData.primaryType && typedData.message); + return valid; +}; +function prepareSelector(selector) { + return isHex(selector) ? selector : getSelectorFromName(selector); +} +function isMerkleTreeType(type) { + return type.type === "merkletree"; +} +var getDependencies = (types, type, dependencies = []) => { + if (type[type.length - 1] === "*") { + type = type.slice(0, -1); + } + if (dependencies.includes(type)) { + return dependencies; + } + if (!types[type]) { + return dependencies; + } + return [ + type, + ...types[type].reduce( + (previous, t) => [ + ...previous, + ...getDependencies(types, t.type, previous).filter( + (dependency) => !previous.includes(dependency) + ) + ], + [] + ) + ]; +}; +function getMerkleTreeType(types, ctx) { + if (ctx.parent && ctx.key) { + const parentType = types[ctx.parent]; + const merkleType = parentType.find((t) => t.name === ctx.key); + const isMerkleTree = isMerkleTreeType(merkleType); + if (!isMerkleTree) { + throw new Error(`${ctx.key} is not a merkle tree`); + } + if (merkleType.contains.endsWith("*")) { + throw new Error(`Merkle tree contain property must not be an array but was given ${ctx.key}`); + } + return merkleType.contains; + } + return "raw"; +} +var encodeType = (types, type) => { + const [primary, ...dependencies] = getDependencies(types, type); + const newTypes = !primary ? [] : [primary, ...dependencies.sort()]; + return newTypes.map((dependency) => { + return `${dependency}(${types[dependency].map((t) => `${t.name}:${t.type}`)})`; + }).join(""); +}; +var getTypeHash = (types, type) => { + return getSelectorFromName(encodeType(types, type)); +}; +var encodeValue = (types, type, data, ctx = {}) => { + if (types[type]) { + return [type, getStructHash(types, type, data)]; + } + if (Object.keys(types).map((x) => `${x}*`).includes(type)) { + const structHashes = data.map((struct) => { + return getStructHash(types, type.slice(0, -1), struct); + }); + return [type, computeHashOnElements(structHashes)]; + } + if (type === "merkletree") { + const merkleTreeType = getMerkleTreeType(types, ctx); + const structHashes = data.map((struct) => { + return encodeValue(types, merkleTreeType, struct)[1]; + }); + const { root } = new MerkleTree(structHashes); + return ["felt", root]; + } + if (type === "felt*") { + return ["felt*", computeHashOnElements(data)]; + } + if (type === "selector") { + return ["felt", prepareSelector(data)]; + } + return [type, getHex(data)]; +}; +var encodeData = (types, type, data) => { + const [returnTypes, values] = types[type].reduce( + ([ts, vs], field) => { + if (data[field.name] === void 0 || data[field.name] === null) { + throw new Error(`Cannot encode data: missing data for '${field.name}'`); + } + const value = data[field.name]; + const [t, encodedValue] = encodeValue(types, field.type, value, { + parent: type, + key: field.name + }); + return [ + [...ts, t], + [...vs, encodedValue] + ]; + }, + [["felt"], [getTypeHash(types, type)]] + ); + return [returnTypes, values]; +}; +var getStructHash = (types, type, data) => { + return computeHashOnElements(encodeData(types, type, data)[1]); +}; +var getMessageHash = (typedData, account) => { + if (!validateTypedData(typedData)) { + throw new Error("Typed data does not match JSON schema"); + } + const message = [ + encodeShortString("StarkNet Message"), + getStructHash(typedData.types, "StarkNetDomain", typedData.domain), + account, + getStructHash(typedData.types, typedData.primaryType, typedData.message) + ]; + return computeHashOnElements(message); +}; + +// src/signer/default.ts +var Signer = class { + constructor(pk = starkCurve.utils.randomPrivateKey()) { + this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk); + } + async getPubKey() { + return starkCurve.getStarkKey(this.pk); + } + async signMessage(typedData, accountAddress) { + const msgHash = getMessageHash(typedData, accountAddress); + return starkCurve.sign(msgHash, this.pk); + } + async signTransaction(transactions, transactionsDetail, abis) { + if (abis && abis.length !== transactions.length) { + throw new Error("ABI must be provided for each transaction or no transaction"); + } + const calldata = getExecuteCalldata(transactions, transactionsDetail.cairoVersion); + const msgHash = calculateTransactionHash( + transactionsDetail.walletAddress, + transactionsDetail.version, + calldata, + transactionsDetail.maxFee, + transactionsDetail.chainId, + transactionsDetail.nonce + ); + return starkCurve.sign(msgHash, this.pk); + } + async signDeployAccountTransaction({ + classHash, + contractAddress, + constructorCalldata, + addressSalt, + maxFee, + version, + chainId, + nonce + }) { + const msgHash = calculateDeployAccountTransactionHash( + contractAddress, + classHash, + CallData.compile(constructorCalldata), + addressSalt, + version, + maxFee, + chainId, + nonce + ); + return starkCurve.sign(msgHash, this.pk); + } + async signDeclareTransaction({ + classHash, + senderAddress, + chainId, + maxFee, + version, + nonce, + compiledClassHash + }) { + const msgHash = calculateDeclareTransactionHash( + classHash, + senderAddress, + version, + maxFee, + chainId, + nonce, + compiledClassHash + ); + return starkCurve.sign(msgHash, this.pk); + } +}; + +// src/utils/events.ts +function parseUDCEvent(txReceipt) { + if (!txReceipt.events) { + throw new Error("UDC emited event is empty"); + } + const event = txReceipt.events.find( + (it) => cleanHex(it.from_address) === cleanHex(UDC.ADDRESS) + ) || { + data: [] + }; + return { + transaction_hash: txReceipt.transaction_hash, + contract_address: event.data[0], + address: event.data[0], + deployer: event.data[1], + unique: event.data[2], + classHash: event.data[3], + calldata_len: event.data[4], + calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)), + salt: event.data[event.data.length - 1] + }; +} + +// src/account/default.ts +var Account = class extends Provider { + constructor(providerOrOptions, address, pkOrSigner, cairoVersion = "0") { + super(providerOrOptions); + this.deploySelf = this.deployAccount; + this.address = address.toLowerCase(); + this.signer = typeof pkOrSigner === "string" || pkOrSigner instanceof Uint8Array ? new Signer(pkOrSigner) : pkOrSigner; + this.cairoVersion = cairoVersion; + } + async getNonce(blockIdentifier) { + return super.getNonceForAddress(this.address, blockIdentifier); + } + async getNonceSafe(nonce) { + try { + return toBigInt(nonce ?? await this.getNonce()); + } catch (error) { + return 0n; + } + } + async estimateFee(calls, estimateFeeDetails) { + return this.estimateInvokeFee(calls, estimateFeeDetails); + } + async estimateInvokeFee(calls, { nonce: providedNonce, blockIdentifier, skipValidate } = {}) { + const transactions = Array.isArray(calls) ? calls : [calls]; + const nonce = toBigInt(providedNonce ?? await this.getNonce()); + const version = toBigInt(feeTransactionVersion); + const chainId = await this.getChainId(); + const signerDetails = { + walletAddress: this.address, + nonce, + maxFee: ZERO, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const invocation = await this.buildInvocation(transactions, signerDetails); + const response = await super.getInvokeEstimateFee( + { ...invocation }, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateDeclareFee({ contract, classHash: providedClassHash, casm, compiledClassHash }, { blockIdentifier, nonce: providedNonce, skipValidate } = {}) { + const nonce = toBigInt(providedNonce ?? await this.getNonce()); + const version = !isSierra(contract) ? feeTransactionVersion : feeTransactionVersion_2; + const chainId = await this.getChainId(); + const declareContractTransaction = await this.buildDeclarePayload( + { classHash: providedClassHash, contract, casm, compiledClassHash }, + { + nonce, + chainId, + version, + walletAddress: this.address, + maxFee: ZERO, + cairoVersion: this.cairoVersion + } + ); + const response = await super.getDeclareEstimateFee( + declareContractTransaction, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateAccountDeployFee({ + classHash, + addressSalt = 0, + constructorCalldata = [], + contractAddress: providedContractAddress + }, { blockIdentifier, skipValidate } = {}) { + const version = toBigInt(feeTransactionVersion); + const nonce = ZERO; + const chainId = await this.getChainId(); + const payload = await this.buildAccountDeployPayload( + { classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress }, + { + nonce, + chainId, + version, + walletAddress: this.address, + maxFee: ZERO, + cairoVersion: this.cairoVersion + } + ); + const response = await super.getDeployAccountEstimateFee( + { ...payload }, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateDeployFee(payload, transactionsDetail) { + const calls = this.buildUDCContractPayload(payload); + return this.estimateInvokeFee(calls, transactionsDetail); + } + async estimateFeeBulk(invocations, { nonce, blockIdentifier, skipValidate } = {}) { + const accountInvocations = await this.accountInvocationsFactory(invocations, { + versions: [feeTransactionVersion, feeTransactionVersion_2], + nonce, + blockIdentifier + }); + const response = await super.getEstimateFeeBulk(accountInvocations, { + blockIdentifier, + skipValidate + }); + return [].concat(response).map((elem) => { + const suggestedMaxFee = estimatedFeeToMaxFee(elem.overall_fee); + return { + ...elem, + suggestedMaxFee + }; + }); + } + async buildInvocation(call, signerDetails) { + const calldata = getExecuteCalldata(call, this.cairoVersion); + const signature = await this.signer.signTransaction(call, signerDetails); + return { + contractAddress: this.address, + calldata, + signature + }; + } + async execute(calls, abis = void 0, transactionsDetail = {}) { + const transactions = Array.isArray(calls) ? calls : [calls]; + const nonce = toBigInt(transactionsDetail.nonce ?? await this.getNonce()); + const maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { type: "INVOKE_FUNCTION" /* INVOKE */, payload: calls }, + transactionsDetail + ); + const version = toBigInt(transactionVersion); + const chainId = await this.getChainId(); + const signerDetails = { + walletAddress: this.address, + nonce, + maxFee, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const signature = await this.signer.signTransaction(transactions, signerDetails, abis); + const calldata = getExecuteCalldata(transactions, this.cairoVersion); + return this.invokeFunction( + { contractAddress: this.address, calldata, signature }, + { + nonce, + maxFee, + version + } + ); + } + /** + * First check if contract is already declared, if not declare it + * If contract already declared returned transaction_hash is ''. + * Method will pass even if contract is already declared + * @param payload DeclareContractPayload + * @param transactionsDetail (optional) InvocationsDetails = \{\} + * @returns DeclareContractResponse + */ + async declareIfNot(payload, transactionsDetail = {}) { + const declareContractPayload = extractContractHashes(payload); + try { + await this.getClassByHash(declareContractPayload.classHash); + } catch (error) { + return this.declare(payload, transactionsDetail); + } + return { + transaction_hash: "", + class_hash: declareContractPayload.classHash + }; + } + async declare(payload, transactionsDetail = {}) { + const declareContractPayload = extractContractHashes(payload); + const details = {}; + details.nonce = toBigInt(transactionsDetail.nonce ?? await this.getNonce()); + details.maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { + type: "DECLARE" /* DECLARE */, + payload: declareContractPayload + }, + transactionsDetail + ); + details.version = !isSierra(payload.contract) ? transactionVersion : transactionVersion_2; + details.chainId = await this.getChainId(); + const declareContractTransaction = await this.buildDeclarePayload(declareContractPayload, { + ...details, + walletAddress: this.address, + cairoVersion: this.cairoVersion + }); + return this.declareContract(declareContractTransaction, details); + } + async deploy(payload, details) { + const params = [].concat(payload).map((it) => { + const { + classHash, + salt, + unique = true, + constructorCalldata = [] + } = it; + const compiledConstructorCallData = CallData.compile(constructorCalldata); + const deploySalt = salt ?? randomAddress(); + return { + call: { + contractAddress: UDC.ADDRESS, + entrypoint: UDC.ENTRYPOINT, + calldata: [ + classHash, + deploySalt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData + ] + }, + address: calculateContractAddressFromHash( + unique ? starkCurve.pedersen(this.address, deploySalt) : deploySalt, + classHash, + compiledConstructorCallData, + unique ? UDC.ADDRESS : 0 + ) + }; + }); + const calls = params.map((it) => it.call); + const addresses = params.map((it) => it.address); + const invokeResponse = await this.execute(calls, void 0, details); + return { + ...invokeResponse, + contract_address: addresses + }; + } + async deployContract(payload, details) { + const deployTx = await this.deploy(payload, details); + const txReceipt = await this.waitForTransaction(deployTx.transaction_hash); + return parseUDCEvent(txReceipt); + } + async declareAndDeploy(payload, details) { + const { constructorCalldata, salt, unique } = payload; + let declare = await this.declareIfNot(payload, details); + if (declare.transaction_hash !== "") { + const tx = await this.waitForTransaction(declare.transaction_hash); + declare = { ...declare, ...tx }; + } + const deploy = await this.deployContract( + { classHash: declare.class_hash, salt, unique, constructorCalldata }, + details + ); + return { declare: { ...declare }, deploy }; + } + async deployAccount({ + classHash, + constructorCalldata = [], + addressSalt = 0, + contractAddress: providedContractAddress + }, transactionsDetail = {}) { + const version = toBigInt(transactionVersion); + const nonce = ZERO; + const chainId = await this.getChainId(); + const compiledCalldata = CallData.compile(constructorCalldata); + const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0); + const maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + payload: { + classHash, + constructorCalldata: compiledCalldata, + addressSalt, + contractAddress + } + }, + transactionsDetail + ); + const signature = await this.signer.signDeployAccountTransaction({ + classHash, + constructorCalldata: compiledCalldata, + contractAddress, + addressSalt, + chainId, + maxFee, + version, + nonce + }); + return this.deployAccountContract( + { classHash, addressSalt, constructorCalldata, signature }, + { + nonce, + maxFee, + version + } + ); + } + async signMessage(typedData) { + return this.signer.signMessage(typedData, this.address); + } + async hashMessage(typedData) { + return getMessageHash(typedData, this.address); + } + async verifyMessageHash(hash, signature) { + try { + await this.callContract({ + contractAddress: this.address, + entrypoint: "isValidSignature", + calldata: CallData.compile({ + hash: toBigInt(hash).toString(), + signature: formatSignature(signature) + }) + }); + return true; + } catch { + return false; + } + } + async verifyMessage(typedData, signature) { + const hash = await this.hashMessage(typedData); + return this.verifyMessageHash(hash, signature); + } + async getSuggestedMaxFee({ type, payload }, details) { + let feeEstimate; + switch (type) { + case "INVOKE_FUNCTION" /* INVOKE */: + feeEstimate = await this.estimateInvokeFee(payload, details); + break; + case "DECLARE" /* DECLARE */: + feeEstimate = await this.estimateDeclareFee(payload, details); + break; + case "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */: + feeEstimate = await this.estimateAccountDeployFee(payload, details); + break; + case "DEPLOY" /* DEPLOY */: + feeEstimate = await this.estimateDeployFee(payload, details); + break; + default: + feeEstimate = { suggestedMaxFee: ZERO, overall_fee: ZERO }; + break; + } + return feeEstimate.suggestedMaxFee; + } + /** + * will be renamed to buildDeclareContractTransaction + */ + async buildDeclarePayload(payload, { nonce, chainId, version, walletAddress, maxFee }) { + const { classHash, contract, compiledClassHash } = extractContractHashes(payload); + const compressedCompiledContract = parseContract(contract); + const signature = await this.signer.signDeclareTransaction({ + classHash, + compiledClassHash, + senderAddress: walletAddress, + chainId, + maxFee, + version, + nonce + }); + return { + senderAddress: walletAddress, + signature, + contract: compressedCompiledContract, + compiledClassHash + }; + } + async buildAccountDeployPayload({ + classHash, + addressSalt = 0, + constructorCalldata = [], + contractAddress: providedContractAddress + }, { nonce, chainId, version, maxFee }) { + const compiledCalldata = CallData.compile(constructorCalldata); + const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0); + const signature = await this.signer.signDeployAccountTransaction({ + classHash, + contractAddress, + chainId, + maxFee, + version, + nonce, + addressSalt, + constructorCalldata: compiledCalldata + }); + return { + classHash, + addressSalt, + constructorCalldata: compiledCalldata, + signature + }; + } + buildUDCContractPayload(payload) { + const calls = [].concat(payload).map((it) => { + const { + classHash, + salt = "0", + unique = true, + constructorCalldata = [] + } = it; + const compiledConstructorCallData = CallData.compile(constructorCalldata); + return { + contractAddress: UDC.ADDRESS, + entrypoint: UDC.ENTRYPOINT, + calldata: [ + classHash, + salt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData + ] + }; + }); + return calls; + } + async simulateTransaction(invocations, { nonce, blockIdentifier, skipValidate, skipExecute } = {}) { + const accountInvocations = await this.accountInvocationsFactory(invocations, { + versions: [transactionVersion, transactionVersion_2], + nonce, + blockIdentifier + }); + return super.getSimulateTransaction(accountInvocations, { + blockIdentifier, + skipValidate, + skipExecute + }); + } + async accountInvocationsFactory(invocations, { versions, nonce, blockIdentifier }) { + const version = versions[0]; + const safeNonce = await this.getNonceSafe(nonce); + const chainId = await this.getChainId(); + return Promise.all( + [].concat(invocations).map(async (transaction, index) => { + const signerDetails = { + walletAddress: this.address, + nonce: toBigInt(Number(safeNonce) + index), + maxFee: ZERO, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const txPayload = "payload" in transaction ? transaction.payload : transaction; + const common = { + type: transaction.type, + version, + nonce: toBigInt(Number(safeNonce) + index), + blockIdentifier + }; + if (transaction.type === "INVOKE_FUNCTION" /* INVOKE */) { + const payload = await this.buildInvocation( + [].concat(txPayload), + signerDetails + ); + return { + ...common, + ...payload + }; + } + if (transaction.type === "DECLARE" /* DECLARE */) { + signerDetails.version = !isSierra(txPayload.contract) ? toBigInt(versions[0]) : toBigInt(versions[1]); + const payload = await this.buildDeclarePayload(txPayload, signerDetails); + return { + ...common, + ...payload, + version: signerDetails.version + }; + } + if (transaction.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + const payload = await this.buildAccountDeployPayload(txPayload, signerDetails); + return { + ...common, + ...payload + }; + } + if (transaction.type === "DEPLOY" /* DEPLOY */) { + const calls = this.buildUDCContractPayload(txPayload); + const payload = await this.buildInvocation(calls, signerDetails); + return { + ...common, + ...payload, + type: "INVOKE_FUNCTION" /* INVOKE */ + }; + } + throw Error(`accountInvocationsFactory: unsupported transaction type: ${transaction}`); + }) + ); + } + async getStarkName(address = this.address, StarknetIdContract2) { + return super.getStarkName(address, StarknetIdContract2); + } +}; + +// src/provider/interface.ts +var ProviderInterface = class { +}; + +// src/provider/index.ts +var defaultProvider = new Provider(); + +// src/account/interface.ts +var AccountInterface = class extends ProviderInterface { +}; + +// src/contract/default.ts +var splitArgsAndOptions = (args) => { + const options = [ + "blockIdentifier", + "parseRequest", + "parseResponse", + "formatResponse", + "maxFee", + "nonce", + "signature", + "addressSalt" + ]; + const lastArg = args[args.length - 1]; + if (typeof lastArg === "object" && options.some((x) => x in lastArg)) { + return { args, options: args.pop() }; + } + return { args }; +}; +function buildCall(contract, functionAbi) { + return async function(...args) { + const params = splitArgsAndOptions(args); + return contract.call(functionAbi.name, params.args, { + parseRequest: true, + parseResponse: true, + ...params.options + }); + }; +} +function buildInvoke(contract, functionAbi) { + return async function(...args) { + const params = splitArgsAndOptions(args); + return contract.invoke(functionAbi.name, params.args, { + parseRequest: true, + ...params.options + }); + }; +} +function buildDefault(contract, functionAbi) { + if (functionAbi.stateMutability === "view" || functionAbi.state_mutability === "view") { + return buildCall(contract, functionAbi); + } + return buildInvoke(contract, functionAbi); +} +function buildPopulate(contract, functionAbi) { + return function(...args) { + return contract.populate(functionAbi.name, args); + }; +} +function buildEstimate(contract, functionAbi) { + return function(...args) { + return contract.estimate(functionAbi.name, args); + }; +} +function getCalldata(args, callback) { + if (Array.isArray(args) && "__compiled__" in args) + return args; + if (Array.isArray(args) && Array.isArray(args[0]) && "__compiled__" in args[0]) + return args[0]; + return callback(); +} +var Contract = class { + /** + * Contract class to handle contract methods + * + * @param abi - Abi of the contract object + * @param address (optional) - address to connect to + * @param providerOrAccount (optional) - Provider or Account to attach to + */ + constructor(abi, address, providerOrAccount = defaultProvider) { + this.address = address && address.toLowerCase(); + this.providerOrAccount = providerOrAccount; + this.callData = new CallData(abi); + this.structs = CallData.getAbiStruct(abi); + const parser = createAbiParser(abi); + this.abi = parser.getLegacyFormat(); + const options = { enumerable: true, value: {}, writable: false }; + Object.defineProperties(this, { + functions: { enumerable: true, value: {}, writable: false }, + callStatic: { enumerable: true, value: {}, writable: false }, + populateTransaction: { enumerable: true, value: {}, writable: false }, + estimateFee: { enumerable: true, value: {}, writable: false } + }); + this.abi.forEach((abiElement) => { + if (abiElement.type !== "function") + return; + const signature = abiElement.name; + if (!this[signature]) { + Object.defineProperty(this, signature, { + ...options, + value: buildDefault(this, abiElement) + }); + } + if (!this.functions[signature]) { + Object.defineProperty(this.functions, signature, { + ...options, + value: buildDefault(this, abiElement) + }); + } + if (!this.callStatic[signature]) { + Object.defineProperty(this.callStatic, signature, { + ...options, + value: buildCall(this, abiElement) + }); + } + if (!this.populateTransaction[signature]) { + Object.defineProperty(this.populateTransaction, signature, { + ...options, + value: buildPopulate(this, abiElement) + }); + } + if (!this.estimateFee[signature]) { + Object.defineProperty(this.estimateFee, signature, { + ...options, + value: buildEstimate(this, abiElement) + }); + } + }); + } + attach(address) { + this.address = address; + } + connect(providerOrAccount) { + this.providerOrAccount = providerOrAccount; + } + async deployed() { + if (this.deployTransactionHash) { + await this.providerOrAccount.waitForTransaction(this.deployTransactionHash); + this.deployTransactionHash = void 0; + } + return this; + } + async call(method, args = [], { + parseRequest = true, + parseResponse = true, + formatResponse = void 0, + blockIdentifier = void 0 + } = {}) { + assert(this.address !== null, "contract is not connected to an address"); + const calldata = getCalldata(args, () => { + if (parseRequest) { + this.callData.validate("CALL" /* CALL */, method, args); + return this.callData.compile(method, args); + } + console.warn("Call skipped parsing but provided rawArgs, possible malfunction request"); + return args; + }); + return this.providerOrAccount.callContract( + { + contractAddress: this.address, + calldata, + entrypoint: method + }, + blockIdentifier + ).then((x) => { + if (!parseResponse) { + return x.result; + } + if (formatResponse) { + return this.callData.format(method, x.result, formatResponse); + } + return this.callData.parse(method, x.result); + }); + } + invoke(method, args = [], { parseRequest = true, maxFee, nonce, signature } = {}) { + assert(this.address !== null, "contract is not connected to an address"); + const calldata = getCalldata(args, () => { + if (parseRequest) { + this.callData.validate("INVOKE" /* INVOKE */, method, args); + return this.callData.compile(method, args); + } + console.warn("Invoke skipped parsing but provided rawArgs, possible malfunction request"); + return args; + }); + const invocation = { + contractAddress: this.address, + calldata, + entrypoint: method + }; + if ("execute" in this.providerOrAccount) { + return this.providerOrAccount.execute(invocation, void 0, { + maxFee, + nonce + }); + } + if (!nonce) + throw new Error(`Nonce is required when invoking a function without an account`); + console.warn(`Invoking ${method} without an account. This will not work on a public node.`); + return this.providerOrAccount.invokeFunction( + { + ...invocation, + signature + }, + { + nonce + } + ); + } + async estimate(method, args = []) { + assert(this.address !== null, "contract is not connected to an address"); + if (!getCalldata(args, () => false)) { + this.callData.validate("INVOKE" /* INVOKE */, method, args); + } + const invocation = this.populate(method, args); + if ("estimateInvokeFee" in this.providerOrAccount) { + return this.providerOrAccount.estimateInvokeFee(invocation); + } + throw Error("Contract must be connected to the account contract to estimate"); + } + populate(method, args = []) { + const calldata = getCalldata(args, () => this.callData.compile(method, args)); + return { + contractAddress: this.address, + entrypoint: method, + calldata + }; + } + isCairo1() { + return cairo_exports.isCairo1Abi(this.abi); + } +}; + +// src/contract/interface.ts +var ContractInterface = class { +}; + +// src/contract/contractFactory.ts +var ContractFactory = class { + /** + * @param params CFParams + * - compiledContract: CompiledContract; + * - account: AccountInterface; + * - casm?: CairoAssembly; + * - classHash?: string; + * - compiledClassHash?: string; + * - abi?: Abi; + */ + constructor(params) { + this.compiledContract = params.compiledContract; + this.account = params.account; + this.casm = params.casm; + this.abi = params.abi ?? params.compiledContract.abi; + this.classHash = params.classHash; + this.compiledClassHash = params.compiledClassHash; + this.CallData = new CallData(this.abi); + } + /** + * Deploys contract and returns new instance of the Contract + * If contract is not declared it will first declare it, and then deploy + * + * @param args - Array of the constructor arguments for deployment + * @param options (optional) Object - parseRequest, parseResponse, addressSalt + * @returns deployed Contract + */ + async deploy(...args) { + const { args: param, options = { parseRequest: true } } = splitArgsAndOptions(args); + const constructorCalldata = getCalldata(param, () => { + if (options.parseRequest) { + this.CallData.validate("DEPLOY" /* DEPLOY */, "constructor", param); + return this.CallData.compile("constructor", param); + } + console.warn("Call skipped parsing but provided rawArgs, possible malfunction request"); + return param; + }); + const { + deploy: { contract_address, transaction_hash } + } = await this.account.declareAndDeploy({ + contract: this.compiledContract, + casm: this.casm, + classHash: this.classHash, + compiledClassHash: this.compiledClassHash, + constructorCalldata, + salt: options.addressSalt + }); + assert(Boolean(contract_address), "Deployment of the contract failed"); + const contractInstance = new Contract( + this.compiledContract.abi, + contract_address, + this.account + ); + contractInstance.deployTransactionHash = transaction_hash; + return contractInstance; + } + /** + * Attaches to new Account + * + * @param account - new Provider or Account to attach to + * @returns ContractFactory + */ + connect(account) { + this.account = account; + return this; + } + /** + * Attaches current abi and account to the new address + * + * @param address - Contract address + * @returns Contract + */ + attach(address) { + return new Contract(this.abi, address, this.account); + } + // ethers.js' getDeployTransaction cant be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation +}; + +// src/utils/address.ts +var import_utils4 = require("@noble/curves/abstract/utils"); +function addAddressPadding(address) { + return addHexPrefix(removeHexPrefix(toHex(address)).padStart(64, "0")); +} +function validateAndParseAddress(address) { + assertInRange(address, ZERO, MASK_251, "Starknet Address"); + const result = addAddressPadding(address); + if (!result.match(/^(0x)?[0-9a-fA-F]{64}$/)) { + throw new Error("Invalid Address Format"); + } + return result; +} +function getChecksumAddress(address) { + const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split(""); + const hex = removeHexPrefix(keccakBn(address)); + const hashed = (0, import_utils4.hexToBytes)(hex.padStart(64, "0")); + for (let i = 0; i < chars.length; i += 2) { + if (hashed[i >> 1] >> 4 >= 8) { + chars[i] = chars[i].toUpperCase(); + } + if ((hashed[i >> 1] & 15) >= 8) { + chars[i + 1] = chars[i + 1].toUpperCase(); + } + } + return addHexPrefix(chars.join("")); +} +function validateChecksumAddress(address) { + return getChecksumAddress(address) === address; +} + +// src/index.ts +var number = num_exports; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Account, + AccountInterface, + BlockStatus, + BlockTag, + CallData, + Contract, + ContractFactory, + ContractInterface, + CustomError, + EntryPointType, + GatewayError, + HttpError, + LibraryError, + Provider, + ProviderInterface, + RPC, + RpcProvider, + SIMULATION_FLAG, + Sequencer, + SequencerProvider, + Signer, + SignerInterface, + TransactionStatus, + TransactionType, + Uint, + ValidateType, + addAddressPadding, + buildUrl, + cairo, + constants, + contractClassResponseToLegacyCompiledContract, + defaultProvider, + ec, + encode, + extractContractHashes, + fixProto, + fixStack, + getCalldata, + getChecksumAddress, + hash, + isSierra, + isUrl, + json, + merkle, + num, + number, + parseUDCEvent, + provider, + selector, + shortString, + splitArgsAndOptions, + stark, + starknetId, + transaction, + typedData, + types, + uint256, + validateAndParseAddress, + validateChecksumAddress +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/web/lib/starknet-estfee-tx-ver/dist/index.js.map b/web/lib/starknet-estfee-tx-ver/dist/index.js.map new file mode 100644 index 000000000..7473c3e6b --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.ts","../src/constants.ts","../src/utils/encode.ts","../src/types/index.ts","../src/types/account.ts","../src/types/calldata.ts","../src/types/lib/contract/index.ts","../src/types/lib/index.ts","../src/types/api/rpc.ts","../src/types/api/sequencer.ts","../src/utils/assert.ts","../src/utils/num.ts","../src/utils/selector.ts","../src/utils/shortString.ts","../src/utils/calldata/cairo.ts","../src/utils/uint256.ts","../src/utils/calldata/formatter.ts","../src/utils/calldata/parser/parser-0-1.1.0.ts","../src/utils/calldata/parser/parser-2.0.0.ts","../src/utils/calldata/parser/index.ts","../src/utils/calldata/tuple.ts","../src/utils/calldata/propertyOrder.ts","../src/utils/calldata/requestParser.ts","../src/utils/calldata/responseParser.ts","../src/utils/calldata/validate.ts","../src/utils/calldata/index.ts","../src/utils/hash.ts","../src/utils/ec.ts","../src/utils/json.ts","../src/utils/stark.ts","../src/utils/contract.ts","../src/utils/fetchPonyfill.ts","../src/utils/provider.ts","../src/utils/responseParser/rpc.ts","../src/provider/errors.ts","../src/utils/starknetId.ts","../src/provider/starknetId.ts","../src/provider/utils.ts","../src/provider/rpc.ts","../src/provider/sequencer.ts","../src/utils/responseParser/index.ts","../src/utils/responseParser/sequencer.ts","../src/utils/url.ts","../src/provider/default.ts","../src/signer/interface.ts","../src/utils/transaction.ts","../src/utils/typedData.ts","../src/utils/merkle.ts","../src/signer/default.ts","../src/utils/events.ts","../src/account/default.ts","../src/provider/interface.ts","../src/provider/index.ts","../src/account/interface.ts","../src/contract/default.ts","../src/contract/interface.ts","../src/contract/contractFactory.ts","../src/utils/address.ts"],"sourcesContent":["/**\n * Main\n */\nexport * from './account';\nexport * from './contract';\nexport * from './provider';\nexport * from './signer';\n\n// TODO: decide on final export style\nexport * from './types';\nexport * as types from './types';\n\n/**\n * Utils\n */\nexport * as constants from './constants';\nexport * as encode from './utils/encode';\nexport * as hash from './utils/hash';\nexport * as json from './utils/json';\nexport * as num from './utils/num';\nexport * as transaction from './utils/transaction';\nexport * as stark from './utils/stark';\nexport * as merkle from './utils/merkle';\nexport * as uint256 from './utils/uint256';\nexport * as shortString from './utils/shortString';\nexport * as typedData from './utils/typedData';\nexport * as ec from './utils/ec';\nexport * as starknetId from './utils/starknetId';\nexport * as provider from './utils/provider';\nexport * as selector from './utils/selector';\nexport * from './utils/address';\nexport * from './utils/url';\nexport * from './utils/calldata';\nexport * from './utils/contract';\nexport * from './utils/events';\n\n/**\n * Deprecated\n */\n/* eslint-disable import/first */\nimport * as num from './utils/num';\n\n/** @deprecated prefer the 'num' naming */\nexport const number = num;\n","export { IS_BROWSER } from './utils/encode';\n\nexport const ZERO = 0n;\nexport const MASK_250 = 2n ** 250n - 1n; // 2 ** 250 - 1\nexport const MASK_251 = 2n ** 251n;\nexport const API_VERSION = ZERO;\n\nexport enum BaseUrl {\n SN_MAIN = 'https://alpha-mainnet.starknet.io',\n SN_GOERLI = 'https://alpha4.starknet.io',\n SN_GOERLI2 = 'https://alpha4-2.starknet.io',\n}\n\nexport enum NetworkName {\n SN_MAIN = 'SN_MAIN',\n SN_GOERLI = 'SN_GOERLI',\n SN_GOERLI2 = 'SN_GOERLI2',\n}\n\nexport enum StarknetChainId {\n SN_MAIN = '0x534e5f4d41494e', // encodeShortString('SN_MAIN'),\n SN_GOERLI = '0x534e5f474f45524c49', // encodeShortString('SN_GOERLI'),\n SN_GOERLI2 = '0x534e5f474f45524c4932', // encodeShortString('SN_GOERLI2'),\n}\n\nexport enum TransactionHashPrefix {\n DECLARE = '0x6465636c617265', // encodeShortString('declare'),\n DEPLOY = '0x6465706c6f79', // encodeShortString('deploy'),\n DEPLOY_ACCOUNT = '0x6465706c6f795f6163636f756e74', // encodeShortString('deploy_account'),\n INVOKE = '0x696e766f6b65', // encodeShortString('invoke'),\n L1_HANDLER = '0x6c315f68616e646c6572', // encodeShortString('l1_handler'),\n}\n\nexport const UDC = {\n ADDRESS: '0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf',\n ENTRYPOINT: 'deployContract',\n};\n\n/**\n * The following is taken from https://github.com/starkware-libs/starkex-resources/blob/master/crypto/starkware/crypto/signature/pedersen_params.json but converted to hex, because JS is very bad handling big integers by default\n * Please do not edit until the JSON changes.\n */\nexport const FIELD_PRIME = '800000000000011000000000000000000000000000000000000000000000001';\nexport const FIELD_GEN = '3';\nexport const FIELD_SIZE = 251;\nexport const EC_ORDER = '800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F';\nexport const ALPHA = '1';\nexport const BETA = '6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89';\nexport const MAX_ECDSA_VAL = '800000000000000000000000000000000000000000000000000000000000000';\nexport const CONSTANT_POINTS = [\n [\n '49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804',\n '3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a',\n ],\n [\n '1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca',\n '5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f',\n ],\n [\n '234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b',\n '3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615',\n ],\n [\n '3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476',\n '7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19',\n ],\n [\n '40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c',\n '109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740',\n ],\n [\n '2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b',\n '6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26',\n ],\n [\n '6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674',\n '606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2',\n ],\n [\n '7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62',\n 'a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae',\n ],\n [\n '3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec',\n '45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9',\n ],\n [\n '1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e',\n '30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a',\n ],\n [\n '6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26',\n '31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2',\n ],\n [\n '54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4',\n 'c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5',\n ],\n [\n '35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6',\n '5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d',\n ],\n [\n '4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23',\n '5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820',\n ],\n [\n '648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf',\n '72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c',\n ],\n [\n 'bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b',\n '6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6',\n ],\n [\n '35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357',\n '3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14',\n ],\n [\n '36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643',\n '7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c',\n ],\n [\n '5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661',\n '9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753',\n ],\n [\n '21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6',\n '51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c',\n ],\n [\n '19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9',\n '515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa',\n ],\n [\n '888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24',\n '730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea',\n ],\n [\n '75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977',\n '4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8',\n ],\n [\n '640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5',\n '3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c',\n ],\n [\n '6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96',\n '7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645',\n ],\n [\n '5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876',\n '518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200',\n ],\n [\n '6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4',\n '2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc',\n ],\n [\n '542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18',\n '5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c',\n ],\n [\n '299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de',\n '1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958',\n ],\n [\n '628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73',\n 'ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d',\n ],\n [\n '6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933',\n '6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db',\n ],\n [\n '28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a',\n '7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba',\n ],\n [\n '619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02',\n '2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308',\n ],\n [\n '641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96',\n '6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837',\n ],\n [\n '58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2',\n '124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9',\n ],\n [\n 'a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74',\n '1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8',\n ],\n [\n '744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b',\n '7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f',\n ],\n [\n '434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c',\n '7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39',\n ],\n [\n '7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73',\n '56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431',\n ],\n [\n '4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7',\n 'ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e',\n ],\n [\n '250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe',\n '1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04',\n ],\n [\n '2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2',\n '55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63',\n ],\n [\n '249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245',\n '7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e',\n ],\n [\n '6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb',\n '640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8',\n ],\n [\n '2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9',\n '636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be',\n ],\n [\n '4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea',\n '1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff',\n ],\n [\n '46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca',\n '1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f',\n ],\n [\n '2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152',\n '1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7',\n ],\n [\n '386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b',\n '2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5',\n ],\n [\n '407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90',\n '436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f',\n ],\n [\n '1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f',\n '69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec',\n ],\n [\n '7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e',\n '34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69',\n ],\n [\n '299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913',\n 'b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675',\n ],\n [\n '551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5',\n '5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e',\n ],\n [\n '7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2',\n '3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6',\n ],\n [\n '28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504',\n '7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b',\n ],\n [\n '1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b',\n '4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4',\n ],\n [\n '2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b',\n '9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911',\n ],\n [\n '770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed',\n '42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd',\n ],\n [\n '5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9',\n '3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d',\n ],\n [\n '6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825',\n '1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177',\n ],\n [\n '404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1',\n '3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb',\n ],\n [\n '20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc',\n '106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7',\n ],\n [\n '119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa',\n '1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773',\n ],\n [\n '45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749',\n 'ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965',\n ],\n [\n '1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38',\n '593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f',\n ],\n [\n '186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3',\n '55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c',\n ],\n [\n '58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9',\n '6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0',\n ],\n [\n '13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b',\n '3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4',\n ],\n [\n '48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676',\n '4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1',\n ],\n [\n '4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158',\n '620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef',\n ],\n [\n '4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b',\n '4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8',\n ],\n [\n '7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9',\n '2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de',\n ],\n [\n '65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f',\n '3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6',\n ],\n [\n '1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d',\n '21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a',\n ],\n [\n '3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b',\n '5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f',\n ],\n [\n '4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4',\n '5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b',\n ],\n [\n '6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8',\n 'e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9',\n ],\n [\n '748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5',\n '3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93',\n ],\n [\n '7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3',\n '5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4',\n ],\n [\n '6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f',\n '32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039',\n ],\n [\n '1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309',\n '56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4',\n ],\n [\n '1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd',\n '431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c',\n ],\n [\n '6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162',\n '14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3',\n ],\n [\n '738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e',\n '33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47',\n ],\n [\n '2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8',\n '92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc',\n ],\n [\n '181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe',\n '5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff',\n ],\n [\n '1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a',\n '4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f',\n ],\n [\n 'e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873',\n '34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f',\n ],\n [\n '4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45',\n '3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af',\n ],\n [\n '37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed',\n '37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6',\n ],\n [\n '27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c',\n '6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d',\n ],\n [\n '2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf',\n '306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413',\n ],\n [\n '307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72',\n '3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995',\n ],\n [\n '79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc',\n '40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2',\n ],\n [\n '4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292',\n '7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717',\n ],\n [\n '645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2',\n '15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab',\n ],\n [\n '1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f',\n '583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c',\n ],\n [\n '66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca',\n '505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4',\n ],\n [\n '5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1',\n 'bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323',\n ],\n [\n 'a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194',\n '4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689',\n ],\n [\n '1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c',\n '7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf',\n ],\n [\n '48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f',\n '781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3',\n ],\n [\n '17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd',\n '6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223',\n ],\n [\n '5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89',\n '1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff',\n ],\n [\n '6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58',\n '436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e',\n ],\n [\n '7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6',\n '484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4',\n ],\n [\n '17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d',\n '7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f',\n ],\n [\n '7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf',\n '33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78',\n ],\n [\n '7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d',\n '6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb',\n ],\n [\n '273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128',\n '653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f',\n ],\n [\n '3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212',\n '65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e',\n ],\n [\n '5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee',\n '3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22',\n ],\n [\n '7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9',\n '71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e',\n ],\n [\n '40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62',\n '499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42',\n ],\n [\n '6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465',\n '35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37',\n ],\n [\n '604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6',\n '68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457',\n ],\n [\n '73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4',\n '4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb',\n ],\n [\n '3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1',\n '677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0',\n ],\n [\n '39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f',\n '20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952',\n ],\n [\n '326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c',\n '7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1',\n ],\n [\n '53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632',\n '2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1',\n ],\n [\n '6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e',\n 'beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63',\n ],\n [\n '3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332',\n '529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7',\n ],\n [\n '3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e',\n '3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740',\n ],\n [\n '7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a',\n '68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400',\n ],\n [\n '1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb',\n '5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9',\n ],\n [\n '3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344',\n '52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590',\n ],\n [\n '44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa',\n '6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940',\n ],\n [\n '7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e',\n '78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9',\n ],\n [\n '7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d',\n '4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62',\n ],\n [\n '7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c',\n '636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84',\n ],\n [\n '758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2',\n '1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245',\n ],\n [\n '7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e',\n '229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470',\n ],\n [\n '78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614',\n '246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675',\n ],\n [\n '6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647',\n '599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4',\n ],\n [\n '4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e',\n '1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad',\n ],\n [\n '3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d',\n '617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c',\n ],\n [\n '5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287',\n '1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d',\n ],\n [\n '3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004',\n '7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232',\n ],\n [\n '3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb',\n '563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6',\n ],\n [\n '16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52',\n '7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e',\n ],\n [\n '75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4',\n '35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0',\n ],\n [\n '3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8',\n '6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd',\n ],\n [\n '54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579',\n '7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0',\n ],\n [\n 'd1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0',\n '2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45',\n ],\n [\n '2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d',\n '70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b',\n ],\n [\n '752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3',\n '3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef',\n ],\n [\n '63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e',\n '37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e',\n ],\n [\n 'd6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b',\n '5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018',\n ],\n [\n '12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557',\n '6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613',\n ],\n [\n '46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c',\n '76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df',\n ],\n [\n '4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516',\n '5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29',\n ],\n [\n '71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833',\n '85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346',\n ],\n [\n '5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61',\n '3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950',\n ],\n [\n '161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941',\n '78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b',\n ],\n [\n '1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1',\n '66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d',\n ],\n [\n '56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44',\n '47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e',\n ],\n [\n '4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491',\n '430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4',\n ],\n [\n '7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606',\n '312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295',\n ],\n [\n '16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe',\n '7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24',\n ],\n [\n '323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b',\n '4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265',\n ],\n [\n '624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d',\n '261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430',\n ],\n [\n 'f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d',\n 'b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6',\n ],\n [\n '686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec',\n '7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6',\n ],\n [\n '3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e',\n '634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af',\n ],\n [\n '484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b',\n '34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8',\n ],\n [\n '203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a',\n '2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2',\n ],\n [\n '2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d',\n '6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6',\n ],\n [\n '5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef',\n '30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d',\n ],\n [\n '57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741',\n '7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad',\n ],\n [\n '611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1',\n '3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4',\n ],\n [\n '1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31',\n '3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527',\n ],\n [\n '275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234',\n '2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521',\n ],\n [\n '6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95',\n '5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e',\n ],\n [\n '44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c',\n '3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e',\n ],\n [\n 'fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966',\n '110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9',\n ],\n [\n '9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef',\n '4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51',\n ],\n [\n '71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7',\n '7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9',\n ],\n [\n '1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345',\n '4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc',\n ],\n [\n '3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115',\n 'a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24',\n ],\n [\n 'c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d',\n '729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d',\n ],\n [\n '44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d',\n '212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8',\n ],\n [\n '35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f',\n '74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62',\n ],\n [\n 'e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03',\n '3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357',\n ],\n [\n '3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a',\n '5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df',\n ],\n [\n '222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c',\n '72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42',\n ],\n [\n '3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764',\n '480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c',\n ],\n [\n 'adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187',\n '60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8',\n ],\n [\n '3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9',\n '7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996',\n ],\n [\n '12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32',\n '6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1',\n ],\n [\n '27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b',\n 'c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917',\n ],\n [\n '431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6',\n '30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197',\n ],\n [\n '4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33',\n '627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c',\n ],\n [\n '2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8',\n '1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f',\n ],\n [\n 'e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc',\n '58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9',\n ],\n [\n '7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5',\n '74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1',\n ],\n [\n '62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b',\n '1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315',\n ],\n [\n '1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938',\n '44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b',\n ],\n [\n '78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea',\n '6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41',\n ],\n [\n '5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d',\n '1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb',\n ],\n [\n '62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04',\n '6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f',\n ],\n [\n '4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f',\n '941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494',\n ],\n [\n '52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1',\n '987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782',\n ],\n [\n '1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f',\n '38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b',\n ],\n [\n '4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232',\n '7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c',\n ],\n [\n '69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73',\n 'a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897',\n ],\n [\n 'b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62',\n '24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915',\n ],\n [\n '5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb',\n '6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9',\n ],\n [\n '1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0',\n '23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699',\n ],\n [\n '2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5',\n '1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862',\n ],\n [\n 'd26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3',\n '34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a',\n ],\n [\n '91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563',\n 'e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a',\n ],\n [\n '1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7',\n '7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd',\n ],\n [\n '4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f',\n '47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e',\n ],\n [\n '3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069',\n '47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc',\n ],\n [\n '758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657',\n '3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83',\n ],\n [\n '19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8',\n '5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709',\n ],\n [\n '28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855',\n '14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2',\n ],\n [\n '3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f',\n '69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d',\n ],\n [\n '77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b',\n '7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df',\n ],\n [\n '97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6',\n '2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223',\n ],\n [\n 'a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647',\n '37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2',\n ],\n [\n 'e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc',\n '1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a',\n ],\n [\n '2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de',\n '6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591',\n ],\n [\n '744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f',\n '685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d',\n ],\n [\n '40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd',\n '2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e',\n ],\n [\n '5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc',\n '2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2',\n ],\n [\n '5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985',\n '49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183',\n ],\n [\n '2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649',\n '61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d',\n ],\n [\n 'ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381',\n '190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60',\n ],\n [\n '233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c',\n '7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef',\n ],\n [\n '42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce',\n '12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65',\n ],\n [\n '30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44',\n '5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a',\n ],\n [\n '4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a',\n '4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93',\n ],\n [\n '62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466',\n '5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0',\n ],\n [\n '5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f',\n '5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94',\n ],\n [\n '670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728',\n '26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0',\n ],\n [\n '3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5',\n '56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015',\n ],\n [\n '4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3',\n '1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e',\n ],\n [\n '4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0',\n '97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09',\n ],\n [\n '574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219',\n '49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8',\n ],\n [\n '7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554',\n '47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba',\n ],\n [\n '67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6',\n '39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8',\n ],\n [\n '63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b',\n '60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9',\n ],\n [\n '3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543',\n '56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628',\n ],\n [\n '758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129',\n '622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746',\n ],\n [\n '38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c',\n '145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e',\n ],\n [\n '206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad',\n '6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8',\n ],\n [\n '56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d',\n '526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6',\n ],\n [\n '4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378',\n '3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d',\n ],\n [\n '450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58',\n '1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7',\n ],\n [\n '6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d',\n '28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2',\n ],\n [\n '1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf',\n 'fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb',\n ],\n [\n '4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997',\n '40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c',\n ],\n [\n '21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef',\n '4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f',\n ],\n [\n '350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046',\n '5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b',\n ],\n [\n '529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6',\n '3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491',\n ],\n [\n '55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d',\n '159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9',\n ],\n [\n '405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f',\n '4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d',\n ],\n [\n '376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe',\n '5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba',\n ],\n [\n '2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38',\n '7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089',\n ],\n [\n '3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed',\n '5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5',\n ],\n [\n '7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4',\n '3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe',\n ],\n [\n '4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d',\n '204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89',\n ],\n [\n '79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72',\n '3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb',\n ],\n [\n '297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c',\n '6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993',\n ],\n [\n '44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7',\n '1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc',\n ],\n [\n '6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26',\n '64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd',\n ],\n [\n '14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24',\n '5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1',\n ],\n [\n '95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83',\n '1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1',\n ],\n [\n '2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5',\n '5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67',\n ],\n [\n '61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d',\n '23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795',\n ],\n [\n '79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf',\n '2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6',\n ],\n [\n '45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b',\n '2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd',\n ],\n [\n '37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007',\n '50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c',\n ],\n [\n '71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b',\n '3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6',\n ],\n [\n '78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06',\n '5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256',\n ],\n [\n 'b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15',\n '653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83',\n ],\n [\n '441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc',\n '4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59',\n ],\n [\n '2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa',\n '4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0',\n ],\n [\n '3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f',\n '4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c',\n ],\n [\n '5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092',\n '5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56',\n ],\n [\n '3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771',\n '459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999',\n ],\n [\n '5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f',\n '56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49',\n ],\n [\n '1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281',\n '5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a',\n ],\n [\n '1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40',\n '6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488',\n ],\n [\n '61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b',\n '27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad',\n ],\n [\n '7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e',\n '481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf',\n ],\n [\n '124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316',\n '33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987',\n ],\n [\n '61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c',\n '5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb',\n ],\n [\n '70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d',\n '3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc',\n ],\n [\n '41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f',\n '7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce',\n ],\n [\n '62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8',\n '1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771',\n ],\n [\n '441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a',\n '29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086',\n ],\n [\n '2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee',\n '11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77',\n ],\n [\n '5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea',\n '63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc',\n ],\n [\n '3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7',\n '7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092',\n ],\n [\n '95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922',\n '159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9',\n ],\n [\n '621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c',\n '65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd',\n ],\n [\n '54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e',\n '680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313',\n ],\n [\n '21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d',\n '7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8',\n ],\n [\n '3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3',\n '12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801',\n ],\n [\n 'befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392',\n '6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8',\n ],\n [\n '15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6',\n '30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df',\n ],\n [\n '38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8',\n '786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13',\n ],\n [\n '6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72',\n '1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a',\n ],\n [\n '5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30',\n '1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea',\n ],\n [\n '309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1',\n '505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851',\n ],\n [\n '89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc',\n '1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540',\n ],\n [\n '480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84',\n '511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570',\n ],\n [\n '3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb',\n '49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920',\n ],\n [\n '66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd',\n '4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b',\n ],\n [\n '373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3',\n '5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c',\n ],\n [\n '26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7',\n '157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc',\n ],\n [\n 'ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f',\n '517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7',\n ],\n [\n '25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66',\n '10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8',\n ],\n [\n '243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742',\n '1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f',\n ],\n [\n '48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562',\n '3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264',\n ],\n [\n '592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca',\n '48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc',\n ],\n [\n '31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d',\n 'a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5',\n ],\n [\n '4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc',\n '512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47',\n ],\n [\n '26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc',\n '75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e',\n ],\n [\n '3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe',\n '20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d',\n ],\n [\n '483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97',\n '2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d',\n ],\n [\n '65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9',\n '562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373',\n ],\n [\n '284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35',\n '5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02',\n ],\n [\n '32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85',\n '7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd',\n ],\n [\n '1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a',\n '478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742',\n ],\n [\n '270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf',\n '3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b',\n ],\n [\n '6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d',\n '5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33',\n ],\n [\n '48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1',\n '2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0',\n ],\n [\n 'e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5',\n '36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997',\n ],\n [\n '5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8',\n '6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c',\n ],\n [\n '15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6',\n '69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903',\n ],\n [\n '274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50',\n '6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656',\n ],\n [\n '4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123',\n '116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba',\n ],\n [\n '4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a',\n '2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f',\n ],\n [\n '5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3',\n '4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b',\n ],\n [\n '11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483',\n '36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8',\n ],\n [\n '4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3',\n 'e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64',\n ],\n [\n '2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3',\n '527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d',\n ],\n [\n '52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf',\n '19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41',\n ],\n [\n '541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961',\n '78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2',\n ],\n [\n '5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd',\n '137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc',\n ],\n [\n '15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4',\n '4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549',\n ],\n [\n '68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4',\n '7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f',\n ],\n [\n '67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df',\n '7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01',\n ],\n [\n '596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334',\n '49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0',\n ],\n [\n '567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395',\n '6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd',\n ],\n [\n 'cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7',\n '4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7',\n ],\n [\n '4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06',\n '2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566',\n ],\n [\n '760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359',\n '1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e',\n ],\n [\n '6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2',\n '3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd',\n ],\n [\n '4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b',\n '2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f',\n ],\n [\n '5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7',\n '76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39',\n ],\n [\n '2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7',\n '62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e',\n ],\n [\n '5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00',\n '14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1',\n ],\n [\n '7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c',\n 'bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970',\n ],\n [\n '37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843',\n '672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb',\n ],\n [\n '5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114',\n '7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e',\n ],\n [\n '25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63',\n '3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb',\n ],\n [\n '32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0',\n 'bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459',\n ],\n [\n '49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f',\n '57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8',\n ],\n [\n '10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd',\n '8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0',\n ],\n [\n '79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36',\n '146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c',\n ],\n [\n '6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439',\n '68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82',\n ],\n [\n '71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097',\n '54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c',\n ],\n [\n '27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b',\n '14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3',\n ],\n [\n '6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c',\n '5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048',\n ],\n [\n '32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9',\n '518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4',\n ],\n [\n '4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e',\n '3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4',\n ],\n [\n '4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10',\n '20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918',\n ],\n [\n '87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a',\n '112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb',\n ],\n [\n '6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae',\n '54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1',\n ],\n [\n '19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a',\n '1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510',\n ],\n [\n '12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d',\n '4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7',\n ],\n [\n '13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2',\n '40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1',\n ],\n [\n '255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d',\n '3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc',\n ],\n [\n '7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31',\n '4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6',\n ],\n [\n '2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35',\n '44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf',\n ],\n [\n '750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b',\n '54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c',\n ],\n [\n '3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72',\n '7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359',\n ],\n [\n '4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb',\n '63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235',\n ],\n [\n '1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f',\n '4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d',\n ],\n [\n '2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087',\n '2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d',\n ],\n [\n '4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3',\n '5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621',\n ],\n [\n '2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05',\n '1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19',\n ],\n [\n '4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c',\n '33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614',\n ],\n [\n '7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b',\n '5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722',\n ],\n [\n '7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51',\n '26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056',\n ],\n [\n '36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881',\n '33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5',\n ],\n [\n '403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd',\n '47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5',\n ],\n [\n '3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb',\n '2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e',\n ],\n [\n '3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537',\n 'f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4',\n ],\n [\n '235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65',\n '37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5',\n ],\n [\n '3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b',\n '4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe',\n ],\n [\n '48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518',\n '73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee',\n ],\n [\n '48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0',\n '3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903',\n ],\n [\n '2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097',\n '19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541',\n ],\n [\n '1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676',\n '36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7',\n ],\n [\n '2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b',\n '7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b',\n ],\n [\n '348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a',\n '3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969',\n ],\n [\n '7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31',\n '42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd',\n ],\n [\n '2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a',\n '5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83',\n ],\n [\n '1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2',\n 'dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d',\n ],\n [\n '54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e',\n '16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089',\n ],\n [\n '525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b',\n '58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea',\n ],\n [\n '54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd',\n '53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76',\n ],\n [\n '4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae',\n '2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17',\n ],\n [\n '21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708',\n '59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c',\n ],\n [\n '167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66',\n '22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a',\n ],\n [\n '31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843',\n '1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c',\n ],\n [\n '1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b',\n '2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b',\n ],\n [\n 'c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0',\n '45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327',\n ],\n [\n '394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6',\n '1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd',\n ],\n [\n '410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27',\n '361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa',\n ],\n [\n '38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734',\n '624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1',\n ],\n [\n '78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608',\n '19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198',\n ],\n [\n '6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867',\n '7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb',\n ],\n [\n '32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602',\n '3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377',\n ],\n [\n '49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5',\n '1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d',\n ],\n [\n '2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5',\n '759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96',\n ],\n [\n '3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70',\n '22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6',\n ],\n [\n '5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab',\n '715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8',\n ],\n [\n '19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a',\n '896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5',\n ],\n [\n '61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc',\n '38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8',\n ],\n [\n '2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df',\n '1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb',\n ],\n [\n '7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54',\n '21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b',\n ],\n [\n 'b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed',\n '5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf',\n ],\n [\n 'e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc',\n '550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a',\n ],\n [\n '7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4',\n '2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f',\n ],\n [\n '7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c',\n '410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e',\n ],\n [\n '225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5',\n '411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e',\n ],\n [\n '1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1',\n '3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8',\n ],\n [\n '59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335',\n '1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8',\n ],\n [\n '2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3',\n '62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535',\n ],\n [\n '6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb',\n '7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f',\n ],\n [\n '34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88',\n '3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d',\n ],\n [\n '436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d',\n '67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044',\n ],\n [\n '592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4',\n '27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5',\n ],\n [\n '89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009',\n '557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b',\n ],\n [\n '1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e',\n '72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a',\n ],\n [\n '574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03',\n '5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3',\n ],\n [\n '513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1',\n '687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5',\n ],\n [\n '53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9',\n '35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be',\n ],\n [\n '213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44',\n '744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89',\n ],\n [\n '735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c',\n '7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9',\n ],\n [\n '3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001',\n '79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8',\n ],\n [\n '51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74',\n '10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad',\n ],\n [\n 'c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc',\n '53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a',\n ],\n [\n '5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece',\n '39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f',\n ],\n [\n '3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299',\n '15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975',\n ],\n [\n '6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0',\n '11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744',\n ],\n [\n '7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65',\n '3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb',\n ],\n [\n '2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6',\n '461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d',\n ],\n [\n '34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f',\n '33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44',\n ],\n [\n '6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441',\n '6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693',\n ],\n [\n '17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce',\n '3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7',\n ],\n [\n '70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27',\n 'd18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8',\n ],\n [\n '2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf',\n '5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1',\n ],\n [\n '5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1',\n 'eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487',\n ],\n [\n '6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61',\n '911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984',\n ],\n [\n '74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293',\n '761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92',\n ],\n [\n '44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9',\n '249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0',\n ],\n [\n '2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc',\n '6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5',\n ],\n [\n '3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb',\n '6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb',\n ],\n [\n '284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677',\n '516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7',\n ],\n [\n '2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32',\n '7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec',\n ],\n [\n '5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7',\n '6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece',\n ],\n [\n '74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f',\n '156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531',\n ],\n [\n '334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45',\n '221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2',\n ],\n [\n '7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30',\n '3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86',\n ],\n [\n '4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8',\n '6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749',\n ],\n [\n '1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7',\n '3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583',\n ],\n [\n '294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1',\n 'd837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad',\n ],\n [\n '753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39',\n '6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75',\n ],\n [\n '5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e',\n '7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8',\n ],\n [\n '4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f',\n '21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e',\n ],\n [\n '726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8',\n '15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12',\n ],\n [\n '38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2',\n '73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b',\n ],\n [\n '6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291',\n '4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75',\n ],\n [\n '6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f',\n '26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05',\n ],\n [\n '2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155',\n '5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244',\n ],\n [\n '4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7',\n '5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1',\n ],\n [\n '110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3',\n '7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43',\n ],\n [\n '5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096',\n '7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2',\n ],\n [\n '2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d',\n '62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b',\n ],\n [\n '1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d',\n '309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4',\n ],\n [\n '2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d',\n '3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf',\n ],\n [\n '376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543',\n '6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547',\n ],\n [\n 'a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066',\n '6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471',\n ],\n [\n '223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed',\n 'c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa',\n ],\n [\n '102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2',\n '6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65',\n ],\n [\n '891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2',\n '5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37',\n ],\n [\n '215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203',\n '10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266',\n ],\n [\n '21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36',\n '3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3',\n ],\n [\n '60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae',\n 'e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879',\n ],\n [\n '1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5',\n '69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3',\n ],\n [\n '5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e',\n '134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec',\n ],\n [\n '626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8',\n '7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0',\n ],\n [\n '23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd',\n '7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf',\n ],\n [\n '54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202',\n '1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426',\n ],\n [\n '13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c',\n '62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9',\n ],\n [\n '47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98',\n '75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb',\n ],\n [\n '2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585',\n '5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c',\n ],\n];\n","/* eslint-disable no-param-reassign */\nexport const IS_BROWSER = typeof window !== 'undefined';\n\nconst STRING_ZERO = '0';\n\nexport function arrayBufferToString(array: ArrayBuffer): string {\n return new Uint8Array(array).reduce((data, byte) => data + String.fromCharCode(byte), '');\n}\n\nexport function stringToArrayBuffer(s: string): Uint8Array {\n return Uint8Array.from(s, (c) => c.charCodeAt(0));\n}\n\nexport function atobUniversal(a: string): Uint8Array {\n return IS_BROWSER ? stringToArrayBuffer(atob(a)) : Buffer.from(a, 'base64');\n}\n\nexport function btoaUniversal(b: ArrayBuffer): string {\n return IS_BROWSER ? btoa(arrayBufferToString(b)) : Buffer.from(b).toString('base64');\n}\n\nexport function buf2hex(buffer: Uint8Array) {\n return [...buffer].map((x) => x.toString(16).padStart(2, '0')).join('');\n}\n\n/**\n * Some function imported from https://github.com/pedrouid/enc-utils/blob/master/src/index.ts\n * enc-utils is no dependency to avoid using `Buffer` which just works in node and no browsers\n */\n\nexport function removeHexPrefix(hex: string): string {\n return hex.replace(/^0x/i, '');\n}\n\nexport function addHexPrefix(hex: string): string {\n return `0x${removeHexPrefix(hex)}`;\n}\n\nfunction padString(str: string, length: number, left: boolean, padding = STRING_ZERO): string {\n const diff = length - str.length;\n let result = str;\n if (diff > 0) {\n const pad = padding.repeat(diff);\n result = left ? pad + str : str + pad;\n }\n return result;\n}\n\nexport function padLeft(str: string, length: number, padding = STRING_ZERO): string {\n return padString(str, length, true, padding);\n}\n\nexport function calcByteLength(length: number, byteSize = 8): number {\n const remainder = length % byteSize;\n return remainder ? ((length - remainder) / byteSize) * byteSize + byteSize : length;\n}\n\nexport function sanitizeBytes(str: string, byteSize = 8, padding = STRING_ZERO): string {\n return padLeft(str, calcByteLength(str.length, byteSize), padding);\n}\n\nexport function sanitizeHex(hex: string): string {\n hex = removeHexPrefix(hex);\n hex = sanitizeBytes(hex, 2);\n if (hex) {\n hex = addHexPrefix(hex);\n }\n return hex;\n}\n\n// implemented using TextEncoder to make it isomorphic\nexport function utf8ToArray(str: string): Uint8Array {\n return new TextEncoder().encode(str);\n}\n","export * from './account';\nexport * from './calldata';\nexport * from './contract';\nexport * from './lib';\nexport * from './provider';\nexport * from './signer';\nexport * from './typedData';\n\nexport * as RPC from './api/rpc';\nexport {\n CallL1Handler,\n DeployedContractItem,\n ExecutionResources,\n FunctionInvocation,\n GetContractAddressesResponse,\n GetTransactionStatusResponse,\n SequencerIdentifier,\n} from './api/sequencer';\nexport * as Sequencer from './api/sequencer';\n","import { BigNumberish, BlockIdentifier } from './lib';\nimport { DeclareTransactionReceiptResponse, EstimateFeeResponse } from './provider';\n\nexport interface EstimateFee extends EstimateFeeResponse {\n suggestedMaxFee: bigint;\n}\n\nexport type EstimateFeeBulk = Array;\n\nexport type AccountInvocationsFactoryDetails = {\n versions: bigint[];\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n};\n\nexport interface EstimateFeeDetails {\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n}\n\nexport interface DeployContractResponse {\n contract_address: string;\n transaction_hash: string;\n}\n\nexport type MultiDeployContractResponse = {\n contract_address: Array;\n transaction_hash: string;\n};\n\nexport type DeployContractUDCResponse = {\n contract_address: string;\n transaction_hash: string;\n address: string;\n deployer: string;\n unique: string;\n classHash: string;\n calldata_len: string;\n calldata: Array;\n salt: string;\n};\n\nexport type DeclareDeployUDCResponse = {\n declare: {\n class_hash: BigNumberish;\n } & Partial;\n deploy: DeployContractUDCResponse;\n};\n\nexport type SimulateTransactionDetails = {\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n skipExecute?: boolean;\n};\n\nexport enum SIMULATION_FLAG {\n SKIP_VALIDATE,\n SKIP_EXECUTE,\n}\n","export enum ValidateType {\n DEPLOY = 'DEPLOY',\n CALL = 'CALL',\n INVOKE = 'INVOKE',\n}\n\nexport enum Uint {\n u8 = 'core::integer::u8',\n u16 = 'core::integer::u16',\n u32 = 'core::integer::u32',\n u64 = 'core::integer::u64',\n u128 = 'core::integer::u128',\n u256 = 'core::integer::u256', // This one is struct\n}\n","import { LegacyCompiledContract, LegacyContractClass } from './legacy';\nimport { CompiledSierra, SierraContractClass } from './sierra';\n\n// Final types\n/**\n * format produced after compressing compiled contract\n * CompressedCompiledContract\n */\nexport type ContractClass = LegacyContractClass | SierraContractClass;\n\n/**\n * format produced after compile .cairo to .json\n */\nexport type CompiledContract = LegacyCompiledContract | CompiledSierra;\n\n/**\n * Compressed or decompressed Cairo0 or Cairo1 Contract\n */\nexport type CairoContract = ContractClass | CompiledContract;\n\n// Basic elements\nexport enum EntryPointType {\n EXTERNAL = 'EXTERNAL',\n L1_HANDLER = 'L1_HANDLER',\n CONSTRUCTOR = 'CONSTRUCTOR',\n}\n\nexport * from './abi';\nexport * from './legacy';\nexport * from './sierra';\n","import { StarknetChainId } from '../../constants';\nimport { weierstrass } from '../../utils/ec';\nimport { CompiledContract, CompiledSierraCasm, ContractClass } from './contract';\n\nexport type WeierstrassSignatureType = weierstrass.SignatureType;\nexport type ArraySignatureType = string[];\nexport type Signature = ArraySignatureType | WeierstrassSignatureType;\n\nexport type BigNumberish = string | number | bigint;\n\n/**\n * Compiled calldata ready to be sent\n * decimal-string array\n */\nexport type Calldata = string[] & { readonly __compiled__?: boolean };\n\n/**\n * Represents an integer in the range [0, 2^256)\n */\nexport interface Uint256 {\n // The low 128 bits of the value\n low: BigNumberish;\n // The high 128 bits of the value\n high: BigNumberish;\n}\n\n/**\n * BigNumberish array\n * use CallData.compile() to convert to Calldata\n */\nexport type RawCalldata = BigNumberish[];\n\n/**\n * Hexadecimal-string array\n */\nexport type HexCalldata = string[];\n\nexport type AllowArray = T | T[];\n\nexport type OptionalPayload = { payload: T } | T;\n\nexport type RawArgs = RawArgsObject | RawArgsArray;\n\nexport type RawArgsObject = {\n [inputName: string]: MultiType | MultiType[] | RawArgs;\n};\n\nexport type RawArgsArray = Array;\n\nexport type MultiType = BigNumberish | Uint256 | object | boolean;\n\nexport type UniversalDeployerContractPayload = {\n classHash: BigNumberish;\n salt?: string;\n unique?: boolean;\n constructorCalldata?: RawArgs;\n};\n\nexport type DeployAccountContractPayload = {\n classHash: string;\n constructorCalldata?: RawArgs;\n addressSalt?: BigNumberish;\n contractAddress?: string;\n};\n\nexport type DeployAccountContractTransaction = Omit<\n DeployAccountContractPayload,\n 'contractAddress'\n> & {\n signature?: Signature;\n};\n\nexport type DeclareContractPayload = {\n contract: CompiledContract | string;\n classHash?: string;\n casm?: CompiledSierraCasm;\n compiledClassHash?: string;\n};\n\nexport type CompleteDeclareContractPayload = {\n contract: CompiledContract | string;\n classHash: string;\n casm?: CompiledSierraCasm;\n compiledClassHash?: string;\n};\n\nexport type DeclareAndDeployContractPayload = Omit &\n DeclareContractPayload;\n\nexport type DeclareContractTransaction = {\n contract: ContractClass;\n senderAddress: string;\n signature?: Signature;\n compiledClassHash?: string;\n};\n\nexport type CallDetails = {\n contractAddress: string;\n calldata?: RawArgs | Calldata;\n entrypoint?: string; // TODO: check if required\n};\n\nexport type Invocation = CallDetails & { signature?: Signature };\n\nexport type Call = CallDetails & { entrypoint: string };\n\nexport type CairoVersion = '0' | '1';\n\nexport type InvocationsDetails = {\n nonce?: BigNumberish;\n maxFee?: BigNumberish;\n version?: BigNumberish;\n};\n\n/**\n * Contain all additional details params\n */\nexport type Details = {\n nonce: BigNumberish;\n maxFee: BigNumberish;\n version: BigNumberish;\n chainId: StarknetChainId;\n};\n\nexport type InvocationsDetailsWithNonce = InvocationsDetails & {\n nonce: BigNumberish;\n};\n\nexport enum TransactionType {\n DECLARE = 'DECLARE',\n DEPLOY = 'DEPLOY',\n DEPLOY_ACCOUNT = 'DEPLOY_ACCOUNT',\n INVOKE = 'INVOKE_FUNCTION',\n}\n\nexport enum TransactionStatus {\n NOT_RECEIVED = 'NOT_RECEIVED',\n RECEIVED = 'RECEIVED',\n ACCEPTED_ON_L2 = 'ACCEPTED_ON_L2',\n ACCEPTED_ON_L1 = 'ACCEPTED_ON_L1',\n REJECTED = 'REJECTED',\n}\n\nexport enum BlockStatus {\n PENDING = 'PENDING',\n ACCEPTED_ON_L1 = 'ACCEPTED_ON_L1',\n ACCEPTED_ON_L2 = 'ACCEPTED_ON_L2',\n REJECTED = 'REJECTED',\n}\n\nexport enum BlockTag {\n pending = 'pending',\n latest = 'latest',\n}\n\nexport type BlockNumber = BlockTag | null | number;\n\n/**\n * hex string and BN are detected as block hashes\n * decimal string and number are detected as block numbers\n * null appends nothing to the request url\n */\nexport type BlockIdentifier = BlockNumber | BigNumberish;\n\n/**\n * items used by AccountInvocations\n */\nexport type AccountInvocationItem = (\n | ({ type: TransactionType.DECLARE } & DeclareContractTransaction)\n | ({ type: TransactionType.DEPLOY_ACCOUNT } & DeployAccountContractTransaction)\n | ({ type: TransactionType.INVOKE } & Invocation)\n) &\n InvocationsDetailsWithNonce;\n\n/**\n * Complete invocations array with account details (internal type from account -> provider)\n */\nexport type AccountInvocations = AccountInvocationItem[];\n\n/**\n * Invocations array user provide to bulk method (simulate)\n */\nexport type Invocations = Array<\n | ({ type: TransactionType.DECLARE } & OptionalPayload)\n | ({ type: TransactionType.DEPLOY } & OptionalPayload<\n AllowArray\n >)\n | ({ type: TransactionType.DEPLOY_ACCOUNT } & OptionalPayload)\n | ({ type: TransactionType.INVOKE } & OptionalPayload>)\n>;\n\nexport type Tupled = { element: any; type: string };\n\nexport type Args = {\n [inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[];\n};\nexport type ParsedStruct = {\n [key: string]: BigNumberish | ParsedStruct;\n};\n\nexport type waitForTransactionOptions = {\n retryInterval?: number;\n successStates?: Array;\n};\n\nexport type getSimulateTransactionOptions = {\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n skipExecute?: boolean;\n};\n\nexport type getEstimateFeeBulkOptions = {\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n};\n\nexport interface CallStruct {\n to: string;\n selector: string;\n calldata: string[];\n}\n\nexport * from './contract';\n","import { ADDRESS, CONTRACT_STORAGE_DIFF_ITEM, FELT, OPENRPC } from './openrpc';\n\nexport type Response = {\n id: number;\n jsonrpc: string;\n result?: any;\n error?: {\n code: string;\n message: string;\n };\n};\n\nexport type ChainId = OPENRPC.CHAIN_ID;\nexport type CallResponse = OPENRPC.CallResponse;\nexport type ContractAddress = ADDRESS;\nexport type Felt = FELT;\nexport type Nonce = OPENRPC.Nonce;\nexport type ContractClass = OPENRPC.ContractClass | OPENRPC.DeprecatedContractClass;\nexport type StateUpdate = OPENRPC.StateUpdate;\nexport type Transaction = OPENRPC.Transaction;\nexport type PendingTransactions = OPENRPC.PendingTransactions;\nexport type TransactionHash = OPENRPC.TransactionHash;\nexport type Trace = OPENRPC.Trace;\nexport type Traces = OPENRPC.Traces;\nexport type BlockHash = OPENRPC.BlockHash;\nexport type BlockHashAndNumber = OPENRPC.BlockHashAndNumber;\nexport type EstimateFeeResponse = OPENRPC.EstimatedFee;\nexport type GetBlockWithTxHashesResponse = OPENRPC.BlockWithTxHashes;\nexport type GetBlockWithTxs = OPENRPC.BlockWithTxs;\nexport type GetStorageAtResponse = OPENRPC.Storage;\nexport type TransactionReceipt = OPENRPC.TransactionReceipt;\nexport type GetTransactionByHashResponse = OPENRPC.Transaction;\nexport type GetTransactionByBlockIdAndIndex = OPENRPC.Transaction;\nexport type GetTransactionCountResponse = number;\nexport type GetBlockNumberResponse = OPENRPC.BlockNumber;\nexport type GetSyncingStatsResponse = OPENRPC.SyncingStatus;\nexport type EventFilter = OPENRPC.EventFilter;\nexport type GetEventsResponse = OPENRPC.Events;\nexport type InvokedTransaction = OPENRPC.InvokedTransaction;\nexport type DeclaredTransaction = OPENRPC.DeclaredTransaction;\nexport type DeployedTransaction = OPENRPC.DeployedTransaction;\nexport type SimulationFlags = OPENRPC.SimulationFlags;\nexport type BroadcastedTransaction = OPENRPC.BroadcastedTransaction;\nexport type EstimatedFee = OPENRPC.EstimatedFee;\nexport type Methods = OPENRPC.Methods;\nexport type Storage = OPENRPC.Storage;\nexport type SimulateTransactionResponse = OPENRPC.SimulatedTransactions;\n\nexport enum TransactionType {\n DECLARE = 'DECLARE',\n DEPLOY = 'DEPLOY',\n DEPLOY_ACCOUNT = 'DEPLOY_ACCOUNT',\n INVOKE = 'INVOKE',\n L1_HANDLER = 'L1_HANDLER',\n}\n\n// Exported Diff on Sequencer (can be removed when diff resolved by new RPC v)\nexport type StorageDiffs = Array;\nexport type DeprecatedDeclaredClasses = Array;\nexport type Nonces = Array<{\n contract_address: ADDRESS;\n nonce: FELT;\n}>;\nexport type ReplacedClasses = Array<{ contract_address: ADDRESS; class_hash: FELT }>;\n","import {\n Abi,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n BlockNumber,\n BlockStatus,\n ByteCode,\n CairoAssembly,\n CompiledContract,\n ContractClass,\n EntryPointType,\n RawCalldata,\n TransactionStatus,\n TransactionType,\n} from '../lib';\n\n// #region | originally not included in the namespace\nexport type GetTransactionStatusResponse = {\n tx_status: TransactionStatus;\n block_hash?: string;\n tx_failure_reason?: {\n code: string;\n error_message: string;\n };\n};\n\nexport type GetContractAddressesResponse = {\n Starknet: string;\n GpsStatementVerifier: string;\n};\n\nexport type FunctionInvocation = {\n caller_address: string;\n contract_address: string;\n calldata: RawCalldata;\n call_type?: string;\n class_hash?: string;\n selector?: string;\n entry_point_type?: EntryPointType.EXTERNAL; // TODO: check this\n result: Array;\n execution_resources: ExecutionResources;\n internal_calls: Array;\n events: Array;\n messages: Array;\n};\n\nexport type ExecutionResources = {\n n_steps: number;\n builtin_instance_counter: {\n pedersen_builtin: number;\n range_check_builtin: number;\n bitwise_builtin: number;\n output_builtin: number;\n ecdsa_builtin: number;\n ec_op_builtin?: number;\n };\n n_memory_holes: number;\n};\n\nexport type CallL1Handler = {\n from_address: string;\n to_address: string;\n entry_point_selector: string;\n payload: Array;\n};\n\nexport type DeployedContractItem = {\n address: string;\n class_hash: string;\n};\n\nexport type SequencerIdentifier = { blockHash: string } | { blockNumber: BlockNumber };\n// #endregion\n\nexport type TransactionTraceResponse = {\n validate_invocation?: FunctionInvocation;\n function_invocation?: FunctionInvocation;\n fee_transfer_invocation?: FunctionInvocation;\n constructor_invocation?: FunctionInvocation;\n signature: string[];\n};\n\nexport type DeclareTransaction = {\n type: TransactionType.DECLARE;\n sender_address: string;\n contract_class: ContractClass;\n signature?: string[];\n nonce: BigNumberish;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n compiled_class_hash?: string; // v2 declare\n};\n\nexport type DeployTransaction = {\n type: TransactionType.DEPLOY;\n contract_definition: ContractClass;\n contract_address_salt: BigNumberish;\n constructor_calldata: string[];\n nonce?: BigNumberish;\n};\n\nexport type DeployAccountTransaction = {\n type: TransactionType.DEPLOY_ACCOUNT;\n class_hash: string;\n contract_address_salt: BigNumberish;\n constructor_calldata: string[];\n signature?: string[];\n max_fee?: BigNumberish;\n version?: BigNumberish;\n nonce?: BigNumberish;\n};\n\nexport type InvokeFunctionTransaction = {\n type: TransactionType.INVOKE;\n sender_address: string;\n signature?: string[];\n entry_point_type?: EntryPointType.EXTERNAL; // TODO: check this\n calldata?: RawCalldata;\n nonce: BigNumberish;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n};\n\nexport type Transaction =\n | DeclareTransaction\n | DeployTransaction\n | InvokeFunctionTransaction\n | DeployAccountTransaction;\n\nexport type AddTransactionResponse = {\n transaction_hash: string;\n code?: 'TRANSACTION_RECEIVED';\n address?: string;\n class_hash?: string;\n};\n\nexport type GetCodeResponse = {\n bytecode: ByteCode;\n abi: Abi;\n};\n\nexport interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction {\n transaction_hash: string;\n entry_point_selector: string;\n}\n\nexport type TransactionResponse =\n | DeclareTransaction\n | DeployTransaction\n | InvokeFunctionTransactionResponse;\n\nexport type SuccessfulTransactionResponse = {\n status: TransactionStatus;\n transaction: TransactionResponse;\n block_hash: string;\n block_number: BlockNumber;\n transaction_index: number;\n};\n\nexport type FailedTransactionResponse = {\n status: TransactionStatus.REJECTED;\n transaction_failure_reason: {\n code: string;\n error_message: string;\n };\n transaction: TransactionResponse;\n};\n\nexport type GetTransactionResponse = SuccessfulTransactionResponse | FailedTransactionResponse;\n\nexport type TransactionReceiptResponse =\n | SuccessfulTransactionReceiptResponse\n | FailedTransactionReceiptResponse;\n\nexport type SuccessfulTransactionReceiptResponse = {\n status: TransactionStatus;\n transaction_hash: string;\n transaction_index: number;\n block_hash: string;\n block_number: BlockNumber;\n l2_to_l1_messages: string[];\n events: string[];\n actual_fee: string;\n execution_resources: ExecutionResources;\n};\n\nexport type FailedTransactionReceiptResponse = {\n status: TransactionStatus.REJECTED;\n transaction_failure_reason: {\n code: string;\n error_message: string;\n };\n transaction_hash: string;\n l2_to_l1_messages: string[];\n events: string[];\n};\n\nexport type GetBlockResponse = {\n block_number: number;\n state_root: string;\n block_hash: string;\n transactions: {\n [txHash: string]: TransactionResponse;\n };\n timestamp: number;\n transaction_receipts: {\n [txHash: string]: {\n block_hash: string;\n transaction_hash: string;\n l2_to_l1_messages: {\n to_address: string;\n payload: string[];\n from_address: string;\n }[];\n block_number: BlockNumber;\n status: TransactionStatus;\n transaction_index: number;\n };\n };\n parent_block_hash: string;\n status: BlockStatus;\n gas_price: string;\n sequencer_address: string;\n starknet_version: string;\n};\n\nexport type CallContractTransaction = {\n calldata?: RawCalldata;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n entry_point_selector: string;\n} & (\n | {\n sender_address: string;\n signature: string[];\n }\n | {\n contract_address: string;\n signature?: never;\n }\n);\n\nexport type CallContractResponse = {\n result: string[];\n};\n\nexport type InvokeEstimateFee = Omit;\nexport type DeclareEstimateFee = Omit;\nexport type DeployAccountEstimateFee = Omit;\nexport type DeployEstimateFee = DeployTransaction;\n\nexport type SimulateTransactionResponse = {\n trace: TransactionTraceResponse; // diff with OPENRPC \"transaction_trace\"\n fee_estimation: EstimateFeeResponse;\n};\n\nexport type AccountTransactionItem =\n | InvokeEstimateFee\n | DeclareEstimateFee\n | DeployEstimateFee\n | DeployAccountEstimateFee;\n\n/**\n * Transaction filled with account data\n */\nexport type AccountTransaction = AllowArray;\n\n// Support 0.9.1 changes in a backward-compatible way\nexport type EstimateFeeResponse =\n | {\n overall_fee: number;\n gas_price: number;\n gas_usage: number;\n uint: string;\n }\n | {\n amount: bigint;\n unit: string;\n };\n\nexport type EstimateFeeResponseBulk = AllowArray;\n\nexport type BlockTransactionTracesResponse = {\n traces: Array;\n};\n\nexport type Storage = string;\n\nexport type StateUpdateResponse = {\n block_hash: string;\n new_root: string;\n old_root: string;\n state_diff: {\n storage_diffs: StorageDiffs;\n nonces: Nonces;\n deployed_contracts: Array;\n old_declared_contracts: OldDeclaredContracts;\n declared_classes: DeclaredClasses;\n replaced_classes: ReplacedClasses; // no definition is it array of string\n };\n};\n\nexport type StorageDiffs = { [address: string]: Array };\n\nexport type StateDiffItem = { key: string; value: string };\n\nexport type Nonces = { [address: string]: Nonce };\n\nexport type Nonce = string;\n\nexport type DeployedContracts = DeployedContractItem[];\n\nexport type OldDeclaredContracts = string[];\n\nexport type DeclaredClasses = DeclaredClass[];\n\nexport type DeclaredClass = { class_hash: string; compiled_class_hash: string };\n\nexport type ReplacedClasses = string[]; // no definition is it array of string ?\n\nexport type Endpoints = {\n get_contract_addresses: {\n QUERY: never;\n REQUEST: never;\n RESPONSE: GetContractAddressesResponse;\n };\n add_transaction: {\n QUERY: never;\n REQUEST: Transaction;\n RESPONSE: AddTransactionResponse;\n };\n get_transaction: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: GetTransactionResponse;\n };\n get_transaction_status: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: GetTransactionStatusResponse;\n };\n get_transaction_trace: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: TransactionTraceResponse;\n };\n get_transaction_receipt: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: TransactionReceiptResponse;\n };\n get_nonce: {\n QUERY: {\n contractAddress: string;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: Nonce;\n };\n get_storage_at: {\n QUERY: {\n contractAddress: string;\n key: BigNumberish;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: Storage;\n };\n get_code: {\n QUERY: {\n contractAddress: string;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: GetCodeResponse;\n };\n get_block: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: GetBlockResponse;\n };\n call_contract: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: CallContractTransaction;\n RESPONSE: CallContractResponse;\n };\n estimate_fee: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransactionItem;\n RESPONSE: EstimateFeeResponse;\n };\n get_class_by_hash: {\n QUERY: {\n classHash: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: CompiledContract;\n };\n get_class_hash_at: {\n QUERY: {\n contractAddress: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: string;\n };\n get_state_update: {\n QUERY: {\n blockHash?: string;\n blockNumber?: BlockNumber;\n };\n REQUEST: never;\n RESPONSE: StateUpdateResponse;\n };\n get_full_contract: {\n QUERY: {\n contractAddress: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: CompiledContract;\n };\n estimate_message_fee: {\n QUERY: any;\n REQUEST: any;\n RESPONSE: EstimateFeeResponse;\n };\n simulate_transaction: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransaction;\n RESPONSE: SimulateTransactionResponse;\n };\n estimate_fee_bulk: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransaction;\n RESPONSE: EstimateFeeResponseBulk;\n };\n get_block_traces: {\n QUERY: {\n blockHash?: string;\n blockNumber?: BlockNumber;\n };\n REQUEST: never;\n RESPONSE: BlockTransactionTracesResponse;\n };\n get_compiled_class_by_class_hash: {\n QUERY: {\n classHash: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: any;\n RESPONSE: CairoAssembly;\n };\n};\n","export default function assert(condition: any, message?: string): asserts condition {\n if (!condition) {\n throw new Error(message || 'Assertion failure');\n }\n}\n","import { hexToBytes as hexToBytesNoble } from '@noble/curves/abstract/utils';\n\nimport { BigNumberish } from '../types';\nimport assert from './assert';\nimport { addHexPrefix, removeHexPrefix } from './encode';\n\n/** @deprecated prefer importing from 'types' over 'num' */\nexport type { BigNumberish };\n\nexport function isHex(hex: string): boolean {\n return /^0x[0-9a-f]*$/i.test(hex);\n}\n\nexport function toBigInt(value: BigNumberish): bigint {\n return BigInt(value);\n}\n\nexport function isBigInt(value: any): value is bigint {\n return typeof value === 'bigint';\n}\n\nexport function toHex(number: BigNumberish): string {\n return addHexPrefix(toBigInt(number).toString(16));\n}\n\n/**\n * Convert BigNumberish to STORAGE_KEY\n * Same as toHex but conforming pattern STORAGE_KEY pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$\n * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.\n * 0x0 + [0-7] + 62 hex = 0x + 64 hex\n * @param number BigNumberish\n */\nexport function toStorageKey(number: BigNumberish): string {\n const res = addHexPrefix(toBigInt(number).toString(16).padStart(64, '0'));\n return res;\n}\n\nexport function hexToDecimalString(hex: string): string {\n return BigInt(addHexPrefix(hex)).toString(10);\n}\n\n/**\n * Remove hex string leading zero and lower case '0x01A'.. -> '0x1a..'\n * @param hex string\n */\nexport const cleanHex = (hex: string) => hex.toLowerCase().replace(/^(0x)0+/, '$1');\n\n/*\n Asserts input is equal to or greater then lowerBound and lower then upperBound.\n Assert message specifies inputName.\n input, lowerBound, and upperBound should be of type BN.\n inputName should be a string.\n*/\nexport function assertInRange(\n input: BigNumberish,\n lowerBound: BigNumberish,\n upperBound: BigNumberish,\n inputName = ''\n) {\n const messageSuffix = inputName === '' ? 'invalid length' : `invalid ${inputName} length`;\n const inputBigInt = BigInt(input);\n const lowerBoundBigInt = BigInt(lowerBound);\n const upperBoundBigInt = BigInt(upperBound);\n\n assert(\n inputBigInt >= lowerBoundBigInt && inputBigInt <= upperBoundBigInt,\n `Message not signable, ${messageSuffix}.`\n );\n}\n\nexport function bigNumberishArrayToDecimalStringArray(rawCalldata: BigNumberish[]): string[] {\n return rawCalldata.map((x) => toBigInt(x).toString(10));\n}\n\nexport function bigNumberishArrayToHexadecimalStringArray(rawCalldata: BigNumberish[]): string[] {\n return rawCalldata.map((x) => toHex(x));\n}\n\nexport const isStringWholeNumber = (value: string) => /^\\d+$/.test(value);\nexport const toHexString = (value: string) => toHex(value);\n\nexport function getDecimalString(value: string) {\n if (isHex(value)) {\n return hexToDecimalString(value);\n }\n if (isStringWholeNumber(value)) {\n return value;\n }\n throw new Error(`${value} need to be hex-string or whole-number-string`);\n}\n\nexport function getHexString(value: string) {\n if (isHex(value)) {\n return value;\n }\n if (isStringWholeNumber(value)) {\n return toHexString(value);\n }\n throw new Error(`${value} need to be hex-string or whole-number-string`);\n}\n\nexport function getHexStringArray(value: Array) {\n return value.map((el) => getHexString(el));\n}\n\nexport const toCairoBool = (value: boolean): string => (+value).toString();\n\n/**\n * Convert a hex string to an array of Bytes (Uint8Array)\n * @param value hex string\n * @returns an array of Bytes\n */\nexport function hexToBytes(value: string): Uint8Array {\n if (!isHex(value)) throw new Error(`${value} need to be a hex-string`);\n\n let adaptedValue: string = removeHexPrefix(value);\n if (adaptedValue.length % 2 !== 0) {\n adaptedValue = `0${adaptedValue}`;\n }\n return hexToBytesNoble(adaptedValue);\n}\n","import { keccak } from 'micro-starknet';\n\nimport { MASK_250 } from '../constants';\nimport { BigNumberish } from '../types';\nimport { addHexPrefix, removeHexPrefix, utf8ToArray } from './encode';\nimport { hexToBytes, isHex, isStringWholeNumber, toHex, toHexString } from './num';\n\n/**\n * Keccak hash BigNumberish value\n * @param value BigNumberish\n * @returns string - hexadecimal string\n */\nexport function keccakBn(value: BigNumberish): string {\n const hexWithoutPrefix = removeHexPrefix(toHex(BigInt(value)));\n const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`;\n return addHexPrefix(keccak(hexToBytes(addHexPrefix(evenHex))).toString(16));\n}\n\n/**\n * Keccak hash string value\n * @param value string\n * @returns string - hexadecimal string\n */\nfunction keccakHex(value: string): string {\n return addHexPrefix(keccak(utf8ToArray(value)).toString(16));\n}\n\n/**\n * Function to get the starknet keccak hash from a string\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L17-L22)\n * @param value - string you want to get the starknetKeccak hash from\n * @returns starknet keccak hash as BigNumber\n */\nexport function starknetKeccak(value: string): bigint {\n const hash = BigInt(keccakHex(value));\n // eslint-disable-next-line no-bitwise\n return hash & MASK_250;\n}\n\n/**\n * Function to get the hex selector from a given function name\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L25-L26)\n * @param funcName - selectors abi function name\n * @returns hex selector of given abi function name\n */\nexport function getSelectorFromName(funcName: string) {\n // sometimes BigInteger pads the hex string with zeros, which is not allowed in the starknet api\n return toHex(starknetKeccak(funcName));\n}\n\n/**\n * Function to get hex selector from function name, decimal string or hex string\n * @param value hex string | decimal string | string\n * @returns Hex selector\n */\nexport function getSelector(value: string) {\n if (isHex(value)) {\n return value;\n }\n if (isStringWholeNumber(value)) {\n return toHexString(value);\n }\n return getSelectorFromName(value);\n}\n","import { addHexPrefix, removeHexPrefix } from './encode';\nimport { isHex, isStringWholeNumber } from './num';\n\nconst TEXT_TO_FELT_MAX_LEN = 31;\n\nexport function isASCII(str: string) {\n // eslint-disable-next-line no-control-regex\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\n// function to check if string has less or equal 31 characters\nexport function isShortString(str: string) {\n return str.length <= TEXT_TO_FELT_MAX_LEN;\n}\n\n// function to check if string is a decimal\nexport function isDecimalString(decim: string): boolean {\n return /^[0-9]*$/i.test(decim);\n}\n\n/**\n * check if value is string text, and not string-hex, string-number\n * @param val any\n * @returns boolean\n */\nexport function isText(val: any) {\n return typeof val === 'string' && !isHex(val) && !isStringWholeNumber(val);\n}\n\nexport const isShortText = (val: any) => isText(val) && isShortString(val);\nexport const isLongText = (val: any) => isText(val) && !isShortString(val);\n\nexport function splitLongString(longStr: string): string[] {\n const regex = RegExp(`[^]{1,${TEXT_TO_FELT_MAX_LEN}}`, 'g');\n return longStr.match(regex) || [];\n}\n\n/**\n * Convert an ASCII string to an hexadecimal string.\n * @param str - ASCII string -\n * 31 characters maxi. Ex : \"uri/item23.jpg\"\n * @returns a string representing an Hex number 248 bits max.\n * @Example\n * ```typescript\n * const myEncodedString: string = encodeShortString(\"uri/pict/t38.jpg\");\n * ```\n * returns : string : \"0x7572692f706963742f7433382e6a7067\"\n */\nexport function encodeShortString(str: string): string {\n if (!isASCII(str)) throw new Error(`${str} is not an ASCII string`);\n if (!isShortString(str)) throw new Error(`${str} is too long`);\n return addHexPrefix(str.replace(/./g, (char) => char.charCodeAt(0).toString(16)));\n}\n\n/**\n * Convert an hexadecimal or decimal string to an ASCII string.\n * @param str - string - representing a 248 bits max number.\n *\n * Ex : hex : \"0x1A4F64EA56\" or decimal : \"236942575435676423\"\n * @returns a string with 31 characters max.\n * @Example\n * ```typescript\n * const myDecodedString: string = decodeShortString(\"0x7572692f706963742f7433382e6a7067\");\n * ```\n * return : string : \"uri/pict/t38.jpg\"\n */\nexport function decodeShortString(str: string): string {\n if (!isASCII(str)) throw new Error(`${str} is not an ASCII string`);\n if (isHex(str)) {\n return removeHexPrefix(str).replace(/.{2}/g, (hex) => String.fromCharCode(parseInt(hex, 16)));\n }\n if (isDecimalString(str)) {\n return decodeShortString('0X'.concat(BigInt(str).toString(16)));\n }\n throw new Error(`${str} is not Hex or decimal`);\n}\n","import { Abi, AbiStructs, BigNumberish, Uint, Uint256 } from '../../types';\nimport { isBigInt, isHex, isStringWholeNumber } from '../num';\nimport { encodeShortString, isShortString, isText } from '../shortString';\nimport { UINT_128_MAX, isUint256 } from '../uint256';\n\nexport const isLen = (name: string) => /_len$/.test(name);\nexport const isTypeFelt = (type: string) => type === 'felt' || type === 'core::felt252';\nexport const isTypeArray = (type: string) =>\n /\\*/.test(type) || type.startsWith('core::array::Array::');\nexport const isTypeTuple = (type: string) => /^\\(.*\\)$/i.test(type);\nexport const isTypeNamedTuple = (type: string) => /\\(.*\\)/i.test(type) && type.includes(':');\nexport const isTypeStruct = (type: string, structs: AbiStructs) => type in structs;\nexport const isTypeUint = (type: string) => Object.values(Uint).includes(type as Uint);\nexport const isTypeUint256 = (type: string) => type === 'core::integer::u256';\nexport const isTypeBool = (type: string) => type === 'core::bool';\nexport const isTypeContractAddress = (type: string) =>\n type === 'core::starknet::contract_address::ContractAddress';\nexport const isCairo1Type = (type: string) => type.includes('core::');\n\nexport const getArrayType = (type: string) => {\n if (isCairo1Type(type)) {\n return type.substring(type.indexOf('<') + 1, type.lastIndexOf('>'));\n }\n return type.replace('*', '');\n};\n\n/**\n * tells if an ABI comes from a Cairo 1 contract\n *\n * @param abi representing the interface of a Cairo contract\n * @returns TRUE if it is an ABI from a Cairo1 contract\n * @example\n * ```typescript\n * const isCairo1: boolean = isCairo1Abi(myAbi: Abi);\n * ```\n */\nexport function isCairo1Abi(abi: Abi): boolean {\n const firstFunction = abi.find((entry) => entry.type === 'function');\n if (!firstFunction) {\n if (abi.find((it) => it.type === 'interface')) {\n // Expected in Cairo1 version 2\n return true;\n }\n throw new Error(`Error in ABI. No function in ABI.`);\n }\n if (firstFunction.inputs.length) {\n return isCairo1Type(firstFunction.inputs[0].type);\n }\n if (firstFunction.outputs.length) {\n return isCairo1Type(firstFunction.outputs[0].type);\n }\n throw new Error(`Error in ABI. No input/output in function ${firstFunction.name}`);\n}\n\n/**\n * named tuple are described as js object {}\n * struct types are described as js object {}\n * array types are described as js array []\n */\n\n/**\n * Uint256 cairo type (helper for common struct type)\n */\nexport const uint256 = (it: BigNumberish): Uint256 => {\n const bn = BigInt(it);\n if (!isUint256(bn)) throw new Error('Number is too large');\n return {\n // eslint-disable-next-line no-bitwise\n low: (bn & UINT_128_MAX).toString(10),\n // eslint-disable-next-line no-bitwise\n high: (bn >> 128n).toString(10),\n };\n};\n\n/**\n * unnamed tuple cairo type (helper same as common struct type)\n */\nexport const tuple = (\n ...args: (BigNumberish | object | boolean)[]\n): Record => ({ ...args });\n\n/**\n * felt cairo type\n */\nexport function felt(it: BigNumberish): string {\n // BN or number\n if (isBigInt(it) || (typeof it === 'number' && Number.isInteger(it))) {\n return it.toString();\n }\n // string text\n if (isText(it)) {\n if (!isShortString(it as string))\n throw new Error(\n `${it} is a long string > 31 chars, felt can store short strings, split it to array of short strings`\n );\n const encoded = encodeShortString(it as string);\n return BigInt(encoded).toString();\n }\n // hex string\n if (typeof it === 'string' && isHex(it)) {\n // toBN().toString\n return BigInt(it).toString();\n }\n // string number (already converted), or unhandled type\n if (typeof it === 'string' && isStringWholeNumber(it)) {\n return it;\n }\n // bool to felt\n if (typeof it === 'boolean') {\n return `${+it}`;\n }\n\n throw new Error(`${it} can't be computed by felt()`);\n}\n","/* eslint-disable no-bitwise */\nimport { BigNumberish, Uint256 } from '../types';\nimport { addHexPrefix } from './encode';\nimport { toBigInt } from './num';\n\n/** @deprecated prefer importing from 'types' over 'uint256' */\nexport type { Uint256 };\n\n// function to convert Uint256 to BN\nexport function uint256ToBN(uint256: Uint256) {\n return (toBigInt(uint256.high) << 128n) + toBigInt(uint256.low);\n}\n\nexport const UINT_128_MAX = (1n << 128n) - 1n;\nexport const UINT_256_MAX = (1n << 256n) - 1n;\n// function to check if BN is smaller or equal 2**256-1\nexport function isUint256(bn: BigNumberish): boolean {\n return toBigInt(bn) <= UINT_256_MAX;\n}\n\n// function to convert BN to Uint256 hex\nexport function bnToUint256(bignumber: BigNumberish): Uint256 {\n const bn = toBigInt(bignumber);\n if (!isUint256(bn)) throw new Error('Number is too large');\n return {\n low: addHexPrefix((bn & UINT_128_MAX).toString(16)),\n high: addHexPrefix((bn >> 128n).toString(16)),\n };\n}\n","import { isBigInt } from '../num';\nimport { decodeShortString } from '../shortString';\n\nconst guard = {\n isBN: (data: any, type: any, key: any) => {\n if (!isBigInt(data[key]))\n throw new Error(\n `Data and formatter mismatch on ${key}:${type[key]}, expected response data ${key}:${\n data[key]\n } to be BN instead it is ${typeof data[key]}`\n );\n },\n unknown: (data: any, type: any, key: any) => {\n throw new Error(`Unhandled formatter type on ${key}:${type[key]} for data ${key}:${data[key]}`);\n },\n};\n\nexport default function formatter(data: any, type: any, sameType?: any) {\n // match data element with type element\n return Object.entries(data).reduce((acc, [key, value]: [any, any]) => {\n const elType = sameType ?? type[key];\n\n if (!(key in type) && !sameType) {\n // no type definition for element return original element\n acc[key] = value;\n return acc;\n }\n\n if (elType === 'string') {\n if (Array.isArray(data[key])) {\n // long string (felt*)\n const arrayStr = formatter(\n data[key],\n data[key].map((_: any) => elType)\n );\n acc[key] = Object.values(arrayStr).join('');\n return acc;\n }\n guard.isBN(data, type, key);\n acc[key] = decodeShortString(value);\n return acc;\n }\n if (elType === 'number') {\n guard.isBN(data, type, key);\n acc[key] = Number(value);\n return acc;\n }\n if (typeof elType === 'function') {\n acc[key] = elType(value);\n return acc;\n }\n if (Array.isArray(elType)) {\n const arrayObj = formatter(data[key], elType, elType[0]);\n acc[key] = Object.values(arrayObj);\n return acc;\n }\n if (typeof elType === 'object') {\n acc[key] = formatter(data[key], elType);\n return acc;\n }\n\n guard.unknown(data, type, key);\n return acc;\n }, {} as any);\n}\n","import { Abi, FunctionAbi } from '../../../types';\nimport { isLen } from '../cairo';\nimport { AbiParserInterface } from './interface';\n\nexport class AbiParser1 implements AbiParserInterface {\n abi: Abi;\n\n constructor(abi: Abi) {\n this.abi = abi;\n }\n\n /**\n * abi method inputs length without '_len' inputs\n * cairo 0 reducer\n * @param abiMethod FunctionAbi\n * @returns number\n */\n public methodInputsLength(abiMethod: FunctionAbi) {\n return abiMethod.inputs.reduce((acc, input) => (!isLen(input.name) ? acc + 1 : acc), 0);\n }\n\n /**\n * get method definition from abi\n * @param name string\n * @returns FunctionAbi | undefined\n */\n public getMethod(name: string): FunctionAbi | undefined {\n return this.abi.find((it) => it.name === name);\n }\n\n /**\n * Get Abi in legacy format\n * @returns Abi\n */\n public getLegacyFormat() {\n return this.abi;\n }\n}\n","import { Abi, FunctionAbi } from '../../../types';\nimport { AbiParserInterface } from './interface';\n\nexport class AbiParser2 implements AbiParserInterface {\n abi: Abi;\n\n constructor(abi: Abi) {\n this.abi = abi;\n }\n\n /**\n * abi method inputs length\n * @param abiMethod FunctionAbi\n * @returns number\n */\n public methodInputsLength(abiMethod: FunctionAbi) {\n return abiMethod.inputs.length;\n }\n\n /**\n * get method definition from abi\n * @param name string\n * @returns FunctionAbi | undefined\n */\n public getMethod(name: string): FunctionAbi | undefined {\n const intf = this.abi.find((it) => it.type === 'interface');\n return intf.items.find((it: any) => it.name === name);\n }\n\n /**\n * Get Abi in legacy format\n * @returns Abi\n */\n public getLegacyFormat(): Abi {\n return this.abi.flatMap((e) => {\n if (e.type === 'interface') {\n return e.items;\n }\n return e;\n });\n }\n}\n","import { Abi, FunctionAbi, RawArgs } from '../../../types';\nimport { isCairo1Abi } from '../cairo';\nimport { AbiParserInterface } from './interface';\nimport { AbiParser1 } from './parser-0-1.1.0';\nimport { AbiParser2 } from './parser-2.0.0';\n\nexport function createAbiParser(abi: Abi): AbiParserInterface {\n const version = getAbiVersion(abi);\n if (version === 0 || version === 1) {\n return new AbiParser1(abi);\n }\n if (version === 2) {\n return new AbiParser2(abi);\n }\n throw Error(`Unsupported ABI version ${version}`);\n}\n\nexport function getAbiVersion(abi: Abi) {\n if (abi.find((it) => it.type === 'interface')) return 2;\n if (isCairo1Abi(abi)) return 1;\n return 0;\n}\n\nexport function isNoConstructorValid(\n method: string,\n argsCalldata: RawArgs,\n abiMethod?: FunctionAbi\n) {\n // No constructor in abi and validly empty args\n return method === 'constructor' && !abiMethod && !argsCalldata.length;\n}\n","/* eslint-disable no-plusplus */\nimport { isCairo1Type, isTypeNamedTuple } from './cairo';\n\nfunction parseNamedTuple(namedTuple: string): any {\n const name = namedTuple.substring(0, namedTuple.indexOf(':'));\n const type = namedTuple.substring(name.length + ':'.length);\n return { name, type };\n}\n\nfunction parseSubTuple(s: string) {\n if (!s.includes('(')) return { subTuple: [], result: s };\n const subTuple: string[] = [];\n let result = '';\n let i = 0;\n while (i < s.length) {\n if (s[i] === '(') {\n let counter = 1;\n const lBracket = i;\n i++;\n while (counter) {\n if (s[i] === ')') counter--;\n if (s[i] === '(') counter++;\n i++;\n }\n subTuple.push(s.substring(lBracket, i));\n result += ' ';\n i--;\n } else {\n result += s[i];\n }\n i++;\n }\n\n return {\n subTuple,\n result,\n };\n}\n\nfunction extractCairo0Tuple(type: string) {\n const cleanType = type.replace(/\\s/g, '').slice(1, -1); // remove first lvl () and spaces\n\n // Decompose subTuple\n const { subTuple, result } = parseSubTuple(cleanType);\n\n // Recompose subTuple\n let recomposed = result.split(',').map((it) => {\n return subTuple.length ? it.replace(' ', subTuple.shift() as string) : it;\n });\n\n // Parse named tuple\n if (isTypeNamedTuple(type)) {\n recomposed = recomposed.reduce((acc, it) => {\n return acc.concat(parseNamedTuple(it));\n }, []);\n }\n\n return recomposed;\n}\n\nfunction extractCairo1Tuple(type: string) {\n // un-named tuples support\n const cleanType = type.replace(/\\s/g, '').slice(1, -1); // remove first lvl () and spaces\n const { subTuple, result } = parseSubTuple(cleanType);\n const recomposed = result.split(',').map((it) => {\n return subTuple.length ? it.replace(' ', subTuple.shift() as string) : it;\n });\n return recomposed;\n}\n\n/**\n * Convert tuple string definition into object like definition\n * @param type tuple string definition\n * @returns object like tuple\n */\nexport default function extractTupleMemberTypes(type: string): (string | object)[] {\n if (isCairo1Type(type)) {\n return extractCairo1Tuple(type);\n }\n return extractCairo0Tuple(type);\n}\n","import { AbiEntry, AbiStructs, RawArgsObject, Uint } from '../../types';\nimport {\n getArrayType,\n isCairo1Type,\n isLen,\n isTypeArray,\n isTypeStruct,\n isTypeTuple,\n isTypeUint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\nfunction errorU256(key: string) {\n return Error(\n `Your object includes the property : ${key}, containing an Uint256 object without the 'low' and 'high' keys.`\n );\n}\nexport default function orderPropsByAbi(\n unorderedObject: RawArgsObject,\n abiOfObject: AbiEntry[],\n structs: AbiStructs\n): object {\n const orderStruct = (unorderedObject2: RawArgsObject, abiObject: AbiEntry[]): object => {\n const orderedObject2 = abiObject.reduce((orderedObject, abiParam) => {\n const setProperty = (value?: any) =>\n Object.defineProperty(orderedObject, abiParam.name, {\n enumerable: true,\n value: value ?? unorderedObject2[abiParam.name],\n });\n\n if (unorderedObject2[abiParam.name] === 'undefined') {\n if (isCairo1Type(abiParam.type) || !isLen(abiParam.name)) {\n throw Error(`Your object needs a property with key : ${abiParam.name} .`);\n }\n }\n switch (true) {\n case isTypeStruct(abiParam.type, structs):\n setProperty(\n orderStruct(\n unorderedObject2[abiParam.name] as RawArgsObject,\n structs[abiParam.type].members\n )\n );\n break;\n case isTypeUint256(abiParam.type): {\n const u256 = unorderedObject2[abiParam.name];\n if (typeof u256 !== 'object') {\n // BigNumberish --> just copy\n setProperty();\n break;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n setProperty({ low: u256.low, high: u256.high });\n break;\n }\n case isTypeTuple(abiParam.type):\n setProperty(orderTuple(unorderedObject2[abiParam.name] as RawArgsObject, abiParam));\n break;\n case isTypeArray(abiParam.type):\n setProperty(orderArray(unorderedObject2[abiParam.name] as Array, abiParam));\n break;\n case !isCairo1Type(abiParam.type) && isLen(abiParam.name):\n // Cairo 0 array_len. Nothing to do, go to next abi item\n break;\n default: // do not needs recursion --> just copy\n setProperty();\n }\n return orderedObject;\n }, {});\n return orderedObject2;\n };\n\n function orderArray(myArray: Array | string, abiParam: AbiEntry): Array | string {\n const typeInArray = getArrayType(abiParam.type);\n if (typeof myArray === 'string') {\n return myArray; // longstring\n }\n switch (true) {\n case typeInArray in structs:\n return myArray.map((myObj) => orderStruct(myObj, structs[typeInArray].members));\n case typeInArray === Uint.u256:\n return myArray.map((u256) => {\n if (typeof u256 !== 'object') {\n return u256;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n return { low: u256.low, high: u256.high };\n });\n case isTypeTuple(typeInArray):\n return myArray.map((myElem) => orderTuple(myElem, { name: '0', type: typeInArray }));\n case isTypeArray(typeInArray):\n return myArray.map((myElem) => orderArray(myElem, { name: '0', type: typeInArray }));\n default: // is an array of litterals\n return myArray;\n }\n }\n\n function orderTuple(unorderedObject2: RawArgsObject, abiParam: AbiEntry): object {\n const typeList = extractTupleMemberTypes(abiParam.type);\n const orderedObject2 = typeList.reduce((orderedObject: object, abiTypeCairoX: any, index) => {\n const myObjKeys: string[] = Object.keys(unorderedObject2);\n const setProperty = (value?: any) =>\n Object.defineProperty(orderedObject, index.toString(), {\n enumerable: true,\n value: value ?? unorderedObject2[myObjKeys[index]],\n });\n const abiType: string = abiTypeCairoX?.type ? abiTypeCairoX.type : abiTypeCairoX; // Named tuple, or tuple\n\n switch (true) {\n case isTypeStruct(abiType, structs):\n setProperty(\n orderStruct(\n unorderedObject2[myObjKeys[index]] as RawArgsObject,\n structs[abiType].members\n )\n );\n break;\n case isTypeUint256(abiType): {\n const u256 = unorderedObject2[myObjKeys[index]];\n if (typeof u256 !== 'object') {\n // BigNumberish --> just copy\n setProperty();\n break;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n setProperty({ low: u256.low, high: u256.high });\n break;\n }\n case isTypeTuple(abiType):\n setProperty(\n orderTuple(unorderedObject2[myObjKeys[index]] as RawArgsObject, {\n name: '0',\n type: abiType,\n })\n );\n break;\n case isTypeArray(abiType):\n setProperty(\n orderArray(unorderedObject2[myObjKeys[index]] as Array, {\n name: '0',\n type: abiType,\n })\n );\n break;\n default: // litterals, do not needs recursion --> just copy\n setProperty();\n }\n return orderedObject;\n }, {});\n return orderedObject2;\n }\n return orderStruct(unorderedObject, abiOfObject);\n}\n","import { AbiEntry, AbiStructs, BigNumberish, ParsedStruct, Tupled, Uint256 } from '../../types';\nimport { isText, splitLongString } from '../shortString';\nimport {\n felt,\n getArrayType,\n isTypeArray,\n isTypeStruct,\n isTypeTuple,\n isTypeUint256,\n uint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\n/**\n * parse base types\n * @param type type from abi\n * @param val value provided\n * @returns string | string[]\n */\nfunction parseBaseTypes(type: string, val: BigNumberish) {\n switch (true) {\n case isTypeUint256(type):\n // eslint-disable-next-line no-case-declarations\n const el_uint256 = uint256(val);\n return [felt(el_uint256.low), felt(el_uint256.high)];\n default:\n return felt(val);\n }\n}\n\n/**\n * Parse tuple type string to array of known objects\n * @param element request element\n * @param typeStr tuple type string\n * @returns Tupled[]\n */\nfunction parseTuple(element: object, typeStr: string): Tupled[] {\n const memberTypes = extractTupleMemberTypes(typeStr);\n const elements = Object.values(element);\n\n if (elements.length !== memberTypes.length) {\n throw Error(\n `ParseTuple: provided and expected abi tuple size do not match.\n provided: ${elements} \n expected: ${memberTypes}`\n );\n }\n\n return memberTypes.map((it: any, dx: number) => {\n return {\n element: elements[dx],\n type: it.type ?? it,\n };\n });\n}\n\nfunction parseUint256(element: object | BigNumberish) {\n if (typeof element === 'object') {\n const { low, high } = element as Uint256;\n return [felt(low as BigNumberish), felt(high as BigNumberish)];\n }\n const el_uint256 = uint256(element);\n return [felt(el_uint256.low), felt(el_uint256.high)];\n}\n\n/**\n * Deep parse of the object that has been passed to the method\n *\n * @param element - element that needs to be parsed\n * @param type - name of the method\n * @param structs - structs from abi\n * @return {string | string[]} - parsed arguments in format that contract is expecting\n */\nfunction parseCalldataValue(\n element: ParsedStruct | BigNumberish | BigNumberish[],\n type: string,\n structs: AbiStructs\n): string | string[] {\n if (element === undefined) {\n throw Error(`Missing parameter for type ${type}`);\n }\n\n // value is Array\n if (Array.isArray(element)) {\n const result: string[] = [];\n result.push(felt(element.length)); // Add length to array\n const arrayType = getArrayType(type);\n\n return element.reduce((acc, it) => {\n return acc.concat(parseCalldataValue(it, arrayType, structs));\n }, result);\n }\n\n // checking if the passed element is struct\n if (structs[type] && structs[type].members.length) {\n if (isTypeUint256(type)) {\n return parseUint256(element);\n }\n\n const { members } = structs[type];\n const subElement = element as any;\n\n return members.reduce((acc, it: AbiEntry) => {\n return acc.concat(parseCalldataValue(subElement[it.name], it.type, structs));\n }, [] as string[]);\n }\n // check if abi element is tuple\n if (isTypeTuple(type)) {\n const tupled = parseTuple(element as object, type);\n\n return tupled.reduce((acc, it: Tupled) => {\n const parsedData = parseCalldataValue(it.element, it.type, structs);\n return acc.concat(parsedData);\n }, [] as string[]);\n }\n // check if u256 C1v0\n if (isTypeUint256(type)) {\n return parseUint256(element);\n }\n if (typeof element === 'object') {\n throw Error(`Parameter ${element} do not align with abi parameter ${type}`);\n }\n return parseBaseTypes(type, element);\n}\n\n/**\n * Parse one field of the calldata by using input field from the abi for that method\n *\n * @param argsIterator - Iterator for value of the field\n * @param input - input(field) information from the abi that will be used to parse the data\n * @param structs - structs from abi\n * @return {string | string[]} - parsed arguments in format that contract is expecting\n */\nexport function parseCalldataField(\n argsIterator: Iterator,\n input: AbiEntry,\n structs: AbiStructs\n): string | string[] {\n const { name, type } = input;\n let { value } = argsIterator.next();\n\n switch (true) {\n // Array\n case isTypeArray(type):\n if (!Array.isArray(value) && !isText(value)) {\n throw Error(`ABI expected parameter ${name} to be array or long string, got ${value}`);\n }\n if (typeof value === 'string') {\n // long string match cairo felt*\n value = splitLongString(value);\n }\n return parseCalldataValue(value, input.type, structs);\n\n // Struct or Tuple\n case isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type):\n return parseCalldataValue(value as ParsedStruct | BigNumberish[], type, structs);\n\n // Felt or unhandled\n default:\n return parseBaseTypes(type, value);\n }\n}\n","/* eslint-disable no-case-declarations */\nimport { AbiEntry, AbiStructs, Args, BigNumberish, ParsedStruct } from '../../types';\nimport { uint256ToBN } from '../uint256';\nimport {\n getArrayType,\n isCairo1Type,\n isLen,\n isTypeArray,\n isTypeBool,\n isTypeTuple,\n isTypeUint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\n/**\n * Parse base types\n * @param type type of element\n * @param it iterator\n * @returns bigint | boolean\n */\nfunction parseBaseTypes(type: string, it: Iterator) {\n let temp;\n switch (true) {\n case isTypeBool(type):\n temp = it.next().value;\n return Boolean(BigInt(temp));\n case isTypeUint256(type):\n const low = it.next().value;\n const high = it.next().value;\n return uint256ToBN({ low, high });\n default:\n temp = it.next().value;\n return BigInt(temp);\n }\n}\n\n/**\n * Parse of the response elements that are converted to Object (Struct) by using the abi\n *\n * @param responseIterator - iterator of the response\n * @param element - element of the field {name: string, type: string}\n * @param structs - structs from abi\n * @return {any} - parsed arguments in format that contract is expecting\n */\nfunction parseResponseValue(\n responseIterator: Iterator,\n element: { name: string; type: string },\n structs: AbiStructs\n): BigNumberish | ParsedStruct | boolean | any[] {\n // type uint256 struct (c1v2)\n if (isTypeUint256(element.type)) {\n const low = responseIterator.next().value;\n const high = responseIterator.next().value;\n return uint256ToBN({ low, high });\n }\n\n // type struct\n if (element.type in structs && structs[element.type]) {\n return structs[element.type].members.reduce((acc, el) => {\n acc[el.name] = parseResponseValue(responseIterator, el, structs);\n return acc;\n }, {} as any);\n }\n\n // type tuple\n if (isTypeTuple(element.type)) {\n const memberTypes = extractTupleMemberTypes(element.type);\n return memberTypes.reduce((acc, it: any, idx) => {\n const name = it?.name ? it.name : idx;\n const type = it?.type ? it.type : it;\n const el = { name, type };\n acc[name] = parseResponseValue(responseIterator, el, structs);\n return acc;\n }, {} as any);\n }\n\n // type c1 array\n if (isTypeArray(element.type)) {\n // eslint-disable-next-line no-case-declarations\n const parsedDataArr: (BigNumberish | ParsedStruct | boolean | any[])[] = [];\n const el = { name: '', type: getArrayType(element.type) };\n const len = BigInt(responseIterator.next().value); // get length\n while (parsedDataArr.length < len) {\n parsedDataArr.push(parseResponseValue(responseIterator, el, structs));\n }\n return parsedDataArr;\n }\n\n // base type\n return parseBaseTypes(element.type, responseIterator);\n}\n\n/**\n * Parse elements of the response and structuring them into one field by using output property from the abi for that method\n *\n * @param responseIterator - iterator of the response\n * @param output - output(field) information from the abi that will be used to parse the data\n * @param structs - structs from abi\n * @param parsedResult\n * @return - parsed response corresponding to the abi structure of the field\n */\nexport default function responseParser(\n responseIterator: Iterator,\n output: AbiEntry,\n structs: AbiStructs,\n parsedResult?: Args\n): any {\n const { name, type } = output;\n let temp;\n\n switch (true) {\n case isLen(name):\n temp = responseIterator.next().value;\n return BigInt(temp);\n\n case type in structs || isTypeTuple(type):\n return parseResponseValue(responseIterator, output, structs);\n\n case isTypeArray(type):\n // C1 Array\n if (isCairo1Type(type)) {\n return parseResponseValue(responseIterator, output, structs);\n }\n // C0 Array\n // eslint-disable-next-line no-case-declarations\n const parsedDataArr: (BigNumberish | ParsedStruct | boolean | any[])[] = [];\n if (parsedResult && parsedResult[`${name}_len`]) {\n const arrLen = parsedResult[`${name}_len`] as number;\n while (parsedDataArr.length < arrLen) {\n parsedDataArr.push(\n parseResponseValue(\n responseIterator,\n { name, type: output.type.replace('*', '') },\n structs\n )\n );\n }\n }\n return parsedDataArr;\n\n default:\n return parseBaseTypes(type, responseIterator);\n }\n}\n","/**\n * Validate cairo contract method arguments\n * Flow: Determine type from abi and than validate against parameter\n */\nimport { AbiEntry, AbiStructs, BigNumberish, FunctionAbi, Uint } from '../../types';\nimport assert from '../assert';\nimport { toBigInt } from '../num';\nimport { isLongText } from '../shortString';\nimport { uint256ToBN } from '../uint256';\nimport {\n getArrayType,\n isLen,\n isTypeArray,\n isTypeBool,\n isTypeContractAddress,\n isTypeFelt,\n isTypeStruct,\n isTypeTuple,\n isTypeUint,\n} from './cairo';\n\nconst validateFelt = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'string' || typeof parameter === 'number' || typeof parameter === 'bigint',\n `Validate: arg ${input.name} should be a felt typed as (String, Number or BigInt)`\n );\n};\n\nconst validateUint = (parameter: any, input: AbiEntry) => {\n if (typeof parameter === 'number') {\n assert(\n parameter <= Number.MAX_SAFE_INTEGER,\n `Validation: Parameter is to large to be typed as Number use (BigInt or String)`\n );\n }\n assert(\n typeof parameter === 'string' ||\n typeof parameter === 'number' ||\n typeof parameter === 'bigint' ||\n (typeof parameter === 'object' && 'low' in parameter && 'high' in parameter),\n `Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)`\n );\n const param = typeof parameter === 'object' ? uint256ToBN(parameter) : toBigInt(parameter);\n\n switch (input.type) {\n case Uint.u8:\n assert(\n param >= 0n && param <= 255n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0 - 255]`\n );\n break;\n\n case Uint.u16:\n assert(\n param >= 0n && param <= 65535n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 65535]`\n );\n break;\n\n case Uint.u32:\n assert(\n param >= 0n && param <= 4294967295n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 4294967295]`\n );\n break;\n\n case Uint.u64:\n assert(\n param >= 0n && param <= 2n ** 64n - 1n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^64-1]`\n );\n break;\n\n case Uint.u128:\n assert(\n param >= 0n && param <= 2n ** 128n - 1n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^128-1]`\n );\n break;\n\n case Uint.u256:\n assert(\n param >= 0n && param <= 2n ** 256n - 1n,\n `Validate: arg ${input.name} is ${input.type} 0 - 2^256-1`\n );\n break;\n\n default:\n break;\n }\n};\n\nconst validateBool = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'boolean',\n `Validate: arg ${input.name} of cairo type ${input.type} should be type (Boolean)`\n );\n};\n\nconst validateStruct = (parameter: any, input: AbiEntry, structs: AbiStructs) => {\n // c1v2 uint256 in struct\n if (input.type === Uint.u256) {\n validateUint(parameter, input);\n return;\n }\n\n assert(\n typeof parameter === 'object' && !Array.isArray(parameter),\n `Validate: arg ${input.name} is cairo type struct (${input.type}), and should be defined as js object (not array)`\n );\n\n // shallow struct validation, only first depth level\n structs[input.type].members.forEach(({ name }) => {\n assert(\n Object.keys(parameter).includes(name),\n `Validate: arg ${input.name} should have a property ${name}`\n );\n });\n};\n\nconst validateTuple = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'object' && !Array.isArray(parameter),\n `Validate: arg ${input.name} should be a tuple (defined as object)`\n );\n // todo: skip tuple structural validation for now\n};\n\nconst validateArray = (parameter: any, input: AbiEntry, structs: AbiStructs) => {\n const baseType = getArrayType(input.type);\n\n // Long text (special case when parameter is not an array but long text)\n if (isTypeFelt(baseType) && isLongText(parameter)) return;\n\n assert(Array.isArray(parameter), `Validate: arg ${input.name} should be an Array`);\n\n switch (true) {\n case isTypeFelt(baseType):\n parameter.forEach((param: BigNumberish) => validateFelt(param, input));\n break;\n case isTypeTuple(baseType):\n parameter.forEach((it: any) => validateTuple(it, { name: input.name, type: baseType }));\n break;\n case isTypeStruct(baseType, structs):\n parameter.forEach((it: any) =>\n validateStruct(it, { name: input.name, type: baseType }, structs)\n );\n break;\n case isTypeUint(baseType):\n parameter.forEach((param: BigNumberish) => validateUint(param, input));\n break;\n case isTypeBool(baseType):\n parameter.forEach((param: BigNumberish) => validateBool(param, input));\n break;\n case isTypeArray(baseType):\n parameter.forEach((param: BigNumberish) =>\n validateArray(param, { name: '', type: baseType }, structs)\n );\n break;\n default:\n throw new Error(\n `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}`\n );\n }\n};\n\nexport default function validateFields(\n abiMethod: FunctionAbi,\n args: Array,\n structs: AbiStructs\n) {\n abiMethod.inputs.reduce((acc, input) => {\n const parameter = args[acc];\n\n switch (true) {\n case isLen(input.name):\n return acc;\n case isTypeFelt(input.type):\n validateFelt(parameter, input);\n break;\n case isTypeUint(input.type):\n validateUint(parameter, input);\n break;\n case isTypeBool(input.type):\n validateBool(parameter, input);\n break;\n case isTypeContractAddress(input.type):\n // TODO: ??\n break;\n case isTypeStruct(input.type, structs):\n validateStruct(parameter, input, structs);\n break;\n case isTypeTuple(input.type):\n validateTuple(parameter, input);\n break;\n case isTypeArray(input.type):\n validateArray(parameter, input, structs);\n break;\n default:\n throw new Error(\n `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}`\n );\n }\n\n return acc + 1;\n }, 0);\n}\n","/* eslint-disable no-plusplus */\nimport {\n Abi,\n AbiStructs,\n Args,\n ArgsOrCalldata,\n Calldata,\n FunctionAbi,\n HexCalldata,\n RawArgs,\n RawArgsArray,\n Result,\n ValidateType,\n} from '../../types';\nimport assert from '../assert';\nimport { isBigInt, toHex } from '../num';\nimport { getSelectorFromName } from '../selector';\nimport { isLongText, splitLongString } from '../shortString';\nimport { felt, isLen } from './cairo';\nimport formatter from './formatter';\nimport { createAbiParser, isNoConstructorValid } from './parser';\nimport { AbiParserInterface } from './parser/interface';\nimport orderPropsByAbi from './propertyOrder';\nimport { parseCalldataField } from './requestParser';\nimport responseParser from './responseParser';\nimport validateFields from './validate';\n\nexport * as cairo from './cairo';\n\nexport class CallData {\n abi: Abi;\n\n parser: AbiParserInterface;\n\n protected readonly structs: AbiStructs;\n\n constructor(abi: Abi) {\n this.structs = CallData.getAbiStruct(abi);\n this.parser = createAbiParser(abi);\n this.abi = this.parser.getLegacyFormat();\n }\n\n /**\n * Validate arguments passed to the method as corresponding to the ones in the abi\n * @param type ValidateType - type of the method\n * @param method string - name of the method\n * @param args ArgsOrCalldata - arguments that are passed to the method\n */\n public validate(type: ValidateType, method: string, args: ArgsOrCalldata = []) {\n // ensure provided method of type exists\n if (type !== ValidateType.DEPLOY) {\n const invocableFunctionNames = this.abi\n .filter((abi) => {\n if (abi.type !== 'function') return false;\n const isView = abi.stateMutability === 'view' || abi.state_mutability === 'view';\n return type === ValidateType.INVOKE ? !isView : isView;\n })\n .map((abi) => abi.name);\n assert(\n invocableFunctionNames.includes(method),\n `${type === ValidateType.INVOKE ? 'invocable' : 'viewable'} method not found in abi`\n );\n }\n\n // get requested method from abi\n const abiMethod = this.abi.find((abi) =>\n type === ValidateType.DEPLOY\n ? abi.name === method && abi.type === 'constructor'\n : abi.name === method && abi.type === 'function'\n ) as FunctionAbi;\n\n if (isNoConstructorValid(method, args, abiMethod)) {\n return;\n }\n\n // validate arguments length\n const inputsLength = this.parser.methodInputsLength(abiMethod);\n if (args.length !== inputsLength) {\n throw Error(\n `Invalid number of arguments, expected ${inputsLength} arguments, but got ${args.length}`\n );\n }\n\n // validate parameters\n validateFields(abiMethod, args, this.structs);\n }\n\n /**\n * Compile contract callData with abi\n * Parse the calldata by using input fields from the abi for that method\n * @param method string - method name\n * @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order).\n * @return Calldata - parsed arguments in format that contract is expecting\n * @example\n * ```typescript\n * const calldata = myCallData.compile(\"constructor\",[\"0x34a\",[1,3n]]);\n * ```\n * ```typescript\n * const calldata2 = myCallData.compile(\"constructor\",{list:[1,3n],balance:\"0x34\"}); // wrong order is valid\n * ```\n */\n public compile(method: string, argsCalldata: RawArgs): Calldata {\n const abiMethod = this.abi.find((abi) => abi.name === method) as FunctionAbi;\n\n if (isNoConstructorValid(method, argsCalldata, abiMethod)) {\n return [];\n }\n\n let args: RawArgsArray;\n if (Array.isArray(argsCalldata)) {\n args = argsCalldata;\n } else {\n // order the object\n const orderedObject = orderPropsByAbi(argsCalldata, abiMethod.inputs, this.structs);\n args = Object.values(orderedObject);\n // // validate array elements to abi\n validateFields(abiMethod, args, this.structs);\n }\n\n const argsIterator = args[Symbol.iterator]();\n\n const callArray = abiMethod.inputs.reduce(\n (acc, input) =>\n isLen(input.name) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs)),\n [] as Calldata\n );\n\n // add compiled property to array object\n Object.defineProperty(callArray, '__compiled__', {\n enumerable: false,\n writable: false,\n value: true,\n });\n return callArray;\n }\n\n /**\n * Compile contract callData without abi\n * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data\n * @returns Calldata\n */\n static compile(rawArgs: RawArgs): Calldata {\n const createTree = (obj: object) => {\n const getEntries = (o: object, prefix = ''): any => {\n const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o;\n return Object.entries(oe).flatMap(([k, v]) => {\n let value = v;\n if (isLongText(value)) value = splitLongString(value);\n if (k === 'entrypoint') value = getSelectorFromName(value);\n const kk = Array.isArray(oe) && k === '0' ? '$$len' : k;\n if (isBigInt(value)) return [[`${prefix}${kk}`, felt(value)]];\n return Object(value) === value\n ? getEntries(value, `${prefix}${kk}.`)\n : [[`${prefix}${kk}`, felt(value)]];\n });\n };\n return Object.fromEntries(getEntries(obj));\n };\n\n let callTreeArray;\n if (!Array.isArray(rawArgs)) {\n // flatten structs, tuples, add array length. Process leafs as Felt\n const callTree = createTree(rawArgs);\n // convert to array\n callTreeArray = Object.values(callTree);\n } else {\n // already compiled data but modified or raw args provided as array, recompile it\n // recreate tree\n const callObj = { ...rawArgs };\n const callTree = createTree(callObj);\n callTreeArray = Object.values(callTree);\n }\n\n // add compiled property to array object\n Object.defineProperty(callTreeArray, '__compiled__', {\n enumerable: false,\n writable: false,\n value: true,\n });\n return callTreeArray;\n }\n\n /**\n * Parse elements of the response array and structuring them into response object\n * @param method string - method name\n * @param response string[] - response from the method\n * @return Result - parsed response corresponding to the abi\n */\n public parse(method: string, response: string[]): Result {\n const { outputs } = this.abi.find((abi) => abi.name === method) as FunctionAbi;\n const responseIterator = response.flat()[Symbol.iterator]();\n\n const parsed = outputs.flat().reduce((acc, output, idx) => {\n const propName = output.name ?? idx;\n acc[propName] = responseParser(responseIterator, output, this.structs, acc);\n if (acc[propName] && acc[`${propName}_len`]) {\n delete acc[`${propName}_len`];\n }\n return acc;\n }, {} as Args);\n\n // Cairo1 avoid object.0 structure\n return Object.keys(parsed).length === 1 && 0 in parsed ? (parsed[0] as Result) : parsed;\n }\n\n /**\n * Format cairo method response data to native js values based on provided format schema\n * @param method string - cairo method name\n * @param response string[] - cairo method response\n * @param format object - formatter object schema\n * @returns Result - parsed and formatted response object\n */\n public format(method: string, response: string[], format: object): Result {\n const parsed = this.parse(method, response);\n return formatter(parsed, format);\n }\n\n /**\n * Helper to extract structs from abi\n * @param abi Abi\n * @returns AbiStructs - structs from abi\n */\n static getAbiStruct(abi: Abi): AbiStructs {\n return abi\n .filter((abiEntry) => abiEntry.type === 'struct')\n .reduce(\n (acc, abiEntry) => ({\n ...acc,\n [abiEntry.name]: abiEntry,\n }),\n {}\n );\n }\n\n /**\n * Helper: Compile HexCalldata | RawCalldata | RawArgs\n * @param rawCalldata HexCalldata | RawCalldata | RawArgs\n * @returns Calldata\n */\n static toCalldata(rawCalldata: RawArgs = []): Calldata {\n return CallData.compile(rawCalldata);\n }\n\n /**\n * Helper: Convert raw to HexCalldata\n * @param raw HexCalldata | RawCalldata | RawArgs\n * @returns HexCalldata\n */\n static toHex(raw: RawArgs = []): HexCalldata {\n const calldata = CallData.compile(raw);\n return calldata.map((it) => toHex(it));\n }\n}\n","/* eslint-disable no-param-reassign */\n/* eslint-disable import/extensions */\nimport { poseidonHashMany } from 'micro-starknet';\n\nimport { API_VERSION, StarknetChainId, TransactionHashPrefix } from '../constants';\nimport {\n BigNumberish,\n Builtins,\n CompiledContract,\n CompiledSierra,\n CompiledSierraCasm,\n ContractEntryPointFields,\n LegacyCompiledContract,\n RawArgs,\n RawCalldata,\n SierraContractEntryPointFields,\n} from '../types';\nimport { CallData } from './calldata';\nimport { felt } from './calldata/cairo';\nimport { starkCurve } from './ec';\nimport { addHexPrefix, utf8ToArray } from './encode';\nimport { parse, stringify } from './json';\nimport { toBigInt, toHex } from './num';\nimport { getSelectorFromName } from './selector';\nimport { encodeShortString } from './shortString';\n\nexport * as poseidon from '@noble/curves/abstract/poseidon';\nexport * from './selector'; // Preserve legacy export structure\n\nexport const transactionVersion = 1n;\nexport const transactionVersion_2 = 2n;\n// TODO: check do we need to use feeTransactionVersion at all for feeEstimation ?\n// export const feeTransactionVersion = 2n ** 128n + transactionVersion;\n// export const feeTransactionVersion_2 = 2n ** 128n + transactionVersion_2;\nexport const feeTransactionVersion = 1n;\nexport const feeTransactionVersion_2 = 2n;\n\n/**\n * Return versions based on version type, default transaction versions\n * @param versionType 'fee' | 'transaction'\n * @returns versions { v1: bigint; v2: bigint; }\n */\nexport function getVersionsByType(versionType?: 'fee' | 'transaction') {\n return versionType === 'fee'\n ? { v1: feeTransactionVersion, v2: feeTransactionVersion_2 }\n : { v1: transactionVersion, v2: transactionVersion_2 };\n}\n\nexport function computeHashOnElements(data: BigNumberish[]): string {\n return [...data, data.length]\n .reduce((x: BigNumberish, y: BigNumberish) => starkCurve.pedersen(toBigInt(x), toBigInt(y)), 0)\n .toString();\n}\n\n// following implementation is based on this python implementation:\n// https://github.com/starkware-libs/cairo-lang/blob/b614d1867c64f3fb2cf4a4879348cfcf87c3a5a7/src/starkware/starknet/core/os/transaction_hash/transaction_hash.py\n\nexport function calculateTransactionHashCommon(\n txHashPrefix: TransactionHashPrefix,\n version: BigNumberish,\n contractAddress: BigNumberish,\n entryPointSelector: BigNumberish,\n calldata: RawCalldata,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n additionalData: BigNumberish[] = []\n): string {\n const calldataHash = computeHashOnElements(calldata);\n const dataToHash = [\n txHashPrefix,\n version,\n contractAddress,\n entryPointSelector,\n calldataHash,\n maxFee,\n chainId,\n ...additionalData,\n ];\n return computeHashOnElements(dataToHash);\n}\n\nexport function calculateDeployTransactionHash(\n contractAddress: BigNumberish,\n constructorCalldata: RawCalldata,\n version: BigNumberish,\n chainId: StarknetChainId,\n constructorName: string = 'constructor'\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DEPLOY,\n version,\n contractAddress,\n getSelectorFromName(constructorName),\n constructorCalldata,\n 0,\n chainId\n );\n}\n\nexport function calculateDeclareTransactionHash(\n classHash: string,\n senderAddress: BigNumberish,\n version: BigNumberish,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish,\n compiledClassHash?: string\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DECLARE,\n version,\n senderAddress,\n 0,\n [classHash],\n maxFee,\n chainId,\n [nonce, ...(compiledClassHash ? [compiledClassHash] : [])]\n );\n}\n\nexport function calculateDeployAccountTransactionHash(\n contractAddress: BigNumberish,\n classHash: BigNumberish,\n constructorCalldata: RawCalldata,\n salt: BigNumberish,\n version: BigNumberish,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish\n) {\n const calldata = [classHash, salt, ...constructorCalldata];\n\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DEPLOY_ACCOUNT,\n version,\n contractAddress,\n 0,\n calldata,\n maxFee,\n chainId,\n [nonce]\n );\n}\n\nexport function calculateTransactionHash(\n contractAddress: BigNumberish,\n version: BigNumberish,\n calldata: RawCalldata,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.INVOKE,\n version,\n contractAddress,\n 0,\n calldata,\n maxFee,\n chainId,\n [nonce]\n );\n}\n\nexport function calculateContractAddressFromHash(\n salt: BigNumberish,\n classHash: BigNumberish,\n constructorCalldata: RawArgs,\n deployerAddress: BigNumberish\n) {\n const compiledCalldata = CallData.compile(constructorCalldata);\n const constructorCalldataHash = computeHashOnElements(compiledCalldata);\n\n const CONTRACT_ADDRESS_PREFIX = felt('0x535441524b4e45545f434f4e54524143545f41444452455353'); // Equivalent to 'STARKNET_CONTRACT_ADDRESS'\n\n return computeHashOnElements([\n CONTRACT_ADDRESS_PREFIX,\n deployerAddress,\n salt,\n classHash,\n constructorCalldataHash,\n ]);\n}\n\nfunction nullSkipReplacer(key: string, value: any) {\n if (key === 'attributes' || key === 'accessible_scopes') {\n return Array.isArray(value) && value.length === 0 ? undefined : value;\n }\n\n if (key === 'debug_info') {\n return null;\n }\n\n return value === null ? undefined : value;\n}\n\n// about 10x to 100x faster using array to build string\nexport function formatSpaces(json: string) {\n let insideQuotes = false;\n const newString = [];\n // eslint-disable-next-line no-restricted-syntax\n for (const char of json) {\n if (char === '\"' && (newString.length > 0 && newString.slice(-1)[0] === '\\\\') === false) {\n insideQuotes = !insideQuotes;\n }\n if (insideQuotes) {\n newString.push(char);\n } else {\n // eslint-disable-next-line no-nested-ternary\n newString.push(char === ':' ? ': ' : char === ',' ? ', ' : char);\n }\n }\n return newString.join('');\n}\n\nexport default function computeHintedClassHash(compiledContract: LegacyCompiledContract) {\n const { abi, program } = compiledContract;\n const contractClass = { abi, program };\n const serializedJson = formatSpaces(stringify(contractClass, nullSkipReplacer));\n\n return addHexPrefix(starkCurve.keccak(utf8ToArray(serializedJson)).toString(16));\n}\n\n// Computes the class hash of a given contract class\nexport function computeLegacyContractClassHash(contract: LegacyCompiledContract | string) {\n const compiledContract =\n typeof contract === 'string' ? (parse(contract) as LegacyCompiledContract) : contract;\n\n const apiVersion = toHex(API_VERSION);\n\n const externalEntryPointsHash = computeHashOnElements(\n compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset])\n );\n\n const l1HandlerEntryPointsHash = computeHashOnElements(\n compiledContract.entry_points_by_type.L1_HANDLER.flatMap((e) => [e.selector, e.offset])\n );\n\n const constructorEntryPointHash = computeHashOnElements(\n compiledContract.entry_points_by_type.CONSTRUCTOR.flatMap((e) => [e.selector, e.offset])\n );\n\n const builtinsHash = computeHashOnElements(\n compiledContract.program.builtins.map((s) => encodeShortString(s))\n );\n\n const hintedClassHash = computeHintedClassHash(compiledContract);\n\n const dataHash = computeHashOnElements(compiledContract.program.data);\n\n return computeHashOnElements([\n apiVersion,\n externalEntryPointsHash,\n l1HandlerEntryPointsHash,\n constructorEntryPointHash,\n builtinsHash,\n hintedClassHash,\n dataHash,\n ]);\n}\n\n// Cairo1 below\nfunction hashBuiltins(builtins: Builtins) {\n return poseidonHashMany(\n builtins.flatMap((it: any) => {\n return BigInt(encodeShortString(it));\n })\n );\n}\n\nfunction hashEntryPoint(data: ContractEntryPointFields[]) {\n const base = data.flatMap((it: any) => {\n return [BigInt(it.selector), BigInt(it.offset), hashBuiltins(it.builtins)];\n });\n return poseidonHashMany(base);\n}\n\nexport function computeCompiledClassHash(casm: CompiledSierraCasm) {\n const COMPILED_CLASS_VERSION = 'COMPILED_CLASS_V1';\n\n // Hash compiled class version\n const compiledClassVersion = BigInt(encodeShortString(COMPILED_CLASS_VERSION));\n\n // Hash external entry points.\n const externalEntryPointsHash = hashEntryPoint(casm.entry_points_by_type.EXTERNAL);\n\n // Hash L1 handler entry points.\n const l1Handlers = hashEntryPoint(casm.entry_points_by_type.L1_HANDLER);\n\n // Hash constructor entry points.\n const constructor = hashEntryPoint(casm.entry_points_by_type.CONSTRUCTOR);\n\n // Hash bytecode.\n const bytecode = poseidonHashMany(casm.bytecode.map((it: string) => BigInt(it)));\n\n return toHex(\n poseidonHashMany([\n compiledClassVersion,\n externalEntryPointsHash,\n l1Handlers,\n constructor,\n bytecode,\n ])\n );\n}\n\nfunction hashEntryPointSierra(data: SierraContractEntryPointFields[]) {\n const base = data.flatMap((it: any) => {\n return [BigInt(it.selector), BigInt(it.function_idx)];\n });\n return poseidonHashMany(base);\n}\n\nfunction hashAbi(sierra: CompiledSierra) {\n const indentString = formatSpaces(stringify(sierra.abi, null));\n return BigInt(addHexPrefix(starkCurve.keccak(utf8ToArray(indentString)).toString(16)));\n}\n\nexport function computeSierraContractClassHash(sierra: CompiledSierra) {\n const CONTRACT_CLASS_VERSION = 'CONTRACT_CLASS_V0.1.0';\n\n // Hash class version\n const compiledClassVersion = BigInt(encodeShortString(CONTRACT_CLASS_VERSION));\n\n // Hash external entry points.\n const externalEntryPointsHash = hashEntryPointSierra(sierra.entry_points_by_type.EXTERNAL);\n\n // Hash L1 handler entry points.\n const l1Handlers = hashEntryPointSierra(sierra.entry_points_by_type.L1_HANDLER);\n\n // Hash constructor entry points.\n const constructor = hashEntryPointSierra(sierra.entry_points_by_type.CONSTRUCTOR);\n\n // Hash abi_hash.\n const abiHash = hashAbi(sierra);\n\n // Hash Sierra program.\n const sierraProgram = poseidonHashMany(sierra.sierra_program.map((it: string) => BigInt(it)));\n\n return toHex(\n poseidonHashMany([\n compiledClassVersion,\n externalEntryPointsHash,\n l1Handlers,\n constructor,\n abiHash,\n sierraProgram,\n ])\n );\n}\n\n/**\n * Compute ClassHash (sierra or legacy) based on provided contract\n * @param contract CompiledContract | CompiledSierra | string\n * @returns HexString ClassHash\n */\nexport function computeContractClassHash(contract: CompiledContract | string) {\n const compiledContract = typeof contract === 'string' ? parse(contract) : contract;\n\n if ('sierra_program' in compiledContract) {\n return computeSierraContractClassHash(compiledContract as CompiledSierra);\n }\n\n return computeLegacyContractClassHash(compiledContract as LegacyCompiledContract);\n}\n","// TODO rename\nexport * as starkCurve from 'micro-starknet';\nexport * as weierstrass from '@noble/curves/abstract/weierstrass';\n","// the ts-ignore suppresses an esm to cjs import error that is resolved with bundling\n// @ts-ignore\nimport * as json from 'lossless-json';\n\nconst parseIntAsNumberOrBigInt = (x: string) => {\n if (!json.isInteger(x)) return parseFloat(x);\n const v = parseInt(x, 10);\n return Number.isSafeInteger(v) ? v : BigInt(x);\n};\n// NOTE: the String() wrapping is used so the behaviour conforms to JSON.parse()\n// which can accept simple data types but is not represented in the default typing\nexport const parse = (x: string): any => json.parse(String(x), undefined, parseIntAsNumberOrBigInt);\nexport const parseAlwaysAsBig = (x: string): any =>\n json.parse(String(x), undefined, json.parseNumberAndBigInt);\n\n// NOTE: the not-null assertion is used so the return type conforms to JSON.stringify()\n// which can also return undefined but is not represented in the default typing\nexport const stringify = (\n value: json.JavaScriptValue,\n replacer?: any,\n space?: string | number | undefined,\n numberStringifiers?: json.NumberStringifier[] | undefined\n): string => json.stringify(value, replacer, space, numberStringifiers)!;\n\n/** @deprecated equivalent to 'stringify', alias will be removed */\nexport const stringifyAlwaysAsBig = stringify;\n","import { getStarkKey, utils } from 'micro-starknet';\nimport { gzip, ungzip } from 'pako';\n\nimport { ArraySignatureType, BigNumberish, CompressedProgram, Program, Signature } from '../types';\nimport { addHexPrefix, arrayBufferToString, atobUniversal, btoaUniversal } from './encode';\nimport { parse, stringify } from './json';\nimport {\n bigNumberishArrayToDecimalStringArray,\n bigNumberishArrayToHexadecimalStringArray,\n toBigInt,\n toHex,\n} from './num';\n\n/**\n * Function to compress compiled cairo program\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/services/api/gateway/transaction.py#L54-L58)\n * @param jsonProgram - json file representing the compiled cairo program\n * @returns Compressed cairo program\n */\nexport function compressProgram(jsonProgram: Program | string): CompressedProgram {\n const stringified = typeof jsonProgram === 'string' ? jsonProgram : stringify(jsonProgram);\n const compressedProgram = gzip(stringified);\n return btoaUniversal(compressedProgram);\n}\n\n/**\n * Function to decompress compressed compiled cairo program\n *\n * @param base64 CompressedProgram\n * @returns parsed decompressed compiled cairo program\n */\nexport function decompressProgram(base64: CompressedProgram) {\n if (Array.isArray(base64)) return base64;\n const decompressed = arrayBufferToString(ungzip(atobUniversal(base64)));\n return parse(decompressed);\n}\n\nexport function randomAddress(): string {\n const randomKeyPair = utils.randomPrivateKey();\n return getStarkKey(randomKeyPair);\n}\n\nexport function makeAddress(input: string): string {\n return addHexPrefix(input).toLowerCase();\n}\n\nexport function formatSignature(sig?: Signature): ArraySignatureType {\n if (!sig) throw Error('formatSignature: provided signature is undefined');\n if (Array.isArray(sig)) {\n return sig.map((it) => toHex(it));\n }\n try {\n const { r, s } = sig;\n return [toHex(r), toHex(s)];\n } catch (e) {\n throw new Error('Signature need to be weierstrass.SignatureType or an array for custom');\n }\n}\n\nexport function signatureToDecimalArray(sig?: Signature): ArraySignatureType {\n return bigNumberishArrayToDecimalStringArray(formatSignature(sig));\n}\n\nexport function signatureToHexArray(sig?: Signature): ArraySignatureType {\n return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig));\n}\n\nexport function estimatedFeeToMaxFee(estimatedFee: BigNumberish, overhead: number = 0.5): bigint {\n // BN can only handle Integers, so we need to do all calulations with integers\n const overHeadPercent = Math.round((1 + overhead) * 100);\n return (toBigInt(estimatedFee) * toBigInt(overHeadPercent)) / 100n;\n}\n","import { ContractClassResponse } from '../types';\nimport {\n CairoContract,\n CompiledSierra,\n LegacyCompiledContract,\n LegacyContractClass,\n SierraContractClass,\n} from '../types/lib/contract/index';\nimport { CompleteDeclareContractPayload, DeclareContractPayload } from '../types/lib/index';\nimport { computeCompiledClassHash, computeContractClassHash } from './hash';\nimport { parse } from './json';\nimport { decompressProgram } from './stark';\n\nexport function isSierra(\n contract: CairoContract | string\n): contract is SierraContractClass | CompiledSierra {\n const compiledContract = typeof contract === 'string' ? parse(contract) : contract;\n return 'sierra_program' in compiledContract;\n}\n\nexport function extractContractHashes(\n payload: DeclareContractPayload\n): CompleteDeclareContractPayload {\n const response = { ...payload } as CompleteDeclareContractPayload;\n\n if (isSierra(payload.contract)) {\n if (!payload.compiledClassHash && payload.casm) {\n response.compiledClassHash = computeCompiledClassHash(payload.casm);\n }\n if (!response.compiledClassHash)\n throw new Error(\n 'Extract compiledClassHash failed, provide (CairoAssembly).casm file or compiledClassHash'\n );\n }\n\n response.classHash = payload.classHash ?? computeContractClassHash(payload.contract);\n if (!response.classHash)\n throw new Error('Extract classHash failed, provide (CompiledContract).json file or classHash');\n\n return response;\n}\n\n/**\n * Helper to redeclare response Cairo0 contract\n * @param ccr ContractClassResponse\n * @returns LegacyCompiledContract\n */\nexport function contractClassResponseToLegacyCompiledContract(ccr: ContractClassResponse) {\n if (isSierra(ccr)) {\n throw Error('ContractClassResponse need to be LegacyContractClass (cairo0 response class)');\n }\n const contract = ccr as LegacyContractClass;\n return { ...contract, program: decompressProgram(contract.program) } as LegacyCompiledContract;\n}\n","import isomorphicFetch from 'isomorphic-fetch';\n\nexport default (typeof window !== 'undefined' && window.fetch) || // use buildin fetch in browser if available\n (typeof global !== 'undefined' && global.fetch) || // use buildin fetch in node, react-native and service worker if available\n isomorphicFetch; // ponyfill fetch in node and browsers that don't have it\n","import {\n CompiledContract,\n CompiledSierra,\n ContractClass,\n LegacyContractClass,\n SierraContractClass,\n} from '../types';\nimport { isSierra } from './contract';\nimport { formatSpaces } from './hash';\nimport { parse, stringify } from './json';\nimport { compressProgram } from './stark';\n\nexport function wait(delay: number) {\n return new Promise((res) => {\n setTimeout(res, delay);\n });\n}\n\nexport function createSierraContractClass(contract: CompiledSierra): SierraContractClass {\n const result = { ...contract } as any;\n delete result.sierra_program_debug_info;\n result.abi = formatSpaces(stringify(contract.abi));\n result.sierra_program = formatSpaces(stringify(contract.sierra_program));\n result.sierra_program = compressProgram(result.sierra_program);\n return result;\n}\n\n// TODO: How can we receive string here ?\nexport function parseContract(contract: CompiledContract | string): ContractClass {\n const parsedContract =\n typeof contract === 'string' ? (parse(contract) as CompiledContract) : contract;\n\n if (!isSierra(contract)) {\n return {\n ...parsedContract,\n ...('program' in parsedContract && { program: compressProgram(parsedContract.program) }),\n } as LegacyContractClass;\n }\n\n return createSierraContractClass(parsedContract as CompiledSierra);\n}\n","/**\n * Map RPC Response to common interface response\n * Intersection (sequencer response ∩ (∪ rpc responses))\n */\nimport {\n CallContractResponse,\n ContractClassResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetTransactionResponse,\n RPC,\n SimulateTransactionResponse,\n} from '../../types';\nimport { toBigInt } from '../num';\nimport { estimatedFeeToMaxFee } from '../stark';\nimport { ResponseParser } from '.';\n\ntype RpcGetBlockResponse = RPC.GetBlockWithTxHashesResponse & {\n [key: string]: any;\n};\n\ntype GetTransactionByHashResponse = RPC.GetTransactionByHashResponse & {\n [key: string]: any;\n};\n\nexport class RPCResponseParser\n implements\n Omit<\n ResponseParser,\n | 'parseDeclareContractResponse'\n | 'parseDeployContractResponse'\n | 'parseInvokeFunctionResponse'\n | 'parseGetTransactionReceiptResponse'\n >\n{\n public parseGetBlockResponse(res: RpcGetBlockResponse): GetBlockResponse {\n return {\n timestamp: res.timestamp,\n block_hash: res.block_hash,\n block_number: res.block_number,\n new_root: res.new_root,\n parent_hash: res.parent_hash,\n status: res.status,\n transactions: res.transactions,\n };\n }\n\n public parseGetTransactionResponse(res: GetTransactionByHashResponse): GetTransactionResponse {\n return {\n calldata: res.calldata || [],\n contract_address: res.contract_address,\n sender_address: res.contract_address,\n max_fee: res.max_fee,\n nonce: res.nonce,\n signature: res.signature || [],\n transaction_hash: res.transaction_hash,\n version: res.version,\n };\n }\n\n public parseFeeEstimateResponse(res: Array): EstimateFeeResponse {\n return {\n overall_fee: toBigInt(res[0].overall_fee),\n gas_consumed: toBigInt(res[0].gas_consumed),\n gas_price: toBigInt(res[0].gas_price),\n };\n }\n\n public parseFeeEstimateBulkResponse(\n res: Array\n ): EstimateFeeResponseBulk {\n return res.map((val) => ({\n overall_fee: toBigInt(val.overall_fee),\n gas_consumed: toBigInt(val.gas_consumed),\n gas_price: toBigInt(val.gas_price),\n }));\n }\n\n public parseCallContractResponse(res: Array): CallContractResponse {\n return {\n result: res,\n };\n }\n\n public parseSimulateTransactionResponse(\n res: RPC.SimulateTransactionResponse\n ): SimulateTransactionResponse {\n return res.map((it) => {\n return {\n ...it,\n suggestedMaxFee: estimatedFeeToMaxFee(BigInt(it.fee_estimation.overall_fee)),\n };\n });\n }\n\n public parseContractClassResponse(res: RPC.ContractClass): ContractClassResponse {\n return {\n ...res,\n abi: typeof res.abi === 'string' ? JSON.parse(res.abi) : res.abi,\n };\n }\n}\n","// eslint-disable-next-line max-classes-per-file\nexport function fixStack(target: Error, fn: Function = target.constructor) {\n const { captureStackTrace } = Error as any;\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n captureStackTrace && captureStackTrace(target, fn);\n}\n\nexport function fixProto(target: Error, prototype: {}) {\n const { setPrototypeOf } = Object as any;\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-proto, no-param-reassign\n setPrototypeOf ? setPrototypeOf(target, prototype) : ((target as any).__proto__ = prototype);\n}\n\n/* eslint-disable max-classes-per-file */\nexport class CustomError extends Error {\n name!: string;\n\n constructor(message?: string) {\n super(message);\n // set error name as constructor name, make it not enumerable to keep native Error behavior\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target#new.target_in_constructors\n // see https://github.com/adriengibrat/ts-custom-error/issues/30\n Object.defineProperty(this, 'name', {\n value: new.target.name,\n enumerable: false,\n configurable: true,\n });\n // fix the extended error prototype chain\n // because typescript __extends implementation can't\n // see https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n fixProto(this, new.target.prototype);\n // try to remove contructor from stack trace\n fixStack(this);\n }\n}\n\nexport class LibraryError extends CustomError {}\n\nexport class GatewayError extends LibraryError {\n constructor(message: string, public errorCode: string) {\n super(message);\n }\n}\n\nexport class HttpError extends LibraryError {\n constructor(message: string, public errorCode: number) {\n super(message);\n }\n}\n","/* eslint-disable no-param-reassign */\nimport { StarknetChainId, ZERO } from '../constants';\n\nconst basicAlphabet = 'abcdefghijklmnopqrstuvwxyz0123456789-';\nconst basicSizePlusOne = BigInt(basicAlphabet.length + 1);\nconst bigAlphabet = '这来';\nconst basicAlphabetSize = BigInt(basicAlphabet.length);\nconst bigAlphabetSize = BigInt(bigAlphabet.length);\nconst bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1);\n\nfunction extractStars(str: string): [string, number] {\n let k = 0;\n while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) {\n str = str.substring(0, str.length - 1);\n k += 1;\n }\n return [str, k];\n}\n\nexport function useDecoded(encoded: bigint[]): string {\n let decoded = '';\n\n encoded.forEach((subdomain) => {\n while (subdomain !== ZERO) {\n const code = subdomain % basicSizePlusOne;\n subdomain /= basicSizePlusOne;\n if (code === BigInt(basicAlphabet.length)) {\n const nextSubdomain = subdomain / bigAlphabetSizePlusOne;\n if (nextSubdomain === ZERO) {\n const code2 = subdomain % bigAlphabetSizePlusOne;\n subdomain = nextSubdomain;\n if (code2 === ZERO) decoded += basicAlphabet[0];\n else decoded += bigAlphabet[Number(code2) - 1];\n } else {\n const code2 = subdomain % bigAlphabetSize;\n decoded += bigAlphabet[Number(code2)];\n subdomain /= bigAlphabetSize;\n }\n } else decoded += basicAlphabet[Number(code)];\n }\n\n const [str, k] = extractStars(decoded);\n if (k)\n decoded =\n str +\n (k % 2 === 0\n ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) +\n bigAlphabet[0] +\n basicAlphabet[1]\n : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1));\n decoded += '.';\n });\n\n if (!decoded) {\n return decoded;\n }\n\n return decoded.concat('stark');\n}\n\nexport function useEncoded(decoded: string): bigint {\n let encoded = BigInt(0);\n let multiplier = BigInt(1);\n\n if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) {\n const [str, k] = extractStars(decoded.substring(0, decoded.length - 2));\n decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1));\n } else {\n const [str, k] = extractStars(decoded);\n if (k) decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1));\n }\n\n for (let i = 0; i < decoded.length; i += 1) {\n const char = decoded[i];\n const index = basicAlphabet.indexOf(char);\n const bnIndex = BigInt(basicAlphabet.indexOf(char));\n\n if (index !== -1) {\n // add encoded + multiplier * index\n if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) {\n encoded += multiplier * basicAlphabetSize;\n multiplier *= basicSizePlusOne;\n // add 0\n multiplier *= basicSizePlusOne;\n } else {\n encoded += multiplier * bnIndex;\n multiplier *= basicSizePlusOne;\n }\n } else if (bigAlphabet.indexOf(char) !== -1) {\n // add encoded + multiplier * (basicAlphabetSize)\n encoded += multiplier * basicAlphabetSize;\n multiplier *= basicSizePlusOne;\n // add encoded + multiplier * index\n const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char);\n encoded += multiplier * BigInt(newid);\n multiplier *= bigAlphabetSize;\n }\n }\n\n return encoded;\n}\n\nexport const enum StarknetIdContract {\n MAINNET = '0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678',\n TESTNET = '0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce',\n}\n\nexport function getStarknetIdContract(chainId: StarknetChainId): string {\n switch (chainId) {\n case StarknetChainId.SN_MAIN:\n return StarknetIdContract.MAINNET;\n\n case StarknetChainId.SN_GOERLI:\n return StarknetIdContract.TESTNET;\n\n default:\n throw new Error('Starknet.id is not yet deployed on this network');\n }\n}\n","import { BigNumberish } from '../types';\nimport { CallData } from '../utils/calldata';\nimport { getStarknetIdContract, useDecoded, useEncoded } from '../utils/starknetId';\nimport { ProviderInterface } from './interface';\n\nexport async function getStarkName(\n provider: ProviderInterface,\n address: BigNumberish,\n StarknetIdContract?: string\n): Promise {\n const chainId = await provider.getChainId();\n const contract = StarknetIdContract ?? getStarknetIdContract(chainId);\n\n try {\n const hexDomain = await provider.callContract({\n contractAddress: contract,\n entrypoint: 'address_to_domain',\n calldata: CallData.compile({\n address,\n }),\n });\n const decimalDomain = hexDomain.result.map((element) => BigInt(element)).slice(1);\n\n const stringDomain = useDecoded(decimalDomain);\n\n if (!stringDomain) {\n throw Error('Starkname not found');\n }\n\n return stringDomain;\n } catch (e) {\n if (e instanceof Error && e.message === 'Starkname not found') {\n throw e;\n }\n throw Error('Could not get stark name');\n }\n}\n\nexport async function getAddressFromStarkName(\n provider: ProviderInterface,\n name: string,\n StarknetIdContract?: string\n): Promise {\n const chainId = await provider.getChainId();\n const contract = StarknetIdContract ?? getStarknetIdContract(chainId);\n\n try {\n const addressData = await provider.callContract({\n contractAddress: contract,\n entrypoint: 'domain_to_address',\n calldata: CallData.compile({\n domain: [useEncoded(name.replace('.stark', '')).toString(10)],\n }),\n });\n\n return addressData.result[0];\n } catch {\n throw Error('Could not get address from stark name');\n }\n}\n","/* eslint-disable max-classes-per-file */\nimport {\n BigNumberish,\n BlockIdentifier,\n BlockNumber,\n BlockTag,\n SequencerIdentifier,\n} from '../types';\nimport { isHex, toHex } from '../utils/num';\n\n/** @deprecated prefer importing from 'types' over 'provider/utils' */\nexport type { BlockIdentifier };\n\n/**\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L148-L153)\n *\n * @param hashValue\n * @param hashField\n */\nexport function formatHash(hashValue: BigNumberish): string {\n if (typeof hashValue === 'string') return hashValue;\n return toHex(hashValue);\n}\n\n/**\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L156-L161)\n * @param txHash\n * @param txId\n */\nexport function txIdentifier(txHash?: BigNumberish, txId?: BigNumberish): string {\n if (!txHash) {\n return `transactionId=${JSON.stringify(txId)}`;\n }\n const hashString = formatHash(txHash);\n\n return `transactionHash=${hashString}`;\n}\n\nexport const validBlockTags = Object.values(BlockTag);\n\nexport class Block {\n hash: BlockIdentifier = null;\n\n number: BlockIdentifier = null;\n\n tag: BlockIdentifier = null;\n\n private setIdentifier(__identifier: BlockIdentifier) {\n if (typeof __identifier === 'string' && isHex(__identifier)) {\n this.hash = __identifier;\n } else if (typeof __identifier === 'bigint') {\n this.hash = toHex(__identifier);\n } else if (typeof __identifier === 'number') {\n this.number = __identifier;\n } else if (\n typeof __identifier === 'string' &&\n validBlockTags.includes(__identifier as BlockTag)\n ) {\n this.tag = __identifier;\n } else {\n // default\n this.tag = BlockTag.pending;\n }\n }\n\n constructor(_identifier: BlockIdentifier) {\n this.setIdentifier(_identifier);\n }\n\n // TODO: fix any\n get queryIdentifier(): any {\n if (this.number !== null) {\n return `blockNumber=${this.number}`;\n }\n\n if (this.hash !== null) {\n return `blockHash=${this.hash}`;\n }\n\n return `blockNumber=${this.tag}`;\n }\n\n // TODO: fix any\n get identifier(): any {\n if (this.number !== null) {\n return { block_number: this.number };\n }\n\n if (this.hash !== null) {\n return { block_hash: this.hash };\n }\n\n return this.tag;\n }\n\n set identifier(_identifier: BlockIdentifier) {\n this.setIdentifier(_identifier);\n }\n\n valueOf = () => this.number;\n\n toString = () => this.hash;\n\n get sequencerIdentifier(): SequencerIdentifier {\n return this.hash !== null\n ? { blockHash: this.hash as string }\n : { blockNumber: (this.number ?? this.tag) as BlockNumber };\n }\n}\n","import { StarknetChainId } from '../constants';\nimport {\n AccountInvocationItem,\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n LegacyContractClass,\n RPC,\n RpcProviderOptions,\n SIMULATION_FLAG,\n SierraContractClass,\n SimulateTransactionResponse,\n TransactionStatus,\n TransactionType,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { isSierra } from '../utils/contract';\nimport fetch from '../utils/fetchPonyfill';\nimport {\n getSelectorFromName,\n getVersionsByType,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { stringify } from '../utils/json';\nimport { toHex, toStorageKey } from '../utils/num';\nimport { wait } from '../utils/provider';\nimport { RPCResponseParser } from '../utils/responseParser/rpc';\nimport { decompressProgram, signatureToHexArray } from '../utils/stark';\nimport { LibraryError } from './errors';\nimport { ProviderInterface } from './interface';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\nimport { Block } from './utils';\n\n// Default Pathfinder disabled pending block https://github.com/eqlabs/pathfinder/blob/main/README.md\n// Note that pending support is disabled by default and must be enabled by setting poll-pending=true in the configuration options.\nconst defaultOptions = {\n headers: { 'Content-Type': 'application/json' },\n blockIdentifier: 'latest',\n retries: 200,\n};\n\nexport class RpcProvider implements ProviderInterface {\n public nodeUrl: string;\n\n public headers: object;\n\n private responseParser = new RPCResponseParser();\n\n private retries: number;\n\n private blockIdentifier: BlockIdentifier;\n\n private chainId?: StarknetChainId;\n\n constructor(optionsOrProvider: RpcProviderOptions) {\n const { nodeUrl, retries, headers, blockIdentifier, chainId } = optionsOrProvider;\n this.nodeUrl = nodeUrl;\n this.retries = retries || defaultOptions.retries;\n this.headers = { ...defaultOptions.headers, ...headers };\n this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier;\n this.chainId = chainId;\n this.getChainId(); // internally skipped if chainId has value\n }\n\n public fetch(method: any, params: any): Promise {\n const body = stringify({ method, jsonrpc: '2.0', params, id: 0 });\n return fetch(this.nodeUrl, {\n method: 'POST',\n body,\n headers: this.headers as Record,\n });\n }\n\n protected errorHandler(error: any) {\n if (error) {\n const { code, message } = error;\n throw new LibraryError(`${code}: ${message}`);\n }\n }\n\n protected async fetchEndpoint(\n method: T,\n params?: RPC.Methods[T]['params']\n ): Promise {\n try {\n const rawResult = await this.fetch(method, params);\n const { error, result } = await rawResult.json();\n this.errorHandler(error);\n return result as RPC.Methods[T]['result'];\n } catch (error: any) {\n this.errorHandler(error?.response?.data);\n throw error;\n }\n }\n\n // Methods from Interface\n public async getChainId(): Promise {\n this.chainId ??= (await this.fetchEndpoint('starknet_chainId')) as StarknetChainId;\n return this.chainId;\n }\n\n public async getBlock(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.getBlockWithTxHashes(blockIdentifier).then(\n this.responseParser.parseGetBlockResponse\n );\n }\n\n public async getBlockHashAndNumber(): Promise {\n return this.fetchEndpoint('starknet_blockHashAndNumber');\n }\n\n public async getBlockWithTxHashes(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockWithTxHashes', { block_id });\n }\n\n public async getBlockWithTxs(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockWithTxs', { block_id });\n }\n\n public async getClassHashAt(\n contractAddress: RPC.ContractAddress,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClassHashAt', {\n block_id,\n contract_address: contractAddress,\n });\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getNonce', {\n contract_address: contractAddress,\n block_id,\n });\n }\n\n public async getPendingTransactions(): Promise {\n return this.fetchEndpoint('starknet_pendingTransactions');\n }\n\n public async getProtocolVersion(): Promise {\n throw new Error('Pathfinder does not implement this rpc 0.1.0 method');\n }\n\n public async getStateUpdate(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getStateUpdate', { block_id });\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const parsedKey = toStorageKey(key);\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getStorageAt', {\n contract_address: contractAddress,\n key: parsedKey,\n block_id,\n });\n }\n\n // Methods from Interface\n public async getTransaction(txHash: string): Promise {\n return this.getTransactionByHash(txHash).then(this.responseParser.parseGetTransactionResponse);\n }\n\n public async getTransactionByHash(txHash: string): Promise {\n return this.fetchEndpoint('starknet_getTransactionByHash', { transaction_hash: txHash });\n }\n\n public async getTransactionByBlockIdAndIndex(\n blockIdentifier: BlockIdentifier,\n index: number\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getTransactionByBlockIdAndIndex', { block_id, index });\n }\n\n public async getTransactionReceipt(txHash: string): Promise {\n return this.fetchEndpoint('starknet_getTransactionReceipt', { transaction_hash: txHash });\n }\n\n public async getClassByHash(classHash: RPC.Felt): Promise {\n return this.getClass(classHash);\n }\n\n public async getClass(\n classHash: RPC.Felt,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClass', {\n class_hash: classHash,\n block_id,\n }).then(this.responseParser.parseContractClassResponse);\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClassAt', {\n block_id,\n contract_address: contractAddress,\n }).then(this.responseParser.parseContractClassResponse);\n }\n\n public async getCode(\n _contractAddress: string,\n _blockIdentifier?: BlockIdentifier\n ): Promise {\n throw new Error('RPC does not implement getCode function');\n }\n\n public async getEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier);\n }\n\n public async getInvokeEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.INVOKE,\n ...invocation,\n ...invocationDetails,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getDeclareEstimateFee(\n invocation: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DECLARE,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getDeployAccountEstimateFee(\n invocation: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n { blockIdentifier = this.blockIdentifier, skipValidate = false }: getEstimateFeeBulkOptions\n ): Promise {\n if (skipValidate) {\n // eslint-disable-next-line no-console\n console.warn('getEstimateFeeBulk RPC does not support skipValidate');\n }\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_estimateFee', {\n request: invocations.map((it) => this.buildTransaction(it, 'fee')),\n block_id,\n }).then(this.responseParser.parseFeeEstimateBulkResponse);\n }\n\n public async declareContract(\n { contract, signature, senderAddress, compiledClassHash }: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n if (!isSierra(contract)) {\n return this.fetchEndpoint('starknet_addDeclareTransaction', {\n declare_transaction: {\n type: RPC.TransactionType.DECLARE,\n contract_class: {\n program: contract.program,\n entry_points_by_type: contract.entry_points_by_type,\n abi: contract.abi,\n },\n version: toHex(transactionVersion),\n max_fee: toHex(details.maxFee || 0),\n signature: signatureToHexArray(signature),\n sender_address: senderAddress,\n nonce: toHex(details.nonce),\n },\n });\n }\n return this.fetchEndpoint('starknet_addDeclareTransaction', {\n declare_transaction: {\n type: RPC.TransactionType.DECLARE,\n contract_class: {\n sierra_program: decompressProgram(contract.sierra_program),\n contract_class_version: contract.contract_class_version,\n entry_points_by_type: contract.entry_points_by_type,\n abi: contract.abi,\n },\n compiled_class_hash: compiledClassHash || '',\n version: toHex(transactionVersion_2),\n max_fee: toHex(details.maxFee || 0),\n signature: signatureToHexArray(signature),\n sender_address: senderAddress,\n nonce: toHex(details.nonce),\n },\n });\n }\n\n public async deployAccountContract(\n { classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('starknet_addDeployAccountTransaction', {\n deploy_account_transaction: {\n constructor_calldata: CallData.toHex(constructorCalldata || []),\n class_hash: toHex(classHash),\n contract_address_salt: toHex(addressSalt || 0),\n type: RPC.TransactionType.DEPLOY_ACCOUNT,\n max_fee: toHex(details.maxFee || 0),\n version: toHex(details.version || 0),\n signature: signatureToHexArray(signature),\n nonce: toHex(details.nonce),\n },\n });\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('starknet_addInvokeTransaction', {\n invoke_transaction: {\n sender_address: functionInvocation.contractAddress,\n calldata: CallData.toHex(functionInvocation.calldata),\n type: RPC.TransactionType.INVOKE,\n max_fee: toHex(details.maxFee || 0),\n version: '0x1',\n signature: signatureToHexArray(functionInvocation.signature),\n nonce: toHex(details.nonce),\n },\n });\n }\n\n // Methods from Interface\n public async callContract(\n call: Call,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const result = await this.fetchEndpoint('starknet_call', {\n request: {\n contract_address: call.contractAddress,\n entry_point_selector: getSelectorFromName(call.entrypoint),\n calldata: CallData.toHex(call.calldata),\n },\n block_id,\n });\n\n return this.responseParser.parseCallContractResponse(result);\n }\n\n public async traceTransaction(transactionHash: RPC.TransactionHash): Promise {\n return this.fetchEndpoint('starknet_traceTransaction', { transaction_hash: transactionHash });\n }\n\n public async traceBlockTransactions(blockHash: RPC.BlockHash): Promise {\n return this.fetchEndpoint('starknet_traceBlockTransactions', { block_hash: blockHash });\n }\n\n public async waitForTransaction(txHash: string, options?: waitForTransactionOptions) {\n const errorStates = [TransactionStatus.REJECTED, TransactionStatus.NOT_RECEIVED];\n let { retries } = this;\n let onchain = false;\n let txReceipt: any = {};\n\n const retryInterval = options?.retryInterval ?? 8000;\n const successStates = options?.successStates ?? [\n TransactionStatus.ACCEPTED_ON_L1,\n TransactionStatus.ACCEPTED_ON_L2,\n ];\n\n while (!onchain) {\n // eslint-disable-next-line no-await-in-loop\n await wait(retryInterval);\n try {\n // eslint-disable-next-line no-await-in-loop\n txReceipt = await this.getTransactionReceipt(txHash);\n\n if (!('status' in txReceipt)) {\n const error = new Error('transaction status');\n throw error;\n }\n\n if (txReceipt.status && successStates.includes(txReceipt.status)) {\n onchain = true;\n } else if (txReceipt.status && errorStates.includes(txReceipt.status)) {\n const message = txReceipt.status;\n const error = new Error(message) as Error & { response: any };\n error.response = txReceipt;\n throw error;\n }\n } catch (error: unknown) {\n if (error instanceof Error && errorStates.includes(error.message as TransactionStatus)) {\n throw error;\n }\n\n if (retries === 0) {\n throw new Error(`waitForTransaction timed-out with retries ${this.retries}`);\n }\n }\n\n retries -= 1;\n }\n\n await wait(retryInterval);\n return txReceipt;\n }\n\n /**\n * Gets the transaction count from a block.\n *\n *\n * @param blockIdentifier\n * @returns Number of transactions\n */\n public async getTransactionCount(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockTransactionCount', { block_id });\n }\n\n /**\n * Gets the latest block number\n *\n *\n * @returns Number of the latest block\n */\n public async getBlockNumber(): Promise {\n return this.fetchEndpoint('starknet_blockNumber');\n }\n\n /**\n * Gets syncing status of the node\n *\n *\n * @returns Object with the stats data\n */\n public async getSyncingStats(): Promise {\n return this.fetchEndpoint('starknet_syncing');\n }\n\n /**\n * Gets all the events filtered\n *\n *\n * @returns events and the pagination of the events\n */\n public async getEvents(eventFilter: RPC.EventFilter): Promise {\n return this.fetchEndpoint('starknet_getEvents', { filter: eventFilter });\n }\n\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n {\n blockIdentifier = this.blockIdentifier,\n skipValidate = false,\n skipExecute = false,\n }: getSimulateTransactionOptions\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n\n const simulationFlags = [];\n if (skipValidate) simulationFlags.push(SIMULATION_FLAG.SKIP_VALIDATE);\n if (skipExecute) simulationFlags.push(SIMULATION_FLAG.SKIP_EXECUTE);\n\n return this.fetchEndpoint('starknet_simulateTransaction', {\n block_id,\n transactions: invocations.map((it) => this.buildTransaction(it)), // TODO: Pathfinder 0.5.6 bug, should be transaction\n simulation_flags: simulationFlags,\n }).then(this.responseParser.parseSimulateTransactionResponse);\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n\n public buildTransaction(\n invocation: AccountInvocationItem,\n versionType?: 'fee' | 'transaction'\n ): RPC.BroadcastedTransaction {\n const defaultVersions = getVersionsByType(versionType);\n const details = {\n signature: signatureToHexArray(invocation.signature),\n nonce: toHex(invocation.nonce),\n max_fee: toHex(invocation.maxFee || 0),\n };\n\n if (invocation.type === TransactionType.INVOKE) {\n return {\n type: RPC.TransactionType.INVOKE, // Diff between sequencer and rpc invoke type\n sender_address: invocation.contractAddress,\n calldata: CallData.toHex(invocation.calldata),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n if (invocation.type === RPC.TransactionType.DECLARE) {\n if (!isSierra(invocation.contract)) {\n const legacyContract = invocation.contract as LegacyContractClass;\n return {\n type: invocation.type,\n contract_class: legacyContract,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n const sierraContract = invocation.contract as SierraContractClass;\n return {\n // compiled_class_hash\n type: invocation.type,\n contract_class: {\n ...sierraContract,\n sierra_program: decompressProgram(sierraContract.sierra_program),\n },\n compiled_class_hash: invocation.compiledClassHash || '',\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v2),\n ...details,\n };\n }\n if (invocation.type === TransactionType.DEPLOY_ACCOUNT) {\n return {\n type: invocation.type,\n constructor_calldata: CallData.toHex(invocation.constructorCalldata || []),\n class_hash: toHex(invocation.classHash),\n contract_address_salt: toHex(invocation.addressSalt || 0),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n throw Error('RPC buildTransaction received unknown TransactionType');\n }\n}\n","import urljoin from 'url-join';\n\nimport { BaseUrl, NetworkName, StarknetChainId } from '../constants';\nimport {\n AccountInvocationItem,\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n BlockTag,\n CairoAssembly,\n Call,\n CallContractResponse,\n CallL1Handler,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetContractAddressesResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n GetTransactionStatusResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Sequencer,\n SequencerHttpMethod,\n SequencerProviderOptions,\n SimulateTransactionResponse,\n StateUpdateResponse,\n TransactionStatus,\n TransactionType,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { isSierra } from '../utils/contract';\nimport fetch from '../utils/fetchPonyfill';\nimport {\n getSelector,\n getSelectorFromName,\n getVersionsByType,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { parse, parseAlwaysAsBig, stringify } from '../utils/json';\nimport { getDecimalString, getHexString, getHexStringArray, toBigInt, toHex } from '../utils/num';\nimport { wait } from '../utils/provider';\nimport { SequencerAPIResponseParser } from '../utils/responseParser/sequencer';\nimport { randomAddress, signatureToDecimalArray } from '../utils/stark';\nimport { buildUrl } from '../utils/url';\nimport { GatewayError, HttpError, LibraryError } from './errors';\nimport { ProviderInterface } from './interface';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\nimport { Block } from './utils';\n\nfunction isEmptyQueryObject(obj?: Record): obj is undefined {\n return (\n obj === undefined ||\n Object.keys(obj).length === 0 ||\n (Object.keys(obj).length === 1 &&\n Object.entries(obj).every(([k, v]) => k === 'blockIdentifier' && v === null))\n );\n}\n\nconst defaultOptions = {\n network: NetworkName.SN_GOERLI2,\n blockIdentifier: BlockTag.pending,\n};\n\nexport class SequencerProvider implements ProviderInterface {\n public baseUrl: string;\n\n public feederGatewayUrl: string;\n\n public gatewayUrl: string;\n\n public headers?: Record;\n\n private blockIdentifier: BlockIdentifier;\n\n private chainId: StarknetChainId;\n\n private responseParser = new SequencerAPIResponseParser();\n\n constructor(optionsOrProvider: SequencerProviderOptions = defaultOptions) {\n if ('network' in optionsOrProvider) {\n this.baseUrl = SequencerProvider.getNetworkFromName(optionsOrProvider.network);\n this.feederGatewayUrl = buildUrl(this.baseUrl, 'feeder_gateway');\n this.gatewayUrl = buildUrl(this.baseUrl, 'gateway');\n } else {\n this.baseUrl = optionsOrProvider.baseUrl;\n this.feederGatewayUrl = buildUrl(\n this.baseUrl,\n 'feeder_gateway',\n optionsOrProvider.feederGatewayUrl\n );\n this.gatewayUrl = buildUrl(this.baseUrl, 'gateway', optionsOrProvider.gatewayUrl);\n }\n this.chainId =\n optionsOrProvider?.chainId ?? SequencerProvider.getChainIdFromBaseUrl(this.baseUrl);\n this.headers = optionsOrProvider.headers;\n this.blockIdentifier = optionsOrProvider?.blockIdentifier || defaultOptions.blockIdentifier;\n }\n\n protected static getNetworkFromName(name: NetworkName | StarknetChainId) {\n switch (name) {\n case NetworkName.SN_MAIN || StarknetChainId.SN_MAIN:\n return BaseUrl.SN_MAIN;\n case NetworkName.SN_GOERLI || StarknetChainId.SN_GOERLI:\n return BaseUrl.SN_GOERLI;\n case NetworkName.SN_GOERLI2 || StarknetChainId.SN_GOERLI2:\n return BaseUrl.SN_GOERLI2;\n default:\n throw new Error('Could not detect base url from NetworkName');\n }\n }\n\n protected static getChainIdFromBaseUrl(baseUrl: string): StarknetChainId {\n try {\n const url = new URL(baseUrl);\n if (url.host.includes('mainnet.starknet.io')) {\n return StarknetChainId.SN_MAIN;\n }\n if (url.host.includes('alpha4-2.starknet.io')) {\n return StarknetChainId.SN_GOERLI2;\n }\n return StarknetChainId.SN_GOERLI;\n } catch {\n // eslint-disable-next-line no-console\n console.error(`Could not parse baseUrl: ${baseUrl}`);\n return StarknetChainId.SN_GOERLI;\n }\n }\n\n private getFetchUrl(endpoint: keyof Sequencer.Endpoints) {\n const gatewayUrlEndpoints = ['add_transaction'];\n return gatewayUrlEndpoints.includes(endpoint) ? this.gatewayUrl : this.feederGatewayUrl;\n }\n\n private getFetchMethod(endpoint: keyof Sequencer.Endpoints) {\n const postMethodEndpoints = [\n 'add_transaction',\n 'call_contract',\n 'estimate_fee',\n 'estimate_message_fee',\n 'estimate_fee_bulk',\n 'simulate_transaction',\n ];\n\n return postMethodEndpoints.includes(endpoint) ? 'POST' : 'GET';\n }\n\n private getQueryString(query?: Record): string {\n if (isEmptyQueryObject(query)) {\n return '';\n }\n const queryString = Object.entries(query)\n .map(([key, value]) => {\n if (key === 'blockIdentifier') {\n const block = new Block(value);\n return `${block.queryIdentifier}`;\n }\n return `${key}=${value}`;\n })\n .join('&');\n\n return `?${queryString}`;\n }\n\n private getHeaders(method: SequencerHttpMethod): Record | undefined {\n if (method === 'POST') {\n return {\n 'Content-Type': 'application/json',\n ...this.headers,\n };\n }\n return this.headers;\n }\n\n // typesafe fetch\n protected async fetchEndpoint(\n endpoint: T,\n // typescript type magic to create a nice fitting function interface\n ...[query, request]: Sequencer.Endpoints[T]['QUERY'] extends never\n ? Sequencer.Endpoints[T]['REQUEST'] extends never\n ? [] // when no query and no request is needed, we can omit the query and request parameters\n : [undefined, Sequencer.Endpoints[T]['REQUEST']]\n : Sequencer.Endpoints[T]['REQUEST'] extends never\n ? [Sequencer.Endpoints[T]['QUERY']] // when no request is needed, we can omit the request parameter\n : [Sequencer.Endpoints[T]['QUERY'], Sequencer.Endpoints[T]['REQUEST']] // when both query and request are needed, we cant omit anything\n ): Promise {\n const baseUrl = this.getFetchUrl(endpoint);\n const method = this.getFetchMethod(endpoint);\n const queryString = this.getQueryString(query);\n const url = urljoin(baseUrl, endpoint, queryString);\n\n return this.fetch(url, {\n method,\n body: request,\n });\n }\n\n public async fetch(\n endpoint: string,\n options?: {\n method?: SequencerHttpMethod;\n body?: any;\n parseAlwaysAsBigInt?: boolean;\n }\n ): Promise {\n const url = buildUrl(this.baseUrl, '', endpoint);\n const method = options?.method ?? 'GET';\n const headers = this.getHeaders(method);\n const body = stringify(options?.body);\n try {\n const response = await fetch(url, {\n method,\n body,\n headers,\n });\n const textResponse = await response.text();\n\n if (!response.ok) {\n // This will allow the user to handle contract errors\n let responseBody: any;\n try {\n responseBody = parse(textResponse);\n } catch {\n throw new HttpError(response.statusText, response.status);\n }\n throw new GatewayError(responseBody.message, responseBody.code);\n }\n\n const parseChoice = options?.parseAlwaysAsBigInt ? parseAlwaysAsBig : parse;\n return parseChoice(textResponse);\n } catch (error) {\n if (error instanceof Error && !(error instanceof LibraryError))\n throw Error(`Could not ${method} from endpoint \\`${url}\\`: ${error.message}`);\n\n throw error;\n }\n }\n\n public async getChainId(): Promise {\n return Promise.resolve(this.chainId);\n }\n\n public async callContract(\n { contractAddress, entrypoint: entryPointSelector, calldata = [] }: Call,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint(\n 'call_contract',\n { blockIdentifier },\n {\n // TODO - determine best choice once both are fully supported in devnet\n // signature: [],\n // sender_address: contractAddress,\n contract_address: contractAddress,\n entry_point_selector: getSelectorFromName(entryPointSelector),\n calldata: CallData.compile(calldata),\n }\n ).then(this.responseParser.parseCallContractResponse);\n }\n\n public async getBlock(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_block', { blockIdentifier }).then(\n this.responseParser.parseGetBlockResponse\n );\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_nonce', { contractAddress, blockIdentifier });\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const parsedKey = toBigInt(key).toString(10);\n return this.fetchEndpoint('get_storage_at', {\n blockIdentifier,\n contractAddress,\n key: parsedKey,\n });\n }\n\n public async getTransaction(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction', { transactionHash: txHashHex }).then((result) => {\n // throw for no matching transaction to unify behavior with RPC and avoid parsing errors\n if (Object.values(result).length === 1) throw new LibraryError(result.status);\n return this.responseParser.parseGetTransactionResponse(result);\n });\n }\n\n public async getTransactionReceipt(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_receipt', { transactionHash: txHashHex }).then(\n this.responseParser.parseGetTransactionReceiptResponse\n );\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_full_contract', { blockIdentifier, contractAddress }).then(\n this.responseParser.parseContractClassResponse\n );\n }\n\n public async getClassHashAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_class_hash_at', { blockIdentifier, contractAddress });\n }\n\n public async getClassByHash(\n classHash: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_class_by_hash', { classHash, blockIdentifier }).then(\n this.responseParser.parseContractClassResponse\n );\n }\n\n public async getCompiledClassByClassHash(\n classHash: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_compiled_class_by_class_hash', { classHash, blockIdentifier });\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.INVOKE,\n sender_address: functionInvocation.contractAddress,\n calldata: CallData.compile(functionInvocation.calldata ?? []),\n signature: signatureToDecimalArray(functionInvocation.signature),\n nonce: toHex(details.nonce),\n max_fee: toHex(details.maxFee || 0),\n version: '0x1',\n }).then(this.responseParser.parseInvokeFunctionResponse);\n }\n\n public async deployAccountContract(\n { classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DEPLOY_ACCOUNT,\n contract_address_salt: addressSalt ?? randomAddress(),\n constructor_calldata: CallData.compile(constructorCalldata ?? []),\n class_hash: toHex(classHash),\n max_fee: toHex(details.maxFee || 0),\n version: toHex(details.version || 0),\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n }).then(this.responseParser.parseDeployContractResponse);\n }\n\n public async declareContract(\n { senderAddress, contract, signature, compiledClassHash }: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n if (!isSierra(contract)) {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DECLARE,\n contract_class: contract,\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n sender_address: senderAddress,\n max_fee: toHex(details.maxFee || 0),\n version: toHex(transactionVersion),\n }).then(this.responseParser.parseDeclareContractResponse);\n }\n // Cairo 1\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DECLARE,\n sender_address: senderAddress,\n compiled_class_hash: compiledClassHash,\n contract_class: contract,\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n max_fee: toHex(details.maxFee || 0),\n version: toHex(transactionVersion_2),\n }).then(this.responseParser.parseDeclareContractResponse);\n }\n\n public async getEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier, skipValidate);\n }\n\n public async getInvokeEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.INVOKE,\n ...invocation,\n ...invocationDetails,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getDeclareEstimateFee(\n invocation: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DECLARE,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getDeployAccountEstimateFee(\n invocation: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n { blockIdentifier = this.blockIdentifier, skipValidate = false }: getEstimateFeeBulkOptions\n ): Promise {\n const transactions = invocations.map((it) => this.buildTransaction(it, 'fee'));\n return this.fetchEndpoint(\n 'estimate_fee_bulk',\n { blockIdentifier, skipValidate },\n transactions\n ).then(this.responseParser.parseFeeEstimateBulkResponse);\n }\n\n public async getCode(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_code', { contractAddress, blockIdentifier });\n }\n\n public async waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions) {\n const errorStates = [TransactionStatus.REJECTED, TransactionStatus.NOT_RECEIVED];\n let onchain = false;\n let res;\n const retryInterval = options?.retryInterval ?? 8000;\n const successStates = options?.successStates ?? [\n TransactionStatus.ACCEPTED_ON_L1,\n TransactionStatus.ACCEPTED_ON_L2,\n ];\n\n while (!onchain) {\n // eslint-disable-next-line no-await-in-loop\n await wait(retryInterval);\n // eslint-disable-next-line no-await-in-loop\n res = await this.getTransactionStatus(txHash);\n\n if (successStates.includes(res.tx_status)) {\n onchain = true;\n } else if (errorStates.includes(res.tx_status)) {\n const message = res.tx_failure_reason\n ? `${res.tx_status}: ${res.tx_failure_reason.code}\\n${res.tx_failure_reason.error_message}`\n : res.tx_status;\n const error = new Error(message) as Error & { response: GetTransactionStatusResponse };\n error.response = res;\n throw error;\n }\n }\n const txReceipt = await this.getTransactionReceipt(txHash);\n return txReceipt;\n }\n\n /**\n * Gets the status of a transaction.\n * @param txHash BigNumberish\n * @returns GetTransactionStatusResponse - the transaction status object\n */\n public async getTransactionStatus(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_status', { transactionHash: txHashHex });\n }\n\n /**\n * Gets the smart contract address on the goerli testnet.\n * @returns GetContractAddressesResponse - starknet smart contract addresses\n */\n public async getContractAddresses(): Promise {\n return this.fetchEndpoint('get_contract_addresses');\n }\n\n /**\n * Gets the transaction trace from a tx id.\n * @param txHash BigNumberish\n * @returns TransactionTraceResponse - the transaction trace\n */\n public async getTransactionTrace(\n txHash: BigNumberish\n ): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_trace', { transactionHash: txHashHex });\n }\n\n public async estimateMessageFee(\n { from_address, to_address, entry_point_selector, payload }: CallL1Handler,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const validCallL1Handler = {\n from_address: getDecimalString(from_address),\n to_address: getHexString(to_address),\n entry_point_selector: getSelector(entry_point_selector),\n payload: getHexStringArray(payload),\n };\n\n return this.fetchEndpoint('estimate_message_fee', { blockIdentifier }, validCallL1Handler);\n }\n\n /**\n * Simulate transaction using Sequencer provider\n * WARNING!: Sequencer will process only first element from invocations array\n *\n * @param invocations Array of invocations, but only first invocation will be processed\n * @param blockIdentifier block identifier, default 'latest'\n * @param skipValidate Skip Account __validate__ method\n * @returns\n */\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n {\n blockIdentifier = this.blockIdentifier,\n skipValidate = false,\n skipExecute = false,\n }: getSimulateTransactionOptions\n ): Promise {\n if (invocations.length > 1) {\n // eslint-disable-next-line no-console\n console.warn('Sequencer simulate process only first element from invocations list');\n }\n if (skipExecute) {\n // eslint-disable-next-line no-console\n console.warn(\"Sequencer can't skip account __execute__\");\n }\n const transaction = this.buildTransaction(invocations[0]);\n return this.fetchEndpoint(\n 'simulate_transaction',\n {\n blockIdentifier,\n skipValidate: skipValidate ?? false,\n },\n transaction\n ).then(this.responseParser.parseSimulateTransactionResponse);\n }\n\n public async getStateUpdate(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const args = new Block(blockIdentifier).sequencerIdentifier;\n return this.fetchEndpoint('get_state_update', { ...args }).then(\n this.responseParser.parseGetStateUpdateResponse\n );\n }\n\n // consider adding an optional trace retrieval parameter to the getBlock method\n public async getBlockTraces(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const args = new Block(blockIdentifier).sequencerIdentifier;\n return this.fetchEndpoint('get_block_traces', { ...args });\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n\n /**\n * Build Single AccountTransaction from Single AccountInvocation\n * @param invocation AccountInvocationItem\n * @param versionType 'fee' | 'transaction' - used to determine default versions\n * @returns AccountTransactionItem\n */\n public buildTransaction(\n invocation: AccountInvocationItem,\n versionType?: 'fee' | 'transaction'\n ): Sequencer.AccountTransactionItem {\n const defaultVersions = getVersionsByType(versionType);\n const details = {\n signature: signatureToDecimalArray(invocation.signature),\n nonce: toHex(invocation.nonce),\n };\n\n if (invocation.type === TransactionType.INVOKE) {\n return {\n type: invocation.type,\n sender_address: invocation.contractAddress,\n calldata: CallData.compile(invocation.calldata ?? []),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n if (invocation.type === TransactionType.DECLARE) {\n if (!isSierra(invocation.contract)) {\n return {\n type: invocation.type,\n contract_class: invocation.contract,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v1), // fee from getDeclareEstimateFee use t.v. instead of feet.v.\n ...details,\n };\n }\n return {\n type: invocation.type,\n contract_class: invocation.contract,\n compiled_class_hash: invocation.compiledClassHash,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v2), // fee on getDeclareEstimateFee use t.v. instead of feet.v.\n ...details,\n };\n }\n if (invocation.type === TransactionType.DEPLOY_ACCOUNT) {\n return {\n type: invocation.type,\n constructor_calldata: CallData.compile(invocation.constructorCalldata || []),\n class_hash: toHex(invocation.classHash),\n contract_address_salt: toHex(invocation.addressSalt || 0),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n throw Error('Sequencer buildTransaction received unknown TransactionType');\n }\n}\n","import {\n CallContractResponse,\n DeclareContractResponse,\n DeployContractResponse,\n EstimateFeeResponse,\n GetBlockResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n InvokeFunctionResponse,\n SimulateTransactionResponse,\n} from '../../types';\n\nexport abstract class ResponseParser {\n abstract parseGetBlockResponse(res: any): GetBlockResponse;\n\n abstract parseGetTransactionResponse(res: any): GetTransactionResponse;\n\n abstract parseGetTransactionReceiptResponse(res: any): GetTransactionReceiptResponse;\n\n abstract parseFeeEstimateResponse(res: any): EstimateFeeResponse;\n\n abstract parseCallContractResponse(res: any): CallContractResponse;\n\n abstract parseInvokeFunctionResponse(res: any): InvokeFunctionResponse;\n\n abstract parseDeployContractResponse(res: any): DeployContractResponse;\n\n abstract parseDeclareContractResponse(res: any): DeclareContractResponse;\n\n abstract parseSimulateTransactionResponse(res: any): SimulateTransactionResponse;\n}\n","/**\n * Map Sequencer Response to common interface response\n * Intersection (sequencer response ∩ (∪ rpc responses))\n */\n\nimport {\n CallContractResponse,\n CompiledContract,\n ContractClassResponse,\n DeclareContractResponse,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n HexCalldata,\n InvokeFunctionResponse,\n Sequencer,\n SimulateTransactionResponse,\n StateUpdateResponse,\n} from '../../types';\nimport { isSierra } from '../contract';\nimport { toBigInt } from '../num';\nimport { parseContract } from '../provider';\nimport { estimatedFeeToMaxFee } from '../stark';\nimport { ResponseParser } from '.';\n\nexport class SequencerAPIResponseParser extends ResponseParser {\n public parseGetBlockResponse(res: Sequencer.GetBlockResponse): GetBlockResponse {\n return {\n ...res,\n new_root: res.state_root,\n parent_hash: res.parent_block_hash,\n transactions: Object.values(res.transactions)\n .map((value) => 'transaction_hash' in value && value.transaction_hash)\n .filter(Boolean) as Array,\n };\n }\n\n public parseGetTransactionResponse(\n res: Sequencer.GetTransactionResponse\n ): GetTransactionResponse {\n return {\n ...res,\n calldata: 'calldata' in res.transaction ? (res.transaction.calldata as HexCalldata) : [],\n contract_class:\n 'contract_class' in res.transaction ? (res.transaction.contract_class as any) : undefined,\n entry_point_selector:\n 'entry_point_selector' in res.transaction\n ? res.transaction.entry_point_selector\n : undefined,\n max_fee: 'max_fee' in res.transaction ? (res.transaction.max_fee as string) : undefined,\n nonce: res.transaction.nonce as string,\n sender_address:\n 'sender_address' in res.transaction\n ? (res.transaction.sender_address as string)\n : undefined,\n signature: 'signature' in res.transaction ? res.transaction.signature : undefined,\n transaction_hash:\n 'transaction_hash' in res.transaction ? res.transaction.transaction_hash : undefined,\n version: 'version' in res.transaction ? (res.transaction.version as string) : undefined,\n };\n }\n\n public parseGetTransactionReceiptResponse(\n res: Sequencer.TransactionReceiptResponse\n ): GetTransactionReceiptResponse {\n return {\n transaction_hash: res.transaction_hash,\n status: res.status,\n messages_sent: res.l2_to_l1_messages as any, // TODO: parse\n events: res.events as any,\n ...('block_hash' in res && { block_hash: res.block_hash }),\n ...('block_number' in res && { block_number: res.block_number }),\n ...('actual_fee' in res && { actual_fee: res.actual_fee }),\n ...('transaction_index' in res && { transaction_index: res.transaction_index }),\n ...('execution_resources' in res && { execution_resources: res.execution_resources }),\n ...('l1_to_l2_consumed_message' in res && {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n l1_to_l2_consumed_message: res['l1_to_l2_consumed_message'],\n }),\n ...('transaction_failure_reason' in res && {\n transaction_failure_reason: res.transaction_failure_reason,\n }),\n };\n }\n\n public parseFeeEstimateResponse(res: Sequencer.EstimateFeeResponse): EstimateFeeResponse {\n if ('overall_fee' in res) {\n let gasInfo = {};\n\n try {\n gasInfo = {\n gas_consumed: toBigInt(res.gas_usage),\n gas_price: toBigInt(res.gas_price),\n };\n } catch {\n // do nothing\n }\n\n return {\n overall_fee: toBigInt(res.overall_fee),\n ...gasInfo,\n };\n }\n return {\n overall_fee: toBigInt(res.amount),\n };\n }\n\n public parseFeeEstimateBulkResponse(\n res: Sequencer.EstimateFeeResponseBulk\n ): EstimateFeeResponseBulk {\n return [].concat(res as []).map((item: Sequencer.EstimateFeeResponse) => {\n if ('overall_fee' in item) {\n let gasInfo = {};\n\n try {\n gasInfo = {\n gas_consumed: toBigInt(item.gas_usage),\n gas_price: toBigInt(item.gas_price),\n };\n } catch {\n // do nothing\n }\n\n return {\n overall_fee: toBigInt(item.overall_fee),\n ...gasInfo,\n };\n }\n return {\n overall_fee: toBigInt(item.amount),\n };\n });\n }\n\n public parseSimulateTransactionResponse(\n res: Sequencer.SimulateTransactionResponse\n ): SimulateTransactionResponse {\n const suggestedMaxFee =\n 'overall_fee' in res.fee_estimation\n ? res.fee_estimation.overall_fee\n : res.fee_estimation.amount;\n return [\n {\n transaction_trace: res.trace,\n fee_estimation: res.fee_estimation,\n suggestedMaxFee: estimatedFeeToMaxFee(BigInt(suggestedMaxFee)),\n },\n ];\n }\n\n public parseCallContractResponse(res: Sequencer.CallContractResponse): CallContractResponse {\n return {\n result: res.result,\n };\n }\n\n public parseInvokeFunctionResponse(\n res: Sequencer.AddTransactionResponse\n ): InvokeFunctionResponse {\n return {\n transaction_hash: res.transaction_hash,\n };\n }\n\n public parseDeployContractResponse(\n res: Sequencer.AddTransactionResponse\n ): DeployContractResponse {\n return {\n transaction_hash: res.transaction_hash,\n contract_address: res.address as string,\n };\n }\n\n public parseDeclareContractResponse(\n res: Sequencer.AddTransactionResponse\n ): DeclareContractResponse {\n return {\n transaction_hash: res.transaction_hash,\n class_hash: res.class_hash as string,\n };\n }\n\n public parseGetStateUpdateResponse(res: Sequencer.StateUpdateResponse): StateUpdateResponse {\n const nonces = Object.entries(res.state_diff.nonces).map(([contract_address, nonce]) => ({\n contract_address,\n nonce,\n }));\n const storage_diffs = Object.entries(res.state_diff.storage_diffs).map(\n ([address, storage_entries]) => ({ address, storage_entries })\n );\n\n return {\n ...res,\n state_diff: {\n ...res.state_diff,\n storage_diffs,\n nonces,\n },\n };\n }\n\n public parseContractClassResponse(res: CompiledContract): ContractClassResponse {\n const response = isSierra(res) ? res : parseContract(res);\n return {\n ...response,\n abi: typeof response.abi === 'string' ? JSON.parse(response.abi) : response.abi,\n };\n }\n}\n","import urljoin from 'url-join';\n\n/**\n * Inspired from https://github.com/segmentio/is-url\n */\n\n/**\n * RegExps.\n * A URL must match #1 and then at least one of #2/#3.\n * Use two levels of REs to avoid REDOS.\n */\nconst protocolAndDomainRE = /^(?:\\w+:)?\\/\\/(\\S+)$/;\n\nconst localhostDomainRE = /^localhost[:?\\d]*(?:[^:?\\d]\\S*)?$/;\nconst nonLocalhostDomainRE = /^[^\\s.]+\\.\\S{2,}$/;\n\n/**\n * Loosely validate a URL `string`.\n * @param {String} s\n * @return {Boolean}\n */\nexport function isUrl(s?: string): boolean {\n if (!s) {\n return false;\n }\n\n if (typeof s !== 'string') {\n return false;\n }\n\n const match = s.match(protocolAndDomainRE);\n if (!match) {\n return false;\n }\n\n const everythingAfterProtocol = match[1];\n if (!everythingAfterProtocol) {\n return false;\n }\n\n if (\n localhostDomainRE.test(everythingAfterProtocol) ||\n nonLocalhostDomainRE.test(everythingAfterProtocol)\n ) {\n return true;\n }\n\n return false;\n}\n\nexport function buildUrl(baseUrl: string, defaultPath: string, urlOrPath?: string) {\n return isUrl(urlOrPath) ? urlOrPath! : urljoin(baseUrl, urlOrPath ?? defaultPath);\n}\n","import { StarknetChainId } from '../constants';\nimport {\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Nonce,\n ProviderOptions,\n RpcProviderOptions,\n SequencerProviderOptions,\n SimulateTransactionResponse,\n StateUpdateResponse,\n Storage,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { ProviderInterface } from './interface';\nimport { RpcProvider } from './rpc';\nimport { SequencerProvider } from './sequencer';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\n\nexport class Provider implements ProviderInterface {\n private provider!: ProviderInterface;\n\n constructor(providerOrOptions?: ProviderOptions | ProviderInterface) {\n if (providerOrOptions instanceof Provider) {\n // providerOrOptions is Provider\n this.provider = providerOrOptions.provider;\n } else if (\n providerOrOptions instanceof RpcProvider ||\n providerOrOptions instanceof SequencerProvider\n ) {\n // providerOrOptions is SequencerProvider or RpcProvider\n this.provider = providerOrOptions;\n } else if (providerOrOptions && 'rpc' in providerOrOptions) {\n // providerOrOptions is rpc option\n this.provider = new RpcProvider(providerOrOptions.rpc);\n } else if (providerOrOptions && 'sequencer' in providerOrOptions) {\n // providerOrOptions is sequencer option\n this.provider = new SequencerProvider(providerOrOptions.sequencer);\n } else {\n // providerOrOptions is none, create SequencerProvider as default\n this.provider = new SequencerProvider();\n }\n }\n\n public async getChainId(): Promise {\n return this.provider.getChainId();\n }\n\n public async getBlock(blockIdentifier: BlockIdentifier): Promise {\n return this.provider.getBlock(blockIdentifier);\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getClassAt(contractAddress, blockIdentifier);\n }\n\n public async getClassHashAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getClassHashAt(contractAddress, blockIdentifier);\n }\n\n public getClassByHash(classHash: string): Promise {\n return this.provider.getClassByHash(classHash);\n }\n\n public async getEstimateFee(\n invocationWithTxType: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier\n ): Promise {\n return this.provider.getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier);\n }\n\n public async getInvokeEstimateFee(\n invocationWithTxType: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getInvokeEstimateFee(\n invocationWithTxType,\n invocationDetails,\n blockIdentifier,\n skipValidate\n );\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n options: getEstimateFeeBulkOptions\n ): Promise {\n return this.provider.getEstimateFeeBulk(invocations, options);\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getNonceForAddress(contractAddress, blockIdentifier);\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getStorageAt(contractAddress, key, blockIdentifier);\n }\n\n public async getTransaction(txHash: BigNumberish): Promise {\n return this.provider.getTransaction(txHash);\n }\n\n public async getTransactionReceipt(txHash: BigNumberish): Promise {\n return this.provider.getTransactionReceipt(txHash);\n }\n\n public async callContract(\n request: Call,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.callContract(request, blockIdentifier);\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.invokeFunction(functionInvocation, details);\n }\n\n public async deployAccountContract(\n payload: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.deployAccountContract(payload, details);\n }\n\n public async declareContract(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.declareContract(transaction, details);\n }\n\n public async getDeclareEstimateFee(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate);\n }\n\n public getDeployAccountEstimateFee(\n transaction: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getDeployAccountEstimateFee(\n transaction,\n details,\n blockIdentifier,\n skipValidate\n );\n }\n\n public async getCode(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getCode(contractAddress, blockIdentifier);\n }\n\n public async waitForTransaction(\n txHash: BigNumberish,\n options?: waitForTransactionOptions\n ): Promise {\n return this.provider.waitForTransaction(txHash, options);\n }\n\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n options?: getSimulateTransactionOptions\n ): Promise {\n return this.provider.getSimulateTransaction(invocations, options);\n }\n\n public async getStateUpdate(blockIdentifier?: BlockIdentifier): Promise {\n return this.provider.getStateUpdate(blockIdentifier);\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n}\n","import {\n Abi,\n Call,\n DeclareSignerDetails,\n DeployAccountSignerDetails,\n InvocationsSignerDetails,\n Signature,\n TypedData,\n} from '../types';\n\nexport abstract class SignerInterface {\n /**\n * Method to get the public key of the signer\n *\n * @returns public key of signer as hex string with 0x prefix\n */\n public abstract getPubKey(): Promise;\n\n /**\n * Sign an JSON object for off-chain usage with the starknet private key and return the signature\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param typedData - JSON object to be signed\n * @param accountAddress - account\n * @returns the signature of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract signMessage(typedData: TypedData, accountAddress: string): Promise;\n\n /**\n * Signs a transaction with the starknet private key and returns the signature\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * @param abi (optional) the abi of the contract for better displaying\n *\n * @returns signature\n */\n public abstract signTransaction(\n transactions: Call[],\n transactionsDetail: InvocationsSignerDetails,\n abis?: Abi[]\n ): Promise;\n\n /**\n * Signs a DEPLOY_ACCOUNT transaction with the starknet private key and returns the signature\n *\n * @param transaction\n * - contractAddress - the computed address of the contract\n * - constructorCalldata - calldata to be passed in deploy constructor\n * - addressSalt - contract address salt\n * - chainId - the chainId to declare contract on\n * - maxFee - maxFee for the declare transaction\n * - version - transaction version\n * - nonce - Nonce of the declare transaction\n * @returns signature\n */\n public abstract signDeployAccountTransaction(\n transaction: DeployAccountSignerDetails\n ): Promise;\n\n /**\n * Signs a DECLARE transaction with the starknet private key and returns the signature\n *\n * @param transaction\n * - classHash - computed class hash. Will be replaced by ContractClass in future once class hash is present in CompiledContract\n * - senderAddress - the address of the sender\n * - chainId - the chainId to declare contract on\n * - maxFee - maxFee for the declare transaction\n * - version - transaction version\n * - nonce - Nonce of the declare transaction\n * @returns signature\n */\n public abstract signDeclareTransaction(transaction: DeclareSignerDetails): Promise;\n}\n","import { BigNumberish, CairoVersion, Call, CallStruct, Calldata, ParsedStruct } from '../types';\nimport { CallData } from './calldata';\nimport { getSelectorFromName } from './hash';\nimport { toBigInt } from './num';\n\n/**\n * Transforms a list of Calls, each with their own calldata, into\n * two arrays: one with the entrypoints, and one with the concatenated calldata.\n * @param calls\n * @returns\n */\nexport const transformCallsToMulticallArrays = (calls: Call[]) => {\n const callArray: ParsedStruct[] = [];\n const calldata: BigNumberish[] = [];\n calls.forEach((call) => {\n const data = CallData.compile(call.calldata || []);\n callArray.push({\n to: toBigInt(call.contractAddress).toString(10),\n selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10),\n data_offset: calldata.length.toString(),\n data_len: data.length.toString(),\n });\n calldata.push(...data);\n });\n return {\n callArray,\n calldata: CallData.compile({ calldata }),\n };\n};\n\n/**\n * Transforms a list of calls in the full flattened calldata expected\n * by the __execute__ protocol.\n * @param calls\n * @returns\n */\nexport const fromCallsToExecuteCalldata = (calls: Call[]) => {\n const { callArray, calldata } = transformCallsToMulticallArrays(calls);\n const compiledCalls = CallData.compile({ callArray });\n return [...compiledCalls, ...calldata] as Calldata;\n};\n\nexport const fromCallsToExecuteCalldataWithNonce = (calls: Call[], nonce: BigNumberish) => {\n return [...fromCallsToExecuteCalldata(calls), toBigInt(nonce).toString()] as Calldata;\n};\n\n// TT: Can be removed ?\n/**\n * Format Data inside Calls\n * @param calls Call[]\n * @returns CallStruct\n */\nexport const transformCallsToMulticallArrays_cairo1 = (calls: Call[]) => {\n const callArray = calls.map((call) => ({\n to: toBigInt(call.contractAddress).toString(10),\n selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10),\n calldata: CallData.compile(call.calldata || []),\n }));\n return callArray;\n};\n\n/**\n * Transforms a list of calls in the full flattened calldata expected\n * by the __execute__ protocol.\n * @param calls\n * @returns Calldata\n */\nexport const fromCallsToExecuteCalldata_cairo1 = (calls: Call[]) => {\n // ensure property order\n const orderCalls = calls.map((call) => ({\n contractAddress: call.contractAddress,\n entrypoint: call.entrypoint,\n calldata: call.calldata,\n }));\n\n return CallData.compile({ orderCalls });\n};\n\n/**\n *\n * @param calls Call array\n * @param cairoVersion Defaults to 0\n * @returns string[] of calldata\n */\nexport const getExecuteCalldata = (calls: Call[], cairoVersion: CairoVersion = '0') => {\n if (cairoVersion === '1') {\n return fromCallsToExecuteCalldata_cairo1(calls);\n }\n return fromCallsToExecuteCalldata(calls);\n};\n","import { BigNumberish, StarkNetMerkleType, StarkNetType, TypedData } from '../types';\nimport { computeHashOnElements, getSelectorFromName } from './hash';\nimport { MerkleTree } from './merkle';\nimport { isHex, toHex } from './num';\nimport { encodeShortString } from './shortString';\n\n/** @deprecated prefer importing from 'types' over 'typedData' */\nexport * from '../types/typedData';\n\nfunction getHex(value: BigNumberish): string {\n try {\n return toHex(value);\n } catch (e) {\n if (typeof value === 'string') {\n return toHex(encodeShortString(value));\n }\n throw new Error(`Invalid BigNumberish: ${value}`);\n }\n}\n\n/**\n * Validates that `data` matches the EIP-712 JSON schema.\n *\n * @param {any} data\n * @return {boolean}\n */\nconst validateTypedData = (data: unknown): data is TypedData => {\n const typedData = data as TypedData;\n\n // Validate that the data matches the EIP-712 JSON schema\n const valid = Boolean(typedData.types && typedData.primaryType && typedData.message);\n\n return valid;\n};\n\nexport function prepareSelector(selector: string): string {\n return isHex(selector) ? selector : getSelectorFromName(selector);\n}\n\nexport function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType {\n return type.type === 'merkletree';\n}\n\ninterface Context {\n parent?: string;\n key?: string;\n}\n\n/**\n * Get the dependencies of a struct type. If a struct has the same dependency multiple times, it's only included once\n * in the resulting array.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {string[]} [dependencies]\n * @return {string[]}\n */\nexport const getDependencies = (\n types: TypedData['types'],\n type: string,\n dependencies: string[] = []\n): string[] => {\n // Include pointers (struct arrays)\n if (type[type.length - 1] === '*') {\n // eslint-disable-next-line no-param-reassign\n type = type.slice(0, -1);\n }\n\n if (dependencies.includes(type)) {\n return dependencies;\n }\n\n if (!types[type]) {\n return dependencies;\n }\n\n return [\n type,\n ...types[type].reduce(\n (previous, t) => [\n ...previous,\n ...getDependencies(types, t.type, previous).filter(\n (dependency) => !previous.includes(dependency)\n ),\n ],\n []\n ),\n ];\n};\n\nfunction getMerkleTreeType(types: TypedData['types'], ctx: Context) {\n if (ctx.parent && ctx.key) {\n const parentType = types[ctx.parent];\n const merkleType = parentType.find((t) => t.name === ctx.key)!;\n const isMerkleTree = isMerkleTreeType(merkleType);\n if (!isMerkleTree) {\n throw new Error(`${ctx.key} is not a merkle tree`);\n }\n if (merkleType.contains.endsWith('*')) {\n throw new Error(`Merkle tree contain property must not be an array but was given ${ctx.key}`);\n }\n return merkleType.contains;\n }\n return 'raw';\n}\n\n/**\n * Encode a type to a string. All dependant types are alphabetically sorted.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @return {string}\n */\nexport const encodeType = (types: TypedData['types'], type: string): string => {\n const [primary, ...dependencies] = getDependencies(types, type);\n const newTypes = !primary ? [] : [primary, ...dependencies.sort()];\n\n return newTypes\n .map((dependency) => {\n return `${dependency}(${types[dependency].map((t) => `${t.name}:${t.type}`)})`;\n })\n .join('');\n};\n\n/**\n * Get a type string as hash.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @return {string}\n */\nexport const getTypeHash = (types: TypedData['types'], type: string): string => {\n return getSelectorFromName(encodeType(types, type));\n};\n\n/**\n * Encodes a single value to an ABI serialisable string, number or Buffer. Returns the data as tuple, which consists of\n * an array of ABI compatible types, and an array of corresponding values.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {any} data\n * @returns {[string, string]}\n */\nexport const encodeValue = (\n types: TypedData['types'],\n type: string,\n data: unknown,\n ctx: Context = {}\n): [string, string] => {\n if (types[type]) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return [type, getStructHash(types, type, data as Record)];\n }\n\n if (\n Object.keys(types)\n .map((x) => `${x}*`)\n .includes(type)\n ) {\n const structHashes: string[] = (data as unknown[]).map((struct) => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return getStructHash(types, type.slice(0, -1), struct as Record);\n });\n return [type, computeHashOnElements(structHashes)];\n }\n\n if (type === 'merkletree') {\n const merkleTreeType = getMerkleTreeType(types, ctx);\n const structHashes: string[] = (data as unknown[]).map((struct) => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return encodeValue(types, merkleTreeType, struct as Record)[1];\n });\n const { root } = new MerkleTree(structHashes as string[]);\n return ['felt', root];\n }\n\n if (type === 'felt*') {\n return ['felt*', computeHashOnElements(data as string[])];\n }\n\n if (type === 'selector') {\n return ['felt', prepareSelector(data as string)];\n }\n\n return [type, getHex(data as string)];\n};\n\n/**\n * Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values. All\n * dependant types are automatically encoded.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {Record} data\n */\nexport const encodeData = (\n types: T['types'],\n type: string,\n data: T['message']\n) => {\n const [returnTypes, values] = types[type].reduce<[string[], string[]]>(\n ([ts, vs], field) => {\n if (data[field.name] === undefined || data[field.name] === null) {\n throw new Error(`Cannot encode data: missing data for '${field.name}'`);\n }\n\n const value = data[field.name];\n const [t, encodedValue] = encodeValue(types, field.type, value, {\n parent: type,\n key: field.name,\n });\n\n return [\n [...ts, t],\n [...vs, encodedValue],\n ];\n },\n [['felt'], [getTypeHash(types, type)]]\n );\n\n return [returnTypes, values];\n};\n\n/**\n * Get encoded data as a hash. The data should be a key -> value object with all the required values. All dependant\n * types are automatically encoded.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {Record} data\n * @return {Buffer}\n */\nexport const getStructHash = (\n types: T['types'],\n type: string,\n data: T['message']\n) => {\n return computeHashOnElements(encodeData(types, type, data)[1]);\n};\n\n/**\n * Get the EIP-191 encoded message to sign, from the typedData object.\n *\n * @param {TypedData} typedData\n * @param {BigNumberish} account\n * @return {string}\n */\nexport const getMessageHash = (typedData: TypedData, account: BigNumberish): string => {\n if (!validateTypedData(typedData)) {\n throw new Error('Typed data does not match JSON schema');\n }\n\n const message = [\n encodeShortString('StarkNet Message'),\n getStructHash(typedData.types, 'StarkNetDomain', typedData.domain),\n account,\n getStructHash(typedData.types, typedData.primaryType, typedData.message),\n ];\n\n return computeHashOnElements(message);\n};\n","import { starkCurve } from './ec';\nimport { toBigInt } from './num';\n\nexport class MerkleTree {\n public leaves: string[];\n\n public branches: string[][] = [];\n\n public root: string;\n\n constructor(leafHashes: string[]) {\n this.leaves = leafHashes;\n this.root = this.build(leafHashes);\n }\n\n private build(leaves: string[]): string {\n if (leaves.length === 1) {\n return leaves[0];\n }\n if (leaves.length !== this.leaves.length) {\n this.branches.push(leaves);\n }\n const newLeaves: string[] = [];\n for (let i = 0; i < leaves.length; i += 2) {\n if (i + 1 === leaves.length) {\n newLeaves.push(MerkleTree.hash(leaves[i], '0x0'));\n } else {\n newLeaves.push(MerkleTree.hash(leaves[i], leaves[i + 1]));\n }\n }\n return this.build(newLeaves);\n }\n\n static hash(a: string, b: string) {\n const [aSorted, bSorted] = [toBigInt(a), toBigInt(b)].sort((x, y) => (x >= y ? 1 : -1));\n return starkCurve.pedersen(aSorted, bSorted);\n }\n\n public getProof(leaf: string, branch = this.leaves, hashPath: string[] = []): string[] {\n const index = branch.indexOf(leaf);\n if (index === -1) {\n throw new Error('leaf not found');\n }\n if (branch.length === 1) {\n return hashPath;\n }\n const isLeft = index % 2 === 0;\n const neededBranch = (isLeft ? branch[index + 1] : branch[index - 1]) ?? '0x0';\n const newHashPath = [...hashPath, neededBranch];\n const currentBranchLevelIndex =\n this.leaves.length === branch.length\n ? -1\n : this.branches.findIndex((b) => b.length === branch.length);\n const nextBranch = this.branches[currentBranchLevelIndex + 1] ?? [this.root];\n return this.getProof(\n MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf),\n nextBranch,\n newHashPath\n );\n }\n}\n\nexport function proofMerklePath(root: string, leaf: string, path: string[]): boolean {\n if (path.length === 0) {\n return root === leaf;\n }\n const [next, ...rest] = path;\n return proofMerklePath(root, MerkleTree.hash(leaf, next), rest);\n}\n","import {\n Abi,\n Call,\n DeclareSignerDetails,\n DeployAccountSignerDetails,\n InvocationsSignerDetails,\n Signature,\n TypedData,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { starkCurve } from '../utils/ec';\nimport { buf2hex } from '../utils/encode';\nimport {\n calculateDeclareTransactionHash,\n calculateDeployAccountTransactionHash,\n calculateTransactionHash,\n} from '../utils/hash';\nimport { toHex } from '../utils/num';\nimport { getExecuteCalldata } from '../utils/transaction';\nimport { getMessageHash } from '../utils/typedData';\nimport { SignerInterface } from './interface';\n\nexport class Signer implements SignerInterface {\n protected pk: Uint8Array | string;\n\n constructor(pk: Uint8Array | string = starkCurve.utils.randomPrivateKey()) {\n this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk);\n }\n\n public async getPubKey(): Promise {\n return starkCurve.getStarkKey(this.pk);\n }\n\n public async signMessage(typedData: TypedData, accountAddress: string): Promise {\n const msgHash = getMessageHash(typedData, accountAddress);\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signTransaction(\n transactions: Call[],\n transactionsDetail: InvocationsSignerDetails,\n abis?: Abi[]\n ): Promise {\n if (abis && abis.length !== transactions.length) {\n throw new Error('ABI must be provided for each transaction or no transaction');\n }\n // now use abi to display decoded data somewhere, but as this signer is headless, we can't do that\n\n const calldata = getExecuteCalldata(transactions, transactionsDetail.cairoVersion);\n\n const msgHash = calculateTransactionHash(\n transactionsDetail.walletAddress,\n transactionsDetail.version,\n calldata,\n transactionsDetail.maxFee,\n transactionsDetail.chainId,\n transactionsDetail.nonce\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signDeployAccountTransaction({\n classHash,\n contractAddress,\n constructorCalldata,\n addressSalt,\n maxFee,\n version,\n chainId,\n nonce,\n }: DeployAccountSignerDetails): Promise {\n const msgHash = calculateDeployAccountTransactionHash(\n contractAddress,\n classHash,\n CallData.compile(constructorCalldata),\n addressSalt,\n version,\n maxFee,\n chainId,\n nonce\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signDeclareTransaction(\n // contractClass: ContractClass, // Should be used once class hash is present in ContractClass\n {\n classHash,\n senderAddress,\n chainId,\n maxFee,\n version,\n nonce,\n compiledClassHash,\n }: DeclareSignerDetails\n ): Promise {\n const msgHash = calculateDeclareTransactionHash(\n classHash,\n senderAddress,\n version,\n maxFee,\n chainId,\n nonce,\n compiledClassHash\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n}\n","import { UDC } from '../constants';\nimport { InvokeTransactionReceiptResponse } from '../types/provider';\nimport { cleanHex } from './num';\n\n/**\n * Parse Transaction Receipt Event from UDC invoke transaction and\n * create DeployContractResponse compatibile response with adition of UDC Event data\n *\n * @param txReceipt\n * @returns DeployContractResponse | UDC Event Response data\n */\nexport function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse) {\n if (!txReceipt.events) {\n throw new Error('UDC emited event is empty');\n }\n const event = txReceipt.events.find(\n (it) => cleanHex(it.from_address) === cleanHex(UDC.ADDRESS)\n ) || {\n data: [],\n };\n return {\n transaction_hash: txReceipt.transaction_hash,\n contract_address: event.data[0],\n address: event.data[0],\n deployer: event.data[1],\n unique: event.data[2],\n classHash: event.data[3],\n calldata_len: event.data[4],\n calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)),\n salt: event.data[event.data.length - 1],\n };\n}\n","import { UDC, ZERO } from '../constants';\nimport { ProviderInterface } from '../provider';\nimport { Provider } from '../provider/default';\nimport { Signer, SignerInterface } from '../signer';\nimport {\n Abi,\n AccountInvocationItem,\n AccountInvocations,\n AccountInvocationsFactoryDetails,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n CairoVersion,\n Call,\n DeclareAndDeployContractPayload,\n DeclareContractPayload,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeclareDeployUDCResponse,\n DeployAccountContractPayload,\n DeployAccountContractTransaction,\n DeployContractResponse,\n DeployContractUDCResponse,\n Details,\n EstimateFee,\n EstimateFeeAction,\n EstimateFeeBulk,\n EstimateFeeDetails,\n Invocation,\n Invocations,\n InvocationsDetails,\n InvocationsSignerDetails,\n InvokeFunctionResponse,\n MultiDeployContractResponse,\n Nonce,\n ProviderOptions,\n Signature,\n SimulateTransactionDetails,\n SimulateTransactionResponse,\n TransactionType,\n TypedData,\n UniversalDeployerContractPayload,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { extractContractHashes, isSierra } from '../utils/contract';\nimport { starkCurve } from '../utils/ec';\nimport { parseUDCEvent } from '../utils/events';\nimport {\n calculateContractAddressFromHash,\n feeTransactionVersion,\n feeTransactionVersion_2,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { toBigInt, toCairoBool } from '../utils/num';\nimport { parseContract } from '../utils/provider';\nimport { estimatedFeeToMaxFee, formatSignature, randomAddress } from '../utils/stark';\nimport { getExecuteCalldata } from '../utils/transaction';\nimport { getMessageHash } from '../utils/typedData';\nimport { AccountInterface } from './interface';\n\nexport class Account extends Provider implements AccountInterface {\n public signer: SignerInterface;\n\n public address: string;\n\n public cairoVersion: CairoVersion;\n\n constructor(\n providerOrOptions: ProviderOptions | ProviderInterface,\n address: string,\n pkOrSigner: Uint8Array | string | SignerInterface,\n cairoVersion: CairoVersion = '0'\n ) {\n super(providerOrOptions);\n this.address = address.toLowerCase();\n this.signer =\n typeof pkOrSigner === 'string' || pkOrSigner instanceof Uint8Array\n ? new Signer(pkOrSigner)\n : pkOrSigner;\n\n this.cairoVersion = cairoVersion;\n }\n\n public async getNonce(blockIdentifier?: BlockIdentifier): Promise {\n return super.getNonceForAddress(this.address, blockIdentifier);\n }\n\n private async getNonceSafe(nonce?: BigNumberish) {\n // Patch DEPLOY_ACCOUNT: RPC getNonce for non-existing address will result in error, on Sequencer it is '0x0'\n try {\n return toBigInt(nonce ?? (await this.getNonce()));\n } catch (error) {\n return 0n;\n }\n }\n\n public async estimateFee(\n calls: AllowArray,\n estimateFeeDetails?: EstimateFeeDetails | undefined\n ): Promise {\n return this.estimateInvokeFee(calls, estimateFeeDetails);\n }\n\n public async estimateInvokeFee(\n calls: AllowArray,\n { nonce: providedNonce, blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const transactions = Array.isArray(calls) ? calls : [calls];\n const nonce = toBigInt(providedNonce ?? (await this.getNonce()));\n const version = toBigInt(feeTransactionVersion);\n const chainId = await this.getChainId();\n\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce,\n maxFee: ZERO,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n\n const invocation = await this.buildInvocation(transactions, signerDetails);\n const response = await super.getInvokeEstimateFee(\n { ...invocation },\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateDeclareFee(\n { contract, classHash: providedClassHash, casm, compiledClassHash }: DeclareContractPayload,\n { blockIdentifier, nonce: providedNonce, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const nonce = toBigInt(providedNonce ?? (await this.getNonce()));\n const version = !isSierra(contract) ? feeTransactionVersion : feeTransactionVersion_2;\n const chainId = await this.getChainId();\n\n const declareContractTransaction = await this.buildDeclarePayload(\n { classHash: providedClassHash, contract, casm, compiledClassHash },\n {\n nonce,\n chainId,\n version,\n walletAddress: this.address,\n maxFee: ZERO,\n cairoVersion: this.cairoVersion,\n }\n );\n\n const response = await super.getDeclareEstimateFee(\n declareContractTransaction,\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateAccountDeployFee(\n {\n classHash,\n addressSalt = 0,\n constructorCalldata = [],\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n { blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const version = toBigInt(feeTransactionVersion);\n const nonce = ZERO; // DEPLOY_ACCOUNT transaction will have a nonce zero as it is the first transaction in the account\n const chainId = await this.getChainId();\n\n const payload = await this.buildAccountDeployPayload(\n { classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress },\n {\n nonce,\n chainId,\n version,\n walletAddress: this.address,\n maxFee: ZERO,\n cairoVersion: this.cairoVersion,\n }\n );\n\n const response = await super.getDeployAccountEstimateFee(\n { ...payload },\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateDeployFee(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n transactionsDetail?: InvocationsDetails | undefined\n ): Promise {\n const calls = this.buildUDCContractPayload(payload);\n return this.estimateInvokeFee(calls, transactionsDetail);\n }\n\n public async estimateFeeBulk(\n invocations: Invocations,\n { nonce, blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const accountInvocations = await this.accountInvocationsFactory(invocations, {\n versions: [feeTransactionVersion, feeTransactionVersion_2],\n nonce,\n blockIdentifier,\n });\n\n const response = await super.getEstimateFeeBulk(accountInvocations, {\n blockIdentifier,\n skipValidate,\n });\n\n return [].concat(response as []).map((elem: any) => {\n const suggestedMaxFee = estimatedFeeToMaxFee(elem.overall_fee);\n return {\n ...elem,\n suggestedMaxFee,\n };\n });\n }\n\n public async buildInvocation(\n call: Array,\n signerDetails: InvocationsSignerDetails\n ): Promise {\n const calldata = getExecuteCalldata(call, this.cairoVersion);\n const signature = await this.signer.signTransaction(call, signerDetails);\n\n return {\n contractAddress: this.address,\n calldata,\n signature,\n };\n }\n\n public async execute(\n calls: AllowArray,\n abis: Abi[] | undefined = undefined,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const transactions = Array.isArray(calls) ? calls : [calls];\n const nonce = toBigInt(transactionsDetail.nonce ?? (await this.getNonce()));\n const maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n { type: TransactionType.INVOKE, payload: calls },\n transactionsDetail\n ));\n const version = toBigInt(transactionVersion);\n const chainId = await this.getChainId();\n\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce,\n maxFee,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n\n const signature = await this.signer.signTransaction(transactions, signerDetails, abis);\n\n const calldata = getExecuteCalldata(transactions, this.cairoVersion);\n\n return this.invokeFunction(\n { contractAddress: this.address, calldata, signature },\n {\n nonce,\n maxFee,\n version,\n }\n );\n }\n\n /**\n * First check if contract is already declared, if not declare it\n * If contract already declared returned transaction_hash is ''.\n * Method will pass even if contract is already declared\n * @param payload DeclareContractPayload\n * @param transactionsDetail (optional) InvocationsDetails = \\{\\}\n * @returns DeclareContractResponse\n */\n public async declareIfNot(\n payload: DeclareContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const declareContractPayload = extractContractHashes(payload);\n try {\n await this.getClassByHash(declareContractPayload.classHash);\n } catch (error) {\n return this.declare(payload, transactionsDetail);\n }\n return {\n transaction_hash: '',\n class_hash: declareContractPayload.classHash,\n };\n }\n\n public async declare(\n payload: DeclareContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const declareContractPayload = extractContractHashes(payload);\n const details = {} as Details;\n\n details.nonce = toBigInt(transactionsDetail.nonce ?? (await this.getNonce()));\n details.maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n {\n type: TransactionType.DECLARE,\n payload: declareContractPayload,\n },\n transactionsDetail\n ));\n details.version = !isSierra(payload.contract) ? transactionVersion : transactionVersion_2;\n details.chainId = await this.getChainId();\n\n const declareContractTransaction = await this.buildDeclarePayload(declareContractPayload, {\n ...details,\n walletAddress: this.address,\n cairoVersion: this.cairoVersion,\n });\n\n return this.declareContract(declareContractTransaction, details);\n }\n\n public async deploy(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise {\n const params = [].concat(payload as []).map((it) => {\n const {\n classHash,\n salt,\n unique = true,\n constructorCalldata = [],\n } = it as UniversalDeployerContractPayload;\n\n const compiledConstructorCallData = CallData.compile(constructorCalldata);\n const deploySalt = salt ?? randomAddress();\n\n return {\n call: {\n contractAddress: UDC.ADDRESS,\n entrypoint: UDC.ENTRYPOINT,\n calldata: [\n classHash,\n deploySalt,\n toCairoBool(unique),\n compiledConstructorCallData.length,\n ...compiledConstructorCallData,\n ],\n },\n address: calculateContractAddressFromHash(\n unique ? starkCurve.pedersen(this.address, deploySalt) : deploySalt,\n classHash,\n compiledConstructorCallData,\n unique ? UDC.ADDRESS : 0\n ),\n };\n });\n\n const calls = params.map((it) => it.call);\n const addresses = params.map((it) => it.address);\n const invokeResponse = await this.execute(calls, undefined, details);\n\n return {\n ...invokeResponse,\n contract_address: addresses,\n };\n }\n\n public async deployContract(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise {\n const deployTx = await this.deploy(payload, details);\n const txReceipt = await this.waitForTransaction(deployTx.transaction_hash);\n return parseUDCEvent(txReceipt);\n }\n\n public async declareAndDeploy(\n payload: DeclareAndDeployContractPayload,\n details?: InvocationsDetails | undefined\n ): Promise {\n const { constructorCalldata, salt, unique } = payload;\n let declare = await this.declareIfNot(payload, details);\n if (declare.transaction_hash !== '') {\n const tx = await this.waitForTransaction(declare.transaction_hash);\n declare = { ...declare, ...tx };\n }\n const deploy = await this.deployContract(\n { classHash: declare.class_hash, salt, unique, constructorCalldata },\n details\n );\n return { declare: { ...declare }, deploy };\n }\n\n public deploySelf = this.deployAccount;\n\n public async deployAccount(\n {\n classHash,\n constructorCalldata = [],\n addressSalt = 0,\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const version = toBigInt(transactionVersion);\n const nonce = ZERO; // DEPLOY_ACCOUNT transaction will have a nonce zero as it is the first transaction in the account\n const chainId = await this.getChainId();\n\n const compiledCalldata = CallData.compile(constructorCalldata);\n const contractAddress =\n providedContractAddress ??\n calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);\n\n const maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n payload: {\n classHash,\n constructorCalldata: compiledCalldata,\n addressSalt,\n contractAddress,\n },\n },\n transactionsDetail\n ));\n\n const signature = await this.signer.signDeployAccountTransaction({\n classHash,\n constructorCalldata: compiledCalldata,\n contractAddress,\n addressSalt,\n chainId,\n maxFee,\n version,\n nonce,\n });\n\n return this.deployAccountContract(\n { classHash, addressSalt, constructorCalldata, signature },\n {\n nonce,\n maxFee,\n version,\n }\n );\n }\n\n public async signMessage(typedData: TypedData): Promise {\n return this.signer.signMessage(typedData, this.address);\n }\n\n public async hashMessage(typedData: TypedData): Promise {\n return getMessageHash(typedData, this.address);\n }\n\n public async verifyMessageHash(hash: BigNumberish, signature: Signature): Promise {\n try {\n await this.callContract({\n contractAddress: this.address,\n entrypoint: 'isValidSignature',\n calldata: CallData.compile({\n hash: toBigInt(hash).toString(),\n signature: formatSignature(signature),\n }),\n });\n return true;\n } catch {\n return false;\n }\n }\n\n public async verifyMessage(typedData: TypedData, signature: Signature): Promise {\n const hash = await this.hashMessage(typedData);\n return this.verifyMessageHash(hash, signature);\n }\n\n public async getSuggestedMaxFee(\n { type, payload }: EstimateFeeAction,\n details: EstimateFeeDetails\n ) {\n let feeEstimate: EstimateFee;\n\n switch (type) {\n case TransactionType.INVOKE:\n feeEstimate = await this.estimateInvokeFee(payload, details);\n break;\n\n case TransactionType.DECLARE:\n feeEstimate = await this.estimateDeclareFee(payload, details);\n break;\n\n case TransactionType.DEPLOY_ACCOUNT:\n feeEstimate = await this.estimateAccountDeployFee(payload, details);\n break;\n\n case TransactionType.DEPLOY:\n feeEstimate = await this.estimateDeployFee(payload, details);\n break;\n\n default:\n feeEstimate = { suggestedMaxFee: ZERO, overall_fee: ZERO };\n break;\n }\n\n return feeEstimate.suggestedMaxFee;\n }\n\n /**\n * will be renamed to buildDeclareContractTransaction\n */\n public async buildDeclarePayload(\n payload: DeclareContractPayload,\n { nonce, chainId, version, walletAddress, maxFee }: InvocationsSignerDetails\n ): Promise {\n const { classHash, contract, compiledClassHash } = extractContractHashes(payload);\n const compressedCompiledContract = parseContract(contract);\n const signature = await this.signer.signDeclareTransaction({\n classHash,\n compiledClassHash,\n senderAddress: walletAddress,\n chainId,\n maxFee,\n version,\n nonce,\n });\n\n return {\n senderAddress: walletAddress,\n signature,\n contract: compressedCompiledContract,\n compiledClassHash,\n };\n }\n\n public async buildAccountDeployPayload(\n {\n classHash,\n addressSalt = 0,\n constructorCalldata = [],\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n { nonce, chainId, version, maxFee }: InvocationsSignerDetails\n ): Promise {\n const compiledCalldata = CallData.compile(constructorCalldata);\n const contractAddress =\n providedContractAddress ??\n calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);\n\n const signature = await this.signer.signDeployAccountTransaction({\n classHash,\n contractAddress,\n chainId,\n maxFee,\n version,\n nonce,\n addressSalt,\n constructorCalldata: compiledCalldata,\n });\n\n return {\n classHash,\n addressSalt,\n constructorCalldata: compiledCalldata,\n signature,\n };\n }\n\n public buildUDCContractPayload(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]\n ): Call[] {\n const calls = [].concat(payload as []).map((it) => {\n const {\n classHash,\n salt = '0',\n unique = true,\n constructorCalldata = [],\n } = it as UniversalDeployerContractPayload;\n const compiledConstructorCallData = CallData.compile(constructorCalldata);\n\n return {\n contractAddress: UDC.ADDRESS,\n entrypoint: UDC.ENTRYPOINT,\n calldata: [\n classHash,\n salt,\n toCairoBool(unique),\n compiledConstructorCallData.length,\n ...compiledConstructorCallData,\n ],\n };\n });\n return calls;\n }\n\n public async simulateTransaction(\n invocations: Invocations,\n { nonce, blockIdentifier, skipValidate, skipExecute }: SimulateTransactionDetails = {}\n ): Promise {\n const accountInvocations = await this.accountInvocationsFactory(invocations, {\n versions: [transactionVersion, transactionVersion_2],\n nonce,\n blockIdentifier,\n });\n\n return super.getSimulateTransaction(accountInvocations, {\n blockIdentifier,\n skipValidate,\n skipExecute,\n });\n }\n\n public async accountInvocationsFactory(\n invocations: Invocations,\n { versions, nonce, blockIdentifier }: AccountInvocationsFactoryDetails\n ) {\n const version = versions[0];\n const safeNonce = await this.getNonceSafe(nonce);\n const chainId = await this.getChainId();\n\n return Promise.all(\n ([] as Invocations).concat(invocations).map(async (transaction, index: number) => {\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce: toBigInt(Number(safeNonce) + index),\n maxFee: ZERO,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n const txPayload: any = 'payload' in transaction ? transaction.payload : transaction;\n const common = {\n type: transaction.type,\n version,\n nonce: toBigInt(Number(safeNonce) + index),\n blockIdentifier,\n };\n\n if (transaction.type === TransactionType.INVOKE) {\n const payload = await this.buildInvocation(\n ([] as Call[]).concat(txPayload),\n signerDetails\n );\n return {\n ...common,\n ...payload,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DECLARE) {\n signerDetails.version = !isSierra(txPayload.contract)\n ? toBigInt(versions[0])\n : toBigInt(versions[1]);\n const payload = await this.buildDeclarePayload(txPayload, signerDetails);\n return {\n ...common,\n ...payload,\n version: signerDetails.version,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DEPLOY_ACCOUNT) {\n const payload = await this.buildAccountDeployPayload(txPayload, signerDetails);\n return {\n ...common,\n ...payload,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DEPLOY) {\n const calls = this.buildUDCContractPayload(txPayload);\n const payload = await this.buildInvocation(calls, signerDetails);\n return {\n ...common,\n ...payload,\n type: TransactionType.INVOKE,\n } as AccountInvocationItem;\n }\n throw Error(`accountInvocationsFactory: unsupported transaction type: ${transaction}`);\n })\n ) as Promise;\n }\n\n public override async getStarkName(\n address: BigNumberish = this.address, // default to the wallet address\n StarknetIdContract?: string\n ): Promise {\n return super.getStarkName(address, StarknetIdContract);\n }\n}\n","import { StarknetChainId } from '../constants';\nimport type {\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractPayload,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Nonce,\n SimulateTransactionResponse,\n StateUpdateResponse,\n Storage,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\n\nexport abstract class ProviderInterface {\n /**\n * Gets the Starknet chain Id\n *\n * @returns the chain Id\n */\n public abstract getChainId(): Promise;\n\n /**\n * Calls a function on the Starknet contract.\n *\n * @param call transaction to be called\n * @param blockIdentifier block identifier\n * @returns the result of the function on the smart contract.\n */\n public abstract callContract(\n call: Call,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the block information\n *\n * @param blockIdentifier block identifier\n * @returns the block object\n */\n public abstract getBlock(blockIdentifier: BlockIdentifier): Promise;\n\n /**\n * @deprecated The method should not be used\n */\n public abstract getCode(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the contract class of the deployed contract.\n *\n * @param contractAddress - contract address\n * @param blockIdentifier - block identifier\n * @returns Contract class of compiled contract\n */\n public abstract getClassAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Returns the class hash deployed under the given address.\n *\n * @param contractAddress - contract address\n * @param blockIdentifier - block identifier\n * @returns Class hash\n */\n public abstract getClassHashAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Returns the contract class deployed under the given class hash.\n *\n * @param classHash - class hash\n * @returns Contract class of compiled contract\n */\n public abstract getClassByHash(classHash: string): Promise;\n\n /**\n * Gets the nonce of a contract with respect to a specific block\n *\n * @param contractAddress - contract address\n * @returns the hex nonce\n */\n public abstract getNonceForAddress(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the contract's storage variable at a specific key.\n *\n * @param contractAddress\n * @param key - from getStorageVarAddress('') (WIP)\n * @param blockIdentifier - block identifier\n * @returns the value of the storage variable\n */\n public abstract getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the transaction information from a tx id.\n *\n * @param txHash\n * @returns the transaction object \\{ transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? \\}\n */\n public abstract getTransaction(transactionHash: BigNumberish): Promise;\n\n /**\n * Gets the transaction receipt from a tx hash.\n *\n * @param txHash\n * @returns the transaction receipt object\n */\n public abstract getTransactionReceipt(\n transactionHash: BigNumberish\n ): Promise;\n\n /**\n * Deploys a given compiled Account contract (json) to starknet\n *\n * @param payload payload to be deployed containing:\n * - compiled contract code\n * - constructor calldata\n * - address salt\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract deployAccountContract(\n payload: DeployAccountContractPayload,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Invokes a function on starknet\n * @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * - maxFee - optional maxFee\n * @returns response from addTransaction\n */\n public abstract invokeFunction(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Declares a given compiled contract (json) to starknet\n * @param transaction transaction payload to be deployed containing:\n * - compiled contract code\n * - sender address\n * - signature\n * @param details Invocation Details containing:\n * - nonce\n * - optional version\n * - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract declareContract(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Estimates the fee for a given INVOKE transaction\n * @deprecated Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getEstimateFee(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given INVOKE transaction\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getInvokeEstimateFee(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given DECLARE transaction\n *\n * @param transaction transaction payload to be declared containing:\n * - compiled contract code\n * - sender address\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce\n * - version - optional version\n * - optional maxFee\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getDeclareEstimateFee(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given DEPLOY_ACCOUNT transaction\n *\n * @param transaction transaction payload to be deployed containing:\n * - classHash\n * - constructorCalldata\n * - addressSalt\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce\n * - version - optional version\n * - optional maxFee\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getDeployAccountEstimateFee(\n transaction: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a list of INVOKE transaction\n *\n * @param invocations AccountInvocations - Complete invocations array with account details\n * @param options getEstimateFeeBulkOptions\n * - (optional) blockIdentifier - BlockIdentifier\n * - (optional) skipValidate - boolean (default false)\n * @returns the estimated fee\n */\n public abstract getEstimateFeeBulk(\n invocations: AccountInvocations,\n options?: getEstimateFeeBulkOptions\n ): Promise;\n\n /**\n * Wait for the transaction to be accepted\n * @param txHash - transaction hash\n * @param options waitForTransactionOptions\n * - (optional) retryInterval: number | undefined;\n * - (optional) successStates: TransactionStatus[] | undefined;\n * @return GetTransactionReceiptResponse\n */\n public abstract waitForTransaction(\n txHash: BigNumberish,\n options?: waitForTransactionOptions\n ): Promise;\n\n /**\n * Simulates the transaction and returns the transaction trace and estimated fee.\n *\n * @param invocations AccountInvocations - Complete invocations array with account details\n * @param options - getSimulateTransactionOptions\n * - (optional) blockIdentifier - block identifier\n * - (optional) skipValidate - skip cairo __validate__ method\n * - (optional) skipExecute - skip cairo __execute__ method\n * @returns an array of transaction trace and estimated fee\n */\n public abstract getSimulateTransaction(\n invocations: AccountInvocations,\n options?: getSimulateTransactionOptions\n ): Promise;\n\n /**\n * Gets the state changes in a specific block\n *\n * @param blockIdentifier - block identifier\n * @returns StateUpdateResponse\n */\n public abstract getStateUpdate(blockIdentifier?: BlockIdentifier): Promise;\n}\n","import { Provider } from './default';\n\nexport * from './default';\nexport * from './errors';\nexport * from './sequencer';\nexport * from './interface';\nexport * from './rpc';\n\nexport const defaultProvider = new Provider();\n","import { ProviderInterface } from '../provider';\nimport { SignerInterface } from '../signer';\nimport {\n Abi,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n CairoVersion,\n Call,\n DeclareAndDeployContractPayload,\n DeclareContractPayload,\n DeclareContractResponse,\n DeclareDeployUDCResponse,\n DeployAccountContractPayload,\n DeployContractResponse,\n DeployContractUDCResponse,\n EstimateFeeAction,\n EstimateFeeDetails,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n Invocations,\n InvocationsDetails,\n InvokeFunctionResponse,\n MultiDeployContractResponse,\n Nonce,\n Signature,\n SimulateTransactionDetails,\n SimulateTransactionResponse,\n TypedData,\n UniversalDeployerContractPayload,\n} from '../types';\n\nexport abstract class AccountInterface extends ProviderInterface {\n public abstract address: string;\n\n public abstract signer: SignerInterface;\n\n public abstract cairoVersion: CairoVersion;\n\n /**\n * Estimate Fee for executing an INVOKE transaction on starknet\n *\n * @param calls the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n *\n * @returns response from estimate_fee\n */\n public abstract estimateInvokeFee(\n calls: AllowArray,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a DECLARE transaction on starknet\n *\n * @param contractPayload the payload object containing:\n * - contract - the compiled contract to be declared\n * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.\n *\n * @returns response from estimate_fee\n */\n public abstract estimateDeclareFee(\n contractPayload: DeclareContractPayload,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet\n *\n * @param contractPayload -\n * - contract - the compiled contract to be deployed\n * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.\n * @param estimateFeeDetails -\n * - optional blockIdentifier\n * - constant nonce = 0\n * @returns response from estimate_fee\n */\n public abstract estimateAccountDeployFee(\n contractPayload: DeployAccountContractPayload,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a UDC DEPLOY transaction on starknet\n * This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC)\n \n * @param deployContractPayload containing\n * - classHash: computed class hash of compiled contract\n * - salt: address salt\n * - unique: bool if true ensure unique salt\n * - calldata: constructor calldata\n * \n * @param transactionsDetail Invocation Details containing:\n * - optional nonce\n * - optional version\n * - optional maxFee\n */\n public abstract estimateDeployFee(\n deployContractPayload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a list of transactions on starknet\n * Contract must be deployed for fee estimation to be possible\n *\n * @param transactions array of transaction object containing :\n * - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT'\n * - payload - the payload of the transaction\n *\n * @returns response from estimate_fee\n */\n public abstract estimateFeeBulk(\n invocations: Invocations,\n details?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Invoke execute function in account contract\n *\n * @param transactions the invocation object or an array of them, containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param abi (optional) the abi of the contract for better displaying\n *\n * @returns response from addTransaction\n */\n public abstract execute(\n transactions: AllowArray,\n abis?: Abi[],\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Declares a given compiled contract (json) to starknet\n * \n * @param contractPayload transaction payload to be deployed containing:\n - contract: compiled contract code\n - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution.\n - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string;\n - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution.\n * @param transactionsDetail Invocation Details containing:\n - optional nonce\n - optional version\n - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract declare(\n contractPayload: DeclareContractPayload,\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Deploys a declared contract to starknet - using Universal Deployer Contract (UDC)\n * support multicall\n *\n * @param payload -\n * - classHash: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details -\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - contract_address[]\n * - transaction_hash\n */\n public abstract deploy(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Simplify deploy simulating old DeployContract with same response + UDC specific response\n * Internal wait for L2 transaction, support multicall\n *\n * @param payload -\n * - classHash: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details -\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - contract_address\n * - transaction_hash\n * - address\n * - deployer\n * - unique\n * - classHash\n * - calldata_len\n * - calldata\n * - salt\n */\n public abstract deployContract(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Declares and Deploy a given compiled contract (json) to starknet using UDC\n * Internal wait for L2 transaction, do not support multicall\n * Method will pass even if contract is already declared (internal using DeclareIfNot)\n *\n * @param payload\n * - contract: compiled contract code\n * - [casm=cairo1]: CairoAssembly | undefined;\n * - [compiledClassHash]: string | undefined;\n * - [classHash]: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - declare\n * - transaction_hash\n * - deploy\n * - contract_address\n * - transaction_hash\n * - address\n * - deployer\n * - unique\n * - classHash\n * - calldata_len\n * - calldata\n * - salt\n */\n public abstract declareAndDeploy(\n payload: DeclareAndDeployContractPayload,\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Deploy the account on Starknet\n * \n * @param contractPayload transaction payload to be deployed containing:\n - classHash: computed class hash of compiled contract\n - optional constructor calldata\n - optional address salt \n - optional contractAddress\n * @param transactionsDetail Invocation Details containing:\n - constant nonce = 0\n - optional version\n - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract deployAccount(\n contractPayload: DeployAccountContractPayload,\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Sign an JSON object for off-chain usage with the starknet private key and return the signature\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param json - JSON object to be signed\n * @returns the signature of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract signMessage(typedData: TypedData): Promise;\n\n /**\n * Hash a JSON object with pederson hash and return the hash\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param json - JSON object to be hashed\n * @returns the hash of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract hashMessage(typedData: TypedData): Promise;\n\n /**\n * Verify a signature of a JSON object\n *\n * @param typedData - JSON object to be verified\n * @param signature - signature of the JSON object\n * @returns true if the signature is valid, false otherwise\n * @throws {Error} if the JSON object is not a valid JSON or the signature is not a valid signature\n */\n public abstract verifyMessage(typedData: TypedData, signature: Signature): Promise;\n\n /**\n * Verify a signature of a given hash\n * @warning This method is not recommended, use verifyMessage instead\n *\n * @param hash - hash to be verified\n * @param signature - signature of the hash\n * @returns true if the signature is valid, false otherwise\n * @throws {Error} if the signature is not a valid signature\n */\n public abstract verifyMessageHash(hash: BigNumberish, signature: Signature): Promise;\n\n /**\n * Gets the nonce of the account with respect to a specific block\n *\n * @param {BlockIdentifier} blockIdentifier - optional blockIdentifier. Defaults to 'pending'\n * @returns nonce of the account\n */\n public abstract getNonce(blockIdentifier?: BlockIdentifier): Promise;\n\n /**\n * Gets Suggested Max Fee based on the transaction type\n *\n * @param {EstimateFeeAction} estimateFeeAction\n * @param {EstimateFeeDetails} details\n * @returns suggestedMaxFee\n */\n public abstract getSuggestedMaxFee(\n estimateFeeAction: EstimateFeeAction,\n details: EstimateFeeDetails\n ): Promise;\n\n /**\n * Simulates an array of transaction and returns an array of transaction trace and estimated fee.\n *\n * @param invocations Invocations containing:\n * - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION\n * @param details SimulateTransactionDetails\n *\n * @returns response from simulate_transaction\n */\n public abstract simulateTransaction(\n invocations: Invocations,\n details?: SimulateTransactionDetails\n ): Promise;\n}\n","import { AccountInterface } from '../account';\nimport { ProviderInterface, defaultProvider } from '../provider';\nimport {\n Abi,\n ArgsOrCalldata,\n ArgsOrCalldataWithOptions,\n AsyncContractFunction,\n Call,\n CallOptions,\n Calldata,\n ContractFunction,\n ContractOptions,\n EstimateFeeResponse,\n FunctionAbi,\n InvokeFunctionResponse,\n InvokeOptions,\n RawArgs,\n Result,\n StructAbi,\n ValidateType,\n} from '../types';\nimport assert from '../utils/assert';\nimport { CallData, cairo } from '../utils/calldata';\nimport { createAbiParser } from '../utils/calldata/parser';\nimport { ContractInterface } from './interface';\n\nexport const splitArgsAndOptions = (args: ArgsOrCalldataWithOptions) => {\n const options = [\n 'blockIdentifier',\n 'parseRequest',\n 'parseResponse',\n 'formatResponse',\n 'maxFee',\n 'nonce',\n 'signature',\n 'addressSalt',\n ];\n const lastArg = args[args.length - 1];\n if (typeof lastArg === 'object' && options.some((x) => x in lastArg)) {\n return { args: args as ArgsOrCalldata, options: args.pop() as ContractOptions };\n }\n return { args: args as ArgsOrCalldata };\n};\n\n/**\n * Adds call methods to the contract\n */\nfunction buildCall(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n return async function (...args: ArgsOrCalldataWithOptions): Promise {\n const params = splitArgsAndOptions(args);\n return contract.call(functionAbi.name, params.args, {\n parseRequest: true,\n parseResponse: true,\n ...params.options,\n });\n };\n}\n\n/**\n * Adds invoke methods to the contract\n */\nfunction buildInvoke(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n return async function (...args: Array): Promise {\n const params = splitArgsAndOptions(args);\n return contract.invoke(functionAbi.name, params.args, {\n parseRequest: true,\n ...params.options,\n });\n };\n}\n\n/**\n * Adds call/invoke methods to the contract\n */\nfunction buildDefault(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n if (functionAbi.stateMutability === 'view' || functionAbi.state_mutability === 'view') {\n return buildCall(contract, functionAbi);\n }\n return buildInvoke(contract, functionAbi);\n}\n\n/**\n * Adds populate for methods to the contract\n */\nfunction buildPopulate(contract: Contract, functionAbi: FunctionAbi): ContractFunction {\n return function (...args: Array): any {\n return contract.populate(functionAbi.name, args);\n };\n}\n\n/**\n * Adds estimateFee for methods to the contract\n */\nfunction buildEstimate(contract: Contract, functionAbi: FunctionAbi): ContractFunction {\n return function (...args: Array): any {\n return contract.estimate(functionAbi.name, args);\n };\n}\n\nexport function getCalldata(args: RawArgs, callback: Function): Calldata {\n // Check if Calldata in args or args[0] else compile\n if (Array.isArray(args) && '__compiled__' in args) return args as Calldata;\n if (Array.isArray(args) && Array.isArray(args[0]) && '__compiled__' in args[0])\n return args[0] as Calldata;\n return callback();\n}\n\n/**\n * Not used at the moment\n */\n/* const detectCairoVersion = (abi: Abi) => {\n if (!abi) return '0';\n return abi.find((it) => 'state_mutability' in it) ? '1' : '0';\n}; */\n\nexport class Contract implements ContractInterface {\n abi: Abi;\n\n address: string;\n\n providerOrAccount: ProviderInterface | AccountInterface;\n\n deployTransactionHash?: string;\n\n protected readonly structs: { [name: string]: StructAbi };\n\n readonly functions!: { [name: string]: AsyncContractFunction };\n\n readonly callStatic!: { [name: string]: AsyncContractFunction };\n\n readonly populateTransaction!: { [name: string]: ContractFunction };\n\n readonly estimateFee!: { [name: string]: ContractFunction };\n\n readonly [key: string]: AsyncContractFunction | any;\n\n private callData: CallData;\n\n /**\n * Contract class to handle contract methods\n *\n * @param abi - Abi of the contract object\n * @param address (optional) - address to connect to\n * @param providerOrAccount (optional) - Provider or Account to attach to\n */\n constructor(\n abi: Abi,\n address: string,\n providerOrAccount: ProviderInterface | AccountInterface = defaultProvider\n ) {\n this.address = address && address.toLowerCase();\n this.providerOrAccount = providerOrAccount;\n this.callData = new CallData(abi);\n this.structs = CallData.getAbiStruct(abi);\n const parser = createAbiParser(abi);\n this.abi = parser.getLegacyFormat();\n\n const options = { enumerable: true, value: {}, writable: false };\n Object.defineProperties(this, {\n functions: { enumerable: true, value: {}, writable: false },\n callStatic: { enumerable: true, value: {}, writable: false },\n populateTransaction: { enumerable: true, value: {}, writable: false },\n estimateFee: { enumerable: true, value: {}, writable: false },\n });\n this.abi.forEach((abiElement) => {\n if (abiElement.type !== 'function') return;\n const signature = abiElement.name;\n if (!this[signature]) {\n Object.defineProperty(this, signature, {\n ...options,\n value: buildDefault(this, abiElement),\n });\n }\n if (!this.functions[signature]) {\n Object.defineProperty(this.functions, signature, {\n ...options,\n value: buildDefault(this, abiElement),\n });\n }\n if (!this.callStatic[signature]) {\n Object.defineProperty(this.callStatic, signature, {\n ...options,\n value: buildCall(this, abiElement),\n });\n }\n if (!this.populateTransaction[signature]) {\n Object.defineProperty(this.populateTransaction, signature, {\n ...options,\n value: buildPopulate(this, abiElement),\n });\n }\n if (!this.estimateFee[signature]) {\n Object.defineProperty(this.estimateFee, signature, {\n ...options,\n value: buildEstimate(this, abiElement),\n });\n }\n });\n }\n\n public attach(address: string): void {\n this.address = address;\n }\n\n public connect(providerOrAccount: ProviderInterface | AccountInterface) {\n this.providerOrAccount = providerOrAccount;\n }\n\n public async deployed(): Promise {\n if (this.deployTransactionHash) {\n await this.providerOrAccount.waitForTransaction(this.deployTransactionHash);\n this.deployTransactionHash = undefined;\n }\n return this;\n }\n\n public async call(\n method: string,\n args: ArgsOrCalldata = [],\n {\n parseRequest = true,\n parseResponse = true,\n formatResponse = undefined,\n blockIdentifier = undefined,\n }: CallOptions = {}\n ): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n const calldata = getCalldata(args, () => {\n if (parseRequest) {\n this.callData.validate(ValidateType.CALL, method, args);\n return this.callData.compile(method, args);\n }\n // eslint-disable-next-line no-console\n console.warn('Call skipped parsing but provided rawArgs, possible malfunction request');\n return args;\n });\n\n return this.providerOrAccount\n .callContract(\n {\n contractAddress: this.address,\n calldata,\n entrypoint: method,\n },\n blockIdentifier\n )\n .then((x) => {\n if (!parseResponse) {\n return x.result;\n }\n if (formatResponse) {\n return this.callData.format(method, x.result, formatResponse);\n }\n return this.callData.parse(method, x.result);\n });\n }\n\n public invoke(\n method: string,\n args: ArgsOrCalldata = [],\n { parseRequest = true, maxFee, nonce, signature }: InvokeOptions = {}\n ): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n const calldata = getCalldata(args, () => {\n if (parseRequest) {\n this.callData.validate(ValidateType.INVOKE, method, args);\n return this.callData.compile(method, args);\n }\n // eslint-disable-next-line no-console\n console.warn('Invoke skipped parsing but provided rawArgs, possible malfunction request');\n return args;\n });\n\n const invocation = {\n contractAddress: this.address,\n calldata,\n entrypoint: method,\n };\n if ('execute' in this.providerOrAccount) {\n return this.providerOrAccount.execute(invocation, undefined, {\n maxFee,\n nonce,\n });\n }\n\n if (!nonce) throw new Error(`Nonce is required when invoking a function without an account`);\n // eslint-disable-next-line no-console\n console.warn(`Invoking ${method} without an account. This will not work on a public node.`);\n\n return this.providerOrAccount.invokeFunction(\n {\n ...invocation,\n signature,\n },\n {\n nonce,\n }\n );\n }\n\n public async estimate(method: string, args: ArgsOrCalldata = []): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n if (!getCalldata(args, () => false)) {\n this.callData.validate(ValidateType.INVOKE, method, args);\n }\n\n const invocation = this.populate(method, args);\n if ('estimateInvokeFee' in this.providerOrAccount) {\n return this.providerOrAccount.estimateInvokeFee(invocation);\n }\n throw Error('Contract must be connected to the account contract to estimate');\n }\n\n public populate(method: string, args: RawArgs = []): Call {\n const calldata: Calldata = getCalldata(args, () => this.callData.compile(method, args));\n return {\n contractAddress: this.address,\n entrypoint: method,\n calldata,\n };\n }\n\n public isCairo1(): boolean {\n return cairo.isCairo1Abi(this.abi);\n }\n}\n","import { AccountInterface } from '../account';\nimport { ProviderInterface } from '../provider';\nimport {\n Abi,\n ArgsOrCalldata,\n AsyncContractFunction,\n BlockIdentifier,\n CallOptions,\n ContractFunction,\n EstimateFeeResponse,\n Invocation,\n InvokeFunctionResponse,\n InvokeOptions,\n Result,\n} from '../types';\n\nexport abstract class ContractInterface {\n public abstract abi: Abi;\n\n public abstract address: string;\n\n public abstract providerOrAccount: ProviderInterface | AccountInterface;\n\n public abstract deployTransactionHash?: string;\n\n readonly functions!: { [name: string]: AsyncContractFunction };\n\n readonly callStatic!: { [name: string]: AsyncContractFunction };\n\n readonly populateTransaction!: { [name: string]: ContractFunction };\n\n readonly estimateFee!: { [name: string]: ContractFunction };\n\n readonly [key: string]: AsyncContractFunction | any;\n\n /**\n * Saves the address of the contract deployed on network that will be used for interaction\n *\n * @param address - address of the contract\n */\n public abstract attach(address: string): void;\n\n /**\n * Attaches to new Provider or Account\n *\n * @param providerOrAccount - new Provider or Account to attach to\n */\n public abstract connect(providerOrAccount: ProviderInterface | AccountInterface): void;\n\n /**\n * Resolves when contract is deployed on the network or when no deployment transaction is found\n *\n * @returns Promise that resolves when contract is deployed on the network or when no deployment transaction is found\n * @throws When deployment fails\n */\n public abstract deployed(): Promise;\n\n /**\n * Calls a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call\n * @param options optional blockIdentifier\n * @returns Result of the call as an array with key value pars\n */\n public abstract call(\n method: string,\n args?: ArgsOrCalldata,\n options?: CallOptions\n ): Promise;\n\n /**\n * Invokes a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the invoke or Calldata\n * @param options\n * @returns Add Transaction Response\n */\n public abstract invoke(\n method: string,\n args?: ArgsOrCalldata,\n options?: InvokeOptions\n ): Promise;\n\n /**\n * Estimates a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call or Calldata\n * @param options optional blockIdentifier\n */\n public abstract estimate(\n method: string,\n args?: ArgsOrCalldata,\n options?: {\n blockIdentifier?: BlockIdentifier;\n }\n ): Promise;\n\n /**\n * Calls a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call or Calldata\n * @returns Invocation object\n */\n public abstract populate(method: string, args?: ArgsOrCalldata): Invocation;\n\n /**\n * tells if the contract comes from a Cairo 1 contract\n *\n * @returns TRUE if the contract comes from a Cairo1 contract\n * @example\n * ```typescript\n * const isCairo1: boolean = myContract.isCairo1();\n * ```\n */\n public abstract isCairo1(): boolean;\n}\n","import { AccountInterface } from '../account';\nimport {\n Abi,\n ArgsOrCalldataWithOptions,\n CairoAssembly,\n CompiledContract,\n ValidateType,\n} from '../types';\nimport assert from '../utils/assert';\nimport { CallData } from '../utils/calldata';\nimport { Contract, getCalldata, splitArgsAndOptions } from './default';\n\nexport type ContractFactoryParams = {\n compiledContract: CompiledContract;\n account: any;\n casm?: CairoAssembly;\n classHash?: string;\n compiledClassHash?: string;\n abi?: Abi;\n};\n\nexport class ContractFactory {\n compiledContract: CompiledContract;\n\n account: AccountInterface;\n\n abi: Abi;\n\n classHash?: string;\n\n casm?: CairoAssembly;\n\n compiledClassHash?: string;\n\n private CallData: CallData;\n\n /**\n * @param params CFParams\n * - compiledContract: CompiledContract;\n * - account: AccountInterface;\n * - casm?: CairoAssembly;\n * - classHash?: string;\n * - compiledClassHash?: string;\n * - abi?: Abi;\n */\n constructor(params: ContractFactoryParams) {\n this.compiledContract = params.compiledContract;\n this.account = params.account;\n this.casm = params.casm;\n this.abi = params.abi ?? params.compiledContract.abi;\n this.classHash = params.classHash;\n this.compiledClassHash = params.compiledClassHash;\n this.CallData = new CallData(this.abi);\n }\n\n /**\n * Deploys contract and returns new instance of the Contract\n * If contract is not declared it will first declare it, and then deploy\n *\n * @param args - Array of the constructor arguments for deployment\n * @param options (optional) Object - parseRequest, parseResponse, addressSalt\n * @returns deployed Contract\n */\n public async deploy(...args: ArgsOrCalldataWithOptions): Promise {\n const { args: param, options = { parseRequest: true } } = splitArgsAndOptions(args);\n\n const constructorCalldata = getCalldata(param, () => {\n if (options.parseRequest) {\n this.CallData.validate(ValidateType.DEPLOY, 'constructor', param);\n return this.CallData.compile('constructor', param);\n }\n // eslint-disable-next-line no-console\n console.warn('Call skipped parsing but provided rawArgs, possible malfunction request');\n return param;\n });\n\n const {\n deploy: { contract_address, transaction_hash },\n } = await this.account.declareAndDeploy({\n contract: this.compiledContract,\n casm: this.casm,\n classHash: this.classHash,\n compiledClassHash: this.compiledClassHash,\n constructorCalldata,\n salt: options.addressSalt,\n });\n assert(Boolean(contract_address), 'Deployment of the contract failed');\n\n const contractInstance = new Contract(\n this.compiledContract.abi,\n contract_address!,\n this.account\n );\n contractInstance.deployTransactionHash = transaction_hash;\n\n return contractInstance;\n }\n\n /**\n * Attaches to new Account\n *\n * @param account - new Provider or Account to attach to\n * @returns ContractFactory\n */\n connect(account: AccountInterface): ContractFactory {\n this.account = account;\n return this;\n }\n\n /**\n * Attaches current abi and account to the new address\n *\n * @param address - Contract address\n * @returns Contract\n */\n attach(address: string): Contract {\n return new Contract(this.abi, address, this.account);\n }\n\n // ethers.js' getDeployTransaction cant be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation\n}\n","/* eslint-disable no-bitwise */\nimport { hexToBytes } from '@noble/curves/abstract/utils';\n\nimport { MASK_251, ZERO } from '../constants';\nimport { BigNumberish } from '../types';\nimport { addHexPrefix, removeHexPrefix } from './encode';\nimport { keccakBn } from './hash';\nimport { assertInRange, toHex } from './num';\n\nexport function addAddressPadding(address: BigNumberish): string {\n return addHexPrefix(removeHexPrefix(toHex(address)).padStart(64, '0'));\n}\n\nexport function validateAndParseAddress(address: BigNumberish): string {\n assertInRange(address, ZERO, MASK_251, 'Starknet Address');\n\n const result = addAddressPadding(address);\n\n if (!result.match(/^(0x)?[0-9a-fA-F]{64}$/)) {\n throw new Error('Invalid Address Format');\n }\n\n return result;\n}\n\n// from https://github.com/ethers-io/ethers.js/blob/fc1e006575d59792fa97b4efb9ea2f8cca1944cf/packages/address/src.ts/index.ts#L12\nexport function getChecksumAddress(address: BigNumberish): string {\n const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split('');\n const hex = removeHexPrefix(keccakBn(address));\n const hashed = hexToBytes(hex.padStart(64, '0'));\n\n for (let i = 0; i < chars.length; i += 2) {\n if (hashed[i >> 1] >> 4 >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n\n return addHexPrefix(chars.join(''));\n}\n\nexport function validateChecksumAddress(address: string): boolean {\n return getChecksumAddress(address) === address;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,E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AAChE,SAAO,mBAAmB,OAAO,MAAM;AACzC;;;AzDFO,IAAM,SAAS;","names":["BaseUrl","NetworkName","StarknetChainId","TransactionHashPrefix","SIMULATION_FLAG","ValidateType","Uint","EntryPointType","TransactionType","TransactionStatus","BlockStatus","BlockTag","TransactionType","number","hexToBytesNoble","uint256","parseBaseTypes","import_micro_starknet","parse","stringify","json","stringify","parse","import_micro_starknet","stringify","parse","parse","isomorphicFetch","stringify","parse","StarknetIdContract","StarknetIdContract","stringify","StarknetIdContract","import_url_join","urljoin","defaultOptions","urljoin","stringify","parse","StarknetIdContract","StarknetIdContract","StarknetIdContract","import_utils"]} \ No newline at end of file diff --git a/web/lib/starknet-estfee-tx-ver/dist/index.mjs b/web/lib/starknet-estfee-tx-ver/dist/index.mjs new file mode 100644 index 000000000..4f40d526f --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/dist/index.mjs @@ -0,0 +1,6536 @@ +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +// src/constants.ts +var constants_exports = {}; +__export(constants_exports, { + ALPHA: () => ALPHA, + API_VERSION: () => API_VERSION, + BETA: () => BETA, + BaseUrl: () => BaseUrl, + CONSTANT_POINTS: () => CONSTANT_POINTS, + EC_ORDER: () => EC_ORDER, + FIELD_GEN: () => FIELD_GEN, + FIELD_PRIME: () => FIELD_PRIME, + FIELD_SIZE: () => FIELD_SIZE, + IS_BROWSER: () => IS_BROWSER, + MASK_250: () => MASK_250, + MASK_251: () => MASK_251, + MAX_ECDSA_VAL: () => MAX_ECDSA_VAL, + NetworkName: () => NetworkName, + StarknetChainId: () => StarknetChainId, + TransactionHashPrefix: () => TransactionHashPrefix, + UDC: () => UDC, + ZERO: () => ZERO +}); + +// src/utils/encode.ts +var encode_exports = {}; +__export(encode_exports, { + IS_BROWSER: () => IS_BROWSER, + addHexPrefix: () => addHexPrefix, + arrayBufferToString: () => arrayBufferToString, + atobUniversal: () => atobUniversal, + btoaUniversal: () => btoaUniversal, + buf2hex: () => buf2hex, + calcByteLength: () => calcByteLength, + padLeft: () => padLeft, + removeHexPrefix: () => removeHexPrefix, + sanitizeBytes: () => sanitizeBytes, + sanitizeHex: () => sanitizeHex, + stringToArrayBuffer: () => stringToArrayBuffer, + utf8ToArray: () => utf8ToArray +}); +var IS_BROWSER = typeof window !== "undefined"; +var STRING_ZERO = "0"; +function arrayBufferToString(array) { + return new Uint8Array(array).reduce((data, byte) => data + String.fromCharCode(byte), ""); +} +function stringToArrayBuffer(s) { + return Uint8Array.from(s, (c) => c.charCodeAt(0)); +} +function atobUniversal(a) { + return IS_BROWSER ? stringToArrayBuffer(atob(a)) : Buffer.from(a, "base64"); +} +function btoaUniversal(b) { + return IS_BROWSER ? btoa(arrayBufferToString(b)) : Buffer.from(b).toString("base64"); +} +function buf2hex(buffer) { + return [...buffer].map((x) => x.toString(16).padStart(2, "0")).join(""); +} +function removeHexPrefix(hex) { + return hex.replace(/^0x/i, ""); +} +function addHexPrefix(hex) { + return `0x${removeHexPrefix(hex)}`; +} +function padString(str, length, left, padding = STRING_ZERO) { + const diff = length - str.length; + let result = str; + if (diff > 0) { + const pad = padding.repeat(diff); + result = left ? pad + str : str + pad; + } + return result; +} +function padLeft(str, length, padding = STRING_ZERO) { + return padString(str, length, true, padding); +} +function calcByteLength(length, byteSize = 8) { + const remainder = length % byteSize; + return remainder ? (length - remainder) / byteSize * byteSize + byteSize : length; +} +function sanitizeBytes(str, byteSize = 8, padding = STRING_ZERO) { + return padLeft(str, calcByteLength(str.length, byteSize), padding); +} +function sanitizeHex(hex) { + hex = removeHexPrefix(hex); + hex = sanitizeBytes(hex, 2); + if (hex) { + hex = addHexPrefix(hex); + } + return hex; +} +function utf8ToArray(str) { + return new TextEncoder().encode(str); +} + +// src/constants.ts +var ZERO = 0n; +var MASK_250 = 2n ** 250n - 1n; +var MASK_251 = 2n ** 251n; +var API_VERSION = ZERO; +var BaseUrl = /* @__PURE__ */ ((BaseUrl2) => { + BaseUrl2["SN_MAIN"] = "https://alpha-mainnet.starknet.io"; + BaseUrl2["SN_GOERLI"] = "https://alpha4.starknet.io"; + BaseUrl2["SN_GOERLI2"] = "https://alpha4-2.starknet.io"; + return BaseUrl2; +})(BaseUrl || {}); +var NetworkName = /* @__PURE__ */ ((NetworkName2) => { + NetworkName2["SN_MAIN"] = "SN_MAIN"; + NetworkName2["SN_GOERLI"] = "SN_GOERLI"; + NetworkName2["SN_GOERLI2"] = "SN_GOERLI2"; + return NetworkName2; +})(NetworkName || {}); +var StarknetChainId = /* @__PURE__ */ ((StarknetChainId3) => { + StarknetChainId3["SN_MAIN"] = "0x534e5f4d41494e"; + StarknetChainId3["SN_GOERLI"] = "0x534e5f474f45524c49"; + StarknetChainId3["SN_GOERLI2"] = "0x534e5f474f45524c4932"; + return StarknetChainId3; +})(StarknetChainId || {}); +var TransactionHashPrefix = /* @__PURE__ */ ((TransactionHashPrefix2) => { + TransactionHashPrefix2["DECLARE"] = "0x6465636c617265"; + TransactionHashPrefix2["DEPLOY"] = "0x6465706c6f79"; + TransactionHashPrefix2["DEPLOY_ACCOUNT"] = "0x6465706c6f795f6163636f756e74"; + TransactionHashPrefix2["INVOKE"] = "0x696e766f6b65"; + TransactionHashPrefix2["L1_HANDLER"] = "0x6c315f68616e646c6572"; + return TransactionHashPrefix2; +})(TransactionHashPrefix || {}); +var UDC = { + ADDRESS: "0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", + ENTRYPOINT: "deployContract" +}; +var FIELD_PRIME = "800000000000011000000000000000000000000000000000000000000000001"; +var FIELD_GEN = "3"; +var FIELD_SIZE = 251; +var EC_ORDER = "800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F"; +var ALPHA = "1"; +var BETA = "6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89"; +var MAX_ECDSA_VAL = "800000000000000000000000000000000000000000000000000000000000000"; +var CONSTANT_POINTS = [ + [ + "49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804", + "3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a" + ], + [ + "1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca", + "5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f" + ], + [ + "234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b", + "3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615" + ], + [ + "3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476", + "7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19" + ], + [ + "40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c", + "109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740" + ], + [ + "2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b", + "6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26" + ], + [ + "6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674", + "606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2" + ], + [ + "7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62", + "a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae" + ], + [ + "3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec", + "45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9" + ], + [ + "1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e", + "30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a" + ], + [ + "6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26", + "31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2" + ], + [ + "54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4", + "c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5" + ], + [ + "35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6", + "5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d" + ], + [ + "4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23", + "5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820" + ], + [ + "648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf", + "72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c" + ], + [ + "bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b", + "6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6" + ], + [ + "35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357", + "3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14" + ], + [ + "36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643", + "7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c" + ], + [ + "5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661", + "9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753" + ], + [ + "21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6", + "51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c" + ], + [ + "19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9", + "515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa" + ], + [ + "888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24", + "730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea" + ], + [ + "75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977", + "4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8" + ], + [ + "640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5", + "3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c" + ], + [ + "6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96", + "7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645" + ], + [ + "5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876", + "518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200" + ], + [ + "6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4", + "2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc" + ], + [ + "542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18", + "5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c" + ], + [ + "299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de", + "1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958" + ], + [ + "628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73", + "ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d" + ], + [ + "6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933", + "6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db" + ], + [ + "28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a", + "7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba" + ], + [ + "619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02", + "2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308" + ], + [ + "641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96", + "6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837" + ], + [ + "58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2", + "124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9" + ], + [ + "a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74", + "1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8" + ], + [ + "744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b", + "7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f" + ], + [ + "434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c", + "7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39" + ], + [ + "7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73", + "56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431" + ], + [ + "4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7", + "ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e" + ], + [ + "250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe", + "1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04" + ], + [ + "2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2", + "55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63" + ], + [ + "249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245", + "7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e" + ], + [ + "6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb", + "640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8" + ], + [ + "2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9", + "636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be" + ], + [ + "4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea", + "1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff" + ], + [ + "46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca", + "1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f" + ], + [ + "2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152", + "1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7" + ], + [ + "386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b", + "2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5" + ], + [ + "407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90", + "436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f" + ], + [ + "1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f", + "69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec" + ], + [ + "7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e", + "34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69" + ], + [ + "299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913", + "b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675" + ], + [ + "551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5", + "5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e" + ], + [ + "7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2", + "3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6" + ], + [ + "28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504", + "7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b" + ], + [ + "1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b", + "4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4" + ], + [ + "2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b", + "9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911" + ], + [ + "770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed", + "42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd" + ], + [ + "5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9", + "3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d" + ], + [ + "6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825", + "1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177" + ], + [ + "404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1", + "3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb" + ], + [ + "20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc", + "106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7" + ], + [ + "119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa", + "1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773" + ], + [ + "45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749", + "ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965" + ], + [ + "1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38", + "593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f" + ], + [ + "186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3", + "55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c" + ], + [ + "58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9", + "6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0" + ], + [ + "13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b", + "3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4" + ], + [ + "48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676", + "4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1" + ], + [ + "4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158", + "620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef" + ], + [ + "4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b", + "4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8" + ], + [ + "7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9", + "2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de" + ], + [ + "65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f", + "3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6" + ], + [ + "1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d", + "21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a" + ], + [ + "3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b", + "5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f" + ], + [ + "4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4", + "5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b" + ], + [ + "6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8", + "e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9" + ], + [ + "748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5", + "3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93" + ], + [ + "7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3", + "5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4" + ], + [ + "6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f", + "32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039" + ], + [ + "1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309", + "56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4" + ], + [ + "1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd", + "431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c" + ], + [ + "6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162", + "14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3" + ], + [ + "738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e", + "33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47" + ], + [ + "2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8", + "92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc" + ], + [ + "181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe", + "5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff" + ], + [ + "1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a", + "4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f" + ], + [ + "e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873", + "34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f" + ], + [ + "4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45", + "3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af" + ], + [ + "37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed", + "37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6" + ], + [ + "27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c", + "6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d" + ], + [ + "2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf", + "306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413" + ], + [ + "307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72", + "3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995" + ], + [ + "79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc", + "40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2" + ], + [ + "4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292", + "7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717" + ], + [ + "645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2", + "15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab" + ], + [ + "1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f", + "583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c" + ], + [ + "66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca", + "505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4" + ], + [ + "5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1", + "bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323" + ], + [ + "a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194", + "4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689" + ], + [ + "1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c", + "7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf" + ], + [ + "48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f", + "781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3" + ], + [ + "17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd", + "6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223" + ], + [ + "5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89", + "1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff" + ], + [ + "6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58", + "436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e" + ], + [ + "7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6", + "484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4" + ], + [ + "17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d", + "7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f" + ], + [ + "7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf", + "33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78" + ], + [ + "7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d", + "6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb" + ], + [ + "273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128", + "653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f" + ], + [ + "3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212", + "65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e" + ], + [ + "5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee", + "3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22" + ], + [ + "7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9", + "71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e" + ], + [ + "40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62", + "499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42" + ], + [ + "6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465", + "35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37" + ], + [ + "604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6", + "68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457" + ], + [ + "73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4", + "4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb" + ], + [ + "3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1", + "677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0" + ], + [ + "39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f", + "20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952" + ], + [ + "326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c", + "7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1" + ], + [ + "53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632", + "2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1" + ], + [ + "6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e", + "beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63" + ], + [ + "3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332", + "529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7" + ], + [ + "3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e", + "3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740" + ], + [ + "7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a", + "68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400" + ], + [ + "1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb", + "5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9" + ], + [ + "3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344", + "52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590" + ], + [ + "44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa", + "6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940" + ], + [ + "7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e", + "78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9" + ], + [ + "7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d", + "4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62" + ], + [ + "7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c", + "636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84" + ], + [ + "758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2", + "1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245" + ], + [ + "7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e", + "229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470" + ], + [ + "78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614", + "246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675" + ], + [ + "6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647", + "599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4" + ], + [ + "4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e", + "1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad" + ], + [ + "3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d", + "617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c" + ], + [ + "5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287", + "1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d" + ], + [ + "3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004", + "7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232" + ], + [ + "3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb", + "563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6" + ], + [ + "16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52", + "7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e" + ], + [ + "75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4", + "35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0" + ], + [ + "3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8", + "6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd" + ], + [ + "54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579", + "7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0" + ], + [ + "d1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0", + "2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45" + ], + [ + "2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d", + "70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b" + ], + [ + "752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3", + "3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef" + ], + [ + "63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e", + "37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e" + ], + [ + "d6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b", + "5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018" + ], + [ + "12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557", + "6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613" + ], + [ + "46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c", + "76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df" + ], + [ + "4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516", + "5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29" + ], + [ + "71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833", + "85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346" + ], + [ + "5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61", + "3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950" + ], + [ + "161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941", + "78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b" + ], + [ + "1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1", + "66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d" + ], + [ + "56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44", + "47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e" + ], + [ + "4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491", + "430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4" + ], + [ + "7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606", + "312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295" + ], + [ + "16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe", + "7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24" + ], + [ + "323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b", + "4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265" + ], + [ + "624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d", + "261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430" + ], + [ + "f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d", + "b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6" + ], + [ + "686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec", + "7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6" + ], + [ + "3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e", + "634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af" + ], + [ + "484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b", + "34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8" + ], + [ + "203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a", + "2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2" + ], + [ + "2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d", + "6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6" + ], + [ + "5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef", + "30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d" + ], + [ + "57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741", + "7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad" + ], + [ + "611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1", + "3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4" + ], + [ + "1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31", + "3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527" + ], + [ + "275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234", + "2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521" + ], + [ + "6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95", + "5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e" + ], + [ + "44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c", + "3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e" + ], + [ + "fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966", + "110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9" + ], + [ + "9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef", + "4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51" + ], + [ + "71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7", + "7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9" + ], + [ + "1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345", + "4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc" + ], + [ + "3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115", + "a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24" + ], + [ + "c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d", + "729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d" + ], + [ + "44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d", + "212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8" + ], + [ + "35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f", + "74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62" + ], + [ + "e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03", + "3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357" + ], + [ + "3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a", + "5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df" + ], + [ + "222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c", + "72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42" + ], + [ + "3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764", + "480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c" + ], + [ + "adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187", + "60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8" + ], + [ + "3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9", + "7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996" + ], + [ + "12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32", + "6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1" + ], + [ + "27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b", + "c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917" + ], + [ + "431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6", + "30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197" + ], + [ + "4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33", + "627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c" + ], + [ + "2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8", + "1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f" + ], + [ + "e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc", + "58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9" + ], + [ + "7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5", + "74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1" + ], + [ + "62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b", + "1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315" + ], + [ + "1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938", + "44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b" + ], + [ + "78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea", + "6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41" + ], + [ + "5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d", + "1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb" + ], + [ + "62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04", + "6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f" + ], + [ + "4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f", + "941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494" + ], + [ + "52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1", + "987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782" + ], + [ + "1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f", + "38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b" + ], + [ + "4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232", + "7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c" + ], + [ + "69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73", + "a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897" + ], + [ + "b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62", + "24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915" + ], + [ + "5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb", + "6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9" + ], + [ + "1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0", + "23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699" + ], + [ + "2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5", + "1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862" + ], + [ + "d26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3", + "34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a" + ], + [ + "91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563", + "e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a" + ], + [ + "1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7", + "7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd" + ], + [ + "4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f", + "47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e" + ], + [ + "3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069", + "47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc" + ], + [ + "758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657", + "3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83" + ], + [ + "19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8", + "5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709" + ], + [ + "28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855", + "14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2" + ], + [ + "3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f", + "69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d" + ], + [ + "77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b", + "7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df" + ], + [ + "97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6", + "2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223" + ], + [ + "a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647", + "37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2" + ], + [ + "e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc", + "1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a" + ], + [ + "2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de", + "6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591" + ], + [ + "744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f", + "685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d" + ], + [ + "40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd", + "2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e" + ], + [ + "5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc", + "2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2" + ], + [ + "5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985", + "49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183" + ], + [ + "2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649", + "61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d" + ], + [ + "ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381", + "190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60" + ], + [ + "233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c", + "7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef" + ], + [ + "42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce", + "12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65" + ], + [ + "30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44", + "5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a" + ], + [ + "4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a", + "4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93" + ], + [ + "62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466", + "5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0" + ], + [ + "5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f", + "5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94" + ], + [ + "670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728", + "26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0" + ], + [ + "3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5", + "56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015" + ], + [ + "4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3", + "1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e" + ], + [ + "4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0", + "97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09" + ], + [ + "574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219", + "49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8" + ], + [ + "7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554", + "47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba" + ], + [ + "67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6", + "39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8" + ], + [ + "63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b", + "60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9" + ], + [ + "3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543", + "56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628" + ], + [ + "758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129", + "622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746" + ], + [ + "38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c", + "145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e" + ], + [ + "206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad", + "6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8" + ], + [ + "56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d", + "526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6" + ], + [ + "4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378", + "3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d" + ], + [ + "450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58", + "1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7" + ], + [ + "6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d", + "28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2" + ], + [ + "1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf", + "fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb" + ], + [ + "4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997", + "40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c" + ], + [ + "21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef", + "4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f" + ], + [ + "350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046", + "5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b" + ], + [ + "529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6", + "3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491" + ], + [ + "55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d", + "159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9" + ], + [ + "405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f", + "4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d" + ], + [ + "376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe", + "5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba" + ], + [ + "2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38", + "7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089" + ], + [ + "3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed", + "5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5" + ], + [ + "7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4", + "3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe" + ], + [ + "4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d", + "204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89" + ], + [ + "79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72", + "3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb" + ], + [ + "297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c", + "6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993" + ], + [ + "44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7", + "1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc" + ], + [ + "6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26", + "64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd" + ], + [ + "14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24", + "5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1" + ], + [ + "95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83", + "1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1" + ], + [ + "2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5", + "5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67" + ], + [ + "61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d", + "23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795" + ], + [ + "79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf", + "2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6" + ], + [ + "45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b", + "2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd" + ], + [ + "37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007", + "50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c" + ], + [ + "71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b", + "3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6" + ], + [ + "78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06", + "5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256" + ], + [ + "b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15", + "653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83" + ], + [ + "441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc", + "4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59" + ], + [ + "2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa", + "4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0" + ], + [ + "3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f", + "4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c" + ], + [ + "5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092", + "5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56" + ], + [ + "3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771", + "459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999" + ], + [ + "5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f", + "56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49" + ], + [ + "1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281", + "5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a" + ], + [ + "1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40", + "6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488" + ], + [ + "61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b", + "27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad" + ], + [ + "7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e", + "481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf" + ], + [ + "124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316", + "33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987" + ], + [ + "61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c", + "5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb" + ], + [ + "70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d", + "3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc" + ], + [ + "41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f", + "7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce" + ], + [ + "62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8", + "1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771" + ], + [ + "441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a", + "29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086" + ], + [ + "2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee", + "11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77" + ], + [ + "5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea", + "63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc" + ], + [ + "3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7", + "7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092" + ], + [ + "95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922", + "159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9" + ], + [ + "621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c", + "65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd" + ], + [ + "54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e", + "680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313" + ], + [ + "21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d", + "7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8" + ], + [ + "3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3", + "12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801" + ], + [ + "befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392", + "6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8" + ], + [ + "15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6", + "30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df" + ], + [ + "38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8", + "786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13" + ], + [ + "6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72", + "1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a" + ], + [ + "5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30", + "1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea" + ], + [ + "309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1", + "505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851" + ], + [ + "89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc", + "1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540" + ], + [ + "480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84", + "511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570" + ], + [ + "3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb", + "49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920" + ], + [ + "66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd", + "4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b" + ], + [ + "373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3", + "5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c" + ], + [ + "26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7", + "157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc" + ], + [ + "ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f", + "517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7" + ], + [ + "25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66", + "10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8" + ], + [ + "243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742", + "1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f" + ], + [ + "48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562", + "3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264" + ], + [ + "592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca", + "48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc" + ], + [ + "31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d", + "a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5" + ], + [ + "4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc", + "512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47" + ], + [ + "26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc", + "75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e" + ], + [ + "3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe", + "20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d" + ], + [ + "483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97", + "2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d" + ], + [ + "65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9", + "562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373" + ], + [ + "284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35", + "5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02" + ], + [ + "32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85", + "7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd" + ], + [ + "1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a", + "478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742" + ], + [ + "270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf", + "3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b" + ], + [ + "6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d", + "5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33" + ], + [ + "48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1", + "2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0" + ], + [ + "e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5", + "36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997" + ], + [ + "5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8", + "6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c" + ], + [ + "15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6", + "69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903" + ], + [ + "274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50", + "6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656" + ], + [ + "4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123", + "116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba" + ], + [ + "4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a", + "2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f" + ], + [ + "5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3", + "4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b" + ], + [ + "11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483", + "36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8" + ], + [ + "4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3", + "e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64" + ], + [ + "2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3", + "527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d" + ], + [ + "52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf", + "19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41" + ], + [ + "541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961", + "78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2" + ], + [ + "5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd", + "137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc" + ], + [ + "15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4", + "4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549" + ], + [ + "68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4", + "7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f" + ], + [ + "67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df", + "7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01" + ], + [ + "596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334", + "49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0" + ], + [ + "567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395", + "6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd" + ], + [ + "cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7", + "4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7" + ], + [ + "4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06", + "2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566" + ], + [ + "760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359", + "1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e" + ], + [ + "6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2", + "3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd" + ], + [ + "4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b", + "2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f" + ], + [ + "5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7", + "76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39" + ], + [ + "2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7", + "62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e" + ], + [ + "5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00", + "14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1" + ], + [ + "7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c", + "bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970" + ], + [ + "37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843", + "672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb" + ], + [ + "5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114", + "7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e" + ], + [ + "25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63", + "3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb" + ], + [ + "32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0", + "bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459" + ], + [ + "49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f", + "57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8" + ], + [ + "10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd", + "8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0" + ], + [ + "79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36", + "146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c" + ], + [ + "6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439", + "68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82" + ], + [ + "71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097", + "54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c" + ], + [ + "27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b", + "14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3" + ], + [ + "6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c", + "5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048" + ], + [ + "32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9", + "518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4" + ], + [ + "4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e", + "3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4" + ], + [ + "4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10", + "20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918" + ], + [ + "87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a", + "112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb" + ], + [ + "6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae", + "54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1" + ], + [ + "19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a", + "1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510" + ], + [ + "12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d", + "4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7" + ], + [ + "13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2", + "40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1" + ], + [ + "255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d", + "3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc" + ], + [ + "7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31", + "4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6" + ], + [ + "2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35", + "44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf" + ], + [ + "750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b", + "54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c" + ], + [ + "3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72", + "7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359" + ], + [ + "4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb", + "63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235" + ], + [ + "1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f", + "4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d" + ], + [ + "2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087", + "2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d" + ], + [ + "4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3", + "5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621" + ], + [ + "2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05", + "1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19" + ], + [ + "4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c", + "33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614" + ], + [ + "7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b", + "5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722" + ], + [ + "7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51", + "26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056" + ], + [ + "36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881", + "33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5" + ], + [ + "403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd", + "47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5" + ], + [ + "3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb", + "2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e" + ], + [ + "3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537", + "f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4" + ], + [ + "235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65", + "37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5" + ], + [ + "3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b", + "4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe" + ], + [ + "48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518", + "73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee" + ], + [ + "48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0", + "3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903" + ], + [ + "2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097", + "19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541" + ], + [ + "1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676", + "36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7" + ], + [ + "2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b", + "7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b" + ], + [ + "348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a", + "3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969" + ], + [ + "7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31", + "42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd" + ], + [ + "2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a", + "5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83" + ], + [ + "1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2", + "dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d" + ], + [ + "54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e", + "16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089" + ], + [ + "525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b", + "58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea" + ], + [ + "54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd", + "53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76" + ], + [ + "4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae", + "2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17" + ], + [ + "21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708", + "59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c" + ], + [ + "167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66", + "22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a" + ], + [ + "31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843", + "1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c" + ], + [ + "1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b", + "2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b" + ], + [ + "c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0", + "45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327" + ], + [ + "394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6", + "1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd" + ], + [ + "410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27", + "361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa" + ], + [ + "38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734", + "624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1" + ], + [ + "78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608", + "19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198" + ], + [ + "6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867", + "7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb" + ], + [ + "32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602", + "3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377" + ], + [ + "49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5", + "1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d" + ], + [ + "2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5", + "759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96" + ], + [ + "3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70", + "22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6" + ], + [ + "5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab", + "715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8" + ], + [ + "19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a", + "896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5" + ], + [ + "61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc", + "38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8" + ], + [ + "2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df", + "1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb" + ], + [ + "7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54", + "21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b" + ], + [ + "b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed", + "5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf" + ], + [ + "e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc", + "550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a" + ], + [ + "7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4", + "2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f" + ], + [ + "7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c", + "410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e" + ], + [ + "225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5", + "411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e" + ], + [ + "1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1", + "3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8" + ], + [ + "59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335", + "1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8" + ], + [ + "2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3", + "62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535" + ], + [ + "6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb", + "7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f" + ], + [ + "34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88", + "3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d" + ], + [ + "436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d", + "67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044" + ], + [ + "592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4", + "27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5" + ], + [ + "89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009", + "557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b" + ], + [ + "1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e", + "72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a" + ], + [ + "574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03", + "5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3" + ], + [ + "513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1", + "687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5" + ], + [ + "53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9", + "35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be" + ], + [ + "213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44", + "744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89" + ], + [ + "735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c", + "7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9" + ], + [ + "3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001", + "79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8" + ], + [ + "51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74", + "10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad" + ], + [ + "c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc", + "53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a" + ], + [ + "5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece", + "39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f" + ], + [ + "3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299", + "15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975" + ], + [ + "6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0", + "11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744" + ], + [ + "7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65", + "3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb" + ], + [ + "2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6", + "461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d" + ], + [ + "34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f", + "33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44" + ], + [ + "6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441", + "6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693" + ], + [ + "17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce", + "3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7" + ], + [ + "70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27", + "d18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8" + ], + [ + "2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf", + "5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1" + ], + [ + "5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1", + "eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487" + ], + [ + "6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61", + "911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984" + ], + [ + "74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293", + "761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92" + ], + [ + "44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9", + "249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0" + ], + [ + "2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc", + "6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5" + ], + [ + "3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb", + "6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb" + ], + [ + "284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677", + "516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7" + ], + [ + "2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32", + "7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec" + ], + [ + "5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7", + "6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece" + ], + [ + "74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f", + "156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531" + ], + [ + "334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45", + "221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2" + ], + [ + "7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30", + "3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86" + ], + [ + "4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8", + "6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749" + ], + [ + "1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7", + "3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583" + ], + [ + "294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1", + "d837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad" + ], + [ + "753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39", + "6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75" + ], + [ + "5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e", + "7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8" + ], + [ + "4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f", + "21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e" + ], + [ + "726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8", + "15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12" + ], + [ + "38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2", + "73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b" + ], + [ + "6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291", + "4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75" + ], + [ + "6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f", + "26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05" + ], + [ + "2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155", + "5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244" + ], + [ + "4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7", + "5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1" + ], + [ + "110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3", + "7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43" + ], + [ + "5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096", + "7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2" + ], + [ + "2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d", + "62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b" + ], + [ + "1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d", + "309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4" + ], + [ + "2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d", + "3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf" + ], + [ + "376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543", + "6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547" + ], + [ + "a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066", + "6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471" + ], + [ + "223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed", + "c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa" + ], + [ + "102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2", + "6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65" + ], + [ + "891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2", + "5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37" + ], + [ + "215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203", + "10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266" + ], + [ + "21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36", + "3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3" + ], + [ + "60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae", + "e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879" + ], + [ + "1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5", + "69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3" + ], + [ + "5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e", + "134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec" + ], + [ + "626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8", + "7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0" + ], + [ + "23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd", + "7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf" + ], + [ + "54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202", + "1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426" + ], + [ + "13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c", + "62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9" + ], + [ + "47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98", + "75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb" + ], + [ + "2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585", + "5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c" + ] +]; + +// src/types/index.ts +var types_exports = {}; +__export(types_exports, { + BlockStatus: () => BlockStatus, + BlockTag: () => BlockTag, + EntryPointType: () => EntryPointType, + RPC: () => rpc_exports, + SIMULATION_FLAG: () => SIMULATION_FLAG, + Sequencer: () => sequencer_exports, + TransactionStatus: () => TransactionStatus, + TransactionType: () => TransactionType, + Uint: () => Uint, + ValidateType: () => ValidateType +}); + +// src/types/account.ts +var SIMULATION_FLAG = /* @__PURE__ */ ((SIMULATION_FLAG2) => { + SIMULATION_FLAG2[SIMULATION_FLAG2["SKIP_VALIDATE"] = 0] = "SKIP_VALIDATE"; + SIMULATION_FLAG2[SIMULATION_FLAG2["SKIP_EXECUTE"] = 1] = "SKIP_EXECUTE"; + return SIMULATION_FLAG2; +})(SIMULATION_FLAG || {}); + +// src/types/calldata.ts +var ValidateType = /* @__PURE__ */ ((ValidateType2) => { + ValidateType2["DEPLOY"] = "DEPLOY"; + ValidateType2["CALL"] = "CALL"; + ValidateType2["INVOKE"] = "INVOKE"; + return ValidateType2; +})(ValidateType || {}); +var Uint = /* @__PURE__ */ ((Uint2) => { + Uint2["u8"] = "core::integer::u8"; + Uint2["u16"] = "core::integer::u16"; + Uint2["u32"] = "core::integer::u32"; + Uint2["u64"] = "core::integer::u64"; + Uint2["u128"] = "core::integer::u128"; + Uint2["u256"] = "core::integer::u256"; + return Uint2; +})(Uint || {}); + +// src/types/lib/contract/index.ts +var EntryPointType = /* @__PURE__ */ ((EntryPointType2) => { + EntryPointType2["EXTERNAL"] = "EXTERNAL"; + EntryPointType2["L1_HANDLER"] = "L1_HANDLER"; + EntryPointType2["CONSTRUCTOR"] = "CONSTRUCTOR"; + return EntryPointType2; +})(EntryPointType || {}); + +// src/types/lib/index.ts +var TransactionType = /* @__PURE__ */ ((TransactionType3) => { + TransactionType3["DECLARE"] = "DECLARE"; + TransactionType3["DEPLOY"] = "DEPLOY"; + TransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT"; + TransactionType3["INVOKE"] = "INVOKE_FUNCTION"; + return TransactionType3; +})(TransactionType || {}); +var TransactionStatus = /* @__PURE__ */ ((TransactionStatus2) => { + TransactionStatus2["NOT_RECEIVED"] = "NOT_RECEIVED"; + TransactionStatus2["RECEIVED"] = "RECEIVED"; + TransactionStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2"; + TransactionStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1"; + TransactionStatus2["REJECTED"] = "REJECTED"; + return TransactionStatus2; +})(TransactionStatus || {}); +var BlockStatus = /* @__PURE__ */ ((BlockStatus2) => { + BlockStatus2["PENDING"] = "PENDING"; + BlockStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1"; + BlockStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2"; + BlockStatus2["REJECTED"] = "REJECTED"; + return BlockStatus2; +})(BlockStatus || {}); +var BlockTag = /* @__PURE__ */ ((BlockTag2) => { + BlockTag2["pending"] = "pending"; + BlockTag2["latest"] = "latest"; + return BlockTag2; +})(BlockTag || {}); + +// src/types/api/rpc.ts +var rpc_exports = {}; +__export(rpc_exports, { + TransactionType: () => TransactionType2 +}); +var TransactionType2 = /* @__PURE__ */ ((TransactionType3) => { + TransactionType3["DECLARE"] = "DECLARE"; + TransactionType3["DEPLOY"] = "DEPLOY"; + TransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT"; + TransactionType3["INVOKE"] = "INVOKE"; + TransactionType3["L1_HANDLER"] = "L1_HANDLER"; + return TransactionType3; +})(TransactionType2 || {}); + +// src/types/api/sequencer.ts +var sequencer_exports = {}; + +// src/utils/assert.ts +function assert(condition, message) { + if (!condition) { + throw new Error(message || "Assertion failure"); + } +} + +// src/utils/num.ts +var num_exports = {}; +__export(num_exports, { + assertInRange: () => assertInRange, + bigNumberishArrayToDecimalStringArray: () => bigNumberishArrayToDecimalStringArray, + bigNumberishArrayToHexadecimalStringArray: () => bigNumberishArrayToHexadecimalStringArray, + cleanHex: () => cleanHex, + getDecimalString: () => getDecimalString, + getHexString: () => getHexString, + getHexStringArray: () => getHexStringArray, + hexToBytes: () => hexToBytes, + hexToDecimalString: () => hexToDecimalString, + isBigInt: () => isBigInt, + isHex: () => isHex, + isStringWholeNumber: () => isStringWholeNumber, + toBigInt: () => toBigInt, + toCairoBool: () => toCairoBool, + toHex: () => toHex, + toHexString: () => toHexString, + toStorageKey: () => toStorageKey +}); +import { hexToBytes as hexToBytesNoble } from "@noble/curves/abstract/utils"; +function isHex(hex) { + return /^0x[0-9a-f]*$/i.test(hex); +} +function toBigInt(value) { + return BigInt(value); +} +function isBigInt(value) { + return typeof value === "bigint"; +} +function toHex(number2) { + return addHexPrefix(toBigInt(number2).toString(16)); +} +function toStorageKey(number2) { + const res = addHexPrefix(toBigInt(number2).toString(16).padStart(64, "0")); + return res; +} +function hexToDecimalString(hex) { + return BigInt(addHexPrefix(hex)).toString(10); +} +var cleanHex = (hex) => hex.toLowerCase().replace(/^(0x)0+/, "$1"); +function assertInRange(input, lowerBound, upperBound, inputName = "") { + const messageSuffix = inputName === "" ? "invalid length" : `invalid ${inputName} length`; + const inputBigInt = BigInt(input); + const lowerBoundBigInt = BigInt(lowerBound); + const upperBoundBigInt = BigInt(upperBound); + assert( + inputBigInt >= lowerBoundBigInt && inputBigInt <= upperBoundBigInt, + `Message not signable, ${messageSuffix}.` + ); +} +function bigNumberishArrayToDecimalStringArray(rawCalldata) { + return rawCalldata.map((x) => toBigInt(x).toString(10)); +} +function bigNumberishArrayToHexadecimalStringArray(rawCalldata) { + return rawCalldata.map((x) => toHex(x)); +} +var isStringWholeNumber = (value) => /^\d+$/.test(value); +var toHexString = (value) => toHex(value); +function getDecimalString(value) { + if (isHex(value)) { + return hexToDecimalString(value); + } + if (isStringWholeNumber(value)) { + return value; + } + throw new Error(`${value} need to be hex-string or whole-number-string`); +} +function getHexString(value) { + if (isHex(value)) { + return value; + } + if (isStringWholeNumber(value)) { + return toHexString(value); + } + throw new Error(`${value} need to be hex-string or whole-number-string`); +} +function getHexStringArray(value) { + return value.map((el) => getHexString(el)); +} +var toCairoBool = (value) => (+value).toString(); +function hexToBytes(value) { + if (!isHex(value)) + throw new Error(`${value} need to be a hex-string`); + let adaptedValue = removeHexPrefix(value); + if (adaptedValue.length % 2 !== 0) { + adaptedValue = `0${adaptedValue}`; + } + return hexToBytesNoble(adaptedValue); +} + +// src/utils/selector.ts +var selector_exports = {}; +__export(selector_exports, { + getSelector: () => getSelector, + getSelectorFromName: () => getSelectorFromName, + keccakBn: () => keccakBn, + starknetKeccak: () => starknetKeccak +}); +import { keccak } from "micro-starknet"; +function keccakBn(value) { + const hexWithoutPrefix = removeHexPrefix(toHex(BigInt(value))); + const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`; + return addHexPrefix(keccak(hexToBytes(addHexPrefix(evenHex))).toString(16)); +} +function keccakHex(value) { + return addHexPrefix(keccak(utf8ToArray(value)).toString(16)); +} +function starknetKeccak(value) { + const hash = BigInt(keccakHex(value)); + return hash & MASK_250; +} +function getSelectorFromName(funcName) { + return toHex(starknetKeccak(funcName)); +} +function getSelector(value) { + if (isHex(value)) { + return value; + } + if (isStringWholeNumber(value)) { + return toHexString(value); + } + return getSelectorFromName(value); +} + +// src/utils/shortString.ts +var shortString_exports = {}; +__export(shortString_exports, { + decodeShortString: () => decodeShortString, + encodeShortString: () => encodeShortString, + isASCII: () => isASCII, + isDecimalString: () => isDecimalString, + isLongText: () => isLongText, + isShortString: () => isShortString, + isShortText: () => isShortText, + isText: () => isText, + splitLongString: () => splitLongString +}); +var TEXT_TO_FELT_MAX_LEN = 31; +function isASCII(str) { + return /^[\x00-\x7F]*$/.test(str); +} +function isShortString(str) { + return str.length <= TEXT_TO_FELT_MAX_LEN; +} +function isDecimalString(decim) { + return /^[0-9]*$/i.test(decim); +} +function isText(val) { + return typeof val === "string" && !isHex(val) && !isStringWholeNumber(val); +} +var isShortText = (val) => isText(val) && isShortString(val); +var isLongText = (val) => isText(val) && !isShortString(val); +function splitLongString(longStr) { + const regex = RegExp(`[^]{1,${TEXT_TO_FELT_MAX_LEN}}`, "g"); + return longStr.match(regex) || []; +} +function encodeShortString(str) { + if (!isASCII(str)) + throw new Error(`${str} is not an ASCII string`); + if (!isShortString(str)) + throw new Error(`${str} is too long`); + return addHexPrefix(str.replace(/./g, (char) => char.charCodeAt(0).toString(16))); +} +function decodeShortString(str) { + if (!isASCII(str)) + throw new Error(`${str} is not an ASCII string`); + if (isHex(str)) { + return removeHexPrefix(str).replace(/.{2}/g, (hex) => String.fromCharCode(parseInt(hex, 16))); + } + if (isDecimalString(str)) { + return decodeShortString("0X".concat(BigInt(str).toString(16))); + } + throw new Error(`${str} is not Hex or decimal`); +} + +// src/utils/calldata/cairo.ts +var cairo_exports = {}; +__export(cairo_exports, { + felt: () => felt, + getArrayType: () => getArrayType, + isCairo1Abi: () => isCairo1Abi, + isCairo1Type: () => isCairo1Type, + isLen: () => isLen, + isTypeArray: () => isTypeArray, + isTypeBool: () => isTypeBool, + isTypeContractAddress: () => isTypeContractAddress, + isTypeFelt: () => isTypeFelt, + isTypeNamedTuple: () => isTypeNamedTuple, + isTypeStruct: () => isTypeStruct, + isTypeTuple: () => isTypeTuple, + isTypeUint: () => isTypeUint, + isTypeUint256: () => isTypeUint256, + tuple: () => tuple, + uint256: () => uint256 +}); + +// src/utils/uint256.ts +var uint256_exports = {}; +__export(uint256_exports, { + UINT_128_MAX: () => UINT_128_MAX, + UINT_256_MAX: () => UINT_256_MAX, + bnToUint256: () => bnToUint256, + isUint256: () => isUint256, + uint256ToBN: () => uint256ToBN +}); +function uint256ToBN(uint2562) { + return (toBigInt(uint2562.high) << 128n) + toBigInt(uint2562.low); +} +var UINT_128_MAX = (1n << 128n) - 1n; +var UINT_256_MAX = (1n << 256n) - 1n; +function isUint256(bn) { + return toBigInt(bn) <= UINT_256_MAX; +} +function bnToUint256(bignumber) { + const bn = toBigInt(bignumber); + if (!isUint256(bn)) + throw new Error("Number is too large"); + return { + low: addHexPrefix((bn & UINT_128_MAX).toString(16)), + high: addHexPrefix((bn >> 128n).toString(16)) + }; +} + +// src/utils/calldata/cairo.ts +var isLen = (name) => /_len$/.test(name); +var isTypeFelt = (type) => type === "felt" || type === "core::felt252"; +var isTypeArray = (type) => /\*/.test(type) || type.startsWith("core::array::Array::"); +var isTypeTuple = (type) => /^\(.*\)$/i.test(type); +var isTypeNamedTuple = (type) => /\(.*\)/i.test(type) && type.includes(":"); +var isTypeStruct = (type, structs) => type in structs; +var isTypeUint = (type) => Object.values(Uint).includes(type); +var isTypeUint256 = (type) => type === "core::integer::u256"; +var isTypeBool = (type) => type === "core::bool"; +var isTypeContractAddress = (type) => type === "core::starknet::contract_address::ContractAddress"; +var isCairo1Type = (type) => type.includes("core::"); +var getArrayType = (type) => { + if (isCairo1Type(type)) { + return type.substring(type.indexOf("<") + 1, type.lastIndexOf(">")); + } + return type.replace("*", ""); +}; +function isCairo1Abi(abi) { + const firstFunction = abi.find((entry) => entry.type === "function"); + if (!firstFunction) { + if (abi.find((it) => it.type === "interface")) { + return true; + } + throw new Error(`Error in ABI. No function in ABI.`); + } + if (firstFunction.inputs.length) { + return isCairo1Type(firstFunction.inputs[0].type); + } + if (firstFunction.outputs.length) { + return isCairo1Type(firstFunction.outputs[0].type); + } + throw new Error(`Error in ABI. No input/output in function ${firstFunction.name}`); +} +var uint256 = (it) => { + const bn = BigInt(it); + if (!isUint256(bn)) + throw new Error("Number is too large"); + return { + // eslint-disable-next-line no-bitwise + low: (bn & UINT_128_MAX).toString(10), + // eslint-disable-next-line no-bitwise + high: (bn >> 128n).toString(10) + }; +}; +var tuple = (...args) => ({ ...args }); +function felt(it) { + if (isBigInt(it) || typeof it === "number" && Number.isInteger(it)) { + return it.toString(); + } + if (isText(it)) { + if (!isShortString(it)) + throw new Error( + `${it} is a long string > 31 chars, felt can store short strings, split it to array of short strings` + ); + const encoded = encodeShortString(it); + return BigInt(encoded).toString(); + } + if (typeof it === "string" && isHex(it)) { + return BigInt(it).toString(); + } + if (typeof it === "string" && isStringWholeNumber(it)) { + return it; + } + if (typeof it === "boolean") { + return `${+it}`; + } + throw new Error(`${it} can't be computed by felt()`); +} + +// src/utils/calldata/formatter.ts +var guard = { + isBN: (data, type, key) => { + if (!isBigInt(data[key])) + throw new Error( + `Data and formatter mismatch on ${key}:${type[key]}, expected response data ${key}:${data[key]} to be BN instead it is ${typeof data[key]}` + ); + }, + unknown: (data, type, key) => { + throw new Error(`Unhandled formatter type on ${key}:${type[key]} for data ${key}:${data[key]}`); + } +}; +function formatter(data, type, sameType) { + return Object.entries(data).reduce((acc, [key, value]) => { + const elType = sameType ?? type[key]; + if (!(key in type) && !sameType) { + acc[key] = value; + return acc; + } + if (elType === "string") { + if (Array.isArray(data[key])) { + const arrayStr = formatter( + data[key], + data[key].map((_) => elType) + ); + acc[key] = Object.values(arrayStr).join(""); + return acc; + } + guard.isBN(data, type, key); + acc[key] = decodeShortString(value); + return acc; + } + if (elType === "number") { + guard.isBN(data, type, key); + acc[key] = Number(value); + return acc; + } + if (typeof elType === "function") { + acc[key] = elType(value); + return acc; + } + if (Array.isArray(elType)) { + const arrayObj = formatter(data[key], elType, elType[0]); + acc[key] = Object.values(arrayObj); + return acc; + } + if (typeof elType === "object") { + acc[key] = formatter(data[key], elType); + return acc; + } + guard.unknown(data, type, key); + return acc; + }, {}); +} + +// src/utils/calldata/parser/parser-0-1.1.0.ts +var AbiParser1 = class { + constructor(abi) { + this.abi = abi; + } + /** + * abi method inputs length without '_len' inputs + * cairo 0 reducer + * @param abiMethod FunctionAbi + * @returns number + */ + methodInputsLength(abiMethod) { + return abiMethod.inputs.reduce((acc, input) => !isLen(input.name) ? acc + 1 : acc, 0); + } + /** + * get method definition from abi + * @param name string + * @returns FunctionAbi | undefined + */ + getMethod(name) { + return this.abi.find((it) => it.name === name); + } + /** + * Get Abi in legacy format + * @returns Abi + */ + getLegacyFormat() { + return this.abi; + } +}; + +// src/utils/calldata/parser/parser-2.0.0.ts +var AbiParser2 = class { + constructor(abi) { + this.abi = abi; + } + /** + * abi method inputs length + * @param abiMethod FunctionAbi + * @returns number + */ + methodInputsLength(abiMethod) { + return abiMethod.inputs.length; + } + /** + * get method definition from abi + * @param name string + * @returns FunctionAbi | undefined + */ + getMethod(name) { + const intf = this.abi.find((it) => it.type === "interface"); + return intf.items.find((it) => it.name === name); + } + /** + * Get Abi in legacy format + * @returns Abi + */ + getLegacyFormat() { + return this.abi.flatMap((e) => { + if (e.type === "interface") { + return e.items; + } + return e; + }); + } +}; + +// src/utils/calldata/parser/index.ts +function createAbiParser(abi) { + const version = getAbiVersion(abi); + if (version === 0 || version === 1) { + return new AbiParser1(abi); + } + if (version === 2) { + return new AbiParser2(abi); + } + throw Error(`Unsupported ABI version ${version}`); +} +function getAbiVersion(abi) { + if (abi.find((it) => it.type === "interface")) + return 2; + if (isCairo1Abi(abi)) + return 1; + return 0; +} +function isNoConstructorValid(method, argsCalldata, abiMethod) { + return method === "constructor" && !abiMethod && !argsCalldata.length; +} + +// src/utils/calldata/tuple.ts +function parseNamedTuple(namedTuple) { + const name = namedTuple.substring(0, namedTuple.indexOf(":")); + const type = namedTuple.substring(name.length + ":".length); + return { name, type }; +} +function parseSubTuple(s) { + if (!s.includes("(")) + return { subTuple: [], result: s }; + const subTuple = []; + let result = ""; + let i = 0; + while (i < s.length) { + if (s[i] === "(") { + let counter = 1; + const lBracket = i; + i++; + while (counter) { + if (s[i] === ")") + counter--; + if (s[i] === "(") + counter++; + i++; + } + subTuple.push(s.substring(lBracket, i)); + result += " "; + i--; + } else { + result += s[i]; + } + i++; + } + return { + subTuple, + result + }; +} +function extractCairo0Tuple(type) { + const cleanType = type.replace(/\s/g, "").slice(1, -1); + const { subTuple, result } = parseSubTuple(cleanType); + let recomposed = result.split(",").map((it) => { + return subTuple.length ? it.replace(" ", subTuple.shift()) : it; + }); + if (isTypeNamedTuple(type)) { + recomposed = recomposed.reduce((acc, it) => { + return acc.concat(parseNamedTuple(it)); + }, []); + } + return recomposed; +} +function extractCairo1Tuple(type) { + const cleanType = type.replace(/\s/g, "").slice(1, -1); + const { subTuple, result } = parseSubTuple(cleanType); + const recomposed = result.split(",").map((it) => { + return subTuple.length ? it.replace(" ", subTuple.shift()) : it; + }); + return recomposed; +} +function extractTupleMemberTypes(type) { + if (isCairo1Type(type)) { + return extractCairo1Tuple(type); + } + return extractCairo0Tuple(type); +} + +// src/utils/calldata/propertyOrder.ts +function errorU256(key) { + return Error( + `Your object includes the property : ${key}, containing an Uint256 object without the 'low' and 'high' keys.` + ); +} +function orderPropsByAbi(unorderedObject, abiOfObject, structs) { + const orderStruct = (unorderedObject2, abiObject) => { + const orderedObject2 = abiObject.reduce((orderedObject, abiParam) => { + const setProperty = (value) => Object.defineProperty(orderedObject, abiParam.name, { + enumerable: true, + value: value ?? unorderedObject2[abiParam.name] + }); + if (unorderedObject2[abiParam.name] === "undefined") { + if (isCairo1Type(abiParam.type) || !isLen(abiParam.name)) { + throw Error(`Your object needs a property with key : ${abiParam.name} .`); + } + } + switch (true) { + case isTypeStruct(abiParam.type, structs): + setProperty( + orderStruct( + unorderedObject2[abiParam.name], + structs[abiParam.type].members + ) + ); + break; + case isTypeUint256(abiParam.type): { + const u256 = unorderedObject2[abiParam.name]; + if (typeof u256 !== "object") { + setProperty(); + break; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + setProperty({ low: u256.low, high: u256.high }); + break; + } + case isTypeTuple(abiParam.type): + setProperty(orderTuple(unorderedObject2[abiParam.name], abiParam)); + break; + case isTypeArray(abiParam.type): + setProperty(orderArray(unorderedObject2[abiParam.name], abiParam)); + break; + case (!isCairo1Type(abiParam.type) && isLen(abiParam.name)): + break; + default: + setProperty(); + } + return orderedObject; + }, {}); + return orderedObject2; + }; + function orderArray(myArray, abiParam) { + const typeInArray = getArrayType(abiParam.type); + if (typeof myArray === "string") { + return myArray; + } + switch (true) { + case typeInArray in structs: + return myArray.map((myObj) => orderStruct(myObj, structs[typeInArray].members)); + case typeInArray === "core::integer::u256" /* u256 */: + return myArray.map((u256) => { + if (typeof u256 !== "object") { + return u256; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + return { low: u256.low, high: u256.high }; + }); + case isTypeTuple(typeInArray): + return myArray.map((myElem) => orderTuple(myElem, { name: "0", type: typeInArray })); + case isTypeArray(typeInArray): + return myArray.map((myElem) => orderArray(myElem, { name: "0", type: typeInArray })); + default: + return myArray; + } + } + function orderTuple(unorderedObject2, abiParam) { + const typeList = extractTupleMemberTypes(abiParam.type); + const orderedObject2 = typeList.reduce((orderedObject, abiTypeCairoX, index) => { + const myObjKeys = Object.keys(unorderedObject2); + const setProperty = (value) => Object.defineProperty(orderedObject, index.toString(), { + enumerable: true, + value: value ?? unorderedObject2[myObjKeys[index]] + }); + const abiType = abiTypeCairoX?.type ? abiTypeCairoX.type : abiTypeCairoX; + switch (true) { + case isTypeStruct(abiType, structs): + setProperty( + orderStruct( + unorderedObject2[myObjKeys[index]], + structs[abiType].members + ) + ); + break; + case isTypeUint256(abiType): { + const u256 = unorderedObject2[myObjKeys[index]]; + if (typeof u256 !== "object") { + setProperty(); + break; + } + if (!("low" in u256 && "high" in u256)) { + throw errorU256(abiParam.name); + } + setProperty({ low: u256.low, high: u256.high }); + break; + } + case isTypeTuple(abiType): + setProperty( + orderTuple(unorderedObject2[myObjKeys[index]], { + name: "0", + type: abiType + }) + ); + break; + case isTypeArray(abiType): + setProperty( + orderArray(unorderedObject2[myObjKeys[index]], { + name: "0", + type: abiType + }) + ); + break; + default: + setProperty(); + } + return orderedObject; + }, {}); + return orderedObject2; + } + return orderStruct(unorderedObject, abiOfObject); +} + +// src/utils/calldata/requestParser.ts +function parseBaseTypes(type, val) { + switch (true) { + case isTypeUint256(type): + const el_uint256 = uint256(val); + return [felt(el_uint256.low), felt(el_uint256.high)]; + default: + return felt(val); + } +} +function parseTuple(element, typeStr) { + const memberTypes = extractTupleMemberTypes(typeStr); + const elements = Object.values(element); + if (elements.length !== memberTypes.length) { + throw Error( + `ParseTuple: provided and expected abi tuple size do not match. + provided: ${elements} + expected: ${memberTypes}` + ); + } + return memberTypes.map((it, dx) => { + return { + element: elements[dx], + type: it.type ?? it + }; + }); +} +function parseUint256(element) { + if (typeof element === "object") { + const { low, high } = element; + return [felt(low), felt(high)]; + } + const el_uint256 = uint256(element); + return [felt(el_uint256.low), felt(el_uint256.high)]; +} +function parseCalldataValue(element, type, structs) { + if (element === void 0) { + throw Error(`Missing parameter for type ${type}`); + } + if (Array.isArray(element)) { + const result = []; + result.push(felt(element.length)); + const arrayType = getArrayType(type); + return element.reduce((acc, it) => { + return acc.concat(parseCalldataValue(it, arrayType, structs)); + }, result); + } + if (structs[type] && structs[type].members.length) { + if (isTypeUint256(type)) { + return parseUint256(element); + } + const { members } = structs[type]; + const subElement = element; + return members.reduce((acc, it) => { + return acc.concat(parseCalldataValue(subElement[it.name], it.type, structs)); + }, []); + } + if (isTypeTuple(type)) { + const tupled = parseTuple(element, type); + return tupled.reduce((acc, it) => { + const parsedData = parseCalldataValue(it.element, it.type, structs); + return acc.concat(parsedData); + }, []); + } + if (isTypeUint256(type)) { + return parseUint256(element); + } + if (typeof element === "object") { + throw Error(`Parameter ${element} do not align with abi parameter ${type}`); + } + return parseBaseTypes(type, element); +} +function parseCalldataField(argsIterator, input, structs) { + const { name, type } = input; + let { value } = argsIterator.next(); + switch (true) { + case isTypeArray(type): + if (!Array.isArray(value) && !isText(value)) { + throw Error(`ABI expected parameter ${name} to be array or long string, got ${value}`); + } + if (typeof value === "string") { + value = splitLongString(value); + } + return parseCalldataValue(value, input.type, structs); + case (isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type)): + return parseCalldataValue(value, type, structs); + default: + return parseBaseTypes(type, value); + } +} + +// src/utils/calldata/responseParser.ts +function parseBaseTypes2(type, it) { + let temp; + switch (true) { + case isTypeBool(type): + temp = it.next().value; + return Boolean(BigInt(temp)); + case isTypeUint256(type): + const low = it.next().value; + const high = it.next().value; + return uint256ToBN({ low, high }); + default: + temp = it.next().value; + return BigInt(temp); + } +} +function parseResponseValue(responseIterator, element, structs) { + if (isTypeUint256(element.type)) { + const low = responseIterator.next().value; + const high = responseIterator.next().value; + return uint256ToBN({ low, high }); + } + if (element.type in structs && structs[element.type]) { + return structs[element.type].members.reduce((acc, el) => { + acc[el.name] = parseResponseValue(responseIterator, el, structs); + return acc; + }, {}); + } + if (isTypeTuple(element.type)) { + const memberTypes = extractTupleMemberTypes(element.type); + return memberTypes.reduce((acc, it, idx) => { + const name = it?.name ? it.name : idx; + const type = it?.type ? it.type : it; + const el = { name, type }; + acc[name] = parseResponseValue(responseIterator, el, structs); + return acc; + }, {}); + } + if (isTypeArray(element.type)) { + const parsedDataArr = []; + const el = { name: "", type: getArrayType(element.type) }; + const len = BigInt(responseIterator.next().value); + while (parsedDataArr.length < len) { + parsedDataArr.push(parseResponseValue(responseIterator, el, structs)); + } + return parsedDataArr; + } + return parseBaseTypes2(element.type, responseIterator); +} +function responseParser(responseIterator, output, structs, parsedResult) { + const { name, type } = output; + let temp; + switch (true) { + case isLen(name): + temp = responseIterator.next().value; + return BigInt(temp); + case (type in structs || isTypeTuple(type)): + return parseResponseValue(responseIterator, output, structs); + case isTypeArray(type): + if (isCairo1Type(type)) { + return parseResponseValue(responseIterator, output, structs); + } + const parsedDataArr = []; + if (parsedResult && parsedResult[`${name}_len`]) { + const arrLen = parsedResult[`${name}_len`]; + while (parsedDataArr.length < arrLen) { + parsedDataArr.push( + parseResponseValue( + responseIterator, + { name, type: output.type.replace("*", "") }, + structs + ) + ); + } + } + return parsedDataArr; + default: + return parseBaseTypes2(type, responseIterator); + } +} + +// src/utils/calldata/validate.ts +var validateFelt = (parameter, input) => { + assert( + typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint", + `Validate: arg ${input.name} should be a felt typed as (String, Number or BigInt)` + ); +}; +var validateUint = (parameter, input) => { + if (typeof parameter === "number") { + assert( + parameter <= Number.MAX_SAFE_INTEGER, + `Validation: Parameter is to large to be typed as Number use (BigInt or String)` + ); + } + assert( + typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint" || typeof parameter === "object" && "low" in parameter && "high" in parameter, + `Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)` + ); + const param = typeof parameter === "object" ? uint256ToBN(parameter) : toBigInt(parameter); + switch (input.type) { + case "core::integer::u8" /* u8 */: + assert( + param >= 0n && param <= 255n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0 - 255]` + ); + break; + case "core::integer::u16" /* u16 */: + assert( + param >= 0n && param <= 65535n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 65535]` + ); + break; + case "core::integer::u32" /* u32 */: + assert( + param >= 0n && param <= 4294967295n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 4294967295]` + ); + break; + case "core::integer::u64" /* u64 */: + assert( + param >= 0n && param <= 2n ** 64n - 1n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^64-1]` + ); + break; + case "core::integer::u128" /* u128 */: + assert( + param >= 0n && param <= 2n ** 128n - 1n, + `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^128-1]` + ); + break; + case "core::integer::u256" /* u256 */: + assert( + param >= 0n && param <= 2n ** 256n - 1n, + `Validate: arg ${input.name} is ${input.type} 0 - 2^256-1` + ); + break; + default: + break; + } +}; +var validateBool = (parameter, input) => { + assert( + typeof parameter === "boolean", + `Validate: arg ${input.name} of cairo type ${input.type} should be type (Boolean)` + ); +}; +var validateStruct = (parameter, input, structs) => { + if (input.type === "core::integer::u256" /* u256 */) { + validateUint(parameter, input); + return; + } + assert( + typeof parameter === "object" && !Array.isArray(parameter), + `Validate: arg ${input.name} is cairo type struct (${input.type}), and should be defined as js object (not array)` + ); + structs[input.type].members.forEach(({ name }) => { + assert( + Object.keys(parameter).includes(name), + `Validate: arg ${input.name} should have a property ${name}` + ); + }); +}; +var validateTuple = (parameter, input) => { + assert( + typeof parameter === "object" && !Array.isArray(parameter), + `Validate: arg ${input.name} should be a tuple (defined as object)` + ); +}; +var validateArray = (parameter, input, structs) => { + const baseType = getArrayType(input.type); + if (isTypeFelt(baseType) && isLongText(parameter)) + return; + assert(Array.isArray(parameter), `Validate: arg ${input.name} should be an Array`); + switch (true) { + case isTypeFelt(baseType): + parameter.forEach((param) => validateFelt(param, input)); + break; + case isTypeTuple(baseType): + parameter.forEach((it) => validateTuple(it, { name: input.name, type: baseType })); + break; + case isTypeStruct(baseType, structs): + parameter.forEach( + (it) => validateStruct(it, { name: input.name, type: baseType }, structs) + ); + break; + case isTypeUint(baseType): + parameter.forEach((param) => validateUint(param, input)); + break; + case isTypeBool(baseType): + parameter.forEach((param) => validateBool(param, input)); + break; + case isTypeArray(baseType): + parameter.forEach( + (param) => validateArray(param, { name: "", type: baseType }, structs) + ); + break; + default: + throw new Error( + `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}` + ); + } +}; +function validateFields(abiMethod, args, structs) { + abiMethod.inputs.reduce((acc, input) => { + const parameter = args[acc]; + switch (true) { + case isLen(input.name): + return acc; + case isTypeFelt(input.type): + validateFelt(parameter, input); + break; + case isTypeUint(input.type): + validateUint(parameter, input); + break; + case isTypeBool(input.type): + validateBool(parameter, input); + break; + case isTypeContractAddress(input.type): + break; + case isTypeStruct(input.type, structs): + validateStruct(parameter, input, structs); + break; + case isTypeTuple(input.type): + validateTuple(parameter, input); + break; + case isTypeArray(input.type): + validateArray(parameter, input, structs); + break; + default: + throw new Error( + `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}` + ); + } + return acc + 1; + }, 0); +} + +// src/utils/calldata/index.ts +var CallData = class { + constructor(abi) { + this.structs = CallData.getAbiStruct(abi); + this.parser = createAbiParser(abi); + this.abi = this.parser.getLegacyFormat(); + } + /** + * Validate arguments passed to the method as corresponding to the ones in the abi + * @param type ValidateType - type of the method + * @param method string - name of the method + * @param args ArgsOrCalldata - arguments that are passed to the method + */ + validate(type, method, args = []) { + if (type !== "DEPLOY" /* DEPLOY */) { + const invocableFunctionNames = this.abi.filter((abi) => { + if (abi.type !== "function") + return false; + const isView = abi.stateMutability === "view" || abi.state_mutability === "view"; + return type === "INVOKE" /* INVOKE */ ? !isView : isView; + }).map((abi) => abi.name); + assert( + invocableFunctionNames.includes(method), + `${type === "INVOKE" /* INVOKE */ ? "invocable" : "viewable"} method not found in abi` + ); + } + const abiMethod = this.abi.find( + (abi) => type === "DEPLOY" /* DEPLOY */ ? abi.name === method && abi.type === "constructor" : abi.name === method && abi.type === "function" + ); + if (isNoConstructorValid(method, args, abiMethod)) { + return; + } + const inputsLength = this.parser.methodInputsLength(abiMethod); + if (args.length !== inputsLength) { + throw Error( + `Invalid number of arguments, expected ${inputsLength} arguments, but got ${args.length}` + ); + } + validateFields(abiMethod, args, this.structs); + } + /** + * Compile contract callData with abi + * Parse the calldata by using input fields from the abi for that method + * @param method string - method name + * @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order). + * @return Calldata - parsed arguments in format that contract is expecting + * @example + * ```typescript + * const calldata = myCallData.compile("constructor",["0x34a",[1,3n]]); + * ``` + * ```typescript + * const calldata2 = myCallData.compile("constructor",{list:[1,3n],balance:"0x34"}); // wrong order is valid + * ``` + */ + compile(method, argsCalldata) { + const abiMethod = this.abi.find((abi) => abi.name === method); + if (isNoConstructorValid(method, argsCalldata, abiMethod)) { + return []; + } + let args; + if (Array.isArray(argsCalldata)) { + args = argsCalldata; + } else { + const orderedObject = orderPropsByAbi(argsCalldata, abiMethod.inputs, this.structs); + args = Object.values(orderedObject); + validateFields(abiMethod, args, this.structs); + } + const argsIterator = args[Symbol.iterator](); + const callArray = abiMethod.inputs.reduce( + (acc, input) => isLen(input.name) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs)), + [] + ); + Object.defineProperty(callArray, "__compiled__", { + enumerable: false, + writable: false, + value: true + }); + return callArray; + } + /** + * Compile contract callData without abi + * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data + * @returns Calldata + */ + static compile(rawArgs) { + const createTree = (obj) => { + const getEntries = (o, prefix = "") => { + const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o; + return Object.entries(oe).flatMap(([k, v]) => { + let value = v; + if (isLongText(value)) + value = splitLongString(value); + if (k === "entrypoint") + value = getSelectorFromName(value); + const kk = Array.isArray(oe) && k === "0" ? "$$len" : k; + if (isBigInt(value)) + return [[`${prefix}${kk}`, felt(value)]]; + return Object(value) === value ? getEntries(value, `${prefix}${kk}.`) : [[`${prefix}${kk}`, felt(value)]]; + }); + }; + return Object.fromEntries(getEntries(obj)); + }; + let callTreeArray; + if (!Array.isArray(rawArgs)) { + const callTree = createTree(rawArgs); + callTreeArray = Object.values(callTree); + } else { + const callObj = { ...rawArgs }; + const callTree = createTree(callObj); + callTreeArray = Object.values(callTree); + } + Object.defineProperty(callTreeArray, "__compiled__", { + enumerable: false, + writable: false, + value: true + }); + return callTreeArray; + } + /** + * Parse elements of the response array and structuring them into response object + * @param method string - method name + * @param response string[] - response from the method + * @return Result - parsed response corresponding to the abi + */ + parse(method, response) { + const { outputs } = this.abi.find((abi) => abi.name === method); + const responseIterator = response.flat()[Symbol.iterator](); + const parsed = outputs.flat().reduce((acc, output, idx) => { + const propName = output.name ?? idx; + acc[propName] = responseParser(responseIterator, output, this.structs, acc); + if (acc[propName] && acc[`${propName}_len`]) { + delete acc[`${propName}_len`]; + } + return acc; + }, {}); + return Object.keys(parsed).length === 1 && 0 in parsed ? parsed[0] : parsed; + } + /** + * Format cairo method response data to native js values based on provided format schema + * @param method string - cairo method name + * @param response string[] - cairo method response + * @param format object - formatter object schema + * @returns Result - parsed and formatted response object + */ + format(method, response, format) { + const parsed = this.parse(method, response); + return formatter(parsed, format); + } + /** + * Helper to extract structs from abi + * @param abi Abi + * @returns AbiStructs - structs from abi + */ + static getAbiStruct(abi) { + return abi.filter((abiEntry) => abiEntry.type === "struct").reduce( + (acc, abiEntry) => ({ + ...acc, + [abiEntry.name]: abiEntry + }), + {} + ); + } + /** + * Helper: Compile HexCalldata | RawCalldata | RawArgs + * @param rawCalldata HexCalldata | RawCalldata | RawArgs + * @returns Calldata + */ + static toCalldata(rawCalldata = []) { + return CallData.compile(rawCalldata); + } + /** + * Helper: Convert raw to HexCalldata + * @param raw HexCalldata | RawCalldata | RawArgs + * @returns HexCalldata + */ + static toHex(raw = []) { + const calldata = CallData.compile(raw); + return calldata.map((it) => toHex(it)); + } +}; + +// src/utils/hash.ts +var hash_exports = {}; +__export(hash_exports, { + calculateContractAddressFromHash: () => calculateContractAddressFromHash, + calculateDeclareTransactionHash: () => calculateDeclareTransactionHash, + calculateDeployAccountTransactionHash: () => calculateDeployAccountTransactionHash, + calculateDeployTransactionHash: () => calculateDeployTransactionHash, + calculateTransactionHash: () => calculateTransactionHash, + calculateTransactionHashCommon: () => calculateTransactionHashCommon, + computeCompiledClassHash: () => computeCompiledClassHash, + computeContractClassHash: () => computeContractClassHash, + computeHashOnElements: () => computeHashOnElements, + computeLegacyContractClassHash: () => computeLegacyContractClassHash, + computeSierraContractClassHash: () => computeSierraContractClassHash, + default: () => computeHintedClassHash, + feeTransactionVersion: () => feeTransactionVersion, + feeTransactionVersion_2: () => feeTransactionVersion_2, + formatSpaces: () => formatSpaces, + getSelector: () => getSelector, + getSelectorFromName: () => getSelectorFromName, + getVersionsByType: () => getVersionsByType, + keccakBn: () => keccakBn, + poseidon: () => poseidon, + starknetKeccak: () => starknetKeccak, + transactionVersion: () => transactionVersion, + transactionVersion_2: () => transactionVersion_2 +}); +import { poseidonHashMany } from "micro-starknet"; + +// src/utils/ec.ts +var ec_exports = {}; +__export(ec_exports, { + starkCurve: () => starkCurve, + weierstrass: () => weierstrass +}); +import * as starkCurve from "micro-starknet"; +import * as weierstrass from "@noble/curves/abstract/weierstrass"; + +// src/utils/json.ts +var json_exports = {}; +__export(json_exports, { + parse: () => parse2, + parseAlwaysAsBig: () => parseAlwaysAsBig, + stringify: () => stringify2, + stringifyAlwaysAsBig: () => stringifyAlwaysAsBig +}); +import * as json from "lossless-json"; +var parseIntAsNumberOrBigInt = (x) => { + if (!json.isInteger(x)) + return parseFloat(x); + const v = parseInt(x, 10); + return Number.isSafeInteger(v) ? v : BigInt(x); +}; +var parse2 = (x) => json.parse(String(x), void 0, parseIntAsNumberOrBigInt); +var parseAlwaysAsBig = (x) => json.parse(String(x), void 0, json.parseNumberAndBigInt); +var stringify2 = (value, replacer, space, numberStringifiers) => json.stringify(value, replacer, space, numberStringifiers); +var stringifyAlwaysAsBig = stringify2; + +// src/utils/hash.ts +import * as poseidon from "@noble/curves/abstract/poseidon"; +var transactionVersion = 1n; +var transactionVersion_2 = 2n; +var feeTransactionVersion = 1n; +var feeTransactionVersion_2 = 2n; +function getVersionsByType(versionType) { + return versionType === "fee" ? { v1: feeTransactionVersion, v2: feeTransactionVersion_2 } : { v1: transactionVersion, v2: transactionVersion_2 }; +} +function computeHashOnElements(data) { + return [...data, data.length].reduce((x, y) => starkCurve.pedersen(toBigInt(x), toBigInt(y)), 0).toString(); +} +function calculateTransactionHashCommon(txHashPrefix, version, contractAddress, entryPointSelector, calldata, maxFee, chainId, additionalData = []) { + const calldataHash = computeHashOnElements(calldata); + const dataToHash = [ + txHashPrefix, + version, + contractAddress, + entryPointSelector, + calldataHash, + maxFee, + chainId, + ...additionalData + ]; + return computeHashOnElements(dataToHash); +} +function calculateDeployTransactionHash(contractAddress, constructorCalldata, version, chainId, constructorName = "constructor") { + return calculateTransactionHashCommon( + "0x6465706c6f79" /* DEPLOY */, + version, + contractAddress, + getSelectorFromName(constructorName), + constructorCalldata, + 0, + chainId + ); +} +function calculateDeclareTransactionHash(classHash, senderAddress, version, maxFee, chainId, nonce, compiledClassHash) { + return calculateTransactionHashCommon( + "0x6465636c617265" /* DECLARE */, + version, + senderAddress, + 0, + [classHash], + maxFee, + chainId, + [nonce, ...compiledClassHash ? [compiledClassHash] : []] + ); +} +function calculateDeployAccountTransactionHash(contractAddress, classHash, constructorCalldata, salt, version, maxFee, chainId, nonce) { + const calldata = [classHash, salt, ...constructorCalldata]; + return calculateTransactionHashCommon( + "0x6465706c6f795f6163636f756e74" /* DEPLOY_ACCOUNT */, + version, + contractAddress, + 0, + calldata, + maxFee, + chainId, + [nonce] + ); +} +function calculateTransactionHash(contractAddress, version, calldata, maxFee, chainId, nonce) { + return calculateTransactionHashCommon( + "0x696e766f6b65" /* INVOKE */, + version, + contractAddress, + 0, + calldata, + maxFee, + chainId, + [nonce] + ); +} +function calculateContractAddressFromHash(salt, classHash, constructorCalldata, deployerAddress) { + const compiledCalldata = CallData.compile(constructorCalldata); + const constructorCalldataHash = computeHashOnElements(compiledCalldata); + const CONTRACT_ADDRESS_PREFIX = felt("0x535441524b4e45545f434f4e54524143545f41444452455353"); + return computeHashOnElements([ + CONTRACT_ADDRESS_PREFIX, + deployerAddress, + salt, + classHash, + constructorCalldataHash + ]); +} +function nullSkipReplacer(key, value) { + if (key === "attributes" || key === "accessible_scopes") { + return Array.isArray(value) && value.length === 0 ? void 0 : value; + } + if (key === "debug_info") { + return null; + } + return value === null ? void 0 : value; +} +function formatSpaces(json2) { + let insideQuotes = false; + const newString = []; + for (const char of json2) { + if (char === '"' && (newString.length > 0 && newString.slice(-1)[0] === "\\") === false) { + insideQuotes = !insideQuotes; + } + if (insideQuotes) { + newString.push(char); + } else { + newString.push(char === ":" ? ": " : char === "," ? ", " : char); + } + } + return newString.join(""); +} +function computeHintedClassHash(compiledContract) { + const { abi, program } = compiledContract; + const contractClass = { abi, program }; + const serializedJson = formatSpaces(stringify2(contractClass, nullSkipReplacer)); + return addHexPrefix(starkCurve.keccak(utf8ToArray(serializedJson)).toString(16)); +} +function computeLegacyContractClassHash(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + const apiVersion = toHex(API_VERSION); + const externalEntryPointsHash = computeHashOnElements( + compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset]) + ); + const l1HandlerEntryPointsHash = computeHashOnElements( + compiledContract.entry_points_by_type.L1_HANDLER.flatMap((e) => [e.selector, e.offset]) + ); + const constructorEntryPointHash = computeHashOnElements( + compiledContract.entry_points_by_type.CONSTRUCTOR.flatMap((e) => [e.selector, e.offset]) + ); + const builtinsHash = computeHashOnElements( + compiledContract.program.builtins.map((s) => encodeShortString(s)) + ); + const hintedClassHash = computeHintedClassHash(compiledContract); + const dataHash = computeHashOnElements(compiledContract.program.data); + return computeHashOnElements([ + apiVersion, + externalEntryPointsHash, + l1HandlerEntryPointsHash, + constructorEntryPointHash, + builtinsHash, + hintedClassHash, + dataHash + ]); +} +function hashBuiltins(builtins) { + return poseidonHashMany( + builtins.flatMap((it) => { + return BigInt(encodeShortString(it)); + }) + ); +} +function hashEntryPoint(data) { + const base = data.flatMap((it) => { + return [BigInt(it.selector), BigInt(it.offset), hashBuiltins(it.builtins)]; + }); + return poseidonHashMany(base); +} +function computeCompiledClassHash(casm) { + const COMPILED_CLASS_VERSION = "COMPILED_CLASS_V1"; + const compiledClassVersion = BigInt(encodeShortString(COMPILED_CLASS_VERSION)); + const externalEntryPointsHash = hashEntryPoint(casm.entry_points_by_type.EXTERNAL); + const l1Handlers = hashEntryPoint(casm.entry_points_by_type.L1_HANDLER); + const constructor = hashEntryPoint(casm.entry_points_by_type.CONSTRUCTOR); + const bytecode = poseidonHashMany(casm.bytecode.map((it) => BigInt(it))); + return toHex( + poseidonHashMany([ + compiledClassVersion, + externalEntryPointsHash, + l1Handlers, + constructor, + bytecode + ]) + ); +} +function hashEntryPointSierra(data) { + const base = data.flatMap((it) => { + return [BigInt(it.selector), BigInt(it.function_idx)]; + }); + return poseidonHashMany(base); +} +function hashAbi(sierra) { + const indentString = formatSpaces(stringify2(sierra.abi, null)); + return BigInt(addHexPrefix(starkCurve.keccak(utf8ToArray(indentString)).toString(16))); +} +function computeSierraContractClassHash(sierra) { + const CONTRACT_CLASS_VERSION = "CONTRACT_CLASS_V0.1.0"; + const compiledClassVersion = BigInt(encodeShortString(CONTRACT_CLASS_VERSION)); + const externalEntryPointsHash = hashEntryPointSierra(sierra.entry_points_by_type.EXTERNAL); + const l1Handlers = hashEntryPointSierra(sierra.entry_points_by_type.L1_HANDLER); + const constructor = hashEntryPointSierra(sierra.entry_points_by_type.CONSTRUCTOR); + const abiHash = hashAbi(sierra); + const sierraProgram = poseidonHashMany(sierra.sierra_program.map((it) => BigInt(it))); + return toHex( + poseidonHashMany([ + compiledClassVersion, + externalEntryPointsHash, + l1Handlers, + constructor, + abiHash, + sierraProgram + ]) + ); +} +function computeContractClassHash(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + if ("sierra_program" in compiledContract) { + return computeSierraContractClassHash(compiledContract); + } + return computeLegacyContractClassHash(compiledContract); +} + +// src/utils/stark.ts +var stark_exports = {}; +__export(stark_exports, { + compressProgram: () => compressProgram, + decompressProgram: () => decompressProgram, + estimatedFeeToMaxFee: () => estimatedFeeToMaxFee, + formatSignature: () => formatSignature, + makeAddress: () => makeAddress, + randomAddress: () => randomAddress, + signatureToDecimalArray: () => signatureToDecimalArray, + signatureToHexArray: () => signatureToHexArray +}); +import { getStarkKey, utils } from "micro-starknet"; +import { gzip, ungzip } from "pako"; +function compressProgram(jsonProgram) { + const stringified = typeof jsonProgram === "string" ? jsonProgram : stringify2(jsonProgram); + const compressedProgram = gzip(stringified); + return btoaUniversal(compressedProgram); +} +function decompressProgram(base64) { + if (Array.isArray(base64)) + return base64; + const decompressed = arrayBufferToString(ungzip(atobUniversal(base64))); + return parse2(decompressed); +} +function randomAddress() { + const randomKeyPair = utils.randomPrivateKey(); + return getStarkKey(randomKeyPair); +} +function makeAddress(input) { + return addHexPrefix(input).toLowerCase(); +} +function formatSignature(sig) { + if (!sig) + throw Error("formatSignature: provided signature is undefined"); + if (Array.isArray(sig)) { + return sig.map((it) => toHex(it)); + } + try { + const { r, s } = sig; + return [toHex(r), toHex(s)]; + } catch (e) { + throw new Error("Signature need to be weierstrass.SignatureType or an array for custom"); + } +} +function signatureToDecimalArray(sig) { + return bigNumberishArrayToDecimalStringArray(formatSignature(sig)); +} +function signatureToHexArray(sig) { + return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig)); +} +function estimatedFeeToMaxFee(estimatedFee, overhead = 0.5) { + const overHeadPercent = Math.round((1 + overhead) * 100); + return toBigInt(estimatedFee) * toBigInt(overHeadPercent) / 100n; +} + +// src/utils/contract.ts +function isSierra(contract) { + const compiledContract = typeof contract === "string" ? parse2(contract) : contract; + return "sierra_program" in compiledContract; +} +function extractContractHashes(payload) { + const response = { ...payload }; + if (isSierra(payload.contract)) { + if (!payload.compiledClassHash && payload.casm) { + response.compiledClassHash = computeCompiledClassHash(payload.casm); + } + if (!response.compiledClassHash) + throw new Error( + "Extract compiledClassHash failed, provide (CairoAssembly).casm file or compiledClassHash" + ); + } + response.classHash = payload.classHash ?? computeContractClassHash(payload.contract); + if (!response.classHash) + throw new Error("Extract classHash failed, provide (CompiledContract).json file or classHash"); + return response; +} +function contractClassResponseToLegacyCompiledContract(ccr) { + if (isSierra(ccr)) { + throw Error("ContractClassResponse need to be LegacyContractClass (cairo0 response class)"); + } + const contract = ccr; + return { ...contract, program: decompressProgram(contract.program) }; +} + +// src/utils/fetchPonyfill.ts +import isomorphicFetch from "isomorphic-fetch"; +var fetchPonyfill_default = typeof window !== "undefined" && window.fetch || // use buildin fetch in browser if available +typeof global !== "undefined" && global.fetch || // use buildin fetch in node, react-native and service worker if available +isomorphicFetch; + +// src/utils/provider.ts +var provider_exports = {}; +__export(provider_exports, { + createSierraContractClass: () => createSierraContractClass, + parseContract: () => parseContract, + wait: () => wait +}); +function wait(delay) { + return new Promise((res) => { + setTimeout(res, delay); + }); +} +function createSierraContractClass(contract) { + const result = { ...contract }; + delete result.sierra_program_debug_info; + result.abi = formatSpaces(stringify2(contract.abi)); + result.sierra_program = formatSpaces(stringify2(contract.sierra_program)); + result.sierra_program = compressProgram(result.sierra_program); + return result; +} +function parseContract(contract) { + const parsedContract = typeof contract === "string" ? parse2(contract) : contract; + if (!isSierra(contract)) { + return { + ...parsedContract, + ..."program" in parsedContract && { program: compressProgram(parsedContract.program) } + }; + } + return createSierraContractClass(parsedContract); +} + +// src/utils/responseParser/rpc.ts +var RPCResponseParser = class { + parseGetBlockResponse(res) { + return { + timestamp: res.timestamp, + block_hash: res.block_hash, + block_number: res.block_number, + new_root: res.new_root, + parent_hash: res.parent_hash, + status: res.status, + transactions: res.transactions + }; + } + parseGetTransactionResponse(res) { + return { + calldata: res.calldata || [], + contract_address: res.contract_address, + sender_address: res.contract_address, + max_fee: res.max_fee, + nonce: res.nonce, + signature: res.signature || [], + transaction_hash: res.transaction_hash, + version: res.version + }; + } + parseFeeEstimateResponse(res) { + return { + overall_fee: toBigInt(res[0].overall_fee), + gas_consumed: toBigInt(res[0].gas_consumed), + gas_price: toBigInt(res[0].gas_price) + }; + } + parseFeeEstimateBulkResponse(res) { + return res.map((val) => ({ + overall_fee: toBigInt(val.overall_fee), + gas_consumed: toBigInt(val.gas_consumed), + gas_price: toBigInt(val.gas_price) + })); + } + parseCallContractResponse(res) { + return { + result: res + }; + } + parseSimulateTransactionResponse(res) { + return res.map((it) => { + return { + ...it, + suggestedMaxFee: estimatedFeeToMaxFee(BigInt(it.fee_estimation.overall_fee)) + }; + }); + } + parseContractClassResponse(res) { + return { + ...res, + abi: typeof res.abi === "string" ? JSON.parse(res.abi) : res.abi + }; + } +}; + +// src/provider/errors.ts +function fixStack(target, fn = target.constructor) { + const { captureStackTrace } = Error; + captureStackTrace && captureStackTrace(target, fn); +} +function fixProto(target, prototype) { + const { setPrototypeOf } = Object; + setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype; +} +var CustomError = class extends Error { + constructor(message) { + super(message); + Object.defineProperty(this, "name", { + value: new.target.name, + enumerable: false, + configurable: true + }); + fixProto(this, new.target.prototype); + fixStack(this); + } +}; +var LibraryError = class extends CustomError { +}; +var GatewayError = class extends LibraryError { + constructor(message, errorCode) { + super(message); + this.errorCode = errorCode; + } +}; +var HttpError = class extends LibraryError { + constructor(message, errorCode) { + super(message); + this.errorCode = errorCode; + } +}; + +// src/utils/starknetId.ts +var starknetId_exports = {}; +__export(starknetId_exports, { + StarknetIdContract: () => StarknetIdContract, + getStarknetIdContract: () => getStarknetIdContract, + useDecoded: () => useDecoded, + useEncoded: () => useEncoded +}); +var basicAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789-"; +var basicSizePlusOne = BigInt(basicAlphabet.length + 1); +var bigAlphabet = "\u8FD9\u6765"; +var basicAlphabetSize = BigInt(basicAlphabet.length); +var bigAlphabetSize = BigInt(bigAlphabet.length); +var bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1); +function extractStars(str) { + let k = 0; + while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) { + str = str.substring(0, str.length - 1); + k += 1; + } + return [str, k]; +} +function useDecoded(encoded) { + let decoded = ""; + encoded.forEach((subdomain) => { + while (subdomain !== ZERO) { + const code = subdomain % basicSizePlusOne; + subdomain /= basicSizePlusOne; + if (code === BigInt(basicAlphabet.length)) { + const nextSubdomain = subdomain / bigAlphabetSizePlusOne; + if (nextSubdomain === ZERO) { + const code2 = subdomain % bigAlphabetSizePlusOne; + subdomain = nextSubdomain; + if (code2 === ZERO) + decoded += basicAlphabet[0]; + else + decoded += bigAlphabet[Number(code2) - 1]; + } else { + const code2 = subdomain % bigAlphabetSize; + decoded += bigAlphabet[Number(code2)]; + subdomain /= bigAlphabetSize; + } + } else + decoded += basicAlphabet[Number(code)]; + } + const [str, k] = extractStars(decoded); + if (k) + decoded = str + (k % 2 === 0 ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) + bigAlphabet[0] + basicAlphabet[1] : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1)); + decoded += "."; + }); + if (!decoded) { + return decoded; + } + return decoded.concat("stark"); +} +function useEncoded(decoded) { + let encoded = BigInt(0); + let multiplier = BigInt(1); + if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) { + const [str, k] = extractStars(decoded.substring(0, decoded.length - 2)); + decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1)); + } else { + const [str, k] = extractStars(decoded); + if (k) + decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1)); + } + for (let i = 0; i < decoded.length; i += 1) { + const char = decoded[i]; + const index = basicAlphabet.indexOf(char); + const bnIndex = BigInt(basicAlphabet.indexOf(char)); + if (index !== -1) { + if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) { + encoded += multiplier * basicAlphabetSize; + multiplier *= basicSizePlusOne; + multiplier *= basicSizePlusOne; + } else { + encoded += multiplier * bnIndex; + multiplier *= basicSizePlusOne; + } + } else if (bigAlphabet.indexOf(char) !== -1) { + encoded += multiplier * basicAlphabetSize; + multiplier *= basicSizePlusOne; + const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char); + encoded += multiplier * BigInt(newid); + multiplier *= bigAlphabetSize; + } + } + return encoded; +} +var StarknetIdContract = /* @__PURE__ */ ((StarknetIdContract2) => { + StarknetIdContract2["MAINNET"] = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678"; + StarknetIdContract2["TESTNET"] = "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce"; + return StarknetIdContract2; +})(StarknetIdContract || {}); +function getStarknetIdContract(chainId) { + switch (chainId) { + case "0x534e5f4d41494e" /* SN_MAIN */: + return "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678" /* MAINNET */; + case "0x534e5f474f45524c49" /* SN_GOERLI */: + return "0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce" /* TESTNET */; + default: + throw new Error("Starknet.id is not yet deployed on this network"); + } +} + +// src/provider/starknetId.ts +async function getStarkName(provider, address, StarknetIdContract2) { + const chainId = await provider.getChainId(); + const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId); + try { + const hexDomain = await provider.callContract({ + contractAddress: contract, + entrypoint: "address_to_domain", + calldata: CallData.compile({ + address + }) + }); + const decimalDomain = hexDomain.result.map((element) => BigInt(element)).slice(1); + const stringDomain = useDecoded(decimalDomain); + if (!stringDomain) { + throw Error("Starkname not found"); + } + return stringDomain; + } catch (e) { + if (e instanceof Error && e.message === "Starkname not found") { + throw e; + } + throw Error("Could not get stark name"); + } +} +async function getAddressFromStarkName(provider, name, StarknetIdContract2) { + const chainId = await provider.getChainId(); + const contract = StarknetIdContract2 ?? getStarknetIdContract(chainId); + try { + const addressData = await provider.callContract({ + contractAddress: contract, + entrypoint: "domain_to_address", + calldata: CallData.compile({ + domain: [useEncoded(name.replace(".stark", "")).toString(10)] + }) + }); + return addressData.result[0]; + } catch { + throw Error("Could not get address from stark name"); + } +} + +// src/provider/utils.ts +var validBlockTags = Object.values(BlockTag); +var Block = class { + constructor(_identifier) { + this.hash = null; + this.number = null; + this.tag = null; + this.valueOf = () => this.number; + this.toString = () => this.hash; + this.setIdentifier(_identifier); + } + setIdentifier(__identifier) { + if (typeof __identifier === "string" && isHex(__identifier)) { + this.hash = __identifier; + } else if (typeof __identifier === "bigint") { + this.hash = toHex(__identifier); + } else if (typeof __identifier === "number") { + this.number = __identifier; + } else if (typeof __identifier === "string" && validBlockTags.includes(__identifier)) { + this.tag = __identifier; + } else { + this.tag = "pending" /* pending */; + } + } + // TODO: fix any + get queryIdentifier() { + if (this.number !== null) { + return `blockNumber=${this.number}`; + } + if (this.hash !== null) { + return `blockHash=${this.hash}`; + } + return `blockNumber=${this.tag}`; + } + // TODO: fix any + get identifier() { + if (this.number !== null) { + return { block_number: this.number }; + } + if (this.hash !== null) { + return { block_hash: this.hash }; + } + return this.tag; + } + set identifier(_identifier) { + this.setIdentifier(_identifier); + } + get sequencerIdentifier() { + return this.hash !== null ? { blockHash: this.hash } : { blockNumber: this.number ?? this.tag }; + } +}; + +// src/provider/rpc.ts +var defaultOptions = { + headers: { "Content-Type": "application/json" }, + blockIdentifier: "latest", + retries: 200 +}; +var RpcProvider = class { + constructor(optionsOrProvider) { + this.responseParser = new RPCResponseParser(); + const { nodeUrl, retries, headers, blockIdentifier, chainId } = optionsOrProvider; + this.nodeUrl = nodeUrl; + this.retries = retries || defaultOptions.retries; + this.headers = { ...defaultOptions.headers, ...headers }; + this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier; + this.chainId = chainId; + this.getChainId(); + } + fetch(method, params) { + const body = stringify2({ method, jsonrpc: "2.0", params, id: 0 }); + return fetchPonyfill_default(this.nodeUrl, { + method: "POST", + body, + headers: this.headers + }); + } + errorHandler(error) { + if (error) { + const { code, message } = error; + throw new LibraryError(`${code}: ${message}`); + } + } + async fetchEndpoint(method, params) { + try { + const rawResult = await this.fetch(method, params); + const { error, result } = await rawResult.json(); + this.errorHandler(error); + return result; + } catch (error) { + this.errorHandler(error?.response?.data); + throw error; + } + } + // Methods from Interface + async getChainId() { + this.chainId ?? (this.chainId = await this.fetchEndpoint("starknet_chainId")); + return this.chainId; + } + async getBlock(blockIdentifier = this.blockIdentifier) { + return this.getBlockWithTxHashes(blockIdentifier).then( + this.responseParser.parseGetBlockResponse + ); + } + async getBlockHashAndNumber() { + return this.fetchEndpoint("starknet_blockHashAndNumber"); + } + async getBlockWithTxHashes(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockWithTxHashes", { block_id }); + } + async getBlockWithTxs(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockWithTxs", { block_id }); + } + async getClassHashAt(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClassHashAt", { + block_id, + contract_address: contractAddress + }); + } + async getNonceForAddress(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getNonce", { + contract_address: contractAddress, + block_id + }); + } + async getPendingTransactions() { + return this.fetchEndpoint("starknet_pendingTransactions"); + } + async getProtocolVersion() { + throw new Error("Pathfinder does not implement this rpc 0.1.0 method"); + } + async getStateUpdate(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getStateUpdate", { block_id }); + } + async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) { + const parsedKey = toStorageKey(key); + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getStorageAt", { + contract_address: contractAddress, + key: parsedKey, + block_id + }); + } + // Methods from Interface + async getTransaction(txHash) { + return this.getTransactionByHash(txHash).then(this.responseParser.parseGetTransactionResponse); + } + async getTransactionByHash(txHash) { + return this.fetchEndpoint("starknet_getTransactionByHash", { transaction_hash: txHash }); + } + async getTransactionByBlockIdAndIndex(blockIdentifier, index) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex", { block_id, index }); + } + async getTransactionReceipt(txHash) { + return this.fetchEndpoint("starknet_getTransactionReceipt", { transaction_hash: txHash }); + } + async getClassByHash(classHash) { + return this.getClass(classHash); + } + async getClass(classHash, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClass", { + class_hash: classHash, + block_id + }).then(this.responseParser.parseContractClassResponse); + } + async getClassAt(contractAddress, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getClassAt", { + block_id, + contract_address: contractAddress + }).then(this.responseParser.parseContractClassResponse); + } + async getCode(_contractAddress, _blockIdentifier) { + throw new Error("RPC does not implement getCode function"); + } + async getEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier) { + return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier); + } + async getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "INVOKE_FUNCTION" /* INVOKE */, + ...invocation, + ...invocationDetails + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getDeclareEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "DECLARE" /* DECLARE */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getDeployAccountEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const transaction = this.buildTransaction( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("starknet_estimateFee", { + request: [transaction], + block_id + }).then(this.responseParser.parseFeeEstimateResponse); + } + async getEstimateFeeBulk(invocations, { blockIdentifier = this.blockIdentifier, skipValidate = false }) { + if (skipValidate) { + console.warn("getEstimateFeeBulk RPC does not support skipValidate"); + } + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_estimateFee", { + request: invocations.map((it) => this.buildTransaction(it, "fee")), + block_id + }).then(this.responseParser.parseFeeEstimateBulkResponse); + } + async declareContract({ contract, signature, senderAddress, compiledClassHash }, details) { + if (!isSierra(contract)) { + return this.fetchEndpoint("starknet_addDeclareTransaction", { + declare_transaction: { + type: rpc_exports.TransactionType.DECLARE, + contract_class: { + program: contract.program, + entry_points_by_type: contract.entry_points_by_type, + abi: contract.abi + }, + version: toHex(transactionVersion), + max_fee: toHex(details.maxFee || 0), + signature: signatureToHexArray(signature), + sender_address: senderAddress, + nonce: toHex(details.nonce) + } + }); + } + return this.fetchEndpoint("starknet_addDeclareTransaction", { + declare_transaction: { + type: rpc_exports.TransactionType.DECLARE, + contract_class: { + sierra_program: decompressProgram(contract.sierra_program), + contract_class_version: contract.contract_class_version, + entry_points_by_type: contract.entry_points_by_type, + abi: contract.abi + }, + compiled_class_hash: compiledClassHash || "", + version: toHex(transactionVersion_2), + max_fee: toHex(details.maxFee || 0), + signature: signatureToHexArray(signature), + sender_address: senderAddress, + nonce: toHex(details.nonce) + } + }); + } + async deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }, details) { + return this.fetchEndpoint("starknet_addDeployAccountTransaction", { + deploy_account_transaction: { + constructor_calldata: CallData.toHex(constructorCalldata || []), + class_hash: toHex(classHash), + contract_address_salt: toHex(addressSalt || 0), + type: rpc_exports.TransactionType.DEPLOY_ACCOUNT, + max_fee: toHex(details.maxFee || 0), + version: toHex(details.version || 0), + signature: signatureToHexArray(signature), + nonce: toHex(details.nonce) + } + }); + } + async invokeFunction(functionInvocation, details) { + return this.fetchEndpoint("starknet_addInvokeTransaction", { + invoke_transaction: { + sender_address: functionInvocation.contractAddress, + calldata: CallData.toHex(functionInvocation.calldata), + type: rpc_exports.TransactionType.INVOKE, + max_fee: toHex(details.maxFee || 0), + version: "0x1", + signature: signatureToHexArray(functionInvocation.signature), + nonce: toHex(details.nonce) + } + }); + } + // Methods from Interface + async callContract(call, blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + const result = await this.fetchEndpoint("starknet_call", { + request: { + contract_address: call.contractAddress, + entry_point_selector: getSelectorFromName(call.entrypoint), + calldata: CallData.toHex(call.calldata) + }, + block_id + }); + return this.responseParser.parseCallContractResponse(result); + } + async traceTransaction(transactionHash) { + return this.fetchEndpoint("starknet_traceTransaction", { transaction_hash: transactionHash }); + } + async traceBlockTransactions(blockHash) { + return this.fetchEndpoint("starknet_traceBlockTransactions", { block_hash: blockHash }); + } + async waitForTransaction(txHash, options) { + const errorStates = ["REJECTED" /* REJECTED */, "NOT_RECEIVED" /* NOT_RECEIVED */]; + let { retries } = this; + let onchain = false; + let txReceipt = {}; + const retryInterval = options?.retryInterval ?? 8e3; + const successStates = options?.successStates ?? [ + "ACCEPTED_ON_L1" /* ACCEPTED_ON_L1 */, + "ACCEPTED_ON_L2" /* ACCEPTED_ON_L2 */ + ]; + while (!onchain) { + await wait(retryInterval); + try { + txReceipt = await this.getTransactionReceipt(txHash); + if (!("status" in txReceipt)) { + const error = new Error("transaction status"); + throw error; + } + if (txReceipt.status && successStates.includes(txReceipt.status)) { + onchain = true; + } else if (txReceipt.status && errorStates.includes(txReceipt.status)) { + const message = txReceipt.status; + const error = new Error(message); + error.response = txReceipt; + throw error; + } + } catch (error) { + if (error instanceof Error && errorStates.includes(error.message)) { + throw error; + } + if (retries === 0) { + throw new Error(`waitForTransaction timed-out with retries ${this.retries}`); + } + } + retries -= 1; + } + await wait(retryInterval); + return txReceipt; + } + /** + * Gets the transaction count from a block. + * + * + * @param blockIdentifier + * @returns Number of transactions + */ + async getTransactionCount(blockIdentifier = this.blockIdentifier) { + const block_id = new Block(blockIdentifier).identifier; + return this.fetchEndpoint("starknet_getBlockTransactionCount", { block_id }); + } + /** + * Gets the latest block number + * + * + * @returns Number of the latest block + */ + async getBlockNumber() { + return this.fetchEndpoint("starknet_blockNumber"); + } + /** + * Gets syncing status of the node + * + * + * @returns Object with the stats data + */ + async getSyncingStats() { + return this.fetchEndpoint("starknet_syncing"); + } + /** + * Gets all the events filtered + * + * + * @returns events and the pagination of the events + */ + async getEvents(eventFilter) { + return this.fetchEndpoint("starknet_getEvents", { filter: eventFilter }); + } + async getSimulateTransaction(invocations, { + blockIdentifier = this.blockIdentifier, + skipValidate = false, + skipExecute = false + }) { + const block_id = new Block(blockIdentifier).identifier; + const simulationFlags = []; + if (skipValidate) + simulationFlags.push(0 /* SKIP_VALIDATE */); + if (skipExecute) + simulationFlags.push(1 /* SKIP_EXECUTE */); + return this.fetchEndpoint("starknet_simulateTransaction", { + block_id, + transactions: invocations.map((it) => this.buildTransaction(it)), + // TODO: Pathfinder 0.5.6 bug, should be transaction + simulation_flags: simulationFlags + }).then(this.responseParser.parseSimulateTransactionResponse); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } + buildTransaction(invocation, versionType) { + const defaultVersions = getVersionsByType(versionType); + const details = { + signature: signatureToHexArray(invocation.signature), + nonce: toHex(invocation.nonce), + max_fee: toHex(invocation.maxFee || 0) + }; + if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) { + return { + type: rpc_exports.TransactionType.INVOKE, + // Diff between sequencer and rpc invoke type + sender_address: invocation.contractAddress, + calldata: CallData.toHex(invocation.calldata), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + if (invocation.type === rpc_exports.TransactionType.DECLARE) { + if (!isSierra(invocation.contract)) { + const legacyContract = invocation.contract; + return { + type: invocation.type, + contract_class: legacyContract, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + const sierraContract = invocation.contract; + return { + // compiled_class_hash + type: invocation.type, + contract_class: { + ...sierraContract, + sierra_program: decompressProgram(sierraContract.sierra_program) + }, + compiled_class_hash: invocation.compiledClassHash || "", + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v2), + ...details + }; + } + if (invocation.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + return { + type: invocation.type, + constructor_calldata: CallData.toHex(invocation.constructorCalldata || []), + class_hash: toHex(invocation.classHash), + contract_address_salt: toHex(invocation.addressSalt || 0), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + throw Error("RPC buildTransaction received unknown TransactionType"); + } +}; + +// src/provider/sequencer.ts +import urljoin2 from "url-join"; + +// src/utils/responseParser/index.ts +var ResponseParser = class { +}; + +// src/utils/responseParser/sequencer.ts +var SequencerAPIResponseParser = class extends ResponseParser { + parseGetBlockResponse(res) { + return { + ...res, + new_root: res.state_root, + parent_hash: res.parent_block_hash, + transactions: Object.values(res.transactions).map((value) => "transaction_hash" in value && value.transaction_hash).filter(Boolean) + }; + } + parseGetTransactionResponse(res) { + return { + ...res, + calldata: "calldata" in res.transaction ? res.transaction.calldata : [], + contract_class: "contract_class" in res.transaction ? res.transaction.contract_class : void 0, + entry_point_selector: "entry_point_selector" in res.transaction ? res.transaction.entry_point_selector : void 0, + max_fee: "max_fee" in res.transaction ? res.transaction.max_fee : void 0, + nonce: res.transaction.nonce, + sender_address: "sender_address" in res.transaction ? res.transaction.sender_address : void 0, + signature: "signature" in res.transaction ? res.transaction.signature : void 0, + transaction_hash: "transaction_hash" in res.transaction ? res.transaction.transaction_hash : void 0, + version: "version" in res.transaction ? res.transaction.version : void 0 + }; + } + parseGetTransactionReceiptResponse(res) { + return { + transaction_hash: res.transaction_hash, + status: res.status, + messages_sent: res.l2_to_l1_messages, + // TODO: parse + events: res.events, + ..."block_hash" in res && { block_hash: res.block_hash }, + ..."block_number" in res && { block_number: res.block_number }, + ..."actual_fee" in res && { actual_fee: res.actual_fee }, + ..."transaction_index" in res && { transaction_index: res.transaction_index }, + ..."execution_resources" in res && { execution_resources: res.execution_resources }, + ..."l1_to_l2_consumed_message" in res && { + // eslint-disable-next-line @typescript-eslint/dot-notation + l1_to_l2_consumed_message: res["l1_to_l2_consumed_message"] + }, + ..."transaction_failure_reason" in res && { + transaction_failure_reason: res.transaction_failure_reason + } + }; + } + parseFeeEstimateResponse(res) { + if ("overall_fee" in res) { + let gasInfo = {}; + try { + gasInfo = { + gas_consumed: toBigInt(res.gas_usage), + gas_price: toBigInt(res.gas_price) + }; + } catch { + } + return { + overall_fee: toBigInt(res.overall_fee), + ...gasInfo + }; + } + return { + overall_fee: toBigInt(res.amount) + }; + } + parseFeeEstimateBulkResponse(res) { + return [].concat(res).map((item) => { + if ("overall_fee" in item) { + let gasInfo = {}; + try { + gasInfo = { + gas_consumed: toBigInt(item.gas_usage), + gas_price: toBigInt(item.gas_price) + }; + } catch { + } + return { + overall_fee: toBigInt(item.overall_fee), + ...gasInfo + }; + } + return { + overall_fee: toBigInt(item.amount) + }; + }); + } + parseSimulateTransactionResponse(res) { + const suggestedMaxFee = "overall_fee" in res.fee_estimation ? res.fee_estimation.overall_fee : res.fee_estimation.amount; + return [ + { + transaction_trace: res.trace, + fee_estimation: res.fee_estimation, + suggestedMaxFee: estimatedFeeToMaxFee(BigInt(suggestedMaxFee)) + } + ]; + } + parseCallContractResponse(res) { + return { + result: res.result + }; + } + parseInvokeFunctionResponse(res) { + return { + transaction_hash: res.transaction_hash + }; + } + parseDeployContractResponse(res) { + return { + transaction_hash: res.transaction_hash, + contract_address: res.address + }; + } + parseDeclareContractResponse(res) { + return { + transaction_hash: res.transaction_hash, + class_hash: res.class_hash + }; + } + parseGetStateUpdateResponse(res) { + const nonces = Object.entries(res.state_diff.nonces).map(([contract_address, nonce]) => ({ + contract_address, + nonce + })); + const storage_diffs = Object.entries(res.state_diff.storage_diffs).map( + ([address, storage_entries]) => ({ address, storage_entries }) + ); + return { + ...res, + state_diff: { + ...res.state_diff, + storage_diffs, + nonces + } + }; + } + parseContractClassResponse(res) { + const response = isSierra(res) ? res : parseContract(res); + return { + ...response, + abi: typeof response.abi === "string" ? JSON.parse(response.abi) : response.abi + }; + } +}; + +// src/utils/url.ts +import urljoin from "url-join"; +var protocolAndDomainRE = /^(?:\w+:)?\/\/(\S+)$/; +var localhostDomainRE = /^localhost[:?\d]*(?:[^:?\d]\S*)?$/; +var nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/; +function isUrl(s) { + if (!s) { + return false; + } + if (typeof s !== "string") { + return false; + } + const match = s.match(protocolAndDomainRE); + if (!match) { + return false; + } + const everythingAfterProtocol = match[1]; + if (!everythingAfterProtocol) { + return false; + } + if (localhostDomainRE.test(everythingAfterProtocol) || nonLocalhostDomainRE.test(everythingAfterProtocol)) { + return true; + } + return false; +} +function buildUrl(baseUrl, defaultPath, urlOrPath) { + return isUrl(urlOrPath) ? urlOrPath : urljoin(baseUrl, urlOrPath ?? defaultPath); +} + +// src/provider/sequencer.ts +function isEmptyQueryObject(obj) { + return obj === void 0 || Object.keys(obj).length === 0 || Object.keys(obj).length === 1 && Object.entries(obj).every(([k, v]) => k === "blockIdentifier" && v === null); +} +var defaultOptions2 = { + network: "SN_GOERLI2" /* SN_GOERLI2 */, + blockIdentifier: "pending" /* pending */ +}; +var SequencerProvider = class { + constructor(optionsOrProvider = defaultOptions2) { + this.responseParser = new SequencerAPIResponseParser(); + if ("network" in optionsOrProvider) { + this.baseUrl = SequencerProvider.getNetworkFromName(optionsOrProvider.network); + this.feederGatewayUrl = buildUrl(this.baseUrl, "feeder_gateway"); + this.gatewayUrl = buildUrl(this.baseUrl, "gateway"); + } else { + this.baseUrl = optionsOrProvider.baseUrl; + this.feederGatewayUrl = buildUrl( + this.baseUrl, + "feeder_gateway", + optionsOrProvider.feederGatewayUrl + ); + this.gatewayUrl = buildUrl(this.baseUrl, "gateway", optionsOrProvider.gatewayUrl); + } + this.chainId = optionsOrProvider?.chainId ?? SequencerProvider.getChainIdFromBaseUrl(this.baseUrl); + this.headers = optionsOrProvider.headers; + this.blockIdentifier = optionsOrProvider?.blockIdentifier || defaultOptions2.blockIdentifier; + } + static getNetworkFromName(name) { + switch (name) { + case ("SN_MAIN" /* SN_MAIN */ || "0x534e5f4d41494e" /* SN_MAIN */): + return "https://alpha-mainnet.starknet.io" /* SN_MAIN */; + case ("SN_GOERLI" /* SN_GOERLI */ || "0x534e5f474f45524c49" /* SN_GOERLI */): + return "https://alpha4.starknet.io" /* SN_GOERLI */; + case ("SN_GOERLI2" /* SN_GOERLI2 */ || "0x534e5f474f45524c4932" /* SN_GOERLI2 */): + return "https://alpha4-2.starknet.io" /* SN_GOERLI2 */; + default: + throw new Error("Could not detect base url from NetworkName"); + } + } + static getChainIdFromBaseUrl(baseUrl) { + try { + const url = new URL(baseUrl); + if (url.host.includes("mainnet.starknet.io")) { + return "0x534e5f4d41494e" /* SN_MAIN */; + } + if (url.host.includes("alpha4-2.starknet.io")) { + return "0x534e5f474f45524c4932" /* SN_GOERLI2 */; + } + return "0x534e5f474f45524c49" /* SN_GOERLI */; + } catch { + console.error(`Could not parse baseUrl: ${baseUrl}`); + return "0x534e5f474f45524c49" /* SN_GOERLI */; + } + } + getFetchUrl(endpoint) { + const gatewayUrlEndpoints = ["add_transaction"]; + return gatewayUrlEndpoints.includes(endpoint) ? this.gatewayUrl : this.feederGatewayUrl; + } + getFetchMethod(endpoint) { + const postMethodEndpoints = [ + "add_transaction", + "call_contract", + "estimate_fee", + "estimate_message_fee", + "estimate_fee_bulk", + "simulate_transaction" + ]; + return postMethodEndpoints.includes(endpoint) ? "POST" : "GET"; + } + getQueryString(query) { + if (isEmptyQueryObject(query)) { + return ""; + } + const queryString = Object.entries(query).map(([key, value]) => { + if (key === "blockIdentifier") { + const block = new Block(value); + return `${block.queryIdentifier}`; + } + return `${key}=${value}`; + }).join("&"); + return `?${queryString}`; + } + getHeaders(method) { + if (method === "POST") { + return { + "Content-Type": "application/json", + ...this.headers + }; + } + return this.headers; + } + // typesafe fetch + async fetchEndpoint(endpoint, ...[query, request]) { + const baseUrl = this.getFetchUrl(endpoint); + const method = this.getFetchMethod(endpoint); + const queryString = this.getQueryString(query); + const url = urljoin2(baseUrl, endpoint, queryString); + return this.fetch(url, { + method, + body: request + }); + } + async fetch(endpoint, options) { + const url = buildUrl(this.baseUrl, "", endpoint); + const method = options?.method ?? "GET"; + const headers = this.getHeaders(method); + const body = stringify2(options?.body); + try { + const response = await fetchPonyfill_default(url, { + method, + body, + headers + }); + const textResponse = await response.text(); + if (!response.ok) { + let responseBody; + try { + responseBody = parse2(textResponse); + } catch { + throw new HttpError(response.statusText, response.status); + } + throw new GatewayError(responseBody.message, responseBody.code); + } + const parseChoice = options?.parseAlwaysAsBigInt ? parseAlwaysAsBig : parse2; + return parseChoice(textResponse); + } catch (error) { + if (error instanceof Error && !(error instanceof LibraryError)) + throw Error(`Could not ${method} from endpoint \`${url}\`: ${error.message}`); + throw error; + } + } + async getChainId() { + return Promise.resolve(this.chainId); + } + async callContract({ contractAddress, entrypoint: entryPointSelector, calldata = [] }, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint( + "call_contract", + { blockIdentifier }, + { + // TODO - determine best choice once both are fully supported in devnet + // signature: [], + // sender_address: contractAddress, + contract_address: contractAddress, + entry_point_selector: getSelectorFromName(entryPointSelector), + calldata: CallData.compile(calldata) + } + ).then(this.responseParser.parseCallContractResponse); + } + async getBlock(blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_block", { blockIdentifier }).then( + this.responseParser.parseGetBlockResponse + ); + } + async getNonceForAddress(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_nonce", { contractAddress, blockIdentifier }); + } + async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) { + const parsedKey = toBigInt(key).toString(10); + return this.fetchEndpoint("get_storage_at", { + blockIdentifier, + contractAddress, + key: parsedKey + }); + } + async getTransaction(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction", { transactionHash: txHashHex }).then((result) => { + if (Object.values(result).length === 1) + throw new LibraryError(result.status); + return this.responseParser.parseGetTransactionResponse(result); + }); + } + async getTransactionReceipt(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_receipt", { transactionHash: txHashHex }).then( + this.responseParser.parseGetTransactionReceiptResponse + ); + } + async getClassAt(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_full_contract", { blockIdentifier, contractAddress }).then( + this.responseParser.parseContractClassResponse + ); + } + async getClassHashAt(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_class_hash_at", { blockIdentifier, contractAddress }); + } + async getClassByHash(classHash, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_class_by_hash", { classHash, blockIdentifier }).then( + this.responseParser.parseContractClassResponse + ); + } + async getCompiledClassByClassHash(classHash, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_compiled_class_by_class_hash", { classHash, blockIdentifier }); + } + async invokeFunction(functionInvocation, details) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "INVOKE_FUNCTION" /* INVOKE */, + sender_address: functionInvocation.contractAddress, + calldata: CallData.compile(functionInvocation.calldata ?? []), + signature: signatureToDecimalArray(functionInvocation.signature), + nonce: toHex(details.nonce), + max_fee: toHex(details.maxFee || 0), + version: "0x1" + }).then(this.responseParser.parseInvokeFunctionResponse); + } + async deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }, details) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + contract_address_salt: addressSalt ?? randomAddress(), + constructor_calldata: CallData.compile(constructorCalldata ?? []), + class_hash: toHex(classHash), + max_fee: toHex(details.maxFee || 0), + version: toHex(details.version || 0), + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature) + }).then(this.responseParser.parseDeployContractResponse); + } + async declareContract({ senderAddress, contract, signature, compiledClassHash }, details) { + if (!isSierra(contract)) { + return this.fetchEndpoint("add_transaction", void 0, { + type: "DECLARE" /* DECLARE */, + contract_class: contract, + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature), + sender_address: senderAddress, + max_fee: toHex(details.maxFee || 0), + version: toHex(transactionVersion) + }).then(this.responseParser.parseDeclareContractResponse); + } + return this.fetchEndpoint("add_transaction", void 0, { + type: "DECLARE" /* DECLARE */, + sender_address: senderAddress, + compiled_class_hash: compiledClassHash, + contract_class: contract, + nonce: toHex(details.nonce), + signature: signatureToDecimalArray(signature), + max_fee: toHex(details.maxFee || 0), + version: toHex(transactionVersion_2) + }).then(this.responseParser.parseDeclareContractResponse); + } + async getEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier, skipValidate = false) { + return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier, skipValidate); + } + async getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "INVOKE_FUNCTION" /* INVOKE */, + ...invocation, + ...invocationDetails + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getDeclareEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "DECLARE" /* DECLARE */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getDeployAccountEstimateFee(invocation, details, blockIdentifier = this.blockIdentifier, skipValidate = false) { + const transaction = this.buildTransaction( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + ...invocation, + ...details + }, + "fee" + ); + return this.fetchEndpoint("estimate_fee", { blockIdentifier, skipValidate }, transaction).then( + this.responseParser.parseFeeEstimateResponse + ); + } + async getEstimateFeeBulk(invocations, { blockIdentifier = this.blockIdentifier, skipValidate = false }) { + const transactions = invocations.map((it) => this.buildTransaction(it, "fee")); + return this.fetchEndpoint( + "estimate_fee_bulk", + { blockIdentifier, skipValidate }, + transactions + ).then(this.responseParser.parseFeeEstimateBulkResponse); + } + async getCode(contractAddress, blockIdentifier = this.blockIdentifier) { + return this.fetchEndpoint("get_code", { contractAddress, blockIdentifier }); + } + async waitForTransaction(txHash, options) { + const errorStates = ["REJECTED" /* REJECTED */, "NOT_RECEIVED" /* NOT_RECEIVED */]; + let onchain = false; + let res; + const retryInterval = options?.retryInterval ?? 8e3; + const successStates = options?.successStates ?? [ + "ACCEPTED_ON_L1" /* ACCEPTED_ON_L1 */, + "ACCEPTED_ON_L2" /* ACCEPTED_ON_L2 */ + ]; + while (!onchain) { + await wait(retryInterval); + res = await this.getTransactionStatus(txHash); + if (successStates.includes(res.tx_status)) { + onchain = true; + } else if (errorStates.includes(res.tx_status)) { + const message = res.tx_failure_reason ? `${res.tx_status}: ${res.tx_failure_reason.code} +${res.tx_failure_reason.error_message}` : res.tx_status; + const error = new Error(message); + error.response = res; + throw error; + } + } + const txReceipt = await this.getTransactionReceipt(txHash); + return txReceipt; + } + /** + * Gets the status of a transaction. + * @param txHash BigNumberish + * @returns GetTransactionStatusResponse - the transaction status object + */ + async getTransactionStatus(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_status", { transactionHash: txHashHex }); + } + /** + * Gets the smart contract address on the goerli testnet. + * @returns GetContractAddressesResponse - starknet smart contract addresses + */ + async getContractAddresses() { + return this.fetchEndpoint("get_contract_addresses"); + } + /** + * Gets the transaction trace from a tx id. + * @param txHash BigNumberish + * @returns TransactionTraceResponse - the transaction trace + */ + async getTransactionTrace(txHash) { + const txHashHex = toHex(txHash); + return this.fetchEndpoint("get_transaction_trace", { transactionHash: txHashHex }); + } + async estimateMessageFee({ from_address, to_address, entry_point_selector, payload }, blockIdentifier = this.blockIdentifier) { + const validCallL1Handler = { + from_address: getDecimalString(from_address), + to_address: getHexString(to_address), + entry_point_selector: getSelector(entry_point_selector), + payload: getHexStringArray(payload) + }; + return this.fetchEndpoint("estimate_message_fee", { blockIdentifier }, validCallL1Handler); + } + /** + * Simulate transaction using Sequencer provider + * WARNING!: Sequencer will process only first element from invocations array + * + * @param invocations Array of invocations, but only first invocation will be processed + * @param blockIdentifier block identifier, default 'latest' + * @param skipValidate Skip Account __validate__ method + * @returns + */ + async getSimulateTransaction(invocations, { + blockIdentifier = this.blockIdentifier, + skipValidate = false, + skipExecute = false + }) { + if (invocations.length > 1) { + console.warn("Sequencer simulate process only first element from invocations list"); + } + if (skipExecute) { + console.warn("Sequencer can't skip account __execute__"); + } + const transaction = this.buildTransaction(invocations[0]); + return this.fetchEndpoint( + "simulate_transaction", + { + blockIdentifier, + skipValidate: skipValidate ?? false + }, + transaction + ).then(this.responseParser.parseSimulateTransactionResponse); + } + async getStateUpdate(blockIdentifier = this.blockIdentifier) { + const args = new Block(blockIdentifier).sequencerIdentifier; + return this.fetchEndpoint("get_state_update", { ...args }).then( + this.responseParser.parseGetStateUpdateResponse + ); + } + // consider adding an optional trace retrieval parameter to the getBlock method + async getBlockTraces(blockIdentifier = this.blockIdentifier) { + const args = new Block(blockIdentifier).sequencerIdentifier; + return this.fetchEndpoint("get_block_traces", { ...args }); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } + /** + * Build Single AccountTransaction from Single AccountInvocation + * @param invocation AccountInvocationItem + * @param versionType 'fee' | 'transaction' - used to determine default versions + * @returns AccountTransactionItem + */ + buildTransaction(invocation, versionType) { + const defaultVersions = getVersionsByType(versionType); + const details = { + signature: signatureToDecimalArray(invocation.signature), + nonce: toHex(invocation.nonce) + }; + if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) { + return { + type: invocation.type, + sender_address: invocation.contractAddress, + calldata: CallData.compile(invocation.calldata ?? []), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + if (invocation.type === "DECLARE" /* DECLARE */) { + if (!isSierra(invocation.contract)) { + return { + type: invocation.type, + contract_class: invocation.contract, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v1), + // fee from getDeclareEstimateFee use t.v. instead of feet.v. + ...details + }; + } + return { + type: invocation.type, + contract_class: invocation.contract, + compiled_class_hash: invocation.compiledClassHash, + sender_address: invocation.senderAddress, + version: toHex(invocation.version || defaultVersions.v2), + // fee on getDeclareEstimateFee use t.v. instead of feet.v. + ...details + }; + } + if (invocation.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + return { + type: invocation.type, + constructor_calldata: CallData.compile(invocation.constructorCalldata || []), + class_hash: toHex(invocation.classHash), + contract_address_salt: toHex(invocation.addressSalt || 0), + version: toHex(invocation.version || defaultVersions.v1), + ...details + }; + } + throw Error("Sequencer buildTransaction received unknown TransactionType"); + } +}; + +// src/provider/default.ts +var Provider = class { + constructor(providerOrOptions) { + if (providerOrOptions instanceof Provider) { + this.provider = providerOrOptions.provider; + } else if (providerOrOptions instanceof RpcProvider || providerOrOptions instanceof SequencerProvider) { + this.provider = providerOrOptions; + } else if (providerOrOptions && "rpc" in providerOrOptions) { + this.provider = new RpcProvider(providerOrOptions.rpc); + } else if (providerOrOptions && "sequencer" in providerOrOptions) { + this.provider = new SequencerProvider(providerOrOptions.sequencer); + } else { + this.provider = new SequencerProvider(); + } + } + async getChainId() { + return this.provider.getChainId(); + } + async getBlock(blockIdentifier) { + return this.provider.getBlock(blockIdentifier); + } + async getClassAt(contractAddress, blockIdentifier) { + return this.provider.getClassAt(contractAddress, blockIdentifier); + } + async getClassHashAt(contractAddress, blockIdentifier) { + return this.provider.getClassHashAt(contractAddress, blockIdentifier); + } + getClassByHash(classHash) { + return this.provider.getClassByHash(classHash); + } + async getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier) { + return this.provider.getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier); + } + async getInvokeEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier, skipValidate) { + return this.provider.getInvokeEstimateFee( + invocationWithTxType, + invocationDetails, + blockIdentifier, + skipValidate + ); + } + async getEstimateFeeBulk(invocations, options) { + return this.provider.getEstimateFeeBulk(invocations, options); + } + async getNonceForAddress(contractAddress, blockIdentifier) { + return this.provider.getNonceForAddress(contractAddress, blockIdentifier); + } + async getStorageAt(contractAddress, key, blockIdentifier) { + return this.provider.getStorageAt(contractAddress, key, blockIdentifier); + } + async getTransaction(txHash) { + return this.provider.getTransaction(txHash); + } + async getTransactionReceipt(txHash) { + return this.provider.getTransactionReceipt(txHash); + } + async callContract(request, blockIdentifier) { + return this.provider.callContract(request, blockIdentifier); + } + async invokeFunction(functionInvocation, details) { + return this.provider.invokeFunction(functionInvocation, details); + } + async deployAccountContract(payload, details) { + return this.provider.deployAccountContract(payload, details); + } + async declareContract(transaction, details) { + return this.provider.declareContract(transaction, details); + } + async getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate) { + return this.provider.getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate); + } + getDeployAccountEstimateFee(transaction, details, blockIdentifier, skipValidate) { + return this.provider.getDeployAccountEstimateFee( + transaction, + details, + blockIdentifier, + skipValidate + ); + } + async getCode(contractAddress, blockIdentifier) { + return this.provider.getCode(contractAddress, blockIdentifier); + } + async waitForTransaction(txHash, options) { + return this.provider.waitForTransaction(txHash, options); + } + async getSimulateTransaction(invocations, options) { + return this.provider.getSimulateTransaction(invocations, options); + } + async getStateUpdate(blockIdentifier) { + return this.provider.getStateUpdate(blockIdentifier); + } + async getStarkName(address, StarknetIdContract2) { + return getStarkName(this, address, StarknetIdContract2); + } + async getAddressFromStarkName(name, StarknetIdContract2) { + return getAddressFromStarkName(this, name, StarknetIdContract2); + } +}; + +// src/signer/interface.ts +var SignerInterface = class { +}; + +// src/utils/transaction.ts +var transaction_exports = {}; +__export(transaction_exports, { + fromCallsToExecuteCalldata: () => fromCallsToExecuteCalldata, + fromCallsToExecuteCalldataWithNonce: () => fromCallsToExecuteCalldataWithNonce, + fromCallsToExecuteCalldata_cairo1: () => fromCallsToExecuteCalldata_cairo1, + getExecuteCalldata: () => getExecuteCalldata, + transformCallsToMulticallArrays: () => transformCallsToMulticallArrays, + transformCallsToMulticallArrays_cairo1: () => transformCallsToMulticallArrays_cairo1 +}); +var transformCallsToMulticallArrays = (calls) => { + const callArray = []; + const calldata = []; + calls.forEach((call) => { + const data = CallData.compile(call.calldata || []); + callArray.push({ + to: toBigInt(call.contractAddress).toString(10), + selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10), + data_offset: calldata.length.toString(), + data_len: data.length.toString() + }); + calldata.push(...data); + }); + return { + callArray, + calldata: CallData.compile({ calldata }) + }; +}; +var fromCallsToExecuteCalldata = (calls) => { + const { callArray, calldata } = transformCallsToMulticallArrays(calls); + const compiledCalls = CallData.compile({ callArray }); + return [...compiledCalls, ...calldata]; +}; +var fromCallsToExecuteCalldataWithNonce = (calls, nonce) => { + return [...fromCallsToExecuteCalldata(calls), toBigInt(nonce).toString()]; +}; +var transformCallsToMulticallArrays_cairo1 = (calls) => { + const callArray = calls.map((call) => ({ + to: toBigInt(call.contractAddress).toString(10), + selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10), + calldata: CallData.compile(call.calldata || []) + })); + return callArray; +}; +var fromCallsToExecuteCalldata_cairo1 = (calls) => { + const orderCalls = calls.map((call) => ({ + contractAddress: call.contractAddress, + entrypoint: call.entrypoint, + calldata: call.calldata + })); + return CallData.compile({ orderCalls }); +}; +var getExecuteCalldata = (calls, cairoVersion = "0") => { + if (cairoVersion === "1") { + return fromCallsToExecuteCalldata_cairo1(calls); + } + return fromCallsToExecuteCalldata(calls); +}; + +// src/utils/typedData.ts +var typedData_exports = {}; +__export(typedData_exports, { + encodeData: () => encodeData, + encodeType: () => encodeType, + encodeValue: () => encodeValue, + getDependencies: () => getDependencies, + getMessageHash: () => getMessageHash, + getStructHash: () => getStructHash, + getTypeHash: () => getTypeHash, + isMerkleTreeType: () => isMerkleTreeType, + prepareSelector: () => prepareSelector +}); + +// src/utils/merkle.ts +var merkle_exports = {}; +__export(merkle_exports, { + MerkleTree: () => MerkleTree, + proofMerklePath: () => proofMerklePath +}); +var MerkleTree = class { + constructor(leafHashes) { + this.branches = []; + this.leaves = leafHashes; + this.root = this.build(leafHashes); + } + build(leaves) { + if (leaves.length === 1) { + return leaves[0]; + } + if (leaves.length !== this.leaves.length) { + this.branches.push(leaves); + } + const newLeaves = []; + for (let i = 0; i < leaves.length; i += 2) { + if (i + 1 === leaves.length) { + newLeaves.push(MerkleTree.hash(leaves[i], "0x0")); + } else { + newLeaves.push(MerkleTree.hash(leaves[i], leaves[i + 1])); + } + } + return this.build(newLeaves); + } + static hash(a, b) { + const [aSorted, bSorted] = [toBigInt(a), toBigInt(b)].sort((x, y) => x >= y ? 1 : -1); + return starkCurve.pedersen(aSorted, bSorted); + } + getProof(leaf, branch = this.leaves, hashPath = []) { + const index = branch.indexOf(leaf); + if (index === -1) { + throw new Error("leaf not found"); + } + if (branch.length === 1) { + return hashPath; + } + const isLeft = index % 2 === 0; + const neededBranch = (isLeft ? branch[index + 1] : branch[index - 1]) ?? "0x0"; + const newHashPath = [...hashPath, neededBranch]; + const currentBranchLevelIndex = this.leaves.length === branch.length ? -1 : this.branches.findIndex((b) => b.length === branch.length); + const nextBranch = this.branches[currentBranchLevelIndex + 1] ?? [this.root]; + return this.getProof( + MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf), + nextBranch, + newHashPath + ); + } +}; +function proofMerklePath(root, leaf, path) { + if (path.length === 0) { + return root === leaf; + } + const [next, ...rest] = path; + return proofMerklePath(root, MerkleTree.hash(leaf, next), rest); +} + +// src/utils/typedData.ts +function getHex(value) { + try { + return toHex(value); + } catch (e) { + if (typeof value === "string") { + return toHex(encodeShortString(value)); + } + throw new Error(`Invalid BigNumberish: ${value}`); + } +} +var validateTypedData = (data) => { + const typedData = data; + const valid = Boolean(typedData.types && typedData.primaryType && typedData.message); + return valid; +}; +function prepareSelector(selector) { + return isHex(selector) ? selector : getSelectorFromName(selector); +} +function isMerkleTreeType(type) { + return type.type === "merkletree"; +} +var getDependencies = (types, type, dependencies = []) => { + if (type[type.length - 1] === "*") { + type = type.slice(0, -1); + } + if (dependencies.includes(type)) { + return dependencies; + } + if (!types[type]) { + return dependencies; + } + return [ + type, + ...types[type].reduce( + (previous, t) => [ + ...previous, + ...getDependencies(types, t.type, previous).filter( + (dependency) => !previous.includes(dependency) + ) + ], + [] + ) + ]; +}; +function getMerkleTreeType(types, ctx) { + if (ctx.parent && ctx.key) { + const parentType = types[ctx.parent]; + const merkleType = parentType.find((t) => t.name === ctx.key); + const isMerkleTree = isMerkleTreeType(merkleType); + if (!isMerkleTree) { + throw new Error(`${ctx.key} is not a merkle tree`); + } + if (merkleType.contains.endsWith("*")) { + throw new Error(`Merkle tree contain property must not be an array but was given ${ctx.key}`); + } + return merkleType.contains; + } + return "raw"; +} +var encodeType = (types, type) => { + const [primary, ...dependencies] = getDependencies(types, type); + const newTypes = !primary ? [] : [primary, ...dependencies.sort()]; + return newTypes.map((dependency) => { + return `${dependency}(${types[dependency].map((t) => `${t.name}:${t.type}`)})`; + }).join(""); +}; +var getTypeHash = (types, type) => { + return getSelectorFromName(encodeType(types, type)); +}; +var encodeValue = (types, type, data, ctx = {}) => { + if (types[type]) { + return [type, getStructHash(types, type, data)]; + } + if (Object.keys(types).map((x) => `${x}*`).includes(type)) { + const structHashes = data.map((struct) => { + return getStructHash(types, type.slice(0, -1), struct); + }); + return [type, computeHashOnElements(structHashes)]; + } + if (type === "merkletree") { + const merkleTreeType = getMerkleTreeType(types, ctx); + const structHashes = data.map((struct) => { + return encodeValue(types, merkleTreeType, struct)[1]; + }); + const { root } = new MerkleTree(structHashes); + return ["felt", root]; + } + if (type === "felt*") { + return ["felt*", computeHashOnElements(data)]; + } + if (type === "selector") { + return ["felt", prepareSelector(data)]; + } + return [type, getHex(data)]; +}; +var encodeData = (types, type, data) => { + const [returnTypes, values] = types[type].reduce( + ([ts, vs], field) => { + if (data[field.name] === void 0 || data[field.name] === null) { + throw new Error(`Cannot encode data: missing data for '${field.name}'`); + } + const value = data[field.name]; + const [t, encodedValue] = encodeValue(types, field.type, value, { + parent: type, + key: field.name + }); + return [ + [...ts, t], + [...vs, encodedValue] + ]; + }, + [["felt"], [getTypeHash(types, type)]] + ); + return [returnTypes, values]; +}; +var getStructHash = (types, type, data) => { + return computeHashOnElements(encodeData(types, type, data)[1]); +}; +var getMessageHash = (typedData, account) => { + if (!validateTypedData(typedData)) { + throw new Error("Typed data does not match JSON schema"); + } + const message = [ + encodeShortString("StarkNet Message"), + getStructHash(typedData.types, "StarkNetDomain", typedData.domain), + account, + getStructHash(typedData.types, typedData.primaryType, typedData.message) + ]; + return computeHashOnElements(message); +}; + +// src/signer/default.ts +var Signer = class { + constructor(pk = starkCurve.utils.randomPrivateKey()) { + this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk); + } + async getPubKey() { + return starkCurve.getStarkKey(this.pk); + } + async signMessage(typedData, accountAddress) { + const msgHash = getMessageHash(typedData, accountAddress); + return starkCurve.sign(msgHash, this.pk); + } + async signTransaction(transactions, transactionsDetail, abis) { + if (abis && abis.length !== transactions.length) { + throw new Error("ABI must be provided for each transaction or no transaction"); + } + const calldata = getExecuteCalldata(transactions, transactionsDetail.cairoVersion); + const msgHash = calculateTransactionHash( + transactionsDetail.walletAddress, + transactionsDetail.version, + calldata, + transactionsDetail.maxFee, + transactionsDetail.chainId, + transactionsDetail.nonce + ); + return starkCurve.sign(msgHash, this.pk); + } + async signDeployAccountTransaction({ + classHash, + contractAddress, + constructorCalldata, + addressSalt, + maxFee, + version, + chainId, + nonce + }) { + const msgHash = calculateDeployAccountTransactionHash( + contractAddress, + classHash, + CallData.compile(constructorCalldata), + addressSalt, + version, + maxFee, + chainId, + nonce + ); + return starkCurve.sign(msgHash, this.pk); + } + async signDeclareTransaction({ + classHash, + senderAddress, + chainId, + maxFee, + version, + nonce, + compiledClassHash + }) { + const msgHash = calculateDeclareTransactionHash( + classHash, + senderAddress, + version, + maxFee, + chainId, + nonce, + compiledClassHash + ); + return starkCurve.sign(msgHash, this.pk); + } +}; + +// src/utils/events.ts +function parseUDCEvent(txReceipt) { + if (!txReceipt.events) { + throw new Error("UDC emited event is empty"); + } + const event = txReceipt.events.find( + (it) => cleanHex(it.from_address) === cleanHex(UDC.ADDRESS) + ) || { + data: [] + }; + return { + transaction_hash: txReceipt.transaction_hash, + contract_address: event.data[0], + address: event.data[0], + deployer: event.data[1], + unique: event.data[2], + classHash: event.data[3], + calldata_len: event.data[4], + calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)), + salt: event.data[event.data.length - 1] + }; +} + +// src/account/default.ts +var Account = class extends Provider { + constructor(providerOrOptions, address, pkOrSigner, cairoVersion = "0") { + super(providerOrOptions); + this.deploySelf = this.deployAccount; + this.address = address.toLowerCase(); + this.signer = typeof pkOrSigner === "string" || pkOrSigner instanceof Uint8Array ? new Signer(pkOrSigner) : pkOrSigner; + this.cairoVersion = cairoVersion; + } + async getNonce(blockIdentifier) { + return super.getNonceForAddress(this.address, blockIdentifier); + } + async getNonceSafe(nonce) { + try { + return toBigInt(nonce ?? await this.getNonce()); + } catch (error) { + return 0n; + } + } + async estimateFee(calls, estimateFeeDetails) { + return this.estimateInvokeFee(calls, estimateFeeDetails); + } + async estimateInvokeFee(calls, { nonce: providedNonce, blockIdentifier, skipValidate } = {}) { + const transactions = Array.isArray(calls) ? calls : [calls]; + const nonce = toBigInt(providedNonce ?? await this.getNonce()); + const version = toBigInt(feeTransactionVersion); + const chainId = await this.getChainId(); + const signerDetails = { + walletAddress: this.address, + nonce, + maxFee: ZERO, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const invocation = await this.buildInvocation(transactions, signerDetails); + const response = await super.getInvokeEstimateFee( + { ...invocation }, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateDeclareFee({ contract, classHash: providedClassHash, casm, compiledClassHash }, { blockIdentifier, nonce: providedNonce, skipValidate } = {}) { + const nonce = toBigInt(providedNonce ?? await this.getNonce()); + const version = !isSierra(contract) ? feeTransactionVersion : feeTransactionVersion_2; + const chainId = await this.getChainId(); + const declareContractTransaction = await this.buildDeclarePayload( + { classHash: providedClassHash, contract, casm, compiledClassHash }, + { + nonce, + chainId, + version, + walletAddress: this.address, + maxFee: ZERO, + cairoVersion: this.cairoVersion + } + ); + const response = await super.getDeclareEstimateFee( + declareContractTransaction, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateAccountDeployFee({ + classHash, + addressSalt = 0, + constructorCalldata = [], + contractAddress: providedContractAddress + }, { blockIdentifier, skipValidate } = {}) { + const version = toBigInt(feeTransactionVersion); + const nonce = ZERO; + const chainId = await this.getChainId(); + const payload = await this.buildAccountDeployPayload( + { classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress }, + { + nonce, + chainId, + version, + walletAddress: this.address, + maxFee: ZERO, + cairoVersion: this.cairoVersion + } + ); + const response = await super.getDeployAccountEstimateFee( + { ...payload }, + { version, nonce }, + blockIdentifier, + skipValidate + ); + const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee); + return { + ...response, + suggestedMaxFee + }; + } + async estimateDeployFee(payload, transactionsDetail) { + const calls = this.buildUDCContractPayload(payload); + return this.estimateInvokeFee(calls, transactionsDetail); + } + async estimateFeeBulk(invocations, { nonce, blockIdentifier, skipValidate } = {}) { + const accountInvocations = await this.accountInvocationsFactory(invocations, { + versions: [feeTransactionVersion, feeTransactionVersion_2], + nonce, + blockIdentifier + }); + const response = await super.getEstimateFeeBulk(accountInvocations, { + blockIdentifier, + skipValidate + }); + return [].concat(response).map((elem) => { + const suggestedMaxFee = estimatedFeeToMaxFee(elem.overall_fee); + return { + ...elem, + suggestedMaxFee + }; + }); + } + async buildInvocation(call, signerDetails) { + const calldata = getExecuteCalldata(call, this.cairoVersion); + const signature = await this.signer.signTransaction(call, signerDetails); + return { + contractAddress: this.address, + calldata, + signature + }; + } + async execute(calls, abis = void 0, transactionsDetail = {}) { + const transactions = Array.isArray(calls) ? calls : [calls]; + const nonce = toBigInt(transactionsDetail.nonce ?? await this.getNonce()); + const maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { type: "INVOKE_FUNCTION" /* INVOKE */, payload: calls }, + transactionsDetail + ); + const version = toBigInt(transactionVersion); + const chainId = await this.getChainId(); + const signerDetails = { + walletAddress: this.address, + nonce, + maxFee, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const signature = await this.signer.signTransaction(transactions, signerDetails, abis); + const calldata = getExecuteCalldata(transactions, this.cairoVersion); + return this.invokeFunction( + { contractAddress: this.address, calldata, signature }, + { + nonce, + maxFee, + version + } + ); + } + /** + * First check if contract is already declared, if not declare it + * If contract already declared returned transaction_hash is ''. + * Method will pass even if contract is already declared + * @param payload DeclareContractPayload + * @param transactionsDetail (optional) InvocationsDetails = \{\} + * @returns DeclareContractResponse + */ + async declareIfNot(payload, transactionsDetail = {}) { + const declareContractPayload = extractContractHashes(payload); + try { + await this.getClassByHash(declareContractPayload.classHash); + } catch (error) { + return this.declare(payload, transactionsDetail); + } + return { + transaction_hash: "", + class_hash: declareContractPayload.classHash + }; + } + async declare(payload, transactionsDetail = {}) { + const declareContractPayload = extractContractHashes(payload); + const details = {}; + details.nonce = toBigInt(transactionsDetail.nonce ?? await this.getNonce()); + details.maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { + type: "DECLARE" /* DECLARE */, + payload: declareContractPayload + }, + transactionsDetail + ); + details.version = !isSierra(payload.contract) ? transactionVersion : transactionVersion_2; + details.chainId = await this.getChainId(); + const declareContractTransaction = await this.buildDeclarePayload(declareContractPayload, { + ...details, + walletAddress: this.address, + cairoVersion: this.cairoVersion + }); + return this.declareContract(declareContractTransaction, details); + } + async deploy(payload, details) { + const params = [].concat(payload).map((it) => { + const { + classHash, + salt, + unique = true, + constructorCalldata = [] + } = it; + const compiledConstructorCallData = CallData.compile(constructorCalldata); + const deploySalt = salt ?? randomAddress(); + return { + call: { + contractAddress: UDC.ADDRESS, + entrypoint: UDC.ENTRYPOINT, + calldata: [ + classHash, + deploySalt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData + ] + }, + address: calculateContractAddressFromHash( + unique ? starkCurve.pedersen(this.address, deploySalt) : deploySalt, + classHash, + compiledConstructorCallData, + unique ? UDC.ADDRESS : 0 + ) + }; + }); + const calls = params.map((it) => it.call); + const addresses = params.map((it) => it.address); + const invokeResponse = await this.execute(calls, void 0, details); + return { + ...invokeResponse, + contract_address: addresses + }; + } + async deployContract(payload, details) { + const deployTx = await this.deploy(payload, details); + const txReceipt = await this.waitForTransaction(deployTx.transaction_hash); + return parseUDCEvent(txReceipt); + } + async declareAndDeploy(payload, details) { + const { constructorCalldata, salt, unique } = payload; + let declare = await this.declareIfNot(payload, details); + if (declare.transaction_hash !== "") { + const tx = await this.waitForTransaction(declare.transaction_hash); + declare = { ...declare, ...tx }; + } + const deploy = await this.deployContract( + { classHash: declare.class_hash, salt, unique, constructorCalldata }, + details + ); + return { declare: { ...declare }, deploy }; + } + async deployAccount({ + classHash, + constructorCalldata = [], + addressSalt = 0, + contractAddress: providedContractAddress + }, transactionsDetail = {}) { + const version = toBigInt(transactionVersion); + const nonce = ZERO; + const chainId = await this.getChainId(); + const compiledCalldata = CallData.compile(constructorCalldata); + const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0); + const maxFee = transactionsDetail.maxFee ?? await this.getSuggestedMaxFee( + { + type: "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */, + payload: { + classHash, + constructorCalldata: compiledCalldata, + addressSalt, + contractAddress + } + }, + transactionsDetail + ); + const signature = await this.signer.signDeployAccountTransaction({ + classHash, + constructorCalldata: compiledCalldata, + contractAddress, + addressSalt, + chainId, + maxFee, + version, + nonce + }); + return this.deployAccountContract( + { classHash, addressSalt, constructorCalldata, signature }, + { + nonce, + maxFee, + version + } + ); + } + async signMessage(typedData) { + return this.signer.signMessage(typedData, this.address); + } + async hashMessage(typedData) { + return getMessageHash(typedData, this.address); + } + async verifyMessageHash(hash, signature) { + try { + await this.callContract({ + contractAddress: this.address, + entrypoint: "isValidSignature", + calldata: CallData.compile({ + hash: toBigInt(hash).toString(), + signature: formatSignature(signature) + }) + }); + return true; + } catch { + return false; + } + } + async verifyMessage(typedData, signature) { + const hash = await this.hashMessage(typedData); + return this.verifyMessageHash(hash, signature); + } + async getSuggestedMaxFee({ type, payload }, details) { + let feeEstimate; + switch (type) { + case "INVOKE_FUNCTION" /* INVOKE */: + feeEstimate = await this.estimateInvokeFee(payload, details); + break; + case "DECLARE" /* DECLARE */: + feeEstimate = await this.estimateDeclareFee(payload, details); + break; + case "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */: + feeEstimate = await this.estimateAccountDeployFee(payload, details); + break; + case "DEPLOY" /* DEPLOY */: + feeEstimate = await this.estimateDeployFee(payload, details); + break; + default: + feeEstimate = { suggestedMaxFee: ZERO, overall_fee: ZERO }; + break; + } + return feeEstimate.suggestedMaxFee; + } + /** + * will be renamed to buildDeclareContractTransaction + */ + async buildDeclarePayload(payload, { nonce, chainId, version, walletAddress, maxFee }) { + const { classHash, contract, compiledClassHash } = extractContractHashes(payload); + const compressedCompiledContract = parseContract(contract); + const signature = await this.signer.signDeclareTransaction({ + classHash, + compiledClassHash, + senderAddress: walletAddress, + chainId, + maxFee, + version, + nonce + }); + return { + senderAddress: walletAddress, + signature, + contract: compressedCompiledContract, + compiledClassHash + }; + } + async buildAccountDeployPayload({ + classHash, + addressSalt = 0, + constructorCalldata = [], + contractAddress: providedContractAddress + }, { nonce, chainId, version, maxFee }) { + const compiledCalldata = CallData.compile(constructorCalldata); + const contractAddress = providedContractAddress ?? calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0); + const signature = await this.signer.signDeployAccountTransaction({ + classHash, + contractAddress, + chainId, + maxFee, + version, + nonce, + addressSalt, + constructorCalldata: compiledCalldata + }); + return { + classHash, + addressSalt, + constructorCalldata: compiledCalldata, + signature + }; + } + buildUDCContractPayload(payload) { + const calls = [].concat(payload).map((it) => { + const { + classHash, + salt = "0", + unique = true, + constructorCalldata = [] + } = it; + const compiledConstructorCallData = CallData.compile(constructorCalldata); + return { + contractAddress: UDC.ADDRESS, + entrypoint: UDC.ENTRYPOINT, + calldata: [ + classHash, + salt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData + ] + }; + }); + return calls; + } + async simulateTransaction(invocations, { nonce, blockIdentifier, skipValidate, skipExecute } = {}) { + const accountInvocations = await this.accountInvocationsFactory(invocations, { + versions: [transactionVersion, transactionVersion_2], + nonce, + blockIdentifier + }); + return super.getSimulateTransaction(accountInvocations, { + blockIdentifier, + skipValidate, + skipExecute + }); + } + async accountInvocationsFactory(invocations, { versions, nonce, blockIdentifier }) { + const version = versions[0]; + const safeNonce = await this.getNonceSafe(nonce); + const chainId = await this.getChainId(); + return Promise.all( + [].concat(invocations).map(async (transaction, index) => { + const signerDetails = { + walletAddress: this.address, + nonce: toBigInt(Number(safeNonce) + index), + maxFee: ZERO, + version, + chainId, + cairoVersion: this.cairoVersion + }; + const txPayload = "payload" in transaction ? transaction.payload : transaction; + const common = { + type: transaction.type, + version, + nonce: toBigInt(Number(safeNonce) + index), + blockIdentifier + }; + if (transaction.type === "INVOKE_FUNCTION" /* INVOKE */) { + const payload = await this.buildInvocation( + [].concat(txPayload), + signerDetails + ); + return { + ...common, + ...payload + }; + } + if (transaction.type === "DECLARE" /* DECLARE */) { + signerDetails.version = !isSierra(txPayload.contract) ? toBigInt(versions[0]) : toBigInt(versions[1]); + const payload = await this.buildDeclarePayload(txPayload, signerDetails); + return { + ...common, + ...payload, + version: signerDetails.version + }; + } + if (transaction.type === "DEPLOY_ACCOUNT" /* DEPLOY_ACCOUNT */) { + const payload = await this.buildAccountDeployPayload(txPayload, signerDetails); + return { + ...common, + ...payload + }; + } + if (transaction.type === "DEPLOY" /* DEPLOY */) { + const calls = this.buildUDCContractPayload(txPayload); + const payload = await this.buildInvocation(calls, signerDetails); + return { + ...common, + ...payload, + type: "INVOKE_FUNCTION" /* INVOKE */ + }; + } + throw Error(`accountInvocationsFactory: unsupported transaction type: ${transaction}`); + }) + ); + } + async getStarkName(address = this.address, StarknetIdContract2) { + return super.getStarkName(address, StarknetIdContract2); + } +}; + +// src/provider/interface.ts +var ProviderInterface = class { +}; + +// src/provider/index.ts +var defaultProvider = new Provider(); + +// src/account/interface.ts +var AccountInterface = class extends ProviderInterface { +}; + +// src/contract/default.ts +var splitArgsAndOptions = (args) => { + const options = [ + "blockIdentifier", + "parseRequest", + "parseResponse", + "formatResponse", + "maxFee", + "nonce", + "signature", + "addressSalt" + ]; + const lastArg = args[args.length - 1]; + if (typeof lastArg === "object" && options.some((x) => x in lastArg)) { + return { args, options: args.pop() }; + } + return { args }; +}; +function buildCall(contract, functionAbi) { + return async function(...args) { + const params = splitArgsAndOptions(args); + return contract.call(functionAbi.name, params.args, { + parseRequest: true, + parseResponse: true, + ...params.options + }); + }; +} +function buildInvoke(contract, functionAbi) { + return async function(...args) { + const params = splitArgsAndOptions(args); + return contract.invoke(functionAbi.name, params.args, { + parseRequest: true, + ...params.options + }); + }; +} +function buildDefault(contract, functionAbi) { + if (functionAbi.stateMutability === "view" || functionAbi.state_mutability === "view") { + return buildCall(contract, functionAbi); + } + return buildInvoke(contract, functionAbi); +} +function buildPopulate(contract, functionAbi) { + return function(...args) { + return contract.populate(functionAbi.name, args); + }; +} +function buildEstimate(contract, functionAbi) { + return function(...args) { + return contract.estimate(functionAbi.name, args); + }; +} +function getCalldata(args, callback) { + if (Array.isArray(args) && "__compiled__" in args) + return args; + if (Array.isArray(args) && Array.isArray(args[0]) && "__compiled__" in args[0]) + return args[0]; + return callback(); +} +var Contract = class { + /** + * Contract class to handle contract methods + * + * @param abi - Abi of the contract object + * @param address (optional) - address to connect to + * @param providerOrAccount (optional) - Provider or Account to attach to + */ + constructor(abi, address, providerOrAccount = defaultProvider) { + this.address = address && address.toLowerCase(); + this.providerOrAccount = providerOrAccount; + this.callData = new CallData(abi); + this.structs = CallData.getAbiStruct(abi); + const parser = createAbiParser(abi); + this.abi = parser.getLegacyFormat(); + const options = { enumerable: true, value: {}, writable: false }; + Object.defineProperties(this, { + functions: { enumerable: true, value: {}, writable: false }, + callStatic: { enumerable: true, value: {}, writable: false }, + populateTransaction: { enumerable: true, value: {}, writable: false }, + estimateFee: { enumerable: true, value: {}, writable: false } + }); + this.abi.forEach((abiElement) => { + if (abiElement.type !== "function") + return; + const signature = abiElement.name; + if (!this[signature]) { + Object.defineProperty(this, signature, { + ...options, + value: buildDefault(this, abiElement) + }); + } + if (!this.functions[signature]) { + Object.defineProperty(this.functions, signature, { + ...options, + value: buildDefault(this, abiElement) + }); + } + if (!this.callStatic[signature]) { + Object.defineProperty(this.callStatic, signature, { + ...options, + value: buildCall(this, abiElement) + }); + } + if (!this.populateTransaction[signature]) { + Object.defineProperty(this.populateTransaction, signature, { + ...options, + value: buildPopulate(this, abiElement) + }); + } + if (!this.estimateFee[signature]) { + Object.defineProperty(this.estimateFee, signature, { + ...options, + value: buildEstimate(this, abiElement) + }); + } + }); + } + attach(address) { + this.address = address; + } + connect(providerOrAccount) { + this.providerOrAccount = providerOrAccount; + } + async deployed() { + if (this.deployTransactionHash) { + await this.providerOrAccount.waitForTransaction(this.deployTransactionHash); + this.deployTransactionHash = void 0; + } + return this; + } + async call(method, args = [], { + parseRequest = true, + parseResponse = true, + formatResponse = void 0, + blockIdentifier = void 0 + } = {}) { + assert(this.address !== null, "contract is not connected to an address"); + const calldata = getCalldata(args, () => { + if (parseRequest) { + this.callData.validate("CALL" /* CALL */, method, args); + return this.callData.compile(method, args); + } + console.warn("Call skipped parsing but provided rawArgs, possible malfunction request"); + return args; + }); + return this.providerOrAccount.callContract( + { + contractAddress: this.address, + calldata, + entrypoint: method + }, + blockIdentifier + ).then((x) => { + if (!parseResponse) { + return x.result; + } + if (formatResponse) { + return this.callData.format(method, x.result, formatResponse); + } + return this.callData.parse(method, x.result); + }); + } + invoke(method, args = [], { parseRequest = true, maxFee, nonce, signature } = {}) { + assert(this.address !== null, "contract is not connected to an address"); + const calldata = getCalldata(args, () => { + if (parseRequest) { + this.callData.validate("INVOKE" /* INVOKE */, method, args); + return this.callData.compile(method, args); + } + console.warn("Invoke skipped parsing but provided rawArgs, possible malfunction request"); + return args; + }); + const invocation = { + contractAddress: this.address, + calldata, + entrypoint: method + }; + if ("execute" in this.providerOrAccount) { + return this.providerOrAccount.execute(invocation, void 0, { + maxFee, + nonce + }); + } + if (!nonce) + throw new Error(`Nonce is required when invoking a function without an account`); + console.warn(`Invoking ${method} without an account. This will not work on a public node.`); + return this.providerOrAccount.invokeFunction( + { + ...invocation, + signature + }, + { + nonce + } + ); + } + async estimate(method, args = []) { + assert(this.address !== null, "contract is not connected to an address"); + if (!getCalldata(args, () => false)) { + this.callData.validate("INVOKE" /* INVOKE */, method, args); + } + const invocation = this.populate(method, args); + if ("estimateInvokeFee" in this.providerOrAccount) { + return this.providerOrAccount.estimateInvokeFee(invocation); + } + throw Error("Contract must be connected to the account contract to estimate"); + } + populate(method, args = []) { + const calldata = getCalldata(args, () => this.callData.compile(method, args)); + return { + contractAddress: this.address, + entrypoint: method, + calldata + }; + } + isCairo1() { + return cairo_exports.isCairo1Abi(this.abi); + } +}; + +// src/contract/interface.ts +var ContractInterface = class { +}; + +// src/contract/contractFactory.ts +var ContractFactory = class { + /** + * @param params CFParams + * - compiledContract: CompiledContract; + * - account: AccountInterface; + * - casm?: CairoAssembly; + * - classHash?: string; + * - compiledClassHash?: string; + * - abi?: Abi; + */ + constructor(params) { + this.compiledContract = params.compiledContract; + this.account = params.account; + this.casm = params.casm; + this.abi = params.abi ?? params.compiledContract.abi; + this.classHash = params.classHash; + this.compiledClassHash = params.compiledClassHash; + this.CallData = new CallData(this.abi); + } + /** + * Deploys contract and returns new instance of the Contract + * If contract is not declared it will first declare it, and then deploy + * + * @param args - Array of the constructor arguments for deployment + * @param options (optional) Object - parseRequest, parseResponse, addressSalt + * @returns deployed Contract + */ + async deploy(...args) { + const { args: param, options = { parseRequest: true } } = splitArgsAndOptions(args); + const constructorCalldata = getCalldata(param, () => { + if (options.parseRequest) { + this.CallData.validate("DEPLOY" /* DEPLOY */, "constructor", param); + return this.CallData.compile("constructor", param); + } + console.warn("Call skipped parsing but provided rawArgs, possible malfunction request"); + return param; + }); + const { + deploy: { contract_address, transaction_hash } + } = await this.account.declareAndDeploy({ + contract: this.compiledContract, + casm: this.casm, + classHash: this.classHash, + compiledClassHash: this.compiledClassHash, + constructorCalldata, + salt: options.addressSalt + }); + assert(Boolean(contract_address), "Deployment of the contract failed"); + const contractInstance = new Contract( + this.compiledContract.abi, + contract_address, + this.account + ); + contractInstance.deployTransactionHash = transaction_hash; + return contractInstance; + } + /** + * Attaches to new Account + * + * @param account - new Provider or Account to attach to + * @returns ContractFactory + */ + connect(account) { + this.account = account; + return this; + } + /** + * Attaches current abi and account to the new address + * + * @param address - Contract address + * @returns Contract + */ + attach(address) { + return new Contract(this.abi, address, this.account); + } + // ethers.js' getDeployTransaction cant be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation +}; + +// src/utils/address.ts +import { hexToBytes as hexToBytes2 } from "@noble/curves/abstract/utils"; +function addAddressPadding(address) { + return addHexPrefix(removeHexPrefix(toHex(address)).padStart(64, "0")); +} +function validateAndParseAddress(address) { + assertInRange(address, ZERO, MASK_251, "Starknet Address"); + const result = addAddressPadding(address); + if (!result.match(/^(0x)?[0-9a-fA-F]{64}$/)) { + throw new Error("Invalid Address Format"); + } + return result; +} +function getChecksumAddress(address) { + const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split(""); + const hex = removeHexPrefix(keccakBn(address)); + const hashed = hexToBytes2(hex.padStart(64, "0")); + for (let i = 0; i < chars.length; i += 2) { + if (hashed[i >> 1] >> 4 >= 8) { + chars[i] = chars[i].toUpperCase(); + } + if ((hashed[i >> 1] & 15) >= 8) { + chars[i + 1] = chars[i + 1].toUpperCase(); + } + } + return addHexPrefix(chars.join("")); +} +function validateChecksumAddress(address) { + return getChecksumAddress(address) === address; +} + +// src/index.ts +var number = num_exports; +export { + Account, + AccountInterface, + BlockStatus, + BlockTag, + CallData, + Contract, + ContractFactory, + ContractInterface, + CustomError, + EntryPointType, + GatewayError, + HttpError, + LibraryError, + Provider, + ProviderInterface, + rpc_exports as RPC, + RpcProvider, + SIMULATION_FLAG, + sequencer_exports as Sequencer, + SequencerProvider, + Signer, + SignerInterface, + TransactionStatus, + TransactionType, + Uint, + ValidateType, + addAddressPadding, + buildUrl, + cairo_exports as cairo, + constants_exports as constants, + contractClassResponseToLegacyCompiledContract, + defaultProvider, + ec_exports as ec, + encode_exports as encode, + extractContractHashes, + fixProto, + fixStack, + getCalldata, + getChecksumAddress, + hash_exports as hash, + isSierra, + isUrl, + json_exports as json, + merkle_exports as merkle, + num_exports as num, + number, + parseUDCEvent, + provider_exports as provider, + selector_exports as selector, + shortString_exports as shortString, + splitArgsAndOptions, + stark_exports as stark, + starknetId_exports as starknetId, + transaction_exports as transaction, + typedData_exports as typedData, + types_exports as types, + uint256_exports as uint256, + validateAndParseAddress, + validateChecksumAddress +}; +//# sourceMappingURL=index.mjs.map \ No newline at end of file diff --git a/web/lib/starknet-estfee-tx-ver/dist/index.mjs.map b/web/lib/starknet-estfee-tx-ver/dist/index.mjs.map new file mode 100644 index 000000000..0910d4d8b --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/constants.ts","../src/utils/encode.ts","../src/types/index.ts","../src/types/account.ts","../src/types/calldata.ts","../src/types/lib/contract/index.ts","../src/types/lib/index.ts","../src/types/api/rpc.ts","../src/types/api/sequencer.ts","../src/utils/assert.ts","../src/utils/num.ts","../src/utils/selector.ts","../src/utils/shortString.ts","../src/utils/calldata/cairo.ts","../src/utils/uint256.ts","../src/utils/calldata/formatter.ts","../src/utils/calldata/parser/parser-0-1.1.0.ts","../src/utils/calldata/parser/parser-2.0.0.ts","../src/utils/calldata/parser/index.ts","../src/utils/calldata/tuple.ts","../src/utils/calldata/propertyOrder.ts","../src/utils/calldata/requestParser.ts","../src/utils/calldata/responseParser.ts","../src/utils/calldata/validate.ts","../src/utils/calldata/index.ts","../src/utils/hash.ts","../src/utils/ec.ts","../src/utils/json.ts","../src/utils/stark.ts","../src/utils/contract.ts","../src/utils/fetchPonyfill.ts","../src/utils/provider.ts","../src/utils/responseParser/rpc.ts","../src/provider/errors.ts","../src/utils/starknetId.ts","../src/provider/starknetId.ts","../src/provider/utils.ts","../src/provider/rpc.ts","../src/provider/sequencer.ts","../src/utils/responseParser/index.ts","../src/utils/responseParser/sequencer.ts","../src/utils/url.ts","../src/provider/default.ts","../src/signer/interface.ts","../src/utils/transaction.ts","../src/utils/typedData.ts","../src/utils/merkle.ts","../src/signer/default.ts","../src/utils/events.ts","../src/account/default.ts","../src/provider/interface.ts","../src/provider/index.ts","../src/account/interface.ts","../src/contract/default.ts","../src/contract/interface.ts","../src/contract/contractFactory.ts","../src/utils/address.ts","../src/index.ts"],"sourcesContent":["export { IS_BROWSER } from './utils/encode';\n\nexport const ZERO = 0n;\nexport const MASK_250 = 2n ** 250n - 1n; // 2 ** 250 - 1\nexport const MASK_251 = 2n ** 251n;\nexport const API_VERSION = ZERO;\n\nexport enum BaseUrl {\n SN_MAIN = 'https://alpha-mainnet.starknet.io',\n SN_GOERLI = 'https://alpha4.starknet.io',\n SN_GOERLI2 = 'https://alpha4-2.starknet.io',\n}\n\nexport enum NetworkName {\n SN_MAIN = 'SN_MAIN',\n SN_GOERLI = 'SN_GOERLI',\n SN_GOERLI2 = 'SN_GOERLI2',\n}\n\nexport enum StarknetChainId {\n SN_MAIN = '0x534e5f4d41494e', // encodeShortString('SN_MAIN'),\n SN_GOERLI = '0x534e5f474f45524c49', // encodeShortString('SN_GOERLI'),\n SN_GOERLI2 = '0x534e5f474f45524c4932', // encodeShortString('SN_GOERLI2'),\n}\n\nexport enum TransactionHashPrefix {\n DECLARE = '0x6465636c617265', // encodeShortString('declare'),\n DEPLOY = '0x6465706c6f79', // encodeShortString('deploy'),\n DEPLOY_ACCOUNT = '0x6465706c6f795f6163636f756e74', // encodeShortString('deploy_account'),\n INVOKE = '0x696e766f6b65', // encodeShortString('invoke'),\n L1_HANDLER = '0x6c315f68616e646c6572', // encodeShortString('l1_handler'),\n}\n\nexport const UDC = {\n ADDRESS: '0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf',\n ENTRYPOINT: 'deployContract',\n};\n\n/**\n * The following is taken from https://github.com/starkware-libs/starkex-resources/blob/master/crypto/starkware/crypto/signature/pedersen_params.json but converted to hex, because JS is very bad handling big integers by default\n * Please do not edit until the JSON changes.\n */\nexport const FIELD_PRIME = '800000000000011000000000000000000000000000000000000000000000001';\nexport const FIELD_GEN = '3';\nexport const FIELD_SIZE = 251;\nexport const EC_ORDER = '800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F';\nexport const ALPHA = '1';\nexport const BETA = '6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89';\nexport const MAX_ECDSA_VAL = '800000000000000000000000000000000000000000000000000000000000000';\nexport const CONSTANT_POINTS = [\n [\n '49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804',\n '3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a',\n ],\n [\n '1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca',\n '5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f',\n ],\n [\n '234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b',\n '3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615',\n ],\n [\n '3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476',\n '7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19',\n ],\n [\n '40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c',\n '109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740',\n ],\n [\n '2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b',\n '6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26',\n ],\n [\n '6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674',\n '606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2',\n ],\n [\n '7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62',\n 'a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae',\n ],\n [\n '3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec',\n '45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9',\n ],\n [\n '1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e',\n '30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a',\n ],\n [\n '6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26',\n '31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2',\n ],\n [\n '54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4',\n 'c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5',\n ],\n [\n '35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6',\n '5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d',\n ],\n [\n '4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23',\n '5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820',\n ],\n [\n '648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf',\n '72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c',\n ],\n [\n 'bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b',\n '6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6',\n ],\n [\n '35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357',\n '3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14',\n ],\n [\n '36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643',\n '7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c',\n ],\n [\n '5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661',\n '9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753',\n ],\n [\n '21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6',\n '51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c',\n ],\n [\n '19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9',\n '515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa',\n ],\n [\n '888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24',\n '730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea',\n ],\n [\n '75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977',\n '4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8',\n ],\n [\n '640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5',\n '3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c',\n ],\n [\n '6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96',\n '7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645',\n ],\n [\n '5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876',\n '518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200',\n ],\n [\n '6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4',\n '2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc',\n ],\n [\n '542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18',\n '5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c',\n ],\n [\n '299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de',\n '1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958',\n ],\n [\n '628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73',\n 'ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d',\n ],\n [\n '6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933',\n '6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db',\n ],\n [\n '28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a',\n '7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba',\n ],\n [\n '619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02',\n '2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308',\n ],\n [\n '641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96',\n '6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837',\n ],\n [\n '58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2',\n '124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9',\n ],\n [\n 'a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74',\n '1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8',\n ],\n [\n '744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b',\n '7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f',\n ],\n [\n '434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c',\n '7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39',\n ],\n [\n '7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73',\n '56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431',\n ],\n [\n '4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7',\n 'ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e',\n ],\n [\n '250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe',\n '1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04',\n ],\n [\n '2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2',\n '55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63',\n ],\n [\n '249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245',\n '7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e',\n ],\n [\n '6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb',\n '640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8',\n ],\n [\n '2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9',\n '636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be',\n ],\n [\n '4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea',\n '1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff',\n ],\n [\n '46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca',\n '1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f',\n ],\n [\n '2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152',\n '1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7',\n ],\n [\n '386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b',\n '2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5',\n ],\n [\n '407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90',\n '436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f',\n ],\n [\n '1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f',\n '69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec',\n ],\n [\n '7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e',\n '34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69',\n ],\n [\n '299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913',\n 'b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675',\n ],\n [\n '551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5',\n '5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e',\n ],\n [\n '7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2',\n '3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6',\n ],\n [\n '28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504',\n '7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b',\n ],\n [\n '1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b',\n '4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4',\n ],\n [\n '2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b',\n '9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911',\n ],\n [\n '770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed',\n '42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd',\n ],\n [\n '5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9',\n '3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d',\n ],\n [\n '6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825',\n '1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177',\n ],\n [\n '404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1',\n '3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb',\n ],\n [\n '20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc',\n '106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7',\n ],\n [\n '119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa',\n '1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773',\n ],\n [\n '45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749',\n 'ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965',\n ],\n [\n '1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38',\n '593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f',\n ],\n [\n '186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3',\n '55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c',\n ],\n [\n '58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9',\n '6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0',\n ],\n [\n '13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b',\n '3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4',\n ],\n [\n '48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676',\n '4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1',\n ],\n [\n '4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158',\n '620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef',\n ],\n [\n '4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b',\n '4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8',\n ],\n [\n '7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9',\n '2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de',\n ],\n [\n '65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f',\n '3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6',\n ],\n [\n '1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d',\n '21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a',\n ],\n [\n '3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b',\n '5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f',\n ],\n [\n '4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4',\n '5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b',\n ],\n [\n '6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8',\n 'e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9',\n ],\n [\n '748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5',\n '3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93',\n ],\n [\n '7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3',\n '5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4',\n ],\n [\n '6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f',\n '32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039',\n ],\n [\n '1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309',\n '56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4',\n ],\n [\n '1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd',\n '431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c',\n ],\n [\n '6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162',\n '14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3',\n ],\n [\n '738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e',\n '33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47',\n ],\n [\n '2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8',\n '92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc',\n ],\n [\n '181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe',\n '5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff',\n ],\n [\n '1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a',\n '4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f',\n ],\n [\n 'e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873',\n '34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f',\n ],\n [\n '4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45',\n '3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af',\n ],\n [\n '37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed',\n '37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6',\n ],\n [\n '27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c',\n '6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d',\n ],\n [\n '2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf',\n '306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413',\n ],\n [\n '307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72',\n '3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995',\n ],\n [\n '79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc',\n '40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2',\n ],\n [\n '4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292',\n '7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717',\n ],\n [\n '645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2',\n '15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab',\n ],\n [\n '1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f',\n '583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c',\n ],\n [\n '66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca',\n '505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4',\n ],\n [\n '5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1',\n 'bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323',\n ],\n [\n 'a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194',\n '4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689',\n ],\n [\n '1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c',\n '7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf',\n ],\n [\n '48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f',\n '781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3',\n ],\n [\n '17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd',\n '6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223',\n ],\n [\n '5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89',\n '1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff',\n ],\n [\n '6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58',\n '436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e',\n ],\n [\n '7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6',\n '484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4',\n ],\n [\n '17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d',\n '7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f',\n ],\n [\n '7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf',\n '33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78',\n ],\n [\n '7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d',\n '6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb',\n ],\n [\n '273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128',\n '653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f',\n ],\n [\n '3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212',\n '65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e',\n ],\n [\n '5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee',\n '3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22',\n ],\n [\n '7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9',\n '71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e',\n ],\n [\n '40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62',\n '499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42',\n ],\n [\n '6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465',\n '35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37',\n ],\n [\n '604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6',\n '68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457',\n ],\n [\n '73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4',\n '4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb',\n ],\n [\n '3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1',\n '677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0',\n ],\n [\n '39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f',\n '20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952',\n ],\n [\n '326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c',\n '7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1',\n ],\n [\n '53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632',\n '2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1',\n ],\n [\n '6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e',\n 'beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63',\n ],\n [\n '3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332',\n '529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7',\n ],\n [\n '3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e',\n '3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740',\n ],\n [\n '7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a',\n '68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400',\n ],\n [\n '1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb',\n '5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9',\n ],\n [\n '3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344',\n '52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590',\n ],\n [\n '44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa',\n '6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940',\n ],\n [\n '7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e',\n '78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9',\n ],\n [\n '7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d',\n '4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62',\n ],\n [\n '7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c',\n '636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84',\n ],\n [\n '758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2',\n '1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245',\n ],\n [\n '7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e',\n '229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470',\n ],\n [\n '78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614',\n '246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675',\n ],\n [\n '6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647',\n '599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4',\n ],\n [\n '4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e',\n '1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad',\n ],\n [\n '3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d',\n '617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c',\n ],\n [\n '5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287',\n '1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d',\n ],\n [\n '3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004',\n '7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232',\n ],\n [\n '3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb',\n '563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6',\n ],\n [\n '16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52',\n '7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e',\n ],\n [\n '75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4',\n '35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0',\n ],\n [\n '3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8',\n '6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd',\n ],\n [\n '54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579',\n '7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0',\n ],\n [\n 'd1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0',\n '2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45',\n ],\n [\n '2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d',\n '70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b',\n ],\n [\n '752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3',\n '3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef',\n ],\n [\n '63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e',\n '37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e',\n ],\n [\n 'd6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b',\n '5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018',\n ],\n [\n '12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557',\n '6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613',\n ],\n [\n '46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c',\n '76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df',\n ],\n [\n '4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516',\n '5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29',\n ],\n [\n '71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833',\n '85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346',\n ],\n [\n '5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61',\n '3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950',\n ],\n [\n '161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941',\n '78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b',\n ],\n [\n '1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1',\n '66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d',\n ],\n [\n '56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44',\n '47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e',\n ],\n [\n '4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491',\n '430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4',\n ],\n [\n '7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606',\n '312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295',\n ],\n [\n '16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe',\n '7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24',\n ],\n [\n '323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b',\n '4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265',\n ],\n [\n '624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d',\n '261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430',\n ],\n [\n 'f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d',\n 'b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6',\n ],\n [\n '686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec',\n '7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6',\n ],\n [\n '3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e',\n '634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af',\n ],\n [\n '484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b',\n '34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8',\n ],\n [\n '203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a',\n '2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2',\n ],\n [\n '2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d',\n '6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6',\n ],\n [\n '5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef',\n '30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d',\n ],\n [\n '57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741',\n '7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad',\n ],\n [\n '611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1',\n '3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4',\n ],\n [\n '1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31',\n '3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527',\n ],\n [\n '275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234',\n '2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521',\n ],\n [\n '6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95',\n '5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e',\n ],\n [\n '44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c',\n '3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e',\n ],\n [\n 'fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966',\n '110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9',\n ],\n [\n '9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef',\n '4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51',\n ],\n [\n '71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7',\n '7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9',\n ],\n [\n '1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345',\n '4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc',\n ],\n [\n '3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115',\n 'a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24',\n ],\n [\n 'c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d',\n '729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d',\n ],\n [\n '44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d',\n '212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8',\n ],\n [\n '35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f',\n '74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62',\n ],\n [\n 'e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03',\n '3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357',\n ],\n [\n '3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a',\n '5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df',\n ],\n [\n '222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c',\n '72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42',\n ],\n [\n '3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764',\n '480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c',\n ],\n [\n 'adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187',\n '60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8',\n ],\n [\n '3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9',\n '7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996',\n ],\n [\n '12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32',\n '6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1',\n ],\n [\n '27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b',\n 'c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917',\n ],\n [\n '431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6',\n '30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197',\n ],\n [\n '4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33',\n '627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c',\n ],\n [\n '2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8',\n '1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f',\n ],\n [\n 'e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc',\n '58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9',\n ],\n [\n '7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5',\n '74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1',\n ],\n [\n '62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b',\n '1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315',\n ],\n [\n '1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938',\n '44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b',\n ],\n [\n '78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea',\n '6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41',\n ],\n [\n '5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d',\n '1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb',\n ],\n [\n '62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04',\n '6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f',\n ],\n [\n '4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f',\n '941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494',\n ],\n [\n '52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1',\n '987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782',\n ],\n [\n '1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f',\n '38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b',\n ],\n [\n '4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232',\n '7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c',\n ],\n [\n '69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73',\n 'a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897',\n ],\n [\n 'b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62',\n '24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915',\n ],\n [\n '5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb',\n '6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9',\n ],\n [\n '1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0',\n '23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699',\n ],\n [\n '2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5',\n '1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862',\n ],\n [\n 'd26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3',\n '34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a',\n ],\n [\n '91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563',\n 'e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a',\n ],\n [\n '1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7',\n '7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd',\n ],\n [\n '4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f',\n '47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e',\n ],\n [\n '3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069',\n '47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc',\n ],\n [\n '758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657',\n '3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83',\n ],\n [\n '19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8',\n '5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709',\n ],\n [\n '28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855',\n '14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2',\n ],\n [\n '3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f',\n '69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d',\n ],\n [\n '77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b',\n '7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df',\n ],\n [\n '97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6',\n '2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223',\n ],\n [\n 'a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647',\n '37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2',\n ],\n [\n 'e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc',\n '1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a',\n ],\n [\n '2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de',\n '6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591',\n ],\n [\n '744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f',\n '685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d',\n ],\n [\n '40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd',\n '2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e',\n ],\n [\n '5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc',\n '2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2',\n ],\n [\n '5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985',\n '49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183',\n ],\n [\n '2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649',\n '61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d',\n ],\n [\n 'ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381',\n '190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60',\n ],\n [\n '233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c',\n '7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef',\n ],\n [\n '42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce',\n '12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65',\n ],\n [\n '30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44',\n '5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a',\n ],\n [\n '4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a',\n '4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93',\n ],\n [\n '62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466',\n '5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0',\n ],\n [\n '5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f',\n '5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94',\n ],\n [\n '670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728',\n '26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0',\n ],\n [\n '3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5',\n '56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015',\n ],\n [\n '4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3',\n '1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e',\n ],\n [\n '4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0',\n '97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09',\n ],\n [\n '574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219',\n '49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8',\n ],\n [\n '7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554',\n '47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba',\n ],\n [\n '67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6',\n '39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8',\n ],\n [\n '63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b',\n '60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9',\n ],\n [\n '3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543',\n '56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628',\n ],\n [\n '758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129',\n '622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746',\n ],\n [\n '38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c',\n '145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e',\n ],\n [\n '206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad',\n '6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8',\n ],\n [\n '56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d',\n '526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6',\n ],\n [\n '4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378',\n '3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d',\n ],\n [\n '450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58',\n '1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7',\n ],\n [\n '6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d',\n '28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2',\n ],\n [\n '1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf',\n 'fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb',\n ],\n [\n '4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997',\n '40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c',\n ],\n [\n '21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef',\n '4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f',\n ],\n [\n '350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046',\n '5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b',\n ],\n [\n '529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6',\n '3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491',\n ],\n [\n '55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d',\n '159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9',\n ],\n [\n '405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f',\n '4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d',\n ],\n [\n '376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe',\n '5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba',\n ],\n [\n '2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38',\n '7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089',\n ],\n [\n '3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed',\n '5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5',\n ],\n [\n '7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4',\n '3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe',\n ],\n [\n '4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d',\n '204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89',\n ],\n [\n '79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72',\n '3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb',\n ],\n [\n '297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c',\n '6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993',\n ],\n [\n '44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7',\n '1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc',\n ],\n [\n '6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26',\n '64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd',\n ],\n [\n '14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24',\n '5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1',\n ],\n [\n '95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83',\n '1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1',\n ],\n [\n '2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5',\n '5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67',\n ],\n [\n '61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d',\n '23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795',\n ],\n [\n '79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf',\n '2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6',\n ],\n [\n '45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b',\n '2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd',\n ],\n [\n '37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007',\n '50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c',\n ],\n [\n '71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b',\n '3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6',\n ],\n [\n '78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06',\n '5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256',\n ],\n [\n 'b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15',\n '653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83',\n ],\n [\n '441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc',\n '4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59',\n ],\n [\n '2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa',\n '4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0',\n ],\n [\n '3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f',\n '4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c',\n ],\n [\n '5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092',\n '5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56',\n ],\n [\n '3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771',\n '459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999',\n ],\n [\n '5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f',\n '56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49',\n ],\n [\n '1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281',\n '5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a',\n ],\n [\n '1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40',\n '6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488',\n ],\n [\n '61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b',\n '27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad',\n ],\n [\n '7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e',\n '481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf',\n ],\n [\n '124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316',\n '33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987',\n ],\n [\n '61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c',\n '5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb',\n ],\n [\n '70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d',\n '3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc',\n ],\n [\n '41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f',\n '7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce',\n ],\n [\n '62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8',\n '1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771',\n ],\n [\n '441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a',\n '29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086',\n ],\n [\n '2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee',\n '11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77',\n ],\n [\n '5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea',\n '63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc',\n ],\n [\n '3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7',\n '7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092',\n ],\n [\n '95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922',\n '159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9',\n ],\n [\n '621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c',\n '65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd',\n ],\n [\n '54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e',\n '680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313',\n ],\n [\n '21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d',\n '7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8',\n ],\n [\n '3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3',\n '12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801',\n ],\n [\n 'befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392',\n '6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8',\n ],\n [\n '15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6',\n '30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df',\n ],\n [\n '38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8',\n '786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13',\n ],\n [\n '6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72',\n '1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a',\n ],\n [\n '5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30',\n '1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea',\n ],\n [\n '309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1',\n '505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851',\n ],\n [\n '89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc',\n '1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540',\n ],\n [\n '480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84',\n '511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570',\n ],\n [\n '3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb',\n '49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920',\n ],\n [\n '66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd',\n '4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b',\n ],\n [\n '373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3',\n '5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c',\n ],\n [\n '26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7',\n '157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc',\n ],\n [\n 'ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f',\n '517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7',\n ],\n [\n '25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66',\n '10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8',\n ],\n [\n '243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742',\n '1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f',\n ],\n [\n '48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562',\n '3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264',\n ],\n [\n '592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca',\n '48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc',\n ],\n [\n '31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d',\n 'a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5',\n ],\n [\n '4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc',\n '512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47',\n ],\n [\n '26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc',\n '75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e',\n ],\n [\n '3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe',\n '20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d',\n ],\n [\n '483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97',\n '2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d',\n ],\n [\n '65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9',\n '562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373',\n ],\n [\n '284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35',\n '5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02',\n ],\n [\n '32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85',\n '7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd',\n ],\n [\n '1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a',\n '478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742',\n ],\n [\n '270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf',\n '3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b',\n ],\n [\n '6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d',\n '5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33',\n ],\n [\n '48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1',\n '2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0',\n ],\n [\n 'e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5',\n '36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997',\n ],\n [\n '5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8',\n '6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c',\n ],\n [\n '15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6',\n '69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903',\n ],\n [\n '274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50',\n '6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656',\n ],\n [\n '4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123',\n '116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba',\n ],\n [\n '4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a',\n '2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f',\n ],\n [\n '5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3',\n '4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b',\n ],\n [\n '11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483',\n '36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8',\n ],\n [\n '4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3',\n 'e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64',\n ],\n [\n '2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3',\n '527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d',\n ],\n [\n '52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf',\n '19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41',\n ],\n [\n '541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961',\n '78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2',\n ],\n [\n '5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd',\n '137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc',\n ],\n [\n '15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4',\n '4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549',\n ],\n [\n '68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4',\n '7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f',\n ],\n [\n '67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df',\n '7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01',\n ],\n [\n '596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334',\n '49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0',\n ],\n [\n '567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395',\n '6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd',\n ],\n [\n 'cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7',\n '4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7',\n ],\n [\n '4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06',\n '2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566',\n ],\n [\n '760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359',\n '1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e',\n ],\n [\n '6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2',\n '3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd',\n ],\n [\n '4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b',\n '2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f',\n ],\n [\n '5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7',\n '76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39',\n ],\n [\n '2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7',\n '62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e',\n ],\n [\n '5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00',\n '14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1',\n ],\n [\n '7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c',\n 'bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970',\n ],\n [\n '37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843',\n '672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb',\n ],\n [\n '5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114',\n '7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e',\n ],\n [\n '25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63',\n '3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb',\n ],\n [\n '32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0',\n 'bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459',\n ],\n [\n '49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f',\n '57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8',\n ],\n [\n '10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd',\n '8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0',\n ],\n [\n '79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36',\n '146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c',\n ],\n [\n '6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439',\n '68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82',\n ],\n [\n '71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097',\n '54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c',\n ],\n [\n '27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b',\n '14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3',\n ],\n [\n '6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c',\n '5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048',\n ],\n [\n '32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9',\n '518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4',\n ],\n [\n '4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e',\n '3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4',\n ],\n [\n '4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10',\n '20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918',\n ],\n [\n '87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a',\n '112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb',\n ],\n [\n '6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae',\n '54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1',\n ],\n [\n '19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a',\n '1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510',\n ],\n [\n '12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d',\n '4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7',\n ],\n [\n '13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2',\n '40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1',\n ],\n [\n '255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d',\n '3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc',\n ],\n [\n '7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31',\n '4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6',\n ],\n [\n '2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35',\n '44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf',\n ],\n [\n '750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b',\n '54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c',\n ],\n [\n '3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72',\n '7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359',\n ],\n [\n '4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb',\n '63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235',\n ],\n [\n '1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f',\n '4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d',\n ],\n [\n '2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087',\n '2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d',\n ],\n [\n '4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3',\n '5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621',\n ],\n [\n '2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05',\n '1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19',\n ],\n [\n '4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c',\n '33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614',\n ],\n [\n '7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b',\n '5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722',\n ],\n [\n '7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51',\n '26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056',\n ],\n [\n '36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881',\n '33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5',\n ],\n [\n '403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd',\n '47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5',\n ],\n [\n '3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb',\n '2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e',\n ],\n [\n '3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537',\n 'f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4',\n ],\n [\n '235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65',\n '37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5',\n ],\n [\n '3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b',\n '4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe',\n ],\n [\n '48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518',\n '73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee',\n ],\n [\n '48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0',\n '3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903',\n ],\n [\n '2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097',\n '19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541',\n ],\n [\n '1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676',\n '36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7',\n ],\n [\n '2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b',\n '7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b',\n ],\n [\n '348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a',\n '3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969',\n ],\n [\n '7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31',\n '42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd',\n ],\n [\n '2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a',\n '5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83',\n ],\n [\n '1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2',\n 'dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d',\n ],\n [\n '54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e',\n '16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089',\n ],\n [\n '525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b',\n '58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea',\n ],\n [\n '54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd',\n '53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76',\n ],\n [\n '4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae',\n '2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17',\n ],\n [\n '21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708',\n '59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c',\n ],\n [\n '167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66',\n '22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a',\n ],\n [\n '31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843',\n '1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c',\n ],\n [\n '1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b',\n '2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b',\n ],\n [\n 'c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0',\n '45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327',\n ],\n [\n '394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6',\n '1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd',\n ],\n [\n '410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27',\n '361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa',\n ],\n [\n '38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734',\n '624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1',\n ],\n [\n '78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608',\n '19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198',\n ],\n [\n '6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867',\n '7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb',\n ],\n [\n '32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602',\n '3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377',\n ],\n [\n '49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5',\n '1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d',\n ],\n [\n '2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5',\n '759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96',\n ],\n [\n '3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70',\n '22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6',\n ],\n [\n '5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab',\n '715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8',\n ],\n [\n '19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a',\n '896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5',\n ],\n [\n '61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc',\n '38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8',\n ],\n [\n '2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df',\n '1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb',\n ],\n [\n '7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54',\n '21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b',\n ],\n [\n 'b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed',\n '5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf',\n ],\n [\n 'e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc',\n '550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a',\n ],\n [\n '7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4',\n '2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f',\n ],\n [\n '7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c',\n '410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e',\n ],\n [\n '225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5',\n '411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e',\n ],\n [\n '1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1',\n '3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8',\n ],\n [\n '59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335',\n '1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8',\n ],\n [\n '2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3',\n '62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535',\n ],\n [\n '6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb',\n '7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f',\n ],\n [\n '34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88',\n '3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d',\n ],\n [\n '436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d',\n '67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044',\n ],\n [\n '592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4',\n '27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5',\n ],\n [\n '89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009',\n '557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b',\n ],\n [\n '1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e',\n '72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a',\n ],\n [\n '574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03',\n '5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3',\n ],\n [\n '513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1',\n '687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5',\n ],\n [\n '53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9',\n '35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be',\n ],\n [\n '213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44',\n '744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89',\n ],\n [\n '735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c',\n '7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9',\n ],\n [\n '3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001',\n '79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8',\n ],\n [\n '51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74',\n '10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad',\n ],\n [\n 'c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc',\n '53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a',\n ],\n [\n '5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece',\n '39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f',\n ],\n [\n '3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299',\n '15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975',\n ],\n [\n '6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0',\n '11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744',\n ],\n [\n '7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65',\n '3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb',\n ],\n [\n '2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6',\n '461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d',\n ],\n [\n '34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f',\n '33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44',\n ],\n [\n '6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441',\n '6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693',\n ],\n [\n '17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce',\n '3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7',\n ],\n [\n '70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27',\n 'd18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8',\n ],\n [\n '2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf',\n '5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1',\n ],\n [\n '5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1',\n 'eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487',\n ],\n [\n '6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61',\n '911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984',\n ],\n [\n '74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293',\n '761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92',\n ],\n [\n '44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9',\n '249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0',\n ],\n [\n '2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc',\n '6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5',\n ],\n [\n '3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb',\n '6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb',\n ],\n [\n '284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677',\n '516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7',\n ],\n [\n '2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32',\n '7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec',\n ],\n [\n '5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7',\n '6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece',\n ],\n [\n '74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f',\n '156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531',\n ],\n [\n '334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45',\n '221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2',\n ],\n [\n '7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30',\n '3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86',\n ],\n [\n '4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8',\n '6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749',\n ],\n [\n '1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7',\n '3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583',\n ],\n [\n '294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1',\n 'd837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad',\n ],\n [\n '753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39',\n '6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75',\n ],\n [\n '5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e',\n '7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8',\n ],\n [\n '4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f',\n '21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e',\n ],\n [\n '726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8',\n '15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12',\n ],\n [\n '38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2',\n '73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b',\n ],\n [\n '6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291',\n '4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75',\n ],\n [\n '6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f',\n '26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05',\n ],\n [\n '2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155',\n '5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244',\n ],\n [\n '4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7',\n '5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1',\n ],\n [\n '110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3',\n '7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43',\n ],\n [\n '5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096',\n '7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2',\n ],\n [\n '2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d',\n '62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b',\n ],\n [\n '1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d',\n '309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4',\n ],\n [\n '2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d',\n '3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf',\n ],\n [\n '376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543',\n '6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547',\n ],\n [\n 'a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066',\n '6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471',\n ],\n [\n '223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed',\n 'c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa',\n ],\n [\n '102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2',\n '6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65',\n ],\n [\n '891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2',\n '5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37',\n ],\n [\n '215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203',\n '10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266',\n ],\n [\n '21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36',\n '3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3',\n ],\n [\n '60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae',\n 'e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879',\n ],\n [\n '1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5',\n '69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3',\n ],\n [\n '5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e',\n '134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec',\n ],\n [\n '626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8',\n '7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0',\n ],\n [\n '23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd',\n '7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf',\n ],\n [\n '54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202',\n '1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426',\n ],\n [\n '13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c',\n '62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9',\n ],\n [\n '47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98',\n '75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb',\n ],\n [\n '2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585',\n '5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c',\n ],\n];\n","/* eslint-disable no-param-reassign */\nexport const IS_BROWSER = typeof window !== 'undefined';\n\nconst STRING_ZERO = '0';\n\nexport function arrayBufferToString(array: ArrayBuffer): string {\n return new Uint8Array(array).reduce((data, byte) => data + String.fromCharCode(byte), '');\n}\n\nexport function stringToArrayBuffer(s: string): Uint8Array {\n return Uint8Array.from(s, (c) => c.charCodeAt(0));\n}\n\nexport function atobUniversal(a: string): Uint8Array {\n return IS_BROWSER ? stringToArrayBuffer(atob(a)) : Buffer.from(a, 'base64');\n}\n\nexport function btoaUniversal(b: ArrayBuffer): string {\n return IS_BROWSER ? btoa(arrayBufferToString(b)) : Buffer.from(b).toString('base64');\n}\n\nexport function buf2hex(buffer: Uint8Array) {\n return [...buffer].map((x) => x.toString(16).padStart(2, '0')).join('');\n}\n\n/**\n * Some function imported from https://github.com/pedrouid/enc-utils/blob/master/src/index.ts\n * enc-utils is no dependency to avoid using `Buffer` which just works in node and no browsers\n */\n\nexport function removeHexPrefix(hex: string): string {\n return hex.replace(/^0x/i, '');\n}\n\nexport function addHexPrefix(hex: string): string {\n return `0x${removeHexPrefix(hex)}`;\n}\n\nfunction padString(str: string, length: number, left: boolean, padding = STRING_ZERO): string {\n const diff = length - str.length;\n let result = str;\n if (diff > 0) {\n const pad = padding.repeat(diff);\n result = left ? pad + str : str + pad;\n }\n return result;\n}\n\nexport function padLeft(str: string, length: number, padding = STRING_ZERO): string {\n return padString(str, length, true, padding);\n}\n\nexport function calcByteLength(length: number, byteSize = 8): number {\n const remainder = length % byteSize;\n return remainder ? ((length - remainder) / byteSize) * byteSize + byteSize : length;\n}\n\nexport function sanitizeBytes(str: string, byteSize = 8, padding = STRING_ZERO): string {\n return padLeft(str, calcByteLength(str.length, byteSize), padding);\n}\n\nexport function sanitizeHex(hex: string): string {\n hex = removeHexPrefix(hex);\n hex = sanitizeBytes(hex, 2);\n if (hex) {\n hex = addHexPrefix(hex);\n }\n return hex;\n}\n\n// implemented using TextEncoder to make it isomorphic\nexport function utf8ToArray(str: string): Uint8Array {\n return new TextEncoder().encode(str);\n}\n","export * from './account';\nexport * from './calldata';\nexport * from './contract';\nexport * from './lib';\nexport * from './provider';\nexport * from './signer';\nexport * from './typedData';\n\nexport * as RPC from './api/rpc';\nexport {\n CallL1Handler,\n DeployedContractItem,\n ExecutionResources,\n FunctionInvocation,\n GetContractAddressesResponse,\n GetTransactionStatusResponse,\n SequencerIdentifier,\n} from './api/sequencer';\nexport * as Sequencer from './api/sequencer';\n","import { BigNumberish, BlockIdentifier } from './lib';\nimport { DeclareTransactionReceiptResponse, EstimateFeeResponse } from './provider';\n\nexport interface EstimateFee extends EstimateFeeResponse {\n suggestedMaxFee: bigint;\n}\n\nexport type EstimateFeeBulk = Array;\n\nexport type AccountInvocationsFactoryDetails = {\n versions: bigint[];\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n};\n\nexport interface EstimateFeeDetails {\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n}\n\nexport interface DeployContractResponse {\n contract_address: string;\n transaction_hash: string;\n}\n\nexport type MultiDeployContractResponse = {\n contract_address: Array;\n transaction_hash: string;\n};\n\nexport type DeployContractUDCResponse = {\n contract_address: string;\n transaction_hash: string;\n address: string;\n deployer: string;\n unique: string;\n classHash: string;\n calldata_len: string;\n calldata: Array;\n salt: string;\n};\n\nexport type DeclareDeployUDCResponse = {\n declare: {\n class_hash: BigNumberish;\n } & Partial;\n deploy: DeployContractUDCResponse;\n};\n\nexport type SimulateTransactionDetails = {\n nonce?: BigNumberish;\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n skipExecute?: boolean;\n};\n\nexport enum SIMULATION_FLAG {\n SKIP_VALIDATE,\n SKIP_EXECUTE,\n}\n","export enum ValidateType {\n DEPLOY = 'DEPLOY',\n CALL = 'CALL',\n INVOKE = 'INVOKE',\n}\n\nexport enum Uint {\n u8 = 'core::integer::u8',\n u16 = 'core::integer::u16',\n u32 = 'core::integer::u32',\n u64 = 'core::integer::u64',\n u128 = 'core::integer::u128',\n u256 = 'core::integer::u256', // This one is struct\n}\n","import { LegacyCompiledContract, LegacyContractClass } from './legacy';\nimport { CompiledSierra, SierraContractClass } from './sierra';\n\n// Final types\n/**\n * format produced after compressing compiled contract\n * CompressedCompiledContract\n */\nexport type ContractClass = LegacyContractClass | SierraContractClass;\n\n/**\n * format produced after compile .cairo to .json\n */\nexport type CompiledContract = LegacyCompiledContract | CompiledSierra;\n\n/**\n * Compressed or decompressed Cairo0 or Cairo1 Contract\n */\nexport type CairoContract = ContractClass | CompiledContract;\n\n// Basic elements\nexport enum EntryPointType {\n EXTERNAL = 'EXTERNAL',\n L1_HANDLER = 'L1_HANDLER',\n CONSTRUCTOR = 'CONSTRUCTOR',\n}\n\nexport * from './abi';\nexport * from './legacy';\nexport * from './sierra';\n","import { StarknetChainId } from '../../constants';\nimport { weierstrass } from '../../utils/ec';\nimport { CompiledContract, CompiledSierraCasm, ContractClass } from './contract';\n\nexport type WeierstrassSignatureType = weierstrass.SignatureType;\nexport type ArraySignatureType = string[];\nexport type Signature = ArraySignatureType | WeierstrassSignatureType;\n\nexport type BigNumberish = string | number | bigint;\n\n/**\n * Compiled calldata ready to be sent\n * decimal-string array\n */\nexport type Calldata = string[] & { readonly __compiled__?: boolean };\n\n/**\n * Represents an integer in the range [0, 2^256)\n */\nexport interface Uint256 {\n // The low 128 bits of the value\n low: BigNumberish;\n // The high 128 bits of the value\n high: BigNumberish;\n}\n\n/**\n * BigNumberish array\n * use CallData.compile() to convert to Calldata\n */\nexport type RawCalldata = BigNumberish[];\n\n/**\n * Hexadecimal-string array\n */\nexport type HexCalldata = string[];\n\nexport type AllowArray = T | T[];\n\nexport type OptionalPayload = { payload: T } | T;\n\nexport type RawArgs = RawArgsObject | RawArgsArray;\n\nexport type RawArgsObject = {\n [inputName: string]: MultiType | MultiType[] | RawArgs;\n};\n\nexport type RawArgsArray = Array;\n\nexport type MultiType = BigNumberish | Uint256 | object | boolean;\n\nexport type UniversalDeployerContractPayload = {\n classHash: BigNumberish;\n salt?: string;\n unique?: boolean;\n constructorCalldata?: RawArgs;\n};\n\nexport type DeployAccountContractPayload = {\n classHash: string;\n constructorCalldata?: RawArgs;\n addressSalt?: BigNumberish;\n contractAddress?: string;\n};\n\nexport type DeployAccountContractTransaction = Omit<\n DeployAccountContractPayload,\n 'contractAddress'\n> & {\n signature?: Signature;\n};\n\nexport type DeclareContractPayload = {\n contract: CompiledContract | string;\n classHash?: string;\n casm?: CompiledSierraCasm;\n compiledClassHash?: string;\n};\n\nexport type CompleteDeclareContractPayload = {\n contract: CompiledContract | string;\n classHash: string;\n casm?: CompiledSierraCasm;\n compiledClassHash?: string;\n};\n\nexport type DeclareAndDeployContractPayload = Omit &\n DeclareContractPayload;\n\nexport type DeclareContractTransaction = {\n contract: ContractClass;\n senderAddress: string;\n signature?: Signature;\n compiledClassHash?: string;\n};\n\nexport type CallDetails = {\n contractAddress: string;\n calldata?: RawArgs | Calldata;\n entrypoint?: string; // TODO: check if required\n};\n\nexport type Invocation = CallDetails & { signature?: Signature };\n\nexport type Call = CallDetails & { entrypoint: string };\n\nexport type CairoVersion = '0' | '1';\n\nexport type InvocationsDetails = {\n nonce?: BigNumberish;\n maxFee?: BigNumberish;\n version?: BigNumberish;\n};\n\n/**\n * Contain all additional details params\n */\nexport type Details = {\n nonce: BigNumberish;\n maxFee: BigNumberish;\n version: BigNumberish;\n chainId: StarknetChainId;\n};\n\nexport type InvocationsDetailsWithNonce = InvocationsDetails & {\n nonce: BigNumberish;\n};\n\nexport enum TransactionType {\n DECLARE = 'DECLARE',\n DEPLOY = 'DEPLOY',\n DEPLOY_ACCOUNT = 'DEPLOY_ACCOUNT',\n INVOKE = 'INVOKE_FUNCTION',\n}\n\nexport enum TransactionStatus {\n NOT_RECEIVED = 'NOT_RECEIVED',\n RECEIVED = 'RECEIVED',\n ACCEPTED_ON_L2 = 'ACCEPTED_ON_L2',\n ACCEPTED_ON_L1 = 'ACCEPTED_ON_L1',\n REJECTED = 'REJECTED',\n}\n\nexport enum BlockStatus {\n PENDING = 'PENDING',\n ACCEPTED_ON_L1 = 'ACCEPTED_ON_L1',\n ACCEPTED_ON_L2 = 'ACCEPTED_ON_L2',\n REJECTED = 'REJECTED',\n}\n\nexport enum BlockTag {\n pending = 'pending',\n latest = 'latest',\n}\n\nexport type BlockNumber = BlockTag | null | number;\n\n/**\n * hex string and BN are detected as block hashes\n * decimal string and number are detected as block numbers\n * null appends nothing to the request url\n */\nexport type BlockIdentifier = BlockNumber | BigNumberish;\n\n/**\n * items used by AccountInvocations\n */\nexport type AccountInvocationItem = (\n | ({ type: TransactionType.DECLARE } & DeclareContractTransaction)\n | ({ type: TransactionType.DEPLOY_ACCOUNT } & DeployAccountContractTransaction)\n | ({ type: TransactionType.INVOKE } & Invocation)\n) &\n InvocationsDetailsWithNonce;\n\n/**\n * Complete invocations array with account details (internal type from account -> provider)\n */\nexport type AccountInvocations = AccountInvocationItem[];\n\n/**\n * Invocations array user provide to bulk method (simulate)\n */\nexport type Invocations = Array<\n | ({ type: TransactionType.DECLARE } & OptionalPayload)\n | ({ type: TransactionType.DEPLOY } & OptionalPayload<\n AllowArray\n >)\n | ({ type: TransactionType.DEPLOY_ACCOUNT } & OptionalPayload)\n | ({ type: TransactionType.INVOKE } & OptionalPayload>)\n>;\n\nexport type Tupled = { element: any; type: string };\n\nexport type Args = {\n [inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[];\n};\nexport type ParsedStruct = {\n [key: string]: BigNumberish | ParsedStruct;\n};\n\nexport type waitForTransactionOptions = {\n retryInterval?: number;\n successStates?: Array;\n};\n\nexport type getSimulateTransactionOptions = {\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n skipExecute?: boolean;\n};\n\nexport type getEstimateFeeBulkOptions = {\n blockIdentifier?: BlockIdentifier;\n skipValidate?: boolean;\n};\n\nexport interface CallStruct {\n to: string;\n selector: string;\n calldata: string[];\n}\n\nexport * from './contract';\n","import { ADDRESS, CONTRACT_STORAGE_DIFF_ITEM, FELT, OPENRPC } from './openrpc';\n\nexport type Response = {\n id: number;\n jsonrpc: string;\n result?: any;\n error?: {\n code: string;\n message: string;\n };\n};\n\nexport type ChainId = OPENRPC.CHAIN_ID;\nexport type CallResponse = OPENRPC.CallResponse;\nexport type ContractAddress = ADDRESS;\nexport type Felt = FELT;\nexport type Nonce = OPENRPC.Nonce;\nexport type ContractClass = OPENRPC.ContractClass | OPENRPC.DeprecatedContractClass;\nexport type StateUpdate = OPENRPC.StateUpdate;\nexport type Transaction = OPENRPC.Transaction;\nexport type PendingTransactions = OPENRPC.PendingTransactions;\nexport type TransactionHash = OPENRPC.TransactionHash;\nexport type Trace = OPENRPC.Trace;\nexport type Traces = OPENRPC.Traces;\nexport type BlockHash = OPENRPC.BlockHash;\nexport type BlockHashAndNumber = OPENRPC.BlockHashAndNumber;\nexport type EstimateFeeResponse = OPENRPC.EstimatedFee;\nexport type GetBlockWithTxHashesResponse = OPENRPC.BlockWithTxHashes;\nexport type GetBlockWithTxs = OPENRPC.BlockWithTxs;\nexport type GetStorageAtResponse = OPENRPC.Storage;\nexport type TransactionReceipt = OPENRPC.TransactionReceipt;\nexport type GetTransactionByHashResponse = OPENRPC.Transaction;\nexport type GetTransactionByBlockIdAndIndex = OPENRPC.Transaction;\nexport type GetTransactionCountResponse = number;\nexport type GetBlockNumberResponse = OPENRPC.BlockNumber;\nexport type GetSyncingStatsResponse = OPENRPC.SyncingStatus;\nexport type EventFilter = OPENRPC.EventFilter;\nexport type GetEventsResponse = OPENRPC.Events;\nexport type InvokedTransaction = OPENRPC.InvokedTransaction;\nexport type DeclaredTransaction = OPENRPC.DeclaredTransaction;\nexport type DeployedTransaction = OPENRPC.DeployedTransaction;\nexport type SimulationFlags = OPENRPC.SimulationFlags;\nexport type BroadcastedTransaction = OPENRPC.BroadcastedTransaction;\nexport type EstimatedFee = OPENRPC.EstimatedFee;\nexport type Methods = OPENRPC.Methods;\nexport type Storage = OPENRPC.Storage;\nexport type SimulateTransactionResponse = OPENRPC.SimulatedTransactions;\n\nexport enum TransactionType {\n DECLARE = 'DECLARE',\n DEPLOY = 'DEPLOY',\n DEPLOY_ACCOUNT = 'DEPLOY_ACCOUNT',\n INVOKE = 'INVOKE',\n L1_HANDLER = 'L1_HANDLER',\n}\n\n// Exported Diff on Sequencer (can be removed when diff resolved by new RPC v)\nexport type StorageDiffs = Array;\nexport type DeprecatedDeclaredClasses = Array;\nexport type Nonces = Array<{\n contract_address: ADDRESS;\n nonce: FELT;\n}>;\nexport type ReplacedClasses = Array<{ contract_address: ADDRESS; class_hash: FELT }>;\n","import {\n Abi,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n BlockNumber,\n BlockStatus,\n ByteCode,\n CairoAssembly,\n CompiledContract,\n ContractClass,\n EntryPointType,\n RawCalldata,\n TransactionStatus,\n TransactionType,\n} from '../lib';\n\n// #region | originally not included in the namespace\nexport type GetTransactionStatusResponse = {\n tx_status: TransactionStatus;\n block_hash?: string;\n tx_failure_reason?: {\n code: string;\n error_message: string;\n };\n};\n\nexport type GetContractAddressesResponse = {\n Starknet: string;\n GpsStatementVerifier: string;\n};\n\nexport type FunctionInvocation = {\n caller_address: string;\n contract_address: string;\n calldata: RawCalldata;\n call_type?: string;\n class_hash?: string;\n selector?: string;\n entry_point_type?: EntryPointType.EXTERNAL; // TODO: check this\n result: Array;\n execution_resources: ExecutionResources;\n internal_calls: Array;\n events: Array;\n messages: Array;\n};\n\nexport type ExecutionResources = {\n n_steps: number;\n builtin_instance_counter: {\n pedersen_builtin: number;\n range_check_builtin: number;\n bitwise_builtin: number;\n output_builtin: number;\n ecdsa_builtin: number;\n ec_op_builtin?: number;\n };\n n_memory_holes: number;\n};\n\nexport type CallL1Handler = {\n from_address: string;\n to_address: string;\n entry_point_selector: string;\n payload: Array;\n};\n\nexport type DeployedContractItem = {\n address: string;\n class_hash: string;\n};\n\nexport type SequencerIdentifier = { blockHash: string } | { blockNumber: BlockNumber };\n// #endregion\n\nexport type TransactionTraceResponse = {\n validate_invocation?: FunctionInvocation;\n function_invocation?: FunctionInvocation;\n fee_transfer_invocation?: FunctionInvocation;\n constructor_invocation?: FunctionInvocation;\n signature: string[];\n};\n\nexport type DeclareTransaction = {\n type: TransactionType.DECLARE;\n sender_address: string;\n contract_class: ContractClass;\n signature?: string[];\n nonce: BigNumberish;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n compiled_class_hash?: string; // v2 declare\n};\n\nexport type DeployTransaction = {\n type: TransactionType.DEPLOY;\n contract_definition: ContractClass;\n contract_address_salt: BigNumberish;\n constructor_calldata: string[];\n nonce?: BigNumberish;\n};\n\nexport type DeployAccountTransaction = {\n type: TransactionType.DEPLOY_ACCOUNT;\n class_hash: string;\n contract_address_salt: BigNumberish;\n constructor_calldata: string[];\n signature?: string[];\n max_fee?: BigNumberish;\n version?: BigNumberish;\n nonce?: BigNumberish;\n};\n\nexport type InvokeFunctionTransaction = {\n type: TransactionType.INVOKE;\n sender_address: string;\n signature?: string[];\n entry_point_type?: EntryPointType.EXTERNAL; // TODO: check this\n calldata?: RawCalldata;\n nonce: BigNumberish;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n};\n\nexport type Transaction =\n | DeclareTransaction\n | DeployTransaction\n | InvokeFunctionTransaction\n | DeployAccountTransaction;\n\nexport type AddTransactionResponse = {\n transaction_hash: string;\n code?: 'TRANSACTION_RECEIVED';\n address?: string;\n class_hash?: string;\n};\n\nexport type GetCodeResponse = {\n bytecode: ByteCode;\n abi: Abi;\n};\n\nexport interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction {\n transaction_hash: string;\n entry_point_selector: string;\n}\n\nexport type TransactionResponse =\n | DeclareTransaction\n | DeployTransaction\n | InvokeFunctionTransactionResponse;\n\nexport type SuccessfulTransactionResponse = {\n status: TransactionStatus;\n transaction: TransactionResponse;\n block_hash: string;\n block_number: BlockNumber;\n transaction_index: number;\n};\n\nexport type FailedTransactionResponse = {\n status: TransactionStatus.REJECTED;\n transaction_failure_reason: {\n code: string;\n error_message: string;\n };\n transaction: TransactionResponse;\n};\n\nexport type GetTransactionResponse = SuccessfulTransactionResponse | FailedTransactionResponse;\n\nexport type TransactionReceiptResponse =\n | SuccessfulTransactionReceiptResponse\n | FailedTransactionReceiptResponse;\n\nexport type SuccessfulTransactionReceiptResponse = {\n status: TransactionStatus;\n transaction_hash: string;\n transaction_index: number;\n block_hash: string;\n block_number: BlockNumber;\n l2_to_l1_messages: string[];\n events: string[];\n actual_fee: string;\n execution_resources: ExecutionResources;\n};\n\nexport type FailedTransactionReceiptResponse = {\n status: TransactionStatus.REJECTED;\n transaction_failure_reason: {\n code: string;\n error_message: string;\n };\n transaction_hash: string;\n l2_to_l1_messages: string[];\n events: string[];\n};\n\nexport type GetBlockResponse = {\n block_number: number;\n state_root: string;\n block_hash: string;\n transactions: {\n [txHash: string]: TransactionResponse;\n };\n timestamp: number;\n transaction_receipts: {\n [txHash: string]: {\n block_hash: string;\n transaction_hash: string;\n l2_to_l1_messages: {\n to_address: string;\n payload: string[];\n from_address: string;\n }[];\n block_number: BlockNumber;\n status: TransactionStatus;\n transaction_index: number;\n };\n };\n parent_block_hash: string;\n status: BlockStatus;\n gas_price: string;\n sequencer_address: string;\n starknet_version: string;\n};\n\nexport type CallContractTransaction = {\n calldata?: RawCalldata;\n max_fee?: BigNumberish;\n version?: BigNumberish;\n entry_point_selector: string;\n} & (\n | {\n sender_address: string;\n signature: string[];\n }\n | {\n contract_address: string;\n signature?: never;\n }\n);\n\nexport type CallContractResponse = {\n result: string[];\n};\n\nexport type InvokeEstimateFee = Omit;\nexport type DeclareEstimateFee = Omit;\nexport type DeployAccountEstimateFee = Omit;\nexport type DeployEstimateFee = DeployTransaction;\n\nexport type SimulateTransactionResponse = {\n trace: TransactionTraceResponse; // diff with OPENRPC \"transaction_trace\"\n fee_estimation: EstimateFeeResponse;\n};\n\nexport type AccountTransactionItem =\n | InvokeEstimateFee\n | DeclareEstimateFee\n | DeployEstimateFee\n | DeployAccountEstimateFee;\n\n/**\n * Transaction filled with account data\n */\nexport type AccountTransaction = AllowArray;\n\n// Support 0.9.1 changes in a backward-compatible way\nexport type EstimateFeeResponse =\n | {\n overall_fee: number;\n gas_price: number;\n gas_usage: number;\n uint: string;\n }\n | {\n amount: bigint;\n unit: string;\n };\n\nexport type EstimateFeeResponseBulk = AllowArray;\n\nexport type BlockTransactionTracesResponse = {\n traces: Array;\n};\n\nexport type Storage = string;\n\nexport type StateUpdateResponse = {\n block_hash: string;\n new_root: string;\n old_root: string;\n state_diff: {\n storage_diffs: StorageDiffs;\n nonces: Nonces;\n deployed_contracts: Array;\n old_declared_contracts: OldDeclaredContracts;\n declared_classes: DeclaredClasses;\n replaced_classes: ReplacedClasses; // no definition is it array of string\n };\n};\n\nexport type StorageDiffs = { [address: string]: Array };\n\nexport type StateDiffItem = { key: string; value: string };\n\nexport type Nonces = { [address: string]: Nonce };\n\nexport type Nonce = string;\n\nexport type DeployedContracts = DeployedContractItem[];\n\nexport type OldDeclaredContracts = string[];\n\nexport type DeclaredClasses = DeclaredClass[];\n\nexport type DeclaredClass = { class_hash: string; compiled_class_hash: string };\n\nexport type ReplacedClasses = string[]; // no definition is it array of string ?\n\nexport type Endpoints = {\n get_contract_addresses: {\n QUERY: never;\n REQUEST: never;\n RESPONSE: GetContractAddressesResponse;\n };\n add_transaction: {\n QUERY: never;\n REQUEST: Transaction;\n RESPONSE: AddTransactionResponse;\n };\n get_transaction: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: GetTransactionResponse;\n };\n get_transaction_status: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: GetTransactionStatusResponse;\n };\n get_transaction_trace: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: TransactionTraceResponse;\n };\n get_transaction_receipt: {\n QUERY: {\n transactionHash: string;\n };\n REQUEST: never;\n RESPONSE: TransactionReceiptResponse;\n };\n get_nonce: {\n QUERY: {\n contractAddress: string;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: Nonce;\n };\n get_storage_at: {\n QUERY: {\n contractAddress: string;\n key: BigNumberish;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: Storage;\n };\n get_code: {\n QUERY: {\n contractAddress: string;\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: GetCodeResponse;\n };\n get_block: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: GetBlockResponse;\n };\n call_contract: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n };\n REQUEST: CallContractTransaction;\n RESPONSE: CallContractResponse;\n };\n estimate_fee: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransactionItem;\n RESPONSE: EstimateFeeResponse;\n };\n get_class_by_hash: {\n QUERY: {\n classHash: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: CompiledContract;\n };\n get_class_hash_at: {\n QUERY: {\n contractAddress: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: string;\n };\n get_state_update: {\n QUERY: {\n blockHash?: string;\n blockNumber?: BlockNumber;\n };\n REQUEST: never;\n RESPONSE: StateUpdateResponse;\n };\n get_full_contract: {\n QUERY: {\n contractAddress: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: never;\n RESPONSE: CompiledContract;\n };\n estimate_message_fee: {\n QUERY: any;\n REQUEST: any;\n RESPONSE: EstimateFeeResponse;\n };\n simulate_transaction: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransaction;\n RESPONSE: SimulateTransactionResponse;\n };\n estimate_fee_bulk: {\n QUERY: {\n blockIdentifier: BlockIdentifier;\n skipValidate: boolean;\n };\n REQUEST: AccountTransaction;\n RESPONSE: EstimateFeeResponseBulk;\n };\n get_block_traces: {\n QUERY: {\n blockHash?: string;\n blockNumber?: BlockNumber;\n };\n REQUEST: never;\n RESPONSE: BlockTransactionTracesResponse;\n };\n get_compiled_class_by_class_hash: {\n QUERY: {\n classHash: string;\n blockIdentifier?: BlockIdentifier;\n };\n REQUEST: any;\n RESPONSE: CairoAssembly;\n };\n};\n","export default function assert(condition: any, message?: string): asserts condition {\n if (!condition) {\n throw new Error(message || 'Assertion failure');\n }\n}\n","import { hexToBytes as hexToBytesNoble } from '@noble/curves/abstract/utils';\n\nimport { BigNumberish } from '../types';\nimport assert from './assert';\nimport { addHexPrefix, removeHexPrefix } from './encode';\n\n/** @deprecated prefer importing from 'types' over 'num' */\nexport type { BigNumberish };\n\nexport function isHex(hex: string): boolean {\n return /^0x[0-9a-f]*$/i.test(hex);\n}\n\nexport function toBigInt(value: BigNumberish): bigint {\n return BigInt(value);\n}\n\nexport function isBigInt(value: any): value is bigint {\n return typeof value === 'bigint';\n}\n\nexport function toHex(number: BigNumberish): string {\n return addHexPrefix(toBigInt(number).toString(16));\n}\n\n/**\n * Convert BigNumberish to STORAGE_KEY\n * Same as toHex but conforming pattern STORAGE_KEY pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$\n * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.\n * 0x0 + [0-7] + 62 hex = 0x + 64 hex\n * @param number BigNumberish\n */\nexport function toStorageKey(number: BigNumberish): string {\n const res = addHexPrefix(toBigInt(number).toString(16).padStart(64, '0'));\n return res;\n}\n\nexport function hexToDecimalString(hex: string): string {\n return BigInt(addHexPrefix(hex)).toString(10);\n}\n\n/**\n * Remove hex string leading zero and lower case '0x01A'.. -> '0x1a..'\n * @param hex string\n */\nexport const cleanHex = (hex: string) => hex.toLowerCase().replace(/^(0x)0+/, '$1');\n\n/*\n Asserts input is equal to or greater then lowerBound and lower then upperBound.\n Assert message specifies inputName.\n input, lowerBound, and upperBound should be of type BN.\n inputName should be a string.\n*/\nexport function assertInRange(\n input: BigNumberish,\n lowerBound: BigNumberish,\n upperBound: BigNumberish,\n inputName = ''\n) {\n const messageSuffix = inputName === '' ? 'invalid length' : `invalid ${inputName} length`;\n const inputBigInt = BigInt(input);\n const lowerBoundBigInt = BigInt(lowerBound);\n const upperBoundBigInt = BigInt(upperBound);\n\n assert(\n inputBigInt >= lowerBoundBigInt && inputBigInt <= upperBoundBigInt,\n `Message not signable, ${messageSuffix}.`\n );\n}\n\nexport function bigNumberishArrayToDecimalStringArray(rawCalldata: BigNumberish[]): string[] {\n return rawCalldata.map((x) => toBigInt(x).toString(10));\n}\n\nexport function bigNumberishArrayToHexadecimalStringArray(rawCalldata: BigNumberish[]): string[] {\n return rawCalldata.map((x) => toHex(x));\n}\n\nexport const isStringWholeNumber = (value: string) => /^\\d+$/.test(value);\nexport const toHexString = (value: string) => toHex(value);\n\nexport function getDecimalString(value: string) {\n if (isHex(value)) {\n return hexToDecimalString(value);\n }\n if (isStringWholeNumber(value)) {\n return value;\n }\n throw new Error(`${value} need to be hex-string or whole-number-string`);\n}\n\nexport function getHexString(value: string) {\n if (isHex(value)) {\n return value;\n }\n if (isStringWholeNumber(value)) {\n return toHexString(value);\n }\n throw new Error(`${value} need to be hex-string or whole-number-string`);\n}\n\nexport function getHexStringArray(value: Array) {\n return value.map((el) => getHexString(el));\n}\n\nexport const toCairoBool = (value: boolean): string => (+value).toString();\n\n/**\n * Convert a hex string to an array of Bytes (Uint8Array)\n * @param value hex string\n * @returns an array of Bytes\n */\nexport function hexToBytes(value: string): Uint8Array {\n if (!isHex(value)) throw new Error(`${value} need to be a hex-string`);\n\n let adaptedValue: string = removeHexPrefix(value);\n if (adaptedValue.length % 2 !== 0) {\n adaptedValue = `0${adaptedValue}`;\n }\n return hexToBytesNoble(adaptedValue);\n}\n","import { keccak } from 'micro-starknet';\n\nimport { MASK_250 } from '../constants';\nimport { BigNumberish } from '../types';\nimport { addHexPrefix, removeHexPrefix, utf8ToArray } from './encode';\nimport { hexToBytes, isHex, isStringWholeNumber, toHex, toHexString } from './num';\n\n/**\n * Keccak hash BigNumberish value\n * @param value BigNumberish\n * @returns string - hexadecimal string\n */\nexport function keccakBn(value: BigNumberish): string {\n const hexWithoutPrefix = removeHexPrefix(toHex(BigInt(value)));\n const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`;\n return addHexPrefix(keccak(hexToBytes(addHexPrefix(evenHex))).toString(16));\n}\n\n/**\n * Keccak hash string value\n * @param value string\n * @returns string - hexadecimal string\n */\nfunction keccakHex(value: string): string {\n return addHexPrefix(keccak(utf8ToArray(value)).toString(16));\n}\n\n/**\n * Function to get the starknet keccak hash from a string\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L17-L22)\n * @param value - string you want to get the starknetKeccak hash from\n * @returns starknet keccak hash as BigNumber\n */\nexport function starknetKeccak(value: string): bigint {\n const hash = BigInt(keccakHex(value));\n // eslint-disable-next-line no-bitwise\n return hash & MASK_250;\n}\n\n/**\n * Function to get the hex selector from a given function name\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/public/abi.py#L25-L26)\n * @param funcName - selectors abi function name\n * @returns hex selector of given abi function name\n */\nexport function getSelectorFromName(funcName: string) {\n // sometimes BigInteger pads the hex string with zeros, which is not allowed in the starknet api\n return toHex(starknetKeccak(funcName));\n}\n\n/**\n * Function to get hex selector from function name, decimal string or hex string\n * @param value hex string | decimal string | string\n * @returns Hex selector\n */\nexport function getSelector(value: string) {\n if (isHex(value)) {\n return value;\n }\n if (isStringWholeNumber(value)) {\n return toHexString(value);\n }\n return getSelectorFromName(value);\n}\n","import { addHexPrefix, removeHexPrefix } from './encode';\nimport { isHex, isStringWholeNumber } from './num';\n\nconst TEXT_TO_FELT_MAX_LEN = 31;\n\nexport function isASCII(str: string) {\n // eslint-disable-next-line no-control-regex\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\n// function to check if string has less or equal 31 characters\nexport function isShortString(str: string) {\n return str.length <= TEXT_TO_FELT_MAX_LEN;\n}\n\n// function to check if string is a decimal\nexport function isDecimalString(decim: string): boolean {\n return /^[0-9]*$/i.test(decim);\n}\n\n/**\n * check if value is string text, and not string-hex, string-number\n * @param val any\n * @returns boolean\n */\nexport function isText(val: any) {\n return typeof val === 'string' && !isHex(val) && !isStringWholeNumber(val);\n}\n\nexport const isShortText = (val: any) => isText(val) && isShortString(val);\nexport const isLongText = (val: any) => isText(val) && !isShortString(val);\n\nexport function splitLongString(longStr: string): string[] {\n const regex = RegExp(`[^]{1,${TEXT_TO_FELT_MAX_LEN}}`, 'g');\n return longStr.match(regex) || [];\n}\n\n/**\n * Convert an ASCII string to an hexadecimal string.\n * @param str - ASCII string -\n * 31 characters maxi. Ex : \"uri/item23.jpg\"\n * @returns a string representing an Hex number 248 bits max.\n * @Example\n * ```typescript\n * const myEncodedString: string = encodeShortString(\"uri/pict/t38.jpg\");\n * ```\n * returns : string : \"0x7572692f706963742f7433382e6a7067\"\n */\nexport function encodeShortString(str: string): string {\n if (!isASCII(str)) throw new Error(`${str} is not an ASCII string`);\n if (!isShortString(str)) throw new Error(`${str} is too long`);\n return addHexPrefix(str.replace(/./g, (char) => char.charCodeAt(0).toString(16)));\n}\n\n/**\n * Convert an hexadecimal or decimal string to an ASCII string.\n * @param str - string - representing a 248 bits max number.\n *\n * Ex : hex : \"0x1A4F64EA56\" or decimal : \"236942575435676423\"\n * @returns a string with 31 characters max.\n * @Example\n * ```typescript\n * const myDecodedString: string = decodeShortString(\"0x7572692f706963742f7433382e6a7067\");\n * ```\n * return : string : \"uri/pict/t38.jpg\"\n */\nexport function decodeShortString(str: string): string {\n if (!isASCII(str)) throw new Error(`${str} is not an ASCII string`);\n if (isHex(str)) {\n return removeHexPrefix(str).replace(/.{2}/g, (hex) => String.fromCharCode(parseInt(hex, 16)));\n }\n if (isDecimalString(str)) {\n return decodeShortString('0X'.concat(BigInt(str).toString(16)));\n }\n throw new Error(`${str} is not Hex or decimal`);\n}\n","import { Abi, AbiStructs, BigNumberish, Uint, Uint256 } from '../../types';\nimport { isBigInt, isHex, isStringWholeNumber } from '../num';\nimport { encodeShortString, isShortString, isText } from '../shortString';\nimport { UINT_128_MAX, isUint256 } from '../uint256';\n\nexport const isLen = (name: string) => /_len$/.test(name);\nexport const isTypeFelt = (type: string) => type === 'felt' || type === 'core::felt252';\nexport const isTypeArray = (type: string) =>\n /\\*/.test(type) || type.startsWith('core::array::Array::');\nexport const isTypeTuple = (type: string) => /^\\(.*\\)$/i.test(type);\nexport const isTypeNamedTuple = (type: string) => /\\(.*\\)/i.test(type) && type.includes(':');\nexport const isTypeStruct = (type: string, structs: AbiStructs) => type in structs;\nexport const isTypeUint = (type: string) => Object.values(Uint).includes(type as Uint);\nexport const isTypeUint256 = (type: string) => type === 'core::integer::u256';\nexport const isTypeBool = (type: string) => type === 'core::bool';\nexport const isTypeContractAddress = (type: string) =>\n type === 'core::starknet::contract_address::ContractAddress';\nexport const isCairo1Type = (type: string) => type.includes('core::');\n\nexport const getArrayType = (type: string) => {\n if (isCairo1Type(type)) {\n return type.substring(type.indexOf('<') + 1, type.lastIndexOf('>'));\n }\n return type.replace('*', '');\n};\n\n/**\n * tells if an ABI comes from a Cairo 1 contract\n *\n * @param abi representing the interface of a Cairo contract\n * @returns TRUE if it is an ABI from a Cairo1 contract\n * @example\n * ```typescript\n * const isCairo1: boolean = isCairo1Abi(myAbi: Abi);\n * ```\n */\nexport function isCairo1Abi(abi: Abi): boolean {\n const firstFunction = abi.find((entry) => entry.type === 'function');\n if (!firstFunction) {\n if (abi.find((it) => it.type === 'interface')) {\n // Expected in Cairo1 version 2\n return true;\n }\n throw new Error(`Error in ABI. No function in ABI.`);\n }\n if (firstFunction.inputs.length) {\n return isCairo1Type(firstFunction.inputs[0].type);\n }\n if (firstFunction.outputs.length) {\n return isCairo1Type(firstFunction.outputs[0].type);\n }\n throw new Error(`Error in ABI. No input/output in function ${firstFunction.name}`);\n}\n\n/**\n * named tuple are described as js object {}\n * struct types are described as js object {}\n * array types are described as js array []\n */\n\n/**\n * Uint256 cairo type (helper for common struct type)\n */\nexport const uint256 = (it: BigNumberish): Uint256 => {\n const bn = BigInt(it);\n if (!isUint256(bn)) throw new Error('Number is too large');\n return {\n // eslint-disable-next-line no-bitwise\n low: (bn & UINT_128_MAX).toString(10),\n // eslint-disable-next-line no-bitwise\n high: (bn >> 128n).toString(10),\n };\n};\n\n/**\n * unnamed tuple cairo type (helper same as common struct type)\n */\nexport const tuple = (\n ...args: (BigNumberish | object | boolean)[]\n): Record => ({ ...args });\n\n/**\n * felt cairo type\n */\nexport function felt(it: BigNumberish): string {\n // BN or number\n if (isBigInt(it) || (typeof it === 'number' && Number.isInteger(it))) {\n return it.toString();\n }\n // string text\n if (isText(it)) {\n if (!isShortString(it as string))\n throw new Error(\n `${it} is a long string > 31 chars, felt can store short strings, split it to array of short strings`\n );\n const encoded = encodeShortString(it as string);\n return BigInt(encoded).toString();\n }\n // hex string\n if (typeof it === 'string' && isHex(it)) {\n // toBN().toString\n return BigInt(it).toString();\n }\n // string number (already converted), or unhandled type\n if (typeof it === 'string' && isStringWholeNumber(it)) {\n return it;\n }\n // bool to felt\n if (typeof it === 'boolean') {\n return `${+it}`;\n }\n\n throw new Error(`${it} can't be computed by felt()`);\n}\n","/* eslint-disable no-bitwise */\nimport { BigNumberish, Uint256 } from '../types';\nimport { addHexPrefix } from './encode';\nimport { toBigInt } from './num';\n\n/** @deprecated prefer importing from 'types' over 'uint256' */\nexport type { Uint256 };\n\n// function to convert Uint256 to BN\nexport function uint256ToBN(uint256: Uint256) {\n return (toBigInt(uint256.high) << 128n) + toBigInt(uint256.low);\n}\n\nexport const UINT_128_MAX = (1n << 128n) - 1n;\nexport const UINT_256_MAX = (1n << 256n) - 1n;\n// function to check if BN is smaller or equal 2**256-1\nexport function isUint256(bn: BigNumberish): boolean {\n return toBigInt(bn) <= UINT_256_MAX;\n}\n\n// function to convert BN to Uint256 hex\nexport function bnToUint256(bignumber: BigNumberish): Uint256 {\n const bn = toBigInt(bignumber);\n if (!isUint256(bn)) throw new Error('Number is too large');\n return {\n low: addHexPrefix((bn & UINT_128_MAX).toString(16)),\n high: addHexPrefix((bn >> 128n).toString(16)),\n };\n}\n","import { isBigInt } from '../num';\nimport { decodeShortString } from '../shortString';\n\nconst guard = {\n isBN: (data: any, type: any, key: any) => {\n if (!isBigInt(data[key]))\n throw new Error(\n `Data and formatter mismatch on ${key}:${type[key]}, expected response data ${key}:${\n data[key]\n } to be BN instead it is ${typeof data[key]}`\n );\n },\n unknown: (data: any, type: any, key: any) => {\n throw new Error(`Unhandled formatter type on ${key}:${type[key]} for data ${key}:${data[key]}`);\n },\n};\n\nexport default function formatter(data: any, type: any, sameType?: any) {\n // match data element with type element\n return Object.entries(data).reduce((acc, [key, value]: [any, any]) => {\n const elType = sameType ?? type[key];\n\n if (!(key in type) && !sameType) {\n // no type definition for element return original element\n acc[key] = value;\n return acc;\n }\n\n if (elType === 'string') {\n if (Array.isArray(data[key])) {\n // long string (felt*)\n const arrayStr = formatter(\n data[key],\n data[key].map((_: any) => elType)\n );\n acc[key] = Object.values(arrayStr).join('');\n return acc;\n }\n guard.isBN(data, type, key);\n acc[key] = decodeShortString(value);\n return acc;\n }\n if (elType === 'number') {\n guard.isBN(data, type, key);\n acc[key] = Number(value);\n return acc;\n }\n if (typeof elType === 'function') {\n acc[key] = elType(value);\n return acc;\n }\n if (Array.isArray(elType)) {\n const arrayObj = formatter(data[key], elType, elType[0]);\n acc[key] = Object.values(arrayObj);\n return acc;\n }\n if (typeof elType === 'object') {\n acc[key] = formatter(data[key], elType);\n return acc;\n }\n\n guard.unknown(data, type, key);\n return acc;\n }, {} as any);\n}\n","import { Abi, FunctionAbi } from '../../../types';\nimport { isLen } from '../cairo';\nimport { AbiParserInterface } from './interface';\n\nexport class AbiParser1 implements AbiParserInterface {\n abi: Abi;\n\n constructor(abi: Abi) {\n this.abi = abi;\n }\n\n /**\n * abi method inputs length without '_len' inputs\n * cairo 0 reducer\n * @param abiMethod FunctionAbi\n * @returns number\n */\n public methodInputsLength(abiMethod: FunctionAbi) {\n return abiMethod.inputs.reduce((acc, input) => (!isLen(input.name) ? acc + 1 : acc), 0);\n }\n\n /**\n * get method definition from abi\n * @param name string\n * @returns FunctionAbi | undefined\n */\n public getMethod(name: string): FunctionAbi | undefined {\n return this.abi.find((it) => it.name === name);\n }\n\n /**\n * Get Abi in legacy format\n * @returns Abi\n */\n public getLegacyFormat() {\n return this.abi;\n }\n}\n","import { Abi, FunctionAbi } from '../../../types';\nimport { AbiParserInterface } from './interface';\n\nexport class AbiParser2 implements AbiParserInterface {\n abi: Abi;\n\n constructor(abi: Abi) {\n this.abi = abi;\n }\n\n /**\n * abi method inputs length\n * @param abiMethod FunctionAbi\n * @returns number\n */\n public methodInputsLength(abiMethod: FunctionAbi) {\n return abiMethod.inputs.length;\n }\n\n /**\n * get method definition from abi\n * @param name string\n * @returns FunctionAbi | undefined\n */\n public getMethod(name: string): FunctionAbi | undefined {\n const intf = this.abi.find((it) => it.type === 'interface');\n return intf.items.find((it: any) => it.name === name);\n }\n\n /**\n * Get Abi in legacy format\n * @returns Abi\n */\n public getLegacyFormat(): Abi {\n return this.abi.flatMap((e) => {\n if (e.type === 'interface') {\n return e.items;\n }\n return e;\n });\n }\n}\n","import { Abi, FunctionAbi, RawArgs } from '../../../types';\nimport { isCairo1Abi } from '../cairo';\nimport { AbiParserInterface } from './interface';\nimport { AbiParser1 } from './parser-0-1.1.0';\nimport { AbiParser2 } from './parser-2.0.0';\n\nexport function createAbiParser(abi: Abi): AbiParserInterface {\n const version = getAbiVersion(abi);\n if (version === 0 || version === 1) {\n return new AbiParser1(abi);\n }\n if (version === 2) {\n return new AbiParser2(abi);\n }\n throw Error(`Unsupported ABI version ${version}`);\n}\n\nexport function getAbiVersion(abi: Abi) {\n if (abi.find((it) => it.type === 'interface')) return 2;\n if (isCairo1Abi(abi)) return 1;\n return 0;\n}\n\nexport function isNoConstructorValid(\n method: string,\n argsCalldata: RawArgs,\n abiMethod?: FunctionAbi\n) {\n // No constructor in abi and validly empty args\n return method === 'constructor' && !abiMethod && !argsCalldata.length;\n}\n","/* eslint-disable no-plusplus */\nimport { isCairo1Type, isTypeNamedTuple } from './cairo';\n\nfunction parseNamedTuple(namedTuple: string): any {\n const name = namedTuple.substring(0, namedTuple.indexOf(':'));\n const type = namedTuple.substring(name.length + ':'.length);\n return { name, type };\n}\n\nfunction parseSubTuple(s: string) {\n if (!s.includes('(')) return { subTuple: [], result: s };\n const subTuple: string[] = [];\n let result = '';\n let i = 0;\n while (i < s.length) {\n if (s[i] === '(') {\n let counter = 1;\n const lBracket = i;\n i++;\n while (counter) {\n if (s[i] === ')') counter--;\n if (s[i] === '(') counter++;\n i++;\n }\n subTuple.push(s.substring(lBracket, i));\n result += ' ';\n i--;\n } else {\n result += s[i];\n }\n i++;\n }\n\n return {\n subTuple,\n result,\n };\n}\n\nfunction extractCairo0Tuple(type: string) {\n const cleanType = type.replace(/\\s/g, '').slice(1, -1); // remove first lvl () and spaces\n\n // Decompose subTuple\n const { subTuple, result } = parseSubTuple(cleanType);\n\n // Recompose subTuple\n let recomposed = result.split(',').map((it) => {\n return subTuple.length ? it.replace(' ', subTuple.shift() as string) : it;\n });\n\n // Parse named tuple\n if (isTypeNamedTuple(type)) {\n recomposed = recomposed.reduce((acc, it) => {\n return acc.concat(parseNamedTuple(it));\n }, []);\n }\n\n return recomposed;\n}\n\nfunction extractCairo1Tuple(type: string) {\n // un-named tuples support\n const cleanType = type.replace(/\\s/g, '').slice(1, -1); // remove first lvl () and spaces\n const { subTuple, result } = parseSubTuple(cleanType);\n const recomposed = result.split(',').map((it) => {\n return subTuple.length ? it.replace(' ', subTuple.shift() as string) : it;\n });\n return recomposed;\n}\n\n/**\n * Convert tuple string definition into object like definition\n * @param type tuple string definition\n * @returns object like tuple\n */\nexport default function extractTupleMemberTypes(type: string): (string | object)[] {\n if (isCairo1Type(type)) {\n return extractCairo1Tuple(type);\n }\n return extractCairo0Tuple(type);\n}\n","import { AbiEntry, AbiStructs, RawArgsObject, Uint } from '../../types';\nimport {\n getArrayType,\n isCairo1Type,\n isLen,\n isTypeArray,\n isTypeStruct,\n isTypeTuple,\n isTypeUint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\nfunction errorU256(key: string) {\n return Error(\n `Your object includes the property : ${key}, containing an Uint256 object without the 'low' and 'high' keys.`\n );\n}\nexport default function orderPropsByAbi(\n unorderedObject: RawArgsObject,\n abiOfObject: AbiEntry[],\n structs: AbiStructs\n): object {\n const orderStruct = (unorderedObject2: RawArgsObject, abiObject: AbiEntry[]): object => {\n const orderedObject2 = abiObject.reduce((orderedObject, abiParam) => {\n const setProperty = (value?: any) =>\n Object.defineProperty(orderedObject, abiParam.name, {\n enumerable: true,\n value: value ?? unorderedObject2[abiParam.name],\n });\n\n if (unorderedObject2[abiParam.name] === 'undefined') {\n if (isCairo1Type(abiParam.type) || !isLen(abiParam.name)) {\n throw Error(`Your object needs a property with key : ${abiParam.name} .`);\n }\n }\n switch (true) {\n case isTypeStruct(abiParam.type, structs):\n setProperty(\n orderStruct(\n unorderedObject2[abiParam.name] as RawArgsObject,\n structs[abiParam.type].members\n )\n );\n break;\n case isTypeUint256(abiParam.type): {\n const u256 = unorderedObject2[abiParam.name];\n if (typeof u256 !== 'object') {\n // BigNumberish --> just copy\n setProperty();\n break;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n setProperty({ low: u256.low, high: u256.high });\n break;\n }\n case isTypeTuple(abiParam.type):\n setProperty(orderTuple(unorderedObject2[abiParam.name] as RawArgsObject, abiParam));\n break;\n case isTypeArray(abiParam.type):\n setProperty(orderArray(unorderedObject2[abiParam.name] as Array, abiParam));\n break;\n case !isCairo1Type(abiParam.type) && isLen(abiParam.name):\n // Cairo 0 array_len. Nothing to do, go to next abi item\n break;\n default: // do not needs recursion --> just copy\n setProperty();\n }\n return orderedObject;\n }, {});\n return orderedObject2;\n };\n\n function orderArray(myArray: Array | string, abiParam: AbiEntry): Array | string {\n const typeInArray = getArrayType(abiParam.type);\n if (typeof myArray === 'string') {\n return myArray; // longstring\n }\n switch (true) {\n case typeInArray in structs:\n return myArray.map((myObj) => orderStruct(myObj, structs[typeInArray].members));\n case typeInArray === Uint.u256:\n return myArray.map((u256) => {\n if (typeof u256 !== 'object') {\n return u256;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n return { low: u256.low, high: u256.high };\n });\n case isTypeTuple(typeInArray):\n return myArray.map((myElem) => orderTuple(myElem, { name: '0', type: typeInArray }));\n case isTypeArray(typeInArray):\n return myArray.map((myElem) => orderArray(myElem, { name: '0', type: typeInArray }));\n default: // is an array of litterals\n return myArray;\n }\n }\n\n function orderTuple(unorderedObject2: RawArgsObject, abiParam: AbiEntry): object {\n const typeList = extractTupleMemberTypes(abiParam.type);\n const orderedObject2 = typeList.reduce((orderedObject: object, abiTypeCairoX: any, index) => {\n const myObjKeys: string[] = Object.keys(unorderedObject2);\n const setProperty = (value?: any) =>\n Object.defineProperty(orderedObject, index.toString(), {\n enumerable: true,\n value: value ?? unorderedObject2[myObjKeys[index]],\n });\n const abiType: string = abiTypeCairoX?.type ? abiTypeCairoX.type : abiTypeCairoX; // Named tuple, or tuple\n\n switch (true) {\n case isTypeStruct(abiType, structs):\n setProperty(\n orderStruct(\n unorderedObject2[myObjKeys[index]] as RawArgsObject,\n structs[abiType].members\n )\n );\n break;\n case isTypeUint256(abiType): {\n const u256 = unorderedObject2[myObjKeys[index]];\n if (typeof u256 !== 'object') {\n // BigNumberish --> just copy\n setProperty();\n break;\n }\n if (!('low' in u256 && 'high' in u256)) {\n throw errorU256(abiParam.name);\n }\n setProperty({ low: u256.low, high: u256.high });\n break;\n }\n case isTypeTuple(abiType):\n setProperty(\n orderTuple(unorderedObject2[myObjKeys[index]] as RawArgsObject, {\n name: '0',\n type: abiType,\n })\n );\n break;\n case isTypeArray(abiType):\n setProperty(\n orderArray(unorderedObject2[myObjKeys[index]] as Array, {\n name: '0',\n type: abiType,\n })\n );\n break;\n default: // litterals, do not needs recursion --> just copy\n setProperty();\n }\n return orderedObject;\n }, {});\n return orderedObject2;\n }\n return orderStruct(unorderedObject, abiOfObject);\n}\n","import { AbiEntry, AbiStructs, BigNumberish, ParsedStruct, Tupled, Uint256 } from '../../types';\nimport { isText, splitLongString } from '../shortString';\nimport {\n felt,\n getArrayType,\n isTypeArray,\n isTypeStruct,\n isTypeTuple,\n isTypeUint256,\n uint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\n/**\n * parse base types\n * @param type type from abi\n * @param val value provided\n * @returns string | string[]\n */\nfunction parseBaseTypes(type: string, val: BigNumberish) {\n switch (true) {\n case isTypeUint256(type):\n // eslint-disable-next-line no-case-declarations\n const el_uint256 = uint256(val);\n return [felt(el_uint256.low), felt(el_uint256.high)];\n default:\n return felt(val);\n }\n}\n\n/**\n * Parse tuple type string to array of known objects\n * @param element request element\n * @param typeStr tuple type string\n * @returns Tupled[]\n */\nfunction parseTuple(element: object, typeStr: string): Tupled[] {\n const memberTypes = extractTupleMemberTypes(typeStr);\n const elements = Object.values(element);\n\n if (elements.length !== memberTypes.length) {\n throw Error(\n `ParseTuple: provided and expected abi tuple size do not match.\n provided: ${elements} \n expected: ${memberTypes}`\n );\n }\n\n return memberTypes.map((it: any, dx: number) => {\n return {\n element: elements[dx],\n type: it.type ?? it,\n };\n });\n}\n\nfunction parseUint256(element: object | BigNumberish) {\n if (typeof element === 'object') {\n const { low, high } = element as Uint256;\n return [felt(low as BigNumberish), felt(high as BigNumberish)];\n }\n const el_uint256 = uint256(element);\n return [felt(el_uint256.low), felt(el_uint256.high)];\n}\n\n/**\n * Deep parse of the object that has been passed to the method\n *\n * @param element - element that needs to be parsed\n * @param type - name of the method\n * @param structs - structs from abi\n * @return {string | string[]} - parsed arguments in format that contract is expecting\n */\nfunction parseCalldataValue(\n element: ParsedStruct | BigNumberish | BigNumberish[],\n type: string,\n structs: AbiStructs\n): string | string[] {\n if (element === undefined) {\n throw Error(`Missing parameter for type ${type}`);\n }\n\n // value is Array\n if (Array.isArray(element)) {\n const result: string[] = [];\n result.push(felt(element.length)); // Add length to array\n const arrayType = getArrayType(type);\n\n return element.reduce((acc, it) => {\n return acc.concat(parseCalldataValue(it, arrayType, structs));\n }, result);\n }\n\n // checking if the passed element is struct\n if (structs[type] && structs[type].members.length) {\n if (isTypeUint256(type)) {\n return parseUint256(element);\n }\n\n const { members } = structs[type];\n const subElement = element as any;\n\n return members.reduce((acc, it: AbiEntry) => {\n return acc.concat(parseCalldataValue(subElement[it.name], it.type, structs));\n }, [] as string[]);\n }\n // check if abi element is tuple\n if (isTypeTuple(type)) {\n const tupled = parseTuple(element as object, type);\n\n return tupled.reduce((acc, it: Tupled) => {\n const parsedData = parseCalldataValue(it.element, it.type, structs);\n return acc.concat(parsedData);\n }, [] as string[]);\n }\n // check if u256 C1v0\n if (isTypeUint256(type)) {\n return parseUint256(element);\n }\n if (typeof element === 'object') {\n throw Error(`Parameter ${element} do not align with abi parameter ${type}`);\n }\n return parseBaseTypes(type, element);\n}\n\n/**\n * Parse one field of the calldata by using input field from the abi for that method\n *\n * @param argsIterator - Iterator for value of the field\n * @param input - input(field) information from the abi that will be used to parse the data\n * @param structs - structs from abi\n * @return {string | string[]} - parsed arguments in format that contract is expecting\n */\nexport function parseCalldataField(\n argsIterator: Iterator,\n input: AbiEntry,\n structs: AbiStructs\n): string | string[] {\n const { name, type } = input;\n let { value } = argsIterator.next();\n\n switch (true) {\n // Array\n case isTypeArray(type):\n if (!Array.isArray(value) && !isText(value)) {\n throw Error(`ABI expected parameter ${name} to be array or long string, got ${value}`);\n }\n if (typeof value === 'string') {\n // long string match cairo felt*\n value = splitLongString(value);\n }\n return parseCalldataValue(value, input.type, structs);\n\n // Struct or Tuple\n case isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type):\n return parseCalldataValue(value as ParsedStruct | BigNumberish[], type, structs);\n\n // Felt or unhandled\n default:\n return parseBaseTypes(type, value);\n }\n}\n","/* eslint-disable no-case-declarations */\nimport { AbiEntry, AbiStructs, Args, BigNumberish, ParsedStruct } from '../../types';\nimport { uint256ToBN } from '../uint256';\nimport {\n getArrayType,\n isCairo1Type,\n isLen,\n isTypeArray,\n isTypeBool,\n isTypeTuple,\n isTypeUint256,\n} from './cairo';\nimport extractTupleMemberTypes from './tuple';\n\n/**\n * Parse base types\n * @param type type of element\n * @param it iterator\n * @returns bigint | boolean\n */\nfunction parseBaseTypes(type: string, it: Iterator) {\n let temp;\n switch (true) {\n case isTypeBool(type):\n temp = it.next().value;\n return Boolean(BigInt(temp));\n case isTypeUint256(type):\n const low = it.next().value;\n const high = it.next().value;\n return uint256ToBN({ low, high });\n default:\n temp = it.next().value;\n return BigInt(temp);\n }\n}\n\n/**\n * Parse of the response elements that are converted to Object (Struct) by using the abi\n *\n * @param responseIterator - iterator of the response\n * @param element - element of the field {name: string, type: string}\n * @param structs - structs from abi\n * @return {any} - parsed arguments in format that contract is expecting\n */\nfunction parseResponseValue(\n responseIterator: Iterator,\n element: { name: string; type: string },\n structs: AbiStructs\n): BigNumberish | ParsedStruct | boolean | any[] {\n // type uint256 struct (c1v2)\n if (isTypeUint256(element.type)) {\n const low = responseIterator.next().value;\n const high = responseIterator.next().value;\n return uint256ToBN({ low, high });\n }\n\n // type struct\n if (element.type in structs && structs[element.type]) {\n return structs[element.type].members.reduce((acc, el) => {\n acc[el.name] = parseResponseValue(responseIterator, el, structs);\n return acc;\n }, {} as any);\n }\n\n // type tuple\n if (isTypeTuple(element.type)) {\n const memberTypes = extractTupleMemberTypes(element.type);\n return memberTypes.reduce((acc, it: any, idx) => {\n const name = it?.name ? it.name : idx;\n const type = it?.type ? it.type : it;\n const el = { name, type };\n acc[name] = parseResponseValue(responseIterator, el, structs);\n return acc;\n }, {} as any);\n }\n\n // type c1 array\n if (isTypeArray(element.type)) {\n // eslint-disable-next-line no-case-declarations\n const parsedDataArr: (BigNumberish | ParsedStruct | boolean | any[])[] = [];\n const el = { name: '', type: getArrayType(element.type) };\n const len = BigInt(responseIterator.next().value); // get length\n while (parsedDataArr.length < len) {\n parsedDataArr.push(parseResponseValue(responseIterator, el, structs));\n }\n return parsedDataArr;\n }\n\n // base type\n return parseBaseTypes(element.type, responseIterator);\n}\n\n/**\n * Parse elements of the response and structuring them into one field by using output property from the abi for that method\n *\n * @param responseIterator - iterator of the response\n * @param output - output(field) information from the abi that will be used to parse the data\n * @param structs - structs from abi\n * @param parsedResult\n * @return - parsed response corresponding to the abi structure of the field\n */\nexport default function responseParser(\n responseIterator: Iterator,\n output: AbiEntry,\n structs: AbiStructs,\n parsedResult?: Args\n): any {\n const { name, type } = output;\n let temp;\n\n switch (true) {\n case isLen(name):\n temp = responseIterator.next().value;\n return BigInt(temp);\n\n case type in structs || isTypeTuple(type):\n return parseResponseValue(responseIterator, output, structs);\n\n case isTypeArray(type):\n // C1 Array\n if (isCairo1Type(type)) {\n return parseResponseValue(responseIterator, output, structs);\n }\n // C0 Array\n // eslint-disable-next-line no-case-declarations\n const parsedDataArr: (BigNumberish | ParsedStruct | boolean | any[])[] = [];\n if (parsedResult && parsedResult[`${name}_len`]) {\n const arrLen = parsedResult[`${name}_len`] as number;\n while (parsedDataArr.length < arrLen) {\n parsedDataArr.push(\n parseResponseValue(\n responseIterator,\n { name, type: output.type.replace('*', '') },\n structs\n )\n );\n }\n }\n return parsedDataArr;\n\n default:\n return parseBaseTypes(type, responseIterator);\n }\n}\n","/**\n * Validate cairo contract method arguments\n * Flow: Determine type from abi and than validate against parameter\n */\nimport { AbiEntry, AbiStructs, BigNumberish, FunctionAbi, Uint } from '../../types';\nimport assert from '../assert';\nimport { toBigInt } from '../num';\nimport { isLongText } from '../shortString';\nimport { uint256ToBN } from '../uint256';\nimport {\n getArrayType,\n isLen,\n isTypeArray,\n isTypeBool,\n isTypeContractAddress,\n isTypeFelt,\n isTypeStruct,\n isTypeTuple,\n isTypeUint,\n} from './cairo';\n\nconst validateFelt = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'string' || typeof parameter === 'number' || typeof parameter === 'bigint',\n `Validate: arg ${input.name} should be a felt typed as (String, Number or BigInt)`\n );\n};\n\nconst validateUint = (parameter: any, input: AbiEntry) => {\n if (typeof parameter === 'number') {\n assert(\n parameter <= Number.MAX_SAFE_INTEGER,\n `Validation: Parameter is to large to be typed as Number use (BigInt or String)`\n );\n }\n assert(\n typeof parameter === 'string' ||\n typeof parameter === 'number' ||\n typeof parameter === 'bigint' ||\n (typeof parameter === 'object' && 'low' in parameter && 'high' in parameter),\n `Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)`\n );\n const param = typeof parameter === 'object' ? uint256ToBN(parameter) : toBigInt(parameter);\n\n switch (input.type) {\n case Uint.u8:\n assert(\n param >= 0n && param <= 255n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0 - 255]`\n );\n break;\n\n case Uint.u16:\n assert(\n param >= 0n && param <= 65535n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 65535]`\n );\n break;\n\n case Uint.u32:\n assert(\n param >= 0n && param <= 4294967295n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 4294967295]`\n );\n break;\n\n case Uint.u64:\n assert(\n param >= 0n && param <= 2n ** 64n - 1n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^64-1]`\n );\n break;\n\n case Uint.u128:\n assert(\n param >= 0n && param <= 2n ** 128n - 1n,\n `Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^128-1]`\n );\n break;\n\n case Uint.u256:\n assert(\n param >= 0n && param <= 2n ** 256n - 1n,\n `Validate: arg ${input.name} is ${input.type} 0 - 2^256-1`\n );\n break;\n\n default:\n break;\n }\n};\n\nconst validateBool = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'boolean',\n `Validate: arg ${input.name} of cairo type ${input.type} should be type (Boolean)`\n );\n};\n\nconst validateStruct = (parameter: any, input: AbiEntry, structs: AbiStructs) => {\n // c1v2 uint256 in struct\n if (input.type === Uint.u256) {\n validateUint(parameter, input);\n return;\n }\n\n assert(\n typeof parameter === 'object' && !Array.isArray(parameter),\n `Validate: arg ${input.name} is cairo type struct (${input.type}), and should be defined as js object (not array)`\n );\n\n // shallow struct validation, only first depth level\n structs[input.type].members.forEach(({ name }) => {\n assert(\n Object.keys(parameter).includes(name),\n `Validate: arg ${input.name} should have a property ${name}`\n );\n });\n};\n\nconst validateTuple = (parameter: any, input: AbiEntry) => {\n assert(\n typeof parameter === 'object' && !Array.isArray(parameter),\n `Validate: arg ${input.name} should be a tuple (defined as object)`\n );\n // todo: skip tuple structural validation for now\n};\n\nconst validateArray = (parameter: any, input: AbiEntry, structs: AbiStructs) => {\n const baseType = getArrayType(input.type);\n\n // Long text (special case when parameter is not an array but long text)\n if (isTypeFelt(baseType) && isLongText(parameter)) return;\n\n assert(Array.isArray(parameter), `Validate: arg ${input.name} should be an Array`);\n\n switch (true) {\n case isTypeFelt(baseType):\n parameter.forEach((param: BigNumberish) => validateFelt(param, input));\n break;\n case isTypeTuple(baseType):\n parameter.forEach((it: any) => validateTuple(it, { name: input.name, type: baseType }));\n break;\n case isTypeStruct(baseType, structs):\n parameter.forEach((it: any) =>\n validateStruct(it, { name: input.name, type: baseType }, structs)\n );\n break;\n case isTypeUint(baseType):\n parameter.forEach((param: BigNumberish) => validateUint(param, input));\n break;\n case isTypeBool(baseType):\n parameter.forEach((param: BigNumberish) => validateBool(param, input));\n break;\n case isTypeArray(baseType):\n parameter.forEach((param: BigNumberish) =>\n validateArray(param, { name: '', type: baseType }, structs)\n );\n break;\n default:\n throw new Error(\n `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}`\n );\n }\n};\n\nexport default function validateFields(\n abiMethod: FunctionAbi,\n args: Array,\n structs: AbiStructs\n) {\n abiMethod.inputs.reduce((acc, input) => {\n const parameter = args[acc];\n\n switch (true) {\n case isLen(input.name):\n return acc;\n case isTypeFelt(input.type):\n validateFelt(parameter, input);\n break;\n case isTypeUint(input.type):\n validateUint(parameter, input);\n break;\n case isTypeBool(input.type):\n validateBool(parameter, input);\n break;\n case isTypeContractAddress(input.type):\n // TODO: ??\n break;\n case isTypeStruct(input.type, structs):\n validateStruct(parameter, input, structs);\n break;\n case isTypeTuple(input.type):\n validateTuple(parameter, input);\n break;\n case isTypeArray(input.type):\n validateArray(parameter, input, structs);\n break;\n default:\n throw new Error(\n `Validate Unhandled: argument ${input.name}, type ${input.type}, value ${parameter}`\n );\n }\n\n return acc + 1;\n }, 0);\n}\n","/* eslint-disable no-plusplus */\nimport {\n Abi,\n AbiStructs,\n Args,\n ArgsOrCalldata,\n Calldata,\n FunctionAbi,\n HexCalldata,\n RawArgs,\n RawArgsArray,\n Result,\n ValidateType,\n} from '../../types';\nimport assert from '../assert';\nimport { isBigInt, toHex } from '../num';\nimport { getSelectorFromName } from '../selector';\nimport { isLongText, splitLongString } from '../shortString';\nimport { felt, isLen } from './cairo';\nimport formatter from './formatter';\nimport { createAbiParser, isNoConstructorValid } from './parser';\nimport { AbiParserInterface } from './parser/interface';\nimport orderPropsByAbi from './propertyOrder';\nimport { parseCalldataField } from './requestParser';\nimport responseParser from './responseParser';\nimport validateFields from './validate';\n\nexport * as cairo from './cairo';\n\nexport class CallData {\n abi: Abi;\n\n parser: AbiParserInterface;\n\n protected readonly structs: AbiStructs;\n\n constructor(abi: Abi) {\n this.structs = CallData.getAbiStruct(abi);\n this.parser = createAbiParser(abi);\n this.abi = this.parser.getLegacyFormat();\n }\n\n /**\n * Validate arguments passed to the method as corresponding to the ones in the abi\n * @param type ValidateType - type of the method\n * @param method string - name of the method\n * @param args ArgsOrCalldata - arguments that are passed to the method\n */\n public validate(type: ValidateType, method: string, args: ArgsOrCalldata = []) {\n // ensure provided method of type exists\n if (type !== ValidateType.DEPLOY) {\n const invocableFunctionNames = this.abi\n .filter((abi) => {\n if (abi.type !== 'function') return false;\n const isView = abi.stateMutability === 'view' || abi.state_mutability === 'view';\n return type === ValidateType.INVOKE ? !isView : isView;\n })\n .map((abi) => abi.name);\n assert(\n invocableFunctionNames.includes(method),\n `${type === ValidateType.INVOKE ? 'invocable' : 'viewable'} method not found in abi`\n );\n }\n\n // get requested method from abi\n const abiMethod = this.abi.find((abi) =>\n type === ValidateType.DEPLOY\n ? abi.name === method && abi.type === 'constructor'\n : abi.name === method && abi.type === 'function'\n ) as FunctionAbi;\n\n if (isNoConstructorValid(method, args, abiMethod)) {\n return;\n }\n\n // validate arguments length\n const inputsLength = this.parser.methodInputsLength(abiMethod);\n if (args.length !== inputsLength) {\n throw Error(\n `Invalid number of arguments, expected ${inputsLength} arguments, but got ${args.length}`\n );\n }\n\n // validate parameters\n validateFields(abiMethod, args, this.structs);\n }\n\n /**\n * Compile contract callData with abi\n * Parse the calldata by using input fields from the abi for that method\n * @param method string - method name\n * @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order).\n * @return Calldata - parsed arguments in format that contract is expecting\n * @example\n * ```typescript\n * const calldata = myCallData.compile(\"constructor\",[\"0x34a\",[1,3n]]);\n * ```\n * ```typescript\n * const calldata2 = myCallData.compile(\"constructor\",{list:[1,3n],balance:\"0x34\"}); // wrong order is valid\n * ```\n */\n public compile(method: string, argsCalldata: RawArgs): Calldata {\n const abiMethod = this.abi.find((abi) => abi.name === method) as FunctionAbi;\n\n if (isNoConstructorValid(method, argsCalldata, abiMethod)) {\n return [];\n }\n\n let args: RawArgsArray;\n if (Array.isArray(argsCalldata)) {\n args = argsCalldata;\n } else {\n // order the object\n const orderedObject = orderPropsByAbi(argsCalldata, abiMethod.inputs, this.structs);\n args = Object.values(orderedObject);\n // // validate array elements to abi\n validateFields(abiMethod, args, this.structs);\n }\n\n const argsIterator = args[Symbol.iterator]();\n\n const callArray = abiMethod.inputs.reduce(\n (acc, input) =>\n isLen(input.name) ? acc : acc.concat(parseCalldataField(argsIterator, input, this.structs)),\n [] as Calldata\n );\n\n // add compiled property to array object\n Object.defineProperty(callArray, '__compiled__', {\n enumerable: false,\n writable: false,\n value: true,\n });\n return callArray;\n }\n\n /**\n * Compile contract callData without abi\n * @param rawArgs RawArgs representing cairo method arguments or string array of compiled data\n * @returns Calldata\n */\n static compile(rawArgs: RawArgs): Calldata {\n const createTree = (obj: object) => {\n const getEntries = (o: object, prefix = ''): any => {\n const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o;\n return Object.entries(oe).flatMap(([k, v]) => {\n let value = v;\n if (isLongText(value)) value = splitLongString(value);\n if (k === 'entrypoint') value = getSelectorFromName(value);\n const kk = Array.isArray(oe) && k === '0' ? '$$len' : k;\n if (isBigInt(value)) return [[`${prefix}${kk}`, felt(value)]];\n return Object(value) === value\n ? getEntries(value, `${prefix}${kk}.`)\n : [[`${prefix}${kk}`, felt(value)]];\n });\n };\n return Object.fromEntries(getEntries(obj));\n };\n\n let callTreeArray;\n if (!Array.isArray(rawArgs)) {\n // flatten structs, tuples, add array length. Process leafs as Felt\n const callTree = createTree(rawArgs);\n // convert to array\n callTreeArray = Object.values(callTree);\n } else {\n // already compiled data but modified or raw args provided as array, recompile it\n // recreate tree\n const callObj = { ...rawArgs };\n const callTree = createTree(callObj);\n callTreeArray = Object.values(callTree);\n }\n\n // add compiled property to array object\n Object.defineProperty(callTreeArray, '__compiled__', {\n enumerable: false,\n writable: false,\n value: true,\n });\n return callTreeArray;\n }\n\n /**\n * Parse elements of the response array and structuring them into response object\n * @param method string - method name\n * @param response string[] - response from the method\n * @return Result - parsed response corresponding to the abi\n */\n public parse(method: string, response: string[]): Result {\n const { outputs } = this.abi.find((abi) => abi.name === method) as FunctionAbi;\n const responseIterator = response.flat()[Symbol.iterator]();\n\n const parsed = outputs.flat().reduce((acc, output, idx) => {\n const propName = output.name ?? idx;\n acc[propName] = responseParser(responseIterator, output, this.structs, acc);\n if (acc[propName] && acc[`${propName}_len`]) {\n delete acc[`${propName}_len`];\n }\n return acc;\n }, {} as Args);\n\n // Cairo1 avoid object.0 structure\n return Object.keys(parsed).length === 1 && 0 in parsed ? (parsed[0] as Result) : parsed;\n }\n\n /**\n * Format cairo method response data to native js values based on provided format schema\n * @param method string - cairo method name\n * @param response string[] - cairo method response\n * @param format object - formatter object schema\n * @returns Result - parsed and formatted response object\n */\n public format(method: string, response: string[], format: object): Result {\n const parsed = this.parse(method, response);\n return formatter(parsed, format);\n }\n\n /**\n * Helper to extract structs from abi\n * @param abi Abi\n * @returns AbiStructs - structs from abi\n */\n static getAbiStruct(abi: Abi): AbiStructs {\n return abi\n .filter((abiEntry) => abiEntry.type === 'struct')\n .reduce(\n (acc, abiEntry) => ({\n ...acc,\n [abiEntry.name]: abiEntry,\n }),\n {}\n );\n }\n\n /**\n * Helper: Compile HexCalldata | RawCalldata | RawArgs\n * @param rawCalldata HexCalldata | RawCalldata | RawArgs\n * @returns Calldata\n */\n static toCalldata(rawCalldata: RawArgs = []): Calldata {\n return CallData.compile(rawCalldata);\n }\n\n /**\n * Helper: Convert raw to HexCalldata\n * @param raw HexCalldata | RawCalldata | RawArgs\n * @returns HexCalldata\n */\n static toHex(raw: RawArgs = []): HexCalldata {\n const calldata = CallData.compile(raw);\n return calldata.map((it) => toHex(it));\n }\n}\n","/* eslint-disable no-param-reassign */\n/* eslint-disable import/extensions */\nimport { poseidonHashMany } from 'micro-starknet';\n\nimport { API_VERSION, StarknetChainId, TransactionHashPrefix } from '../constants';\nimport {\n BigNumberish,\n Builtins,\n CompiledContract,\n CompiledSierra,\n CompiledSierraCasm,\n ContractEntryPointFields,\n LegacyCompiledContract,\n RawArgs,\n RawCalldata,\n SierraContractEntryPointFields,\n} from '../types';\nimport { CallData } from './calldata';\nimport { felt } from './calldata/cairo';\nimport { starkCurve } from './ec';\nimport { addHexPrefix, utf8ToArray } from './encode';\nimport { parse, stringify } from './json';\nimport { toBigInt, toHex } from './num';\nimport { getSelectorFromName } from './selector';\nimport { encodeShortString } from './shortString';\n\nexport * as poseidon from '@noble/curves/abstract/poseidon';\nexport * from './selector'; // Preserve legacy export structure\n\nexport const transactionVersion = 1n;\nexport const transactionVersion_2 = 2n;\n// TODO: check do we need to use feeTransactionVersion at all for feeEstimation ?\n// export const feeTransactionVersion = 2n ** 128n + transactionVersion;\n// export const feeTransactionVersion_2 = 2n ** 128n + transactionVersion_2;\nexport const feeTransactionVersion = 1n;\nexport const feeTransactionVersion_2 = 2n;\n\n/**\n * Return versions based on version type, default transaction versions\n * @param versionType 'fee' | 'transaction'\n * @returns versions { v1: bigint; v2: bigint; }\n */\nexport function getVersionsByType(versionType?: 'fee' | 'transaction') {\n return versionType === 'fee'\n ? { v1: feeTransactionVersion, v2: feeTransactionVersion_2 }\n : { v1: transactionVersion, v2: transactionVersion_2 };\n}\n\nexport function computeHashOnElements(data: BigNumberish[]): string {\n return [...data, data.length]\n .reduce((x: BigNumberish, y: BigNumberish) => starkCurve.pedersen(toBigInt(x), toBigInt(y)), 0)\n .toString();\n}\n\n// following implementation is based on this python implementation:\n// https://github.com/starkware-libs/cairo-lang/blob/b614d1867c64f3fb2cf4a4879348cfcf87c3a5a7/src/starkware/starknet/core/os/transaction_hash/transaction_hash.py\n\nexport function calculateTransactionHashCommon(\n txHashPrefix: TransactionHashPrefix,\n version: BigNumberish,\n contractAddress: BigNumberish,\n entryPointSelector: BigNumberish,\n calldata: RawCalldata,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n additionalData: BigNumberish[] = []\n): string {\n const calldataHash = computeHashOnElements(calldata);\n const dataToHash = [\n txHashPrefix,\n version,\n contractAddress,\n entryPointSelector,\n calldataHash,\n maxFee,\n chainId,\n ...additionalData,\n ];\n return computeHashOnElements(dataToHash);\n}\n\nexport function calculateDeployTransactionHash(\n contractAddress: BigNumberish,\n constructorCalldata: RawCalldata,\n version: BigNumberish,\n chainId: StarknetChainId,\n constructorName: string = 'constructor'\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DEPLOY,\n version,\n contractAddress,\n getSelectorFromName(constructorName),\n constructorCalldata,\n 0,\n chainId\n );\n}\n\nexport function calculateDeclareTransactionHash(\n classHash: string,\n senderAddress: BigNumberish,\n version: BigNumberish,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish,\n compiledClassHash?: string\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DECLARE,\n version,\n senderAddress,\n 0,\n [classHash],\n maxFee,\n chainId,\n [nonce, ...(compiledClassHash ? [compiledClassHash] : [])]\n );\n}\n\nexport function calculateDeployAccountTransactionHash(\n contractAddress: BigNumberish,\n classHash: BigNumberish,\n constructorCalldata: RawCalldata,\n salt: BigNumberish,\n version: BigNumberish,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish\n) {\n const calldata = [classHash, salt, ...constructorCalldata];\n\n return calculateTransactionHashCommon(\n TransactionHashPrefix.DEPLOY_ACCOUNT,\n version,\n contractAddress,\n 0,\n calldata,\n maxFee,\n chainId,\n [nonce]\n );\n}\n\nexport function calculateTransactionHash(\n contractAddress: BigNumberish,\n version: BigNumberish,\n calldata: RawCalldata,\n maxFee: BigNumberish,\n chainId: StarknetChainId,\n nonce: BigNumberish\n): string {\n return calculateTransactionHashCommon(\n TransactionHashPrefix.INVOKE,\n version,\n contractAddress,\n 0,\n calldata,\n maxFee,\n chainId,\n [nonce]\n );\n}\n\nexport function calculateContractAddressFromHash(\n salt: BigNumberish,\n classHash: BigNumberish,\n constructorCalldata: RawArgs,\n deployerAddress: BigNumberish\n) {\n const compiledCalldata = CallData.compile(constructorCalldata);\n const constructorCalldataHash = computeHashOnElements(compiledCalldata);\n\n const CONTRACT_ADDRESS_PREFIX = felt('0x535441524b4e45545f434f4e54524143545f41444452455353'); // Equivalent to 'STARKNET_CONTRACT_ADDRESS'\n\n return computeHashOnElements([\n CONTRACT_ADDRESS_PREFIX,\n deployerAddress,\n salt,\n classHash,\n constructorCalldataHash,\n ]);\n}\n\nfunction nullSkipReplacer(key: string, value: any) {\n if (key === 'attributes' || key === 'accessible_scopes') {\n return Array.isArray(value) && value.length === 0 ? undefined : value;\n }\n\n if (key === 'debug_info') {\n return null;\n }\n\n return value === null ? undefined : value;\n}\n\n// about 10x to 100x faster using array to build string\nexport function formatSpaces(json: string) {\n let insideQuotes = false;\n const newString = [];\n // eslint-disable-next-line no-restricted-syntax\n for (const char of json) {\n if (char === '\"' && (newString.length > 0 && newString.slice(-1)[0] === '\\\\') === false) {\n insideQuotes = !insideQuotes;\n }\n if (insideQuotes) {\n newString.push(char);\n } else {\n // eslint-disable-next-line no-nested-ternary\n newString.push(char === ':' ? ': ' : char === ',' ? ', ' : char);\n }\n }\n return newString.join('');\n}\n\nexport default function computeHintedClassHash(compiledContract: LegacyCompiledContract) {\n const { abi, program } = compiledContract;\n const contractClass = { abi, program };\n const serializedJson = formatSpaces(stringify(contractClass, nullSkipReplacer));\n\n return addHexPrefix(starkCurve.keccak(utf8ToArray(serializedJson)).toString(16));\n}\n\n// Computes the class hash of a given contract class\nexport function computeLegacyContractClassHash(contract: LegacyCompiledContract | string) {\n const compiledContract =\n typeof contract === 'string' ? (parse(contract) as LegacyCompiledContract) : contract;\n\n const apiVersion = toHex(API_VERSION);\n\n const externalEntryPointsHash = computeHashOnElements(\n compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset])\n );\n\n const l1HandlerEntryPointsHash = computeHashOnElements(\n compiledContract.entry_points_by_type.L1_HANDLER.flatMap((e) => [e.selector, e.offset])\n );\n\n const constructorEntryPointHash = computeHashOnElements(\n compiledContract.entry_points_by_type.CONSTRUCTOR.flatMap((e) => [e.selector, e.offset])\n );\n\n const builtinsHash = computeHashOnElements(\n compiledContract.program.builtins.map((s) => encodeShortString(s))\n );\n\n const hintedClassHash = computeHintedClassHash(compiledContract);\n\n const dataHash = computeHashOnElements(compiledContract.program.data);\n\n return computeHashOnElements([\n apiVersion,\n externalEntryPointsHash,\n l1HandlerEntryPointsHash,\n constructorEntryPointHash,\n builtinsHash,\n hintedClassHash,\n dataHash,\n ]);\n}\n\n// Cairo1 below\nfunction hashBuiltins(builtins: Builtins) {\n return poseidonHashMany(\n builtins.flatMap((it: any) => {\n return BigInt(encodeShortString(it));\n })\n );\n}\n\nfunction hashEntryPoint(data: ContractEntryPointFields[]) {\n const base = data.flatMap((it: any) => {\n return [BigInt(it.selector), BigInt(it.offset), hashBuiltins(it.builtins)];\n });\n return poseidonHashMany(base);\n}\n\nexport function computeCompiledClassHash(casm: CompiledSierraCasm) {\n const COMPILED_CLASS_VERSION = 'COMPILED_CLASS_V1';\n\n // Hash compiled class version\n const compiledClassVersion = BigInt(encodeShortString(COMPILED_CLASS_VERSION));\n\n // Hash external entry points.\n const externalEntryPointsHash = hashEntryPoint(casm.entry_points_by_type.EXTERNAL);\n\n // Hash L1 handler entry points.\n const l1Handlers = hashEntryPoint(casm.entry_points_by_type.L1_HANDLER);\n\n // Hash constructor entry points.\n const constructor = hashEntryPoint(casm.entry_points_by_type.CONSTRUCTOR);\n\n // Hash bytecode.\n const bytecode = poseidonHashMany(casm.bytecode.map((it: string) => BigInt(it)));\n\n return toHex(\n poseidonHashMany([\n compiledClassVersion,\n externalEntryPointsHash,\n l1Handlers,\n constructor,\n bytecode,\n ])\n );\n}\n\nfunction hashEntryPointSierra(data: SierraContractEntryPointFields[]) {\n const base = data.flatMap((it: any) => {\n return [BigInt(it.selector), BigInt(it.function_idx)];\n });\n return poseidonHashMany(base);\n}\n\nfunction hashAbi(sierra: CompiledSierra) {\n const indentString = formatSpaces(stringify(sierra.abi, null));\n return BigInt(addHexPrefix(starkCurve.keccak(utf8ToArray(indentString)).toString(16)));\n}\n\nexport function computeSierraContractClassHash(sierra: CompiledSierra) {\n const CONTRACT_CLASS_VERSION = 'CONTRACT_CLASS_V0.1.0';\n\n // Hash class version\n const compiledClassVersion = BigInt(encodeShortString(CONTRACT_CLASS_VERSION));\n\n // Hash external entry points.\n const externalEntryPointsHash = hashEntryPointSierra(sierra.entry_points_by_type.EXTERNAL);\n\n // Hash L1 handler entry points.\n const l1Handlers = hashEntryPointSierra(sierra.entry_points_by_type.L1_HANDLER);\n\n // Hash constructor entry points.\n const constructor = hashEntryPointSierra(sierra.entry_points_by_type.CONSTRUCTOR);\n\n // Hash abi_hash.\n const abiHash = hashAbi(sierra);\n\n // Hash Sierra program.\n const sierraProgram = poseidonHashMany(sierra.sierra_program.map((it: string) => BigInt(it)));\n\n return toHex(\n poseidonHashMany([\n compiledClassVersion,\n externalEntryPointsHash,\n l1Handlers,\n constructor,\n abiHash,\n sierraProgram,\n ])\n );\n}\n\n/**\n * Compute ClassHash (sierra or legacy) based on provided contract\n * @param contract CompiledContract | CompiledSierra | string\n * @returns HexString ClassHash\n */\nexport function computeContractClassHash(contract: CompiledContract | string) {\n const compiledContract = typeof contract === 'string' ? parse(contract) : contract;\n\n if ('sierra_program' in compiledContract) {\n return computeSierraContractClassHash(compiledContract as CompiledSierra);\n }\n\n return computeLegacyContractClassHash(compiledContract as LegacyCompiledContract);\n}\n","// TODO rename\nexport * as starkCurve from 'micro-starknet';\nexport * as weierstrass from '@noble/curves/abstract/weierstrass';\n","// the ts-ignore suppresses an esm to cjs import error that is resolved with bundling\n// @ts-ignore\nimport * as json from 'lossless-json';\n\nconst parseIntAsNumberOrBigInt = (x: string) => {\n if (!json.isInteger(x)) return parseFloat(x);\n const v = parseInt(x, 10);\n return Number.isSafeInteger(v) ? v : BigInt(x);\n};\n// NOTE: the String() wrapping is used so the behaviour conforms to JSON.parse()\n// which can accept simple data types but is not represented in the default typing\nexport const parse = (x: string): any => json.parse(String(x), undefined, parseIntAsNumberOrBigInt);\nexport const parseAlwaysAsBig = (x: string): any =>\n json.parse(String(x), undefined, json.parseNumberAndBigInt);\n\n// NOTE: the not-null assertion is used so the return type conforms to JSON.stringify()\n// which can also return undefined but is not represented in the default typing\nexport const stringify = (\n value: json.JavaScriptValue,\n replacer?: any,\n space?: string | number | undefined,\n numberStringifiers?: json.NumberStringifier[] | undefined\n): string => json.stringify(value, replacer, space, numberStringifiers)!;\n\n/** @deprecated equivalent to 'stringify', alias will be removed */\nexport const stringifyAlwaysAsBig = stringify;\n","import { getStarkKey, utils } from 'micro-starknet';\nimport { gzip, ungzip } from 'pako';\n\nimport { ArraySignatureType, BigNumberish, CompressedProgram, Program, Signature } from '../types';\nimport { addHexPrefix, arrayBufferToString, atobUniversal, btoaUniversal } from './encode';\nimport { parse, stringify } from './json';\nimport {\n bigNumberishArrayToDecimalStringArray,\n bigNumberishArrayToHexadecimalStringArray,\n toBigInt,\n toHex,\n} from './num';\n\n/**\n * Function to compress compiled cairo program\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/services/api/gateway/transaction.py#L54-L58)\n * @param jsonProgram - json file representing the compiled cairo program\n * @returns Compressed cairo program\n */\nexport function compressProgram(jsonProgram: Program | string): CompressedProgram {\n const stringified = typeof jsonProgram === 'string' ? jsonProgram : stringify(jsonProgram);\n const compressedProgram = gzip(stringified);\n return btoaUniversal(compressedProgram);\n}\n\n/**\n * Function to decompress compressed compiled cairo program\n *\n * @param base64 CompressedProgram\n * @returns parsed decompressed compiled cairo program\n */\nexport function decompressProgram(base64: CompressedProgram) {\n if (Array.isArray(base64)) return base64;\n const decompressed = arrayBufferToString(ungzip(atobUniversal(base64)));\n return parse(decompressed);\n}\n\nexport function randomAddress(): string {\n const randomKeyPair = utils.randomPrivateKey();\n return getStarkKey(randomKeyPair);\n}\n\nexport function makeAddress(input: string): string {\n return addHexPrefix(input).toLowerCase();\n}\n\nexport function formatSignature(sig?: Signature): ArraySignatureType {\n if (!sig) throw Error('formatSignature: provided signature is undefined');\n if (Array.isArray(sig)) {\n return sig.map((it) => toHex(it));\n }\n try {\n const { r, s } = sig;\n return [toHex(r), toHex(s)];\n } catch (e) {\n throw new Error('Signature need to be weierstrass.SignatureType or an array for custom');\n }\n}\n\nexport function signatureToDecimalArray(sig?: Signature): ArraySignatureType {\n return bigNumberishArrayToDecimalStringArray(formatSignature(sig));\n}\n\nexport function signatureToHexArray(sig?: Signature): ArraySignatureType {\n return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig));\n}\n\nexport function estimatedFeeToMaxFee(estimatedFee: BigNumberish, overhead: number = 0.5): bigint {\n // BN can only handle Integers, so we need to do all calulations with integers\n const overHeadPercent = Math.round((1 + overhead) * 100);\n return (toBigInt(estimatedFee) * toBigInt(overHeadPercent)) / 100n;\n}\n","import { ContractClassResponse } from '../types';\nimport {\n CairoContract,\n CompiledSierra,\n LegacyCompiledContract,\n LegacyContractClass,\n SierraContractClass,\n} from '../types/lib/contract/index';\nimport { CompleteDeclareContractPayload, DeclareContractPayload } from '../types/lib/index';\nimport { computeCompiledClassHash, computeContractClassHash } from './hash';\nimport { parse } from './json';\nimport { decompressProgram } from './stark';\n\nexport function isSierra(\n contract: CairoContract | string\n): contract is SierraContractClass | CompiledSierra {\n const compiledContract = typeof contract === 'string' ? parse(contract) : contract;\n return 'sierra_program' in compiledContract;\n}\n\nexport function extractContractHashes(\n payload: DeclareContractPayload\n): CompleteDeclareContractPayload {\n const response = { ...payload } as CompleteDeclareContractPayload;\n\n if (isSierra(payload.contract)) {\n if (!payload.compiledClassHash && payload.casm) {\n response.compiledClassHash = computeCompiledClassHash(payload.casm);\n }\n if (!response.compiledClassHash)\n throw new Error(\n 'Extract compiledClassHash failed, provide (CairoAssembly).casm file or compiledClassHash'\n );\n }\n\n response.classHash = payload.classHash ?? computeContractClassHash(payload.contract);\n if (!response.classHash)\n throw new Error('Extract classHash failed, provide (CompiledContract).json file or classHash');\n\n return response;\n}\n\n/**\n * Helper to redeclare response Cairo0 contract\n * @param ccr ContractClassResponse\n * @returns LegacyCompiledContract\n */\nexport function contractClassResponseToLegacyCompiledContract(ccr: ContractClassResponse) {\n if (isSierra(ccr)) {\n throw Error('ContractClassResponse need to be LegacyContractClass (cairo0 response class)');\n }\n const contract = ccr as LegacyContractClass;\n return { ...contract, program: decompressProgram(contract.program) } as LegacyCompiledContract;\n}\n","import isomorphicFetch from 'isomorphic-fetch';\n\nexport default (typeof window !== 'undefined' && window.fetch) || // use buildin fetch in browser if available\n (typeof global !== 'undefined' && global.fetch) || // use buildin fetch in node, react-native and service worker if available\n isomorphicFetch; // ponyfill fetch in node and browsers that don't have it\n","import {\n CompiledContract,\n CompiledSierra,\n ContractClass,\n LegacyContractClass,\n SierraContractClass,\n} from '../types';\nimport { isSierra } from './contract';\nimport { formatSpaces } from './hash';\nimport { parse, stringify } from './json';\nimport { compressProgram } from './stark';\n\nexport function wait(delay: number) {\n return new Promise((res) => {\n setTimeout(res, delay);\n });\n}\n\nexport function createSierraContractClass(contract: CompiledSierra): SierraContractClass {\n const result = { ...contract } as any;\n delete result.sierra_program_debug_info;\n result.abi = formatSpaces(stringify(contract.abi));\n result.sierra_program = formatSpaces(stringify(contract.sierra_program));\n result.sierra_program = compressProgram(result.sierra_program);\n return result;\n}\n\n// TODO: How can we receive string here ?\nexport function parseContract(contract: CompiledContract | string): ContractClass {\n const parsedContract =\n typeof contract === 'string' ? (parse(contract) as CompiledContract) : contract;\n\n if (!isSierra(contract)) {\n return {\n ...parsedContract,\n ...('program' in parsedContract && { program: compressProgram(parsedContract.program) }),\n } as LegacyContractClass;\n }\n\n return createSierraContractClass(parsedContract as CompiledSierra);\n}\n","/**\n * Map RPC Response to common interface response\n * Intersection (sequencer response ∩ (∪ rpc responses))\n */\nimport {\n CallContractResponse,\n ContractClassResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetTransactionResponse,\n RPC,\n SimulateTransactionResponse,\n} from '../../types';\nimport { toBigInt } from '../num';\nimport { estimatedFeeToMaxFee } from '../stark';\nimport { ResponseParser } from '.';\n\ntype RpcGetBlockResponse = RPC.GetBlockWithTxHashesResponse & {\n [key: string]: any;\n};\n\ntype GetTransactionByHashResponse = RPC.GetTransactionByHashResponse & {\n [key: string]: any;\n};\n\nexport class RPCResponseParser\n implements\n Omit<\n ResponseParser,\n | 'parseDeclareContractResponse'\n | 'parseDeployContractResponse'\n | 'parseInvokeFunctionResponse'\n | 'parseGetTransactionReceiptResponse'\n >\n{\n public parseGetBlockResponse(res: RpcGetBlockResponse): GetBlockResponse {\n return {\n timestamp: res.timestamp,\n block_hash: res.block_hash,\n block_number: res.block_number,\n new_root: res.new_root,\n parent_hash: res.parent_hash,\n status: res.status,\n transactions: res.transactions,\n };\n }\n\n public parseGetTransactionResponse(res: GetTransactionByHashResponse): GetTransactionResponse {\n return {\n calldata: res.calldata || [],\n contract_address: res.contract_address,\n sender_address: res.contract_address,\n max_fee: res.max_fee,\n nonce: res.nonce,\n signature: res.signature || [],\n transaction_hash: res.transaction_hash,\n version: res.version,\n };\n }\n\n public parseFeeEstimateResponse(res: Array): EstimateFeeResponse {\n return {\n overall_fee: toBigInt(res[0].overall_fee),\n gas_consumed: toBigInt(res[0].gas_consumed),\n gas_price: toBigInt(res[0].gas_price),\n };\n }\n\n public parseFeeEstimateBulkResponse(\n res: Array\n ): EstimateFeeResponseBulk {\n return res.map((val) => ({\n overall_fee: toBigInt(val.overall_fee),\n gas_consumed: toBigInt(val.gas_consumed),\n gas_price: toBigInt(val.gas_price),\n }));\n }\n\n public parseCallContractResponse(res: Array): CallContractResponse {\n return {\n result: res,\n };\n }\n\n public parseSimulateTransactionResponse(\n res: RPC.SimulateTransactionResponse\n ): SimulateTransactionResponse {\n return res.map((it) => {\n return {\n ...it,\n suggestedMaxFee: estimatedFeeToMaxFee(BigInt(it.fee_estimation.overall_fee)),\n };\n });\n }\n\n public parseContractClassResponse(res: RPC.ContractClass): ContractClassResponse {\n return {\n ...res,\n abi: typeof res.abi === 'string' ? JSON.parse(res.abi) : res.abi,\n };\n }\n}\n","// eslint-disable-next-line max-classes-per-file\nexport function fixStack(target: Error, fn: Function = target.constructor) {\n const { captureStackTrace } = Error as any;\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n captureStackTrace && captureStackTrace(target, fn);\n}\n\nexport function fixProto(target: Error, prototype: {}) {\n const { setPrototypeOf } = Object as any;\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions, no-proto, no-param-reassign\n setPrototypeOf ? setPrototypeOf(target, prototype) : ((target as any).__proto__ = prototype);\n}\n\n/* eslint-disable max-classes-per-file */\nexport class CustomError extends Error {\n name!: string;\n\n constructor(message?: string) {\n super(message);\n // set error name as constructor name, make it not enumerable to keep native Error behavior\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target#new.target_in_constructors\n // see https://github.com/adriengibrat/ts-custom-error/issues/30\n Object.defineProperty(this, 'name', {\n value: new.target.name,\n enumerable: false,\n configurable: true,\n });\n // fix the extended error prototype chain\n // because typescript __extends implementation can't\n // see https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n fixProto(this, new.target.prototype);\n // try to remove contructor from stack trace\n fixStack(this);\n }\n}\n\nexport class LibraryError extends CustomError {}\n\nexport class GatewayError extends LibraryError {\n constructor(message: string, public errorCode: string) {\n super(message);\n }\n}\n\nexport class HttpError extends LibraryError {\n constructor(message: string, public errorCode: number) {\n super(message);\n }\n}\n","/* eslint-disable no-param-reassign */\nimport { StarknetChainId, ZERO } from '../constants';\n\nconst basicAlphabet = 'abcdefghijklmnopqrstuvwxyz0123456789-';\nconst basicSizePlusOne = BigInt(basicAlphabet.length + 1);\nconst bigAlphabet = '这来';\nconst basicAlphabetSize = BigInt(basicAlphabet.length);\nconst bigAlphabetSize = BigInt(bigAlphabet.length);\nconst bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1);\n\nfunction extractStars(str: string): [string, number] {\n let k = 0;\n while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) {\n str = str.substring(0, str.length - 1);\n k += 1;\n }\n return [str, k];\n}\n\nexport function useDecoded(encoded: bigint[]): string {\n let decoded = '';\n\n encoded.forEach((subdomain) => {\n while (subdomain !== ZERO) {\n const code = subdomain % basicSizePlusOne;\n subdomain /= basicSizePlusOne;\n if (code === BigInt(basicAlphabet.length)) {\n const nextSubdomain = subdomain / bigAlphabetSizePlusOne;\n if (nextSubdomain === ZERO) {\n const code2 = subdomain % bigAlphabetSizePlusOne;\n subdomain = nextSubdomain;\n if (code2 === ZERO) decoded += basicAlphabet[0];\n else decoded += bigAlphabet[Number(code2) - 1];\n } else {\n const code2 = subdomain % bigAlphabetSize;\n decoded += bigAlphabet[Number(code2)];\n subdomain /= bigAlphabetSize;\n }\n } else decoded += basicAlphabet[Number(code)];\n }\n\n const [str, k] = extractStars(decoded);\n if (k)\n decoded =\n str +\n (k % 2 === 0\n ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) +\n bigAlphabet[0] +\n basicAlphabet[1]\n : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1));\n decoded += '.';\n });\n\n if (!decoded) {\n return decoded;\n }\n\n return decoded.concat('stark');\n}\n\nexport function useEncoded(decoded: string): bigint {\n let encoded = BigInt(0);\n let multiplier = BigInt(1);\n\n if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) {\n const [str, k] = extractStars(decoded.substring(0, decoded.length - 2));\n decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1));\n } else {\n const [str, k] = extractStars(decoded);\n if (k) decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1));\n }\n\n for (let i = 0; i < decoded.length; i += 1) {\n const char = decoded[i];\n const index = basicAlphabet.indexOf(char);\n const bnIndex = BigInt(basicAlphabet.indexOf(char));\n\n if (index !== -1) {\n // add encoded + multiplier * index\n if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) {\n encoded += multiplier * basicAlphabetSize;\n multiplier *= basicSizePlusOne;\n // add 0\n multiplier *= basicSizePlusOne;\n } else {\n encoded += multiplier * bnIndex;\n multiplier *= basicSizePlusOne;\n }\n } else if (bigAlphabet.indexOf(char) !== -1) {\n // add encoded + multiplier * (basicAlphabetSize)\n encoded += multiplier * basicAlphabetSize;\n multiplier *= basicSizePlusOne;\n // add encoded + multiplier * index\n const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char);\n encoded += multiplier * BigInt(newid);\n multiplier *= bigAlphabetSize;\n }\n }\n\n return encoded;\n}\n\nexport const enum StarknetIdContract {\n MAINNET = '0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678',\n TESTNET = '0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce',\n}\n\nexport function getStarknetIdContract(chainId: StarknetChainId): string {\n switch (chainId) {\n case StarknetChainId.SN_MAIN:\n return StarknetIdContract.MAINNET;\n\n case StarknetChainId.SN_GOERLI:\n return StarknetIdContract.TESTNET;\n\n default:\n throw new Error('Starknet.id is not yet deployed on this network');\n }\n}\n","import { BigNumberish } from '../types';\nimport { CallData } from '../utils/calldata';\nimport { getStarknetIdContract, useDecoded, useEncoded } from '../utils/starknetId';\nimport { ProviderInterface } from './interface';\n\nexport async function getStarkName(\n provider: ProviderInterface,\n address: BigNumberish,\n StarknetIdContract?: string\n): Promise {\n const chainId = await provider.getChainId();\n const contract = StarknetIdContract ?? getStarknetIdContract(chainId);\n\n try {\n const hexDomain = await provider.callContract({\n contractAddress: contract,\n entrypoint: 'address_to_domain',\n calldata: CallData.compile({\n address,\n }),\n });\n const decimalDomain = hexDomain.result.map((element) => BigInt(element)).slice(1);\n\n const stringDomain = useDecoded(decimalDomain);\n\n if (!stringDomain) {\n throw Error('Starkname not found');\n }\n\n return stringDomain;\n } catch (e) {\n if (e instanceof Error && e.message === 'Starkname not found') {\n throw e;\n }\n throw Error('Could not get stark name');\n }\n}\n\nexport async function getAddressFromStarkName(\n provider: ProviderInterface,\n name: string,\n StarknetIdContract?: string\n): Promise {\n const chainId = await provider.getChainId();\n const contract = StarknetIdContract ?? getStarknetIdContract(chainId);\n\n try {\n const addressData = await provider.callContract({\n contractAddress: contract,\n entrypoint: 'domain_to_address',\n calldata: CallData.compile({\n domain: [useEncoded(name.replace('.stark', '')).toString(10)],\n }),\n });\n\n return addressData.result[0];\n } catch {\n throw Error('Could not get address from stark name');\n }\n}\n","/* eslint-disable max-classes-per-file */\nimport {\n BigNumberish,\n BlockIdentifier,\n BlockNumber,\n BlockTag,\n SequencerIdentifier,\n} from '../types';\nimport { isHex, toHex } from '../utils/num';\n\n/** @deprecated prefer importing from 'types' over 'provider/utils' */\nexport type { BlockIdentifier };\n\n/**\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L148-L153)\n *\n * @param hashValue\n * @param hashField\n */\nexport function formatHash(hashValue: BigNumberish): string {\n if (typeof hashValue === 'string') return hashValue;\n return toHex(hashValue);\n}\n\n/**\n *\n * [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L156-L161)\n * @param txHash\n * @param txId\n */\nexport function txIdentifier(txHash?: BigNumberish, txId?: BigNumberish): string {\n if (!txHash) {\n return `transactionId=${JSON.stringify(txId)}`;\n }\n const hashString = formatHash(txHash);\n\n return `transactionHash=${hashString}`;\n}\n\nexport const validBlockTags = Object.values(BlockTag);\n\nexport class Block {\n hash: BlockIdentifier = null;\n\n number: BlockIdentifier = null;\n\n tag: BlockIdentifier = null;\n\n private setIdentifier(__identifier: BlockIdentifier) {\n if (typeof __identifier === 'string' && isHex(__identifier)) {\n this.hash = __identifier;\n } else if (typeof __identifier === 'bigint') {\n this.hash = toHex(__identifier);\n } else if (typeof __identifier === 'number') {\n this.number = __identifier;\n } else if (\n typeof __identifier === 'string' &&\n validBlockTags.includes(__identifier as BlockTag)\n ) {\n this.tag = __identifier;\n } else {\n // default\n this.tag = BlockTag.pending;\n }\n }\n\n constructor(_identifier: BlockIdentifier) {\n this.setIdentifier(_identifier);\n }\n\n // TODO: fix any\n get queryIdentifier(): any {\n if (this.number !== null) {\n return `blockNumber=${this.number}`;\n }\n\n if (this.hash !== null) {\n return `blockHash=${this.hash}`;\n }\n\n return `blockNumber=${this.tag}`;\n }\n\n // TODO: fix any\n get identifier(): any {\n if (this.number !== null) {\n return { block_number: this.number };\n }\n\n if (this.hash !== null) {\n return { block_hash: this.hash };\n }\n\n return this.tag;\n }\n\n set identifier(_identifier: BlockIdentifier) {\n this.setIdentifier(_identifier);\n }\n\n valueOf = () => this.number;\n\n toString = () => this.hash;\n\n get sequencerIdentifier(): SequencerIdentifier {\n return this.hash !== null\n ? { blockHash: this.hash as string }\n : { blockNumber: (this.number ?? this.tag) as BlockNumber };\n }\n}\n","import { StarknetChainId } from '../constants';\nimport {\n AccountInvocationItem,\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n LegacyContractClass,\n RPC,\n RpcProviderOptions,\n SIMULATION_FLAG,\n SierraContractClass,\n SimulateTransactionResponse,\n TransactionStatus,\n TransactionType,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { isSierra } from '../utils/contract';\nimport fetch from '../utils/fetchPonyfill';\nimport {\n getSelectorFromName,\n getVersionsByType,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { stringify } from '../utils/json';\nimport { toHex, toStorageKey } from '../utils/num';\nimport { wait } from '../utils/provider';\nimport { RPCResponseParser } from '../utils/responseParser/rpc';\nimport { decompressProgram, signatureToHexArray } from '../utils/stark';\nimport { LibraryError } from './errors';\nimport { ProviderInterface } from './interface';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\nimport { Block } from './utils';\n\n// Default Pathfinder disabled pending block https://github.com/eqlabs/pathfinder/blob/main/README.md\n// Note that pending support is disabled by default and must be enabled by setting poll-pending=true in the configuration options.\nconst defaultOptions = {\n headers: { 'Content-Type': 'application/json' },\n blockIdentifier: 'latest',\n retries: 200,\n};\n\nexport class RpcProvider implements ProviderInterface {\n public nodeUrl: string;\n\n public headers: object;\n\n private responseParser = new RPCResponseParser();\n\n private retries: number;\n\n private blockIdentifier: BlockIdentifier;\n\n private chainId?: StarknetChainId;\n\n constructor(optionsOrProvider: RpcProviderOptions) {\n const { nodeUrl, retries, headers, blockIdentifier, chainId } = optionsOrProvider;\n this.nodeUrl = nodeUrl;\n this.retries = retries || defaultOptions.retries;\n this.headers = { ...defaultOptions.headers, ...headers };\n this.blockIdentifier = blockIdentifier || defaultOptions.blockIdentifier;\n this.chainId = chainId;\n this.getChainId(); // internally skipped if chainId has value\n }\n\n public fetch(method: any, params: any): Promise {\n const body = stringify({ method, jsonrpc: '2.0', params, id: 0 });\n return fetch(this.nodeUrl, {\n method: 'POST',\n body,\n headers: this.headers as Record,\n });\n }\n\n protected errorHandler(error: any) {\n if (error) {\n const { code, message } = error;\n throw new LibraryError(`${code}: ${message}`);\n }\n }\n\n protected async fetchEndpoint(\n method: T,\n params?: RPC.Methods[T]['params']\n ): Promise {\n try {\n const rawResult = await this.fetch(method, params);\n const { error, result } = await rawResult.json();\n this.errorHandler(error);\n return result as RPC.Methods[T]['result'];\n } catch (error: any) {\n this.errorHandler(error?.response?.data);\n throw error;\n }\n }\n\n // Methods from Interface\n public async getChainId(): Promise {\n this.chainId ??= (await this.fetchEndpoint('starknet_chainId')) as StarknetChainId;\n return this.chainId;\n }\n\n public async getBlock(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.getBlockWithTxHashes(blockIdentifier).then(\n this.responseParser.parseGetBlockResponse\n );\n }\n\n public async getBlockHashAndNumber(): Promise {\n return this.fetchEndpoint('starknet_blockHashAndNumber');\n }\n\n public async getBlockWithTxHashes(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockWithTxHashes', { block_id });\n }\n\n public async getBlockWithTxs(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockWithTxs', { block_id });\n }\n\n public async getClassHashAt(\n contractAddress: RPC.ContractAddress,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClassHashAt', {\n block_id,\n contract_address: contractAddress,\n });\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getNonce', {\n contract_address: contractAddress,\n block_id,\n });\n }\n\n public async getPendingTransactions(): Promise {\n return this.fetchEndpoint('starknet_pendingTransactions');\n }\n\n public async getProtocolVersion(): Promise {\n throw new Error('Pathfinder does not implement this rpc 0.1.0 method');\n }\n\n public async getStateUpdate(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getStateUpdate', { block_id });\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const parsedKey = toStorageKey(key);\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getStorageAt', {\n contract_address: contractAddress,\n key: parsedKey,\n block_id,\n });\n }\n\n // Methods from Interface\n public async getTransaction(txHash: string): Promise {\n return this.getTransactionByHash(txHash).then(this.responseParser.parseGetTransactionResponse);\n }\n\n public async getTransactionByHash(txHash: string): Promise {\n return this.fetchEndpoint('starknet_getTransactionByHash', { transaction_hash: txHash });\n }\n\n public async getTransactionByBlockIdAndIndex(\n blockIdentifier: BlockIdentifier,\n index: number\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getTransactionByBlockIdAndIndex', { block_id, index });\n }\n\n public async getTransactionReceipt(txHash: string): Promise {\n return this.fetchEndpoint('starknet_getTransactionReceipt', { transaction_hash: txHash });\n }\n\n public async getClassByHash(classHash: RPC.Felt): Promise {\n return this.getClass(classHash);\n }\n\n public async getClass(\n classHash: RPC.Felt,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClass', {\n class_hash: classHash,\n block_id,\n }).then(this.responseParser.parseContractClassResponse);\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getClassAt', {\n block_id,\n contract_address: contractAddress,\n }).then(this.responseParser.parseContractClassResponse);\n }\n\n public async getCode(\n _contractAddress: string,\n _blockIdentifier?: BlockIdentifier\n ): Promise {\n throw new Error('RPC does not implement getCode function');\n }\n\n public async getEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier);\n }\n\n public async getInvokeEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.INVOKE,\n ...invocation,\n ...invocationDetails,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getDeclareEstimateFee(\n invocation: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DECLARE,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getDeployAccountEstimateFee(\n invocation: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('starknet_estimateFee', {\n request: [transaction],\n block_id,\n }).then(this.responseParser.parseFeeEstimateResponse);\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n { blockIdentifier = this.blockIdentifier, skipValidate = false }: getEstimateFeeBulkOptions\n ): Promise {\n if (skipValidate) {\n // eslint-disable-next-line no-console\n console.warn('getEstimateFeeBulk RPC does not support skipValidate');\n }\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_estimateFee', {\n request: invocations.map((it) => this.buildTransaction(it, 'fee')),\n block_id,\n }).then(this.responseParser.parseFeeEstimateBulkResponse);\n }\n\n public async declareContract(\n { contract, signature, senderAddress, compiledClassHash }: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n if (!isSierra(contract)) {\n return this.fetchEndpoint('starknet_addDeclareTransaction', {\n declare_transaction: {\n type: RPC.TransactionType.DECLARE,\n contract_class: {\n program: contract.program,\n entry_points_by_type: contract.entry_points_by_type,\n abi: contract.abi,\n },\n version: toHex(transactionVersion),\n max_fee: toHex(details.maxFee || 0),\n signature: signatureToHexArray(signature),\n sender_address: senderAddress,\n nonce: toHex(details.nonce),\n },\n });\n }\n return this.fetchEndpoint('starknet_addDeclareTransaction', {\n declare_transaction: {\n type: RPC.TransactionType.DECLARE,\n contract_class: {\n sierra_program: decompressProgram(contract.sierra_program),\n contract_class_version: contract.contract_class_version,\n entry_points_by_type: contract.entry_points_by_type,\n abi: contract.abi,\n },\n compiled_class_hash: compiledClassHash || '',\n version: toHex(transactionVersion_2),\n max_fee: toHex(details.maxFee || 0),\n signature: signatureToHexArray(signature),\n sender_address: senderAddress,\n nonce: toHex(details.nonce),\n },\n });\n }\n\n public async deployAccountContract(\n { classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('starknet_addDeployAccountTransaction', {\n deploy_account_transaction: {\n constructor_calldata: CallData.toHex(constructorCalldata || []),\n class_hash: toHex(classHash),\n contract_address_salt: toHex(addressSalt || 0),\n type: RPC.TransactionType.DEPLOY_ACCOUNT,\n max_fee: toHex(details.maxFee || 0),\n version: toHex(details.version || 0),\n signature: signatureToHexArray(signature),\n nonce: toHex(details.nonce),\n },\n });\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('starknet_addInvokeTransaction', {\n invoke_transaction: {\n sender_address: functionInvocation.contractAddress,\n calldata: CallData.toHex(functionInvocation.calldata),\n type: RPC.TransactionType.INVOKE,\n max_fee: toHex(details.maxFee || 0),\n version: '0x1',\n signature: signatureToHexArray(functionInvocation.signature),\n nonce: toHex(details.nonce),\n },\n });\n }\n\n // Methods from Interface\n public async callContract(\n call: Call,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n const result = await this.fetchEndpoint('starknet_call', {\n request: {\n contract_address: call.contractAddress,\n entry_point_selector: getSelectorFromName(call.entrypoint),\n calldata: CallData.toHex(call.calldata),\n },\n block_id,\n });\n\n return this.responseParser.parseCallContractResponse(result);\n }\n\n public async traceTransaction(transactionHash: RPC.TransactionHash): Promise {\n return this.fetchEndpoint('starknet_traceTransaction', { transaction_hash: transactionHash });\n }\n\n public async traceBlockTransactions(blockHash: RPC.BlockHash): Promise {\n return this.fetchEndpoint('starknet_traceBlockTransactions', { block_hash: blockHash });\n }\n\n public async waitForTransaction(txHash: string, options?: waitForTransactionOptions) {\n const errorStates = [TransactionStatus.REJECTED, TransactionStatus.NOT_RECEIVED];\n let { retries } = this;\n let onchain = false;\n let txReceipt: any = {};\n\n const retryInterval = options?.retryInterval ?? 8000;\n const successStates = options?.successStates ?? [\n TransactionStatus.ACCEPTED_ON_L1,\n TransactionStatus.ACCEPTED_ON_L2,\n ];\n\n while (!onchain) {\n // eslint-disable-next-line no-await-in-loop\n await wait(retryInterval);\n try {\n // eslint-disable-next-line no-await-in-loop\n txReceipt = await this.getTransactionReceipt(txHash);\n\n if (!('status' in txReceipt)) {\n const error = new Error('transaction status');\n throw error;\n }\n\n if (txReceipt.status && successStates.includes(txReceipt.status)) {\n onchain = true;\n } else if (txReceipt.status && errorStates.includes(txReceipt.status)) {\n const message = txReceipt.status;\n const error = new Error(message) as Error & { response: any };\n error.response = txReceipt;\n throw error;\n }\n } catch (error: unknown) {\n if (error instanceof Error && errorStates.includes(error.message as TransactionStatus)) {\n throw error;\n }\n\n if (retries === 0) {\n throw new Error(`waitForTransaction timed-out with retries ${this.retries}`);\n }\n }\n\n retries -= 1;\n }\n\n await wait(retryInterval);\n return txReceipt;\n }\n\n /**\n * Gets the transaction count from a block.\n *\n *\n * @param blockIdentifier\n * @returns Number of transactions\n */\n public async getTransactionCount(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n return this.fetchEndpoint('starknet_getBlockTransactionCount', { block_id });\n }\n\n /**\n * Gets the latest block number\n *\n *\n * @returns Number of the latest block\n */\n public async getBlockNumber(): Promise {\n return this.fetchEndpoint('starknet_blockNumber');\n }\n\n /**\n * Gets syncing status of the node\n *\n *\n * @returns Object with the stats data\n */\n public async getSyncingStats(): Promise {\n return this.fetchEndpoint('starknet_syncing');\n }\n\n /**\n * Gets all the events filtered\n *\n *\n * @returns events and the pagination of the events\n */\n public async getEvents(eventFilter: RPC.EventFilter): Promise {\n return this.fetchEndpoint('starknet_getEvents', { filter: eventFilter });\n }\n\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n {\n blockIdentifier = this.blockIdentifier,\n skipValidate = false,\n skipExecute = false,\n }: getSimulateTransactionOptions\n ): Promise {\n const block_id = new Block(blockIdentifier).identifier;\n\n const simulationFlags = [];\n if (skipValidate) simulationFlags.push(SIMULATION_FLAG.SKIP_VALIDATE);\n if (skipExecute) simulationFlags.push(SIMULATION_FLAG.SKIP_EXECUTE);\n\n return this.fetchEndpoint('starknet_simulateTransaction', {\n block_id,\n transactions: invocations.map((it) => this.buildTransaction(it)), // TODO: Pathfinder 0.5.6 bug, should be transaction\n simulation_flags: simulationFlags,\n }).then(this.responseParser.parseSimulateTransactionResponse);\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n\n public buildTransaction(\n invocation: AccountInvocationItem,\n versionType?: 'fee' | 'transaction'\n ): RPC.BroadcastedTransaction {\n const defaultVersions = getVersionsByType(versionType);\n const details = {\n signature: signatureToHexArray(invocation.signature),\n nonce: toHex(invocation.nonce),\n max_fee: toHex(invocation.maxFee || 0),\n };\n\n if (invocation.type === TransactionType.INVOKE) {\n return {\n type: RPC.TransactionType.INVOKE, // Diff between sequencer and rpc invoke type\n sender_address: invocation.contractAddress,\n calldata: CallData.toHex(invocation.calldata),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n if (invocation.type === RPC.TransactionType.DECLARE) {\n if (!isSierra(invocation.contract)) {\n const legacyContract = invocation.contract as LegacyContractClass;\n return {\n type: invocation.type,\n contract_class: legacyContract,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n const sierraContract = invocation.contract as SierraContractClass;\n return {\n // compiled_class_hash\n type: invocation.type,\n contract_class: {\n ...sierraContract,\n sierra_program: decompressProgram(sierraContract.sierra_program),\n },\n compiled_class_hash: invocation.compiledClassHash || '',\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v2),\n ...details,\n };\n }\n if (invocation.type === TransactionType.DEPLOY_ACCOUNT) {\n return {\n type: invocation.type,\n constructor_calldata: CallData.toHex(invocation.constructorCalldata || []),\n class_hash: toHex(invocation.classHash),\n contract_address_salt: toHex(invocation.addressSalt || 0),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n throw Error('RPC buildTransaction received unknown TransactionType');\n }\n}\n","import urljoin from 'url-join';\n\nimport { BaseUrl, NetworkName, StarknetChainId } from '../constants';\nimport {\n AccountInvocationItem,\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n BlockTag,\n CairoAssembly,\n Call,\n CallContractResponse,\n CallL1Handler,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetContractAddressesResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n GetTransactionStatusResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Sequencer,\n SequencerHttpMethod,\n SequencerProviderOptions,\n SimulateTransactionResponse,\n StateUpdateResponse,\n TransactionStatus,\n TransactionType,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { isSierra } from '../utils/contract';\nimport fetch from '../utils/fetchPonyfill';\nimport {\n getSelector,\n getSelectorFromName,\n getVersionsByType,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { parse, parseAlwaysAsBig, stringify } from '../utils/json';\nimport { getDecimalString, getHexString, getHexStringArray, toBigInt, toHex } from '../utils/num';\nimport { wait } from '../utils/provider';\nimport { SequencerAPIResponseParser } from '../utils/responseParser/sequencer';\nimport { randomAddress, signatureToDecimalArray } from '../utils/stark';\nimport { buildUrl } from '../utils/url';\nimport { GatewayError, HttpError, LibraryError } from './errors';\nimport { ProviderInterface } from './interface';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\nimport { Block } from './utils';\n\nfunction isEmptyQueryObject(obj?: Record): obj is undefined {\n return (\n obj === undefined ||\n Object.keys(obj).length === 0 ||\n (Object.keys(obj).length === 1 &&\n Object.entries(obj).every(([k, v]) => k === 'blockIdentifier' && v === null))\n );\n}\n\nconst defaultOptions = {\n network: NetworkName.SN_GOERLI2,\n blockIdentifier: BlockTag.pending,\n};\n\nexport class SequencerProvider implements ProviderInterface {\n public baseUrl: string;\n\n public feederGatewayUrl: string;\n\n public gatewayUrl: string;\n\n public headers?: Record;\n\n private blockIdentifier: BlockIdentifier;\n\n private chainId: StarknetChainId;\n\n private responseParser = new SequencerAPIResponseParser();\n\n constructor(optionsOrProvider: SequencerProviderOptions = defaultOptions) {\n if ('network' in optionsOrProvider) {\n this.baseUrl = SequencerProvider.getNetworkFromName(optionsOrProvider.network);\n this.feederGatewayUrl = buildUrl(this.baseUrl, 'feeder_gateway');\n this.gatewayUrl = buildUrl(this.baseUrl, 'gateway');\n } else {\n this.baseUrl = optionsOrProvider.baseUrl;\n this.feederGatewayUrl = buildUrl(\n this.baseUrl,\n 'feeder_gateway',\n optionsOrProvider.feederGatewayUrl\n );\n this.gatewayUrl = buildUrl(this.baseUrl, 'gateway', optionsOrProvider.gatewayUrl);\n }\n this.chainId =\n optionsOrProvider?.chainId ?? SequencerProvider.getChainIdFromBaseUrl(this.baseUrl);\n this.headers = optionsOrProvider.headers;\n this.blockIdentifier = optionsOrProvider?.blockIdentifier || defaultOptions.blockIdentifier;\n }\n\n protected static getNetworkFromName(name: NetworkName | StarknetChainId) {\n switch (name) {\n case NetworkName.SN_MAIN || StarknetChainId.SN_MAIN:\n return BaseUrl.SN_MAIN;\n case NetworkName.SN_GOERLI || StarknetChainId.SN_GOERLI:\n return BaseUrl.SN_GOERLI;\n case NetworkName.SN_GOERLI2 || StarknetChainId.SN_GOERLI2:\n return BaseUrl.SN_GOERLI2;\n default:\n throw new Error('Could not detect base url from NetworkName');\n }\n }\n\n protected static getChainIdFromBaseUrl(baseUrl: string): StarknetChainId {\n try {\n const url = new URL(baseUrl);\n if (url.host.includes('mainnet.starknet.io')) {\n return StarknetChainId.SN_MAIN;\n }\n if (url.host.includes('alpha4-2.starknet.io')) {\n return StarknetChainId.SN_GOERLI2;\n }\n return StarknetChainId.SN_GOERLI;\n } catch {\n // eslint-disable-next-line no-console\n console.error(`Could not parse baseUrl: ${baseUrl}`);\n return StarknetChainId.SN_GOERLI;\n }\n }\n\n private getFetchUrl(endpoint: keyof Sequencer.Endpoints) {\n const gatewayUrlEndpoints = ['add_transaction'];\n return gatewayUrlEndpoints.includes(endpoint) ? this.gatewayUrl : this.feederGatewayUrl;\n }\n\n private getFetchMethod(endpoint: keyof Sequencer.Endpoints) {\n const postMethodEndpoints = [\n 'add_transaction',\n 'call_contract',\n 'estimate_fee',\n 'estimate_message_fee',\n 'estimate_fee_bulk',\n 'simulate_transaction',\n ];\n\n return postMethodEndpoints.includes(endpoint) ? 'POST' : 'GET';\n }\n\n private getQueryString(query?: Record): string {\n if (isEmptyQueryObject(query)) {\n return '';\n }\n const queryString = Object.entries(query)\n .map(([key, value]) => {\n if (key === 'blockIdentifier') {\n const block = new Block(value);\n return `${block.queryIdentifier}`;\n }\n return `${key}=${value}`;\n })\n .join('&');\n\n return `?${queryString}`;\n }\n\n private getHeaders(method: SequencerHttpMethod): Record | undefined {\n if (method === 'POST') {\n return {\n 'Content-Type': 'application/json',\n ...this.headers,\n };\n }\n return this.headers;\n }\n\n // typesafe fetch\n protected async fetchEndpoint(\n endpoint: T,\n // typescript type magic to create a nice fitting function interface\n ...[query, request]: Sequencer.Endpoints[T]['QUERY'] extends never\n ? Sequencer.Endpoints[T]['REQUEST'] extends never\n ? [] // when no query and no request is needed, we can omit the query and request parameters\n : [undefined, Sequencer.Endpoints[T]['REQUEST']]\n : Sequencer.Endpoints[T]['REQUEST'] extends never\n ? [Sequencer.Endpoints[T]['QUERY']] // when no request is needed, we can omit the request parameter\n : [Sequencer.Endpoints[T]['QUERY'], Sequencer.Endpoints[T]['REQUEST']] // when both query and request are needed, we cant omit anything\n ): Promise {\n const baseUrl = this.getFetchUrl(endpoint);\n const method = this.getFetchMethod(endpoint);\n const queryString = this.getQueryString(query);\n const url = urljoin(baseUrl, endpoint, queryString);\n\n return this.fetch(url, {\n method,\n body: request,\n });\n }\n\n public async fetch(\n endpoint: string,\n options?: {\n method?: SequencerHttpMethod;\n body?: any;\n parseAlwaysAsBigInt?: boolean;\n }\n ): Promise {\n const url = buildUrl(this.baseUrl, '', endpoint);\n const method = options?.method ?? 'GET';\n const headers = this.getHeaders(method);\n const body = stringify(options?.body);\n try {\n const response = await fetch(url, {\n method,\n body,\n headers,\n });\n const textResponse = await response.text();\n\n if (!response.ok) {\n // This will allow the user to handle contract errors\n let responseBody: any;\n try {\n responseBody = parse(textResponse);\n } catch {\n throw new HttpError(response.statusText, response.status);\n }\n throw new GatewayError(responseBody.message, responseBody.code);\n }\n\n const parseChoice = options?.parseAlwaysAsBigInt ? parseAlwaysAsBig : parse;\n return parseChoice(textResponse);\n } catch (error) {\n if (error instanceof Error && !(error instanceof LibraryError))\n throw Error(`Could not ${method} from endpoint \\`${url}\\`: ${error.message}`);\n\n throw error;\n }\n }\n\n public async getChainId(): Promise {\n return Promise.resolve(this.chainId);\n }\n\n public async callContract(\n { contractAddress, entrypoint: entryPointSelector, calldata = [] }: Call,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint(\n 'call_contract',\n { blockIdentifier },\n {\n // TODO - determine best choice once both are fully supported in devnet\n // signature: [],\n // sender_address: contractAddress,\n contract_address: contractAddress,\n entry_point_selector: getSelectorFromName(entryPointSelector),\n calldata: CallData.compile(calldata),\n }\n ).then(this.responseParser.parseCallContractResponse);\n }\n\n public async getBlock(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_block', { blockIdentifier }).then(\n this.responseParser.parseGetBlockResponse\n );\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_nonce', { contractAddress, blockIdentifier });\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const parsedKey = toBigInt(key).toString(10);\n return this.fetchEndpoint('get_storage_at', {\n blockIdentifier,\n contractAddress,\n key: parsedKey,\n });\n }\n\n public async getTransaction(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction', { transactionHash: txHashHex }).then((result) => {\n // throw for no matching transaction to unify behavior with RPC and avoid parsing errors\n if (Object.values(result).length === 1) throw new LibraryError(result.status);\n return this.responseParser.parseGetTransactionResponse(result);\n });\n }\n\n public async getTransactionReceipt(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_receipt', { transactionHash: txHashHex }).then(\n this.responseParser.parseGetTransactionReceiptResponse\n );\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_full_contract', { blockIdentifier, contractAddress }).then(\n this.responseParser.parseContractClassResponse\n );\n }\n\n public async getClassHashAt(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_class_hash_at', { blockIdentifier, contractAddress });\n }\n\n public async getClassByHash(\n classHash: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_class_by_hash', { classHash, blockIdentifier }).then(\n this.responseParser.parseContractClassResponse\n );\n }\n\n public async getCompiledClassByClassHash(\n classHash: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_compiled_class_by_class_hash', { classHash, blockIdentifier });\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.INVOKE,\n sender_address: functionInvocation.contractAddress,\n calldata: CallData.compile(functionInvocation.calldata ?? []),\n signature: signatureToDecimalArray(functionInvocation.signature),\n nonce: toHex(details.nonce),\n max_fee: toHex(details.maxFee || 0),\n version: '0x1',\n }).then(this.responseParser.parseInvokeFunctionResponse);\n }\n\n public async deployAccountContract(\n { classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DEPLOY_ACCOUNT,\n contract_address_salt: addressSalt ?? randomAddress(),\n constructor_calldata: CallData.compile(constructorCalldata ?? []),\n class_hash: toHex(classHash),\n max_fee: toHex(details.maxFee || 0),\n version: toHex(details.version || 0),\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n }).then(this.responseParser.parseDeployContractResponse);\n }\n\n public async declareContract(\n { senderAddress, contract, signature, compiledClassHash }: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n if (!isSierra(contract)) {\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DECLARE,\n contract_class: contract,\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n sender_address: senderAddress,\n max_fee: toHex(details.maxFee || 0),\n version: toHex(transactionVersion),\n }).then(this.responseParser.parseDeclareContractResponse);\n }\n // Cairo 1\n return this.fetchEndpoint('add_transaction', undefined, {\n type: TransactionType.DECLARE,\n sender_address: senderAddress,\n compiled_class_hash: compiledClassHash,\n contract_class: contract,\n nonce: toHex(details.nonce),\n signature: signatureToDecimalArray(signature),\n max_fee: toHex(details.maxFee || 0),\n version: toHex(transactionVersion_2),\n }).then(this.responseParser.parseDeclareContractResponse);\n }\n\n public async getEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n return this.getInvokeEstimateFee(invocation, invocationDetails, blockIdentifier, skipValidate);\n }\n\n public async getInvokeEstimateFee(\n invocation: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.INVOKE,\n ...invocation,\n ...invocationDetails,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getDeclareEstimateFee(\n invocation: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DECLARE,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getDeployAccountEstimateFee(\n invocation: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier = this.blockIdentifier,\n skipValidate: boolean = false\n ): Promise {\n const transaction = this.buildTransaction(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n ...invocation,\n ...details,\n },\n 'fee'\n );\n return this.fetchEndpoint('estimate_fee', { blockIdentifier, skipValidate }, transaction).then(\n this.responseParser.parseFeeEstimateResponse\n );\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n { blockIdentifier = this.blockIdentifier, skipValidate = false }: getEstimateFeeBulkOptions\n ): Promise {\n const transactions = invocations.map((it) => this.buildTransaction(it, 'fee'));\n return this.fetchEndpoint(\n 'estimate_fee_bulk',\n { blockIdentifier, skipValidate },\n transactions\n ).then(this.responseParser.parseFeeEstimateBulkResponse);\n }\n\n public async getCode(\n contractAddress: string,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n return this.fetchEndpoint('get_code', { contractAddress, blockIdentifier });\n }\n\n public async waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions) {\n const errorStates = [TransactionStatus.REJECTED, TransactionStatus.NOT_RECEIVED];\n let onchain = false;\n let res;\n const retryInterval = options?.retryInterval ?? 8000;\n const successStates = options?.successStates ?? [\n TransactionStatus.ACCEPTED_ON_L1,\n TransactionStatus.ACCEPTED_ON_L2,\n ];\n\n while (!onchain) {\n // eslint-disable-next-line no-await-in-loop\n await wait(retryInterval);\n // eslint-disable-next-line no-await-in-loop\n res = await this.getTransactionStatus(txHash);\n\n if (successStates.includes(res.tx_status)) {\n onchain = true;\n } else if (errorStates.includes(res.tx_status)) {\n const message = res.tx_failure_reason\n ? `${res.tx_status}: ${res.tx_failure_reason.code}\\n${res.tx_failure_reason.error_message}`\n : res.tx_status;\n const error = new Error(message) as Error & { response: GetTransactionStatusResponse };\n error.response = res;\n throw error;\n }\n }\n const txReceipt = await this.getTransactionReceipt(txHash);\n return txReceipt;\n }\n\n /**\n * Gets the status of a transaction.\n * @param txHash BigNumberish\n * @returns GetTransactionStatusResponse - the transaction status object\n */\n public async getTransactionStatus(txHash: BigNumberish): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_status', { transactionHash: txHashHex });\n }\n\n /**\n * Gets the smart contract address on the goerli testnet.\n * @returns GetContractAddressesResponse - starknet smart contract addresses\n */\n public async getContractAddresses(): Promise {\n return this.fetchEndpoint('get_contract_addresses');\n }\n\n /**\n * Gets the transaction trace from a tx id.\n * @param txHash BigNumberish\n * @returns TransactionTraceResponse - the transaction trace\n */\n public async getTransactionTrace(\n txHash: BigNumberish\n ): Promise {\n const txHashHex = toHex(txHash);\n return this.fetchEndpoint('get_transaction_trace', { transactionHash: txHashHex });\n }\n\n public async estimateMessageFee(\n { from_address, to_address, entry_point_selector, payload }: CallL1Handler,\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const validCallL1Handler = {\n from_address: getDecimalString(from_address),\n to_address: getHexString(to_address),\n entry_point_selector: getSelector(entry_point_selector),\n payload: getHexStringArray(payload),\n };\n\n return this.fetchEndpoint('estimate_message_fee', { blockIdentifier }, validCallL1Handler);\n }\n\n /**\n * Simulate transaction using Sequencer provider\n * WARNING!: Sequencer will process only first element from invocations array\n *\n * @param invocations Array of invocations, but only first invocation will be processed\n * @param blockIdentifier block identifier, default 'latest'\n * @param skipValidate Skip Account __validate__ method\n * @returns\n */\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n {\n blockIdentifier = this.blockIdentifier,\n skipValidate = false,\n skipExecute = false,\n }: getSimulateTransactionOptions\n ): Promise {\n if (invocations.length > 1) {\n // eslint-disable-next-line no-console\n console.warn('Sequencer simulate process only first element from invocations list');\n }\n if (skipExecute) {\n // eslint-disable-next-line no-console\n console.warn(\"Sequencer can't skip account __execute__\");\n }\n const transaction = this.buildTransaction(invocations[0]);\n return this.fetchEndpoint(\n 'simulate_transaction',\n {\n blockIdentifier,\n skipValidate: skipValidate ?? false,\n },\n transaction\n ).then(this.responseParser.parseSimulateTransactionResponse);\n }\n\n public async getStateUpdate(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const args = new Block(blockIdentifier).sequencerIdentifier;\n return this.fetchEndpoint('get_state_update', { ...args }).then(\n this.responseParser.parseGetStateUpdateResponse\n );\n }\n\n // consider adding an optional trace retrieval parameter to the getBlock method\n public async getBlockTraces(\n blockIdentifier: BlockIdentifier = this.blockIdentifier\n ): Promise {\n const args = new Block(blockIdentifier).sequencerIdentifier;\n return this.fetchEndpoint('get_block_traces', { ...args });\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n\n /**\n * Build Single AccountTransaction from Single AccountInvocation\n * @param invocation AccountInvocationItem\n * @param versionType 'fee' | 'transaction' - used to determine default versions\n * @returns AccountTransactionItem\n */\n public buildTransaction(\n invocation: AccountInvocationItem,\n versionType?: 'fee' | 'transaction'\n ): Sequencer.AccountTransactionItem {\n const defaultVersions = getVersionsByType(versionType);\n const details = {\n signature: signatureToDecimalArray(invocation.signature),\n nonce: toHex(invocation.nonce),\n };\n\n if (invocation.type === TransactionType.INVOKE) {\n return {\n type: invocation.type,\n sender_address: invocation.contractAddress,\n calldata: CallData.compile(invocation.calldata ?? []),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n if (invocation.type === TransactionType.DECLARE) {\n if (!isSierra(invocation.contract)) {\n return {\n type: invocation.type,\n contract_class: invocation.contract,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v1), // fee from getDeclareEstimateFee use t.v. instead of feet.v.\n ...details,\n };\n }\n return {\n type: invocation.type,\n contract_class: invocation.contract,\n compiled_class_hash: invocation.compiledClassHash,\n sender_address: invocation.senderAddress,\n version: toHex(invocation.version || defaultVersions.v2), // fee on getDeclareEstimateFee use t.v. instead of feet.v.\n ...details,\n };\n }\n if (invocation.type === TransactionType.DEPLOY_ACCOUNT) {\n return {\n type: invocation.type,\n constructor_calldata: CallData.compile(invocation.constructorCalldata || []),\n class_hash: toHex(invocation.classHash),\n contract_address_salt: toHex(invocation.addressSalt || 0),\n version: toHex(invocation.version || defaultVersions.v1),\n ...details,\n };\n }\n throw Error('Sequencer buildTransaction received unknown TransactionType');\n }\n}\n","import {\n CallContractResponse,\n DeclareContractResponse,\n DeployContractResponse,\n EstimateFeeResponse,\n GetBlockResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n InvokeFunctionResponse,\n SimulateTransactionResponse,\n} from '../../types';\n\nexport abstract class ResponseParser {\n abstract parseGetBlockResponse(res: any): GetBlockResponse;\n\n abstract parseGetTransactionResponse(res: any): GetTransactionResponse;\n\n abstract parseGetTransactionReceiptResponse(res: any): GetTransactionReceiptResponse;\n\n abstract parseFeeEstimateResponse(res: any): EstimateFeeResponse;\n\n abstract parseCallContractResponse(res: any): CallContractResponse;\n\n abstract parseInvokeFunctionResponse(res: any): InvokeFunctionResponse;\n\n abstract parseDeployContractResponse(res: any): DeployContractResponse;\n\n abstract parseDeclareContractResponse(res: any): DeclareContractResponse;\n\n abstract parseSimulateTransactionResponse(res: any): SimulateTransactionResponse;\n}\n","/**\n * Map Sequencer Response to common interface response\n * Intersection (sequencer response ∩ (∪ rpc responses))\n */\n\nimport {\n CallContractResponse,\n CompiledContract,\n ContractClassResponse,\n DeclareContractResponse,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n HexCalldata,\n InvokeFunctionResponse,\n Sequencer,\n SimulateTransactionResponse,\n StateUpdateResponse,\n} from '../../types';\nimport { isSierra } from '../contract';\nimport { toBigInt } from '../num';\nimport { parseContract } from '../provider';\nimport { estimatedFeeToMaxFee } from '../stark';\nimport { ResponseParser } from '.';\n\nexport class SequencerAPIResponseParser extends ResponseParser {\n public parseGetBlockResponse(res: Sequencer.GetBlockResponse): GetBlockResponse {\n return {\n ...res,\n new_root: res.state_root,\n parent_hash: res.parent_block_hash,\n transactions: Object.values(res.transactions)\n .map((value) => 'transaction_hash' in value && value.transaction_hash)\n .filter(Boolean) as Array,\n };\n }\n\n public parseGetTransactionResponse(\n res: Sequencer.GetTransactionResponse\n ): GetTransactionResponse {\n return {\n ...res,\n calldata: 'calldata' in res.transaction ? (res.transaction.calldata as HexCalldata) : [],\n contract_class:\n 'contract_class' in res.transaction ? (res.transaction.contract_class as any) : undefined,\n entry_point_selector:\n 'entry_point_selector' in res.transaction\n ? res.transaction.entry_point_selector\n : undefined,\n max_fee: 'max_fee' in res.transaction ? (res.transaction.max_fee as string) : undefined,\n nonce: res.transaction.nonce as string,\n sender_address:\n 'sender_address' in res.transaction\n ? (res.transaction.sender_address as string)\n : undefined,\n signature: 'signature' in res.transaction ? res.transaction.signature : undefined,\n transaction_hash:\n 'transaction_hash' in res.transaction ? res.transaction.transaction_hash : undefined,\n version: 'version' in res.transaction ? (res.transaction.version as string) : undefined,\n };\n }\n\n public parseGetTransactionReceiptResponse(\n res: Sequencer.TransactionReceiptResponse\n ): GetTransactionReceiptResponse {\n return {\n transaction_hash: res.transaction_hash,\n status: res.status,\n messages_sent: res.l2_to_l1_messages as any, // TODO: parse\n events: res.events as any,\n ...('block_hash' in res && { block_hash: res.block_hash }),\n ...('block_number' in res && { block_number: res.block_number }),\n ...('actual_fee' in res && { actual_fee: res.actual_fee }),\n ...('transaction_index' in res && { transaction_index: res.transaction_index }),\n ...('execution_resources' in res && { execution_resources: res.execution_resources }),\n ...('l1_to_l2_consumed_message' in res && {\n // eslint-disable-next-line @typescript-eslint/dot-notation\n l1_to_l2_consumed_message: res['l1_to_l2_consumed_message'],\n }),\n ...('transaction_failure_reason' in res && {\n transaction_failure_reason: res.transaction_failure_reason,\n }),\n };\n }\n\n public parseFeeEstimateResponse(res: Sequencer.EstimateFeeResponse): EstimateFeeResponse {\n if ('overall_fee' in res) {\n let gasInfo = {};\n\n try {\n gasInfo = {\n gas_consumed: toBigInt(res.gas_usage),\n gas_price: toBigInt(res.gas_price),\n };\n } catch {\n // do nothing\n }\n\n return {\n overall_fee: toBigInt(res.overall_fee),\n ...gasInfo,\n };\n }\n return {\n overall_fee: toBigInt(res.amount),\n };\n }\n\n public parseFeeEstimateBulkResponse(\n res: Sequencer.EstimateFeeResponseBulk\n ): EstimateFeeResponseBulk {\n return [].concat(res as []).map((item: Sequencer.EstimateFeeResponse) => {\n if ('overall_fee' in item) {\n let gasInfo = {};\n\n try {\n gasInfo = {\n gas_consumed: toBigInt(item.gas_usage),\n gas_price: toBigInt(item.gas_price),\n };\n } catch {\n // do nothing\n }\n\n return {\n overall_fee: toBigInt(item.overall_fee),\n ...gasInfo,\n };\n }\n return {\n overall_fee: toBigInt(item.amount),\n };\n });\n }\n\n public parseSimulateTransactionResponse(\n res: Sequencer.SimulateTransactionResponse\n ): SimulateTransactionResponse {\n const suggestedMaxFee =\n 'overall_fee' in res.fee_estimation\n ? res.fee_estimation.overall_fee\n : res.fee_estimation.amount;\n return [\n {\n transaction_trace: res.trace,\n fee_estimation: res.fee_estimation,\n suggestedMaxFee: estimatedFeeToMaxFee(BigInt(suggestedMaxFee)),\n },\n ];\n }\n\n public parseCallContractResponse(res: Sequencer.CallContractResponse): CallContractResponse {\n return {\n result: res.result,\n };\n }\n\n public parseInvokeFunctionResponse(\n res: Sequencer.AddTransactionResponse\n ): InvokeFunctionResponse {\n return {\n transaction_hash: res.transaction_hash,\n };\n }\n\n public parseDeployContractResponse(\n res: Sequencer.AddTransactionResponse\n ): DeployContractResponse {\n return {\n transaction_hash: res.transaction_hash,\n contract_address: res.address as string,\n };\n }\n\n public parseDeclareContractResponse(\n res: Sequencer.AddTransactionResponse\n ): DeclareContractResponse {\n return {\n transaction_hash: res.transaction_hash,\n class_hash: res.class_hash as string,\n };\n }\n\n public parseGetStateUpdateResponse(res: Sequencer.StateUpdateResponse): StateUpdateResponse {\n const nonces = Object.entries(res.state_diff.nonces).map(([contract_address, nonce]) => ({\n contract_address,\n nonce,\n }));\n const storage_diffs = Object.entries(res.state_diff.storage_diffs).map(\n ([address, storage_entries]) => ({ address, storage_entries })\n );\n\n return {\n ...res,\n state_diff: {\n ...res.state_diff,\n storage_diffs,\n nonces,\n },\n };\n }\n\n public parseContractClassResponse(res: CompiledContract): ContractClassResponse {\n const response = isSierra(res) ? res : parseContract(res);\n return {\n ...response,\n abi: typeof response.abi === 'string' ? JSON.parse(response.abi) : response.abi,\n };\n }\n}\n","import urljoin from 'url-join';\n\n/**\n * Inspired from https://github.com/segmentio/is-url\n */\n\n/**\n * RegExps.\n * A URL must match #1 and then at least one of #2/#3.\n * Use two levels of REs to avoid REDOS.\n */\nconst protocolAndDomainRE = /^(?:\\w+:)?\\/\\/(\\S+)$/;\n\nconst localhostDomainRE = /^localhost[:?\\d]*(?:[^:?\\d]\\S*)?$/;\nconst nonLocalhostDomainRE = /^[^\\s.]+\\.\\S{2,}$/;\n\n/**\n * Loosely validate a URL `string`.\n * @param {String} s\n * @return {Boolean}\n */\nexport function isUrl(s?: string): boolean {\n if (!s) {\n return false;\n }\n\n if (typeof s !== 'string') {\n return false;\n }\n\n const match = s.match(protocolAndDomainRE);\n if (!match) {\n return false;\n }\n\n const everythingAfterProtocol = match[1];\n if (!everythingAfterProtocol) {\n return false;\n }\n\n if (\n localhostDomainRE.test(everythingAfterProtocol) ||\n nonLocalhostDomainRE.test(everythingAfterProtocol)\n ) {\n return true;\n }\n\n return false;\n}\n\nexport function buildUrl(baseUrl: string, defaultPath: string, urlOrPath?: string) {\n return isUrl(urlOrPath) ? urlOrPath! : urljoin(baseUrl, urlOrPath ?? defaultPath);\n}\n","import { StarknetChainId } from '../constants';\nimport {\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Nonce,\n ProviderOptions,\n RpcProviderOptions,\n SequencerProviderOptions,\n SimulateTransactionResponse,\n StateUpdateResponse,\n Storage,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\nimport { ProviderInterface } from './interface';\nimport { RpcProvider } from './rpc';\nimport { SequencerProvider } from './sequencer';\nimport { getAddressFromStarkName, getStarkName } from './starknetId';\n\nexport class Provider implements ProviderInterface {\n private provider!: ProviderInterface;\n\n constructor(providerOrOptions?: ProviderOptions | ProviderInterface) {\n if (providerOrOptions instanceof Provider) {\n // providerOrOptions is Provider\n this.provider = providerOrOptions.provider;\n } else if (\n providerOrOptions instanceof RpcProvider ||\n providerOrOptions instanceof SequencerProvider\n ) {\n // providerOrOptions is SequencerProvider or RpcProvider\n this.provider = providerOrOptions;\n } else if (providerOrOptions && 'rpc' in providerOrOptions) {\n // providerOrOptions is rpc option\n this.provider = new RpcProvider(providerOrOptions.rpc);\n } else if (providerOrOptions && 'sequencer' in providerOrOptions) {\n // providerOrOptions is sequencer option\n this.provider = new SequencerProvider(providerOrOptions.sequencer);\n } else {\n // providerOrOptions is none, create SequencerProvider as default\n this.provider = new SequencerProvider();\n }\n }\n\n public async getChainId(): Promise {\n return this.provider.getChainId();\n }\n\n public async getBlock(blockIdentifier: BlockIdentifier): Promise {\n return this.provider.getBlock(blockIdentifier);\n }\n\n public async getClassAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getClassAt(contractAddress, blockIdentifier);\n }\n\n public async getClassHashAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getClassHashAt(contractAddress, blockIdentifier);\n }\n\n public getClassByHash(classHash: string): Promise {\n return this.provider.getClassByHash(classHash);\n }\n\n public async getEstimateFee(\n invocationWithTxType: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier\n ): Promise {\n return this.provider.getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier);\n }\n\n public async getInvokeEstimateFee(\n invocationWithTxType: Invocation,\n invocationDetails: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getInvokeEstimateFee(\n invocationWithTxType,\n invocationDetails,\n blockIdentifier,\n skipValidate\n );\n }\n\n public async getEstimateFeeBulk(\n invocations: AccountInvocations,\n options: getEstimateFeeBulkOptions\n ): Promise {\n return this.provider.getEstimateFeeBulk(invocations, options);\n }\n\n public async getNonceForAddress(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getNonceForAddress(contractAddress, blockIdentifier);\n }\n\n public async getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getStorageAt(contractAddress, key, blockIdentifier);\n }\n\n public async getTransaction(txHash: BigNumberish): Promise {\n return this.provider.getTransaction(txHash);\n }\n\n public async getTransactionReceipt(txHash: BigNumberish): Promise {\n return this.provider.getTransactionReceipt(txHash);\n }\n\n public async callContract(\n request: Call,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.callContract(request, blockIdentifier);\n }\n\n public async invokeFunction(\n functionInvocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.invokeFunction(functionInvocation, details);\n }\n\n public async deployAccountContract(\n payload: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.deployAccountContract(payload, details);\n }\n\n public async declareContract(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise {\n return this.provider.declareContract(transaction, details);\n }\n\n public async getDeclareEstimateFee(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getDeclareEstimateFee(transaction, details, blockIdentifier, skipValidate);\n }\n\n public getDeployAccountEstimateFee(\n transaction: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise {\n return this.provider.getDeployAccountEstimateFee(\n transaction,\n details,\n blockIdentifier,\n skipValidate\n );\n }\n\n public async getCode(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise {\n return this.provider.getCode(contractAddress, blockIdentifier);\n }\n\n public async waitForTransaction(\n txHash: BigNumberish,\n options?: waitForTransactionOptions\n ): Promise {\n return this.provider.waitForTransaction(txHash, options);\n }\n\n public async getSimulateTransaction(\n invocations: AccountInvocations,\n options?: getSimulateTransactionOptions\n ): Promise {\n return this.provider.getSimulateTransaction(invocations, options);\n }\n\n public async getStateUpdate(blockIdentifier?: BlockIdentifier): Promise {\n return this.provider.getStateUpdate(blockIdentifier);\n }\n\n public async getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise {\n return getStarkName(this, address, StarknetIdContract);\n }\n\n public async getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise {\n return getAddressFromStarkName(this, name, StarknetIdContract);\n }\n}\n","import {\n Abi,\n Call,\n DeclareSignerDetails,\n DeployAccountSignerDetails,\n InvocationsSignerDetails,\n Signature,\n TypedData,\n} from '../types';\n\nexport abstract class SignerInterface {\n /**\n * Method to get the public key of the signer\n *\n * @returns public key of signer as hex string with 0x prefix\n */\n public abstract getPubKey(): Promise;\n\n /**\n * Sign an JSON object for off-chain usage with the starknet private key and return the signature\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param typedData - JSON object to be signed\n * @param accountAddress - account\n * @returns the signature of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract signMessage(typedData: TypedData, accountAddress: string): Promise;\n\n /**\n * Signs a transaction with the starknet private key and returns the signature\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * @param abi (optional) the abi of the contract for better displaying\n *\n * @returns signature\n */\n public abstract signTransaction(\n transactions: Call[],\n transactionsDetail: InvocationsSignerDetails,\n abis?: Abi[]\n ): Promise;\n\n /**\n * Signs a DEPLOY_ACCOUNT transaction with the starknet private key and returns the signature\n *\n * @param transaction\n * - contractAddress - the computed address of the contract\n * - constructorCalldata - calldata to be passed in deploy constructor\n * - addressSalt - contract address salt\n * - chainId - the chainId to declare contract on\n * - maxFee - maxFee for the declare transaction\n * - version - transaction version\n * - nonce - Nonce of the declare transaction\n * @returns signature\n */\n public abstract signDeployAccountTransaction(\n transaction: DeployAccountSignerDetails\n ): Promise;\n\n /**\n * Signs a DECLARE transaction with the starknet private key and returns the signature\n *\n * @param transaction\n * - classHash - computed class hash. Will be replaced by ContractClass in future once class hash is present in CompiledContract\n * - senderAddress - the address of the sender\n * - chainId - the chainId to declare contract on\n * - maxFee - maxFee for the declare transaction\n * - version - transaction version\n * - nonce - Nonce of the declare transaction\n * @returns signature\n */\n public abstract signDeclareTransaction(transaction: DeclareSignerDetails): Promise;\n}\n","import { BigNumberish, CairoVersion, Call, CallStruct, Calldata, ParsedStruct } from '../types';\nimport { CallData } from './calldata';\nimport { getSelectorFromName } from './hash';\nimport { toBigInt } from './num';\n\n/**\n * Transforms a list of Calls, each with their own calldata, into\n * two arrays: one with the entrypoints, and one with the concatenated calldata.\n * @param calls\n * @returns\n */\nexport const transformCallsToMulticallArrays = (calls: Call[]) => {\n const callArray: ParsedStruct[] = [];\n const calldata: BigNumberish[] = [];\n calls.forEach((call) => {\n const data = CallData.compile(call.calldata || []);\n callArray.push({\n to: toBigInt(call.contractAddress).toString(10),\n selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10),\n data_offset: calldata.length.toString(),\n data_len: data.length.toString(),\n });\n calldata.push(...data);\n });\n return {\n callArray,\n calldata: CallData.compile({ calldata }),\n };\n};\n\n/**\n * Transforms a list of calls in the full flattened calldata expected\n * by the __execute__ protocol.\n * @param calls\n * @returns\n */\nexport const fromCallsToExecuteCalldata = (calls: Call[]) => {\n const { callArray, calldata } = transformCallsToMulticallArrays(calls);\n const compiledCalls = CallData.compile({ callArray });\n return [...compiledCalls, ...calldata] as Calldata;\n};\n\nexport const fromCallsToExecuteCalldataWithNonce = (calls: Call[], nonce: BigNumberish) => {\n return [...fromCallsToExecuteCalldata(calls), toBigInt(nonce).toString()] as Calldata;\n};\n\n// TT: Can be removed ?\n/**\n * Format Data inside Calls\n * @param calls Call[]\n * @returns CallStruct\n */\nexport const transformCallsToMulticallArrays_cairo1 = (calls: Call[]) => {\n const callArray = calls.map((call) => ({\n to: toBigInt(call.contractAddress).toString(10),\n selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10),\n calldata: CallData.compile(call.calldata || []),\n }));\n return callArray;\n};\n\n/**\n * Transforms a list of calls in the full flattened calldata expected\n * by the __execute__ protocol.\n * @param calls\n * @returns Calldata\n */\nexport const fromCallsToExecuteCalldata_cairo1 = (calls: Call[]) => {\n // ensure property order\n const orderCalls = calls.map((call) => ({\n contractAddress: call.contractAddress,\n entrypoint: call.entrypoint,\n calldata: call.calldata,\n }));\n\n return CallData.compile({ orderCalls });\n};\n\n/**\n *\n * @param calls Call array\n * @param cairoVersion Defaults to 0\n * @returns string[] of calldata\n */\nexport const getExecuteCalldata = (calls: Call[], cairoVersion: CairoVersion = '0') => {\n if (cairoVersion === '1') {\n return fromCallsToExecuteCalldata_cairo1(calls);\n }\n return fromCallsToExecuteCalldata(calls);\n};\n","import { BigNumberish, StarkNetMerkleType, StarkNetType, TypedData } from '../types';\nimport { computeHashOnElements, getSelectorFromName } from './hash';\nimport { MerkleTree } from './merkle';\nimport { isHex, toHex } from './num';\nimport { encodeShortString } from './shortString';\n\n/** @deprecated prefer importing from 'types' over 'typedData' */\nexport * from '../types/typedData';\n\nfunction getHex(value: BigNumberish): string {\n try {\n return toHex(value);\n } catch (e) {\n if (typeof value === 'string') {\n return toHex(encodeShortString(value));\n }\n throw new Error(`Invalid BigNumberish: ${value}`);\n }\n}\n\n/**\n * Validates that `data` matches the EIP-712 JSON schema.\n *\n * @param {any} data\n * @return {boolean}\n */\nconst validateTypedData = (data: unknown): data is TypedData => {\n const typedData = data as TypedData;\n\n // Validate that the data matches the EIP-712 JSON schema\n const valid = Boolean(typedData.types && typedData.primaryType && typedData.message);\n\n return valid;\n};\n\nexport function prepareSelector(selector: string): string {\n return isHex(selector) ? selector : getSelectorFromName(selector);\n}\n\nexport function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType {\n return type.type === 'merkletree';\n}\n\ninterface Context {\n parent?: string;\n key?: string;\n}\n\n/**\n * Get the dependencies of a struct type. If a struct has the same dependency multiple times, it's only included once\n * in the resulting array.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {string[]} [dependencies]\n * @return {string[]}\n */\nexport const getDependencies = (\n types: TypedData['types'],\n type: string,\n dependencies: string[] = []\n): string[] => {\n // Include pointers (struct arrays)\n if (type[type.length - 1] === '*') {\n // eslint-disable-next-line no-param-reassign\n type = type.slice(0, -1);\n }\n\n if (dependencies.includes(type)) {\n return dependencies;\n }\n\n if (!types[type]) {\n return dependencies;\n }\n\n return [\n type,\n ...types[type].reduce(\n (previous, t) => [\n ...previous,\n ...getDependencies(types, t.type, previous).filter(\n (dependency) => !previous.includes(dependency)\n ),\n ],\n []\n ),\n ];\n};\n\nfunction getMerkleTreeType(types: TypedData['types'], ctx: Context) {\n if (ctx.parent && ctx.key) {\n const parentType = types[ctx.parent];\n const merkleType = parentType.find((t) => t.name === ctx.key)!;\n const isMerkleTree = isMerkleTreeType(merkleType);\n if (!isMerkleTree) {\n throw new Error(`${ctx.key} is not a merkle tree`);\n }\n if (merkleType.contains.endsWith('*')) {\n throw new Error(`Merkle tree contain property must not be an array but was given ${ctx.key}`);\n }\n return merkleType.contains;\n }\n return 'raw';\n}\n\n/**\n * Encode a type to a string. All dependant types are alphabetically sorted.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @return {string}\n */\nexport const encodeType = (types: TypedData['types'], type: string): string => {\n const [primary, ...dependencies] = getDependencies(types, type);\n const newTypes = !primary ? [] : [primary, ...dependencies.sort()];\n\n return newTypes\n .map((dependency) => {\n return `${dependency}(${types[dependency].map((t) => `${t.name}:${t.type}`)})`;\n })\n .join('');\n};\n\n/**\n * Get a type string as hash.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @return {string}\n */\nexport const getTypeHash = (types: TypedData['types'], type: string): string => {\n return getSelectorFromName(encodeType(types, type));\n};\n\n/**\n * Encodes a single value to an ABI serialisable string, number or Buffer. Returns the data as tuple, which consists of\n * an array of ABI compatible types, and an array of corresponding values.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {any} data\n * @returns {[string, string]}\n */\nexport const encodeValue = (\n types: TypedData['types'],\n type: string,\n data: unknown,\n ctx: Context = {}\n): [string, string] => {\n if (types[type]) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return [type, getStructHash(types, type, data as Record)];\n }\n\n if (\n Object.keys(types)\n .map((x) => `${x}*`)\n .includes(type)\n ) {\n const structHashes: string[] = (data as unknown[]).map((struct) => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return getStructHash(types, type.slice(0, -1), struct as Record);\n });\n return [type, computeHashOnElements(structHashes)];\n }\n\n if (type === 'merkletree') {\n const merkleTreeType = getMerkleTreeType(types, ctx);\n const structHashes: string[] = (data as unknown[]).map((struct) => {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return encodeValue(types, merkleTreeType, struct as Record)[1];\n });\n const { root } = new MerkleTree(structHashes as string[]);\n return ['felt', root];\n }\n\n if (type === 'felt*') {\n return ['felt*', computeHashOnElements(data as string[])];\n }\n\n if (type === 'selector') {\n return ['felt', prepareSelector(data as string)];\n }\n\n return [type, getHex(data as string)];\n};\n\n/**\n * Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values. All\n * dependant types are automatically encoded.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {Record} data\n */\nexport const encodeData = (\n types: T['types'],\n type: string,\n data: T['message']\n) => {\n const [returnTypes, values] = types[type].reduce<[string[], string[]]>(\n ([ts, vs], field) => {\n if (data[field.name] === undefined || data[field.name] === null) {\n throw new Error(`Cannot encode data: missing data for '${field.name}'`);\n }\n\n const value = data[field.name];\n const [t, encodedValue] = encodeValue(types, field.type, value, {\n parent: type,\n key: field.name,\n });\n\n return [\n [...ts, t],\n [...vs, encodedValue],\n ];\n },\n [['felt'], [getTypeHash(types, type)]]\n );\n\n return [returnTypes, values];\n};\n\n/**\n * Get encoded data as a hash. The data should be a key -> value object with all the required values. All dependant\n * types are automatically encoded.\n *\n * @param {TypedData} typedData\n * @param {string} type\n * @param {Record} data\n * @return {Buffer}\n */\nexport const getStructHash = (\n types: T['types'],\n type: string,\n data: T['message']\n) => {\n return computeHashOnElements(encodeData(types, type, data)[1]);\n};\n\n/**\n * Get the EIP-191 encoded message to sign, from the typedData object.\n *\n * @param {TypedData} typedData\n * @param {BigNumberish} account\n * @return {string}\n */\nexport const getMessageHash = (typedData: TypedData, account: BigNumberish): string => {\n if (!validateTypedData(typedData)) {\n throw new Error('Typed data does not match JSON schema');\n }\n\n const message = [\n encodeShortString('StarkNet Message'),\n getStructHash(typedData.types, 'StarkNetDomain', typedData.domain),\n account,\n getStructHash(typedData.types, typedData.primaryType, typedData.message),\n ];\n\n return computeHashOnElements(message);\n};\n","import { starkCurve } from './ec';\nimport { toBigInt } from './num';\n\nexport class MerkleTree {\n public leaves: string[];\n\n public branches: string[][] = [];\n\n public root: string;\n\n constructor(leafHashes: string[]) {\n this.leaves = leafHashes;\n this.root = this.build(leafHashes);\n }\n\n private build(leaves: string[]): string {\n if (leaves.length === 1) {\n return leaves[0];\n }\n if (leaves.length !== this.leaves.length) {\n this.branches.push(leaves);\n }\n const newLeaves: string[] = [];\n for (let i = 0; i < leaves.length; i += 2) {\n if (i + 1 === leaves.length) {\n newLeaves.push(MerkleTree.hash(leaves[i], '0x0'));\n } else {\n newLeaves.push(MerkleTree.hash(leaves[i], leaves[i + 1]));\n }\n }\n return this.build(newLeaves);\n }\n\n static hash(a: string, b: string) {\n const [aSorted, bSorted] = [toBigInt(a), toBigInt(b)].sort((x, y) => (x >= y ? 1 : -1));\n return starkCurve.pedersen(aSorted, bSorted);\n }\n\n public getProof(leaf: string, branch = this.leaves, hashPath: string[] = []): string[] {\n const index = branch.indexOf(leaf);\n if (index === -1) {\n throw new Error('leaf not found');\n }\n if (branch.length === 1) {\n return hashPath;\n }\n const isLeft = index % 2 === 0;\n const neededBranch = (isLeft ? branch[index + 1] : branch[index - 1]) ?? '0x0';\n const newHashPath = [...hashPath, neededBranch];\n const currentBranchLevelIndex =\n this.leaves.length === branch.length\n ? -1\n : this.branches.findIndex((b) => b.length === branch.length);\n const nextBranch = this.branches[currentBranchLevelIndex + 1] ?? [this.root];\n return this.getProof(\n MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf),\n nextBranch,\n newHashPath\n );\n }\n}\n\nexport function proofMerklePath(root: string, leaf: string, path: string[]): boolean {\n if (path.length === 0) {\n return root === leaf;\n }\n const [next, ...rest] = path;\n return proofMerklePath(root, MerkleTree.hash(leaf, next), rest);\n}\n","import {\n Abi,\n Call,\n DeclareSignerDetails,\n DeployAccountSignerDetails,\n InvocationsSignerDetails,\n Signature,\n TypedData,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { starkCurve } from '../utils/ec';\nimport { buf2hex } from '../utils/encode';\nimport {\n calculateDeclareTransactionHash,\n calculateDeployAccountTransactionHash,\n calculateTransactionHash,\n} from '../utils/hash';\nimport { toHex } from '../utils/num';\nimport { getExecuteCalldata } from '../utils/transaction';\nimport { getMessageHash } from '../utils/typedData';\nimport { SignerInterface } from './interface';\n\nexport class Signer implements SignerInterface {\n protected pk: Uint8Array | string;\n\n constructor(pk: Uint8Array | string = starkCurve.utils.randomPrivateKey()) {\n this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk);\n }\n\n public async getPubKey(): Promise {\n return starkCurve.getStarkKey(this.pk);\n }\n\n public async signMessage(typedData: TypedData, accountAddress: string): Promise {\n const msgHash = getMessageHash(typedData, accountAddress);\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signTransaction(\n transactions: Call[],\n transactionsDetail: InvocationsSignerDetails,\n abis?: Abi[]\n ): Promise {\n if (abis && abis.length !== transactions.length) {\n throw new Error('ABI must be provided for each transaction or no transaction');\n }\n // now use abi to display decoded data somewhere, but as this signer is headless, we can't do that\n\n const calldata = getExecuteCalldata(transactions, transactionsDetail.cairoVersion);\n\n const msgHash = calculateTransactionHash(\n transactionsDetail.walletAddress,\n transactionsDetail.version,\n calldata,\n transactionsDetail.maxFee,\n transactionsDetail.chainId,\n transactionsDetail.nonce\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signDeployAccountTransaction({\n classHash,\n contractAddress,\n constructorCalldata,\n addressSalt,\n maxFee,\n version,\n chainId,\n nonce,\n }: DeployAccountSignerDetails): Promise {\n const msgHash = calculateDeployAccountTransactionHash(\n contractAddress,\n classHash,\n CallData.compile(constructorCalldata),\n addressSalt,\n version,\n maxFee,\n chainId,\n nonce\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n\n public async signDeclareTransaction(\n // contractClass: ContractClass, // Should be used once class hash is present in ContractClass\n {\n classHash,\n senderAddress,\n chainId,\n maxFee,\n version,\n nonce,\n compiledClassHash,\n }: DeclareSignerDetails\n ): Promise {\n const msgHash = calculateDeclareTransactionHash(\n classHash,\n senderAddress,\n version,\n maxFee,\n chainId,\n nonce,\n compiledClassHash\n );\n\n return starkCurve.sign(msgHash, this.pk);\n }\n}\n","import { UDC } from '../constants';\nimport { InvokeTransactionReceiptResponse } from '../types/provider';\nimport { cleanHex } from './num';\n\n/**\n * Parse Transaction Receipt Event from UDC invoke transaction and\n * create DeployContractResponse compatibile response with adition of UDC Event data\n *\n * @param txReceipt\n * @returns DeployContractResponse | UDC Event Response data\n */\nexport function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse) {\n if (!txReceipt.events) {\n throw new Error('UDC emited event is empty');\n }\n const event = txReceipt.events.find(\n (it) => cleanHex(it.from_address) === cleanHex(UDC.ADDRESS)\n ) || {\n data: [],\n };\n return {\n transaction_hash: txReceipt.transaction_hash,\n contract_address: event.data[0],\n address: event.data[0],\n deployer: event.data[1],\n unique: event.data[2],\n classHash: event.data[3],\n calldata_len: event.data[4],\n calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)),\n salt: event.data[event.data.length - 1],\n };\n}\n","import { UDC, ZERO } from '../constants';\nimport { ProviderInterface } from '../provider';\nimport { Provider } from '../provider/default';\nimport { Signer, SignerInterface } from '../signer';\nimport {\n Abi,\n AccountInvocationItem,\n AccountInvocations,\n AccountInvocationsFactoryDetails,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n CairoVersion,\n Call,\n DeclareAndDeployContractPayload,\n DeclareContractPayload,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeclareDeployUDCResponse,\n DeployAccountContractPayload,\n DeployAccountContractTransaction,\n DeployContractResponse,\n DeployContractUDCResponse,\n Details,\n EstimateFee,\n EstimateFeeAction,\n EstimateFeeBulk,\n EstimateFeeDetails,\n Invocation,\n Invocations,\n InvocationsDetails,\n InvocationsSignerDetails,\n InvokeFunctionResponse,\n MultiDeployContractResponse,\n Nonce,\n ProviderOptions,\n Signature,\n SimulateTransactionDetails,\n SimulateTransactionResponse,\n TransactionType,\n TypedData,\n UniversalDeployerContractPayload,\n} from '../types';\nimport { CallData } from '../utils/calldata';\nimport { extractContractHashes, isSierra } from '../utils/contract';\nimport { starkCurve } from '../utils/ec';\nimport { parseUDCEvent } from '../utils/events';\nimport {\n calculateContractAddressFromHash,\n feeTransactionVersion,\n feeTransactionVersion_2,\n transactionVersion,\n transactionVersion_2,\n} from '../utils/hash';\nimport { toBigInt, toCairoBool } from '../utils/num';\nimport { parseContract } from '../utils/provider';\nimport { estimatedFeeToMaxFee, formatSignature, randomAddress } from '../utils/stark';\nimport { getExecuteCalldata } from '../utils/transaction';\nimport { getMessageHash } from '../utils/typedData';\nimport { AccountInterface } from './interface';\n\nexport class Account extends Provider implements AccountInterface {\n public signer: SignerInterface;\n\n public address: string;\n\n public cairoVersion: CairoVersion;\n\n constructor(\n providerOrOptions: ProviderOptions | ProviderInterface,\n address: string,\n pkOrSigner: Uint8Array | string | SignerInterface,\n cairoVersion: CairoVersion = '0'\n ) {\n super(providerOrOptions);\n this.address = address.toLowerCase();\n this.signer =\n typeof pkOrSigner === 'string' || pkOrSigner instanceof Uint8Array\n ? new Signer(pkOrSigner)\n : pkOrSigner;\n\n this.cairoVersion = cairoVersion;\n }\n\n public async getNonce(blockIdentifier?: BlockIdentifier): Promise {\n return super.getNonceForAddress(this.address, blockIdentifier);\n }\n\n private async getNonceSafe(nonce?: BigNumberish) {\n // Patch DEPLOY_ACCOUNT: RPC getNonce for non-existing address will result in error, on Sequencer it is '0x0'\n try {\n return toBigInt(nonce ?? (await this.getNonce()));\n } catch (error) {\n return 0n;\n }\n }\n\n public async estimateFee(\n calls: AllowArray,\n estimateFeeDetails?: EstimateFeeDetails | undefined\n ): Promise {\n return this.estimateInvokeFee(calls, estimateFeeDetails);\n }\n\n public async estimateInvokeFee(\n calls: AllowArray,\n { nonce: providedNonce, blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const transactions = Array.isArray(calls) ? calls : [calls];\n const nonce = toBigInt(providedNonce ?? (await this.getNonce()));\n const version = toBigInt(feeTransactionVersion);\n const chainId = await this.getChainId();\n\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce,\n maxFee: ZERO,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n\n const invocation = await this.buildInvocation(transactions, signerDetails);\n const response = await super.getInvokeEstimateFee(\n { ...invocation },\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateDeclareFee(\n { contract, classHash: providedClassHash, casm, compiledClassHash }: DeclareContractPayload,\n { blockIdentifier, nonce: providedNonce, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const nonce = toBigInt(providedNonce ?? (await this.getNonce()));\n const version = !isSierra(contract) ? feeTransactionVersion : feeTransactionVersion_2;\n const chainId = await this.getChainId();\n\n const declareContractTransaction = await this.buildDeclarePayload(\n { classHash: providedClassHash, contract, casm, compiledClassHash },\n {\n nonce,\n chainId,\n version,\n walletAddress: this.address,\n maxFee: ZERO,\n cairoVersion: this.cairoVersion,\n }\n );\n\n const response = await super.getDeclareEstimateFee(\n declareContractTransaction,\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateAccountDeployFee(\n {\n classHash,\n addressSalt = 0,\n constructorCalldata = [],\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n { blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const version = toBigInt(feeTransactionVersion);\n const nonce = ZERO; // DEPLOY_ACCOUNT transaction will have a nonce zero as it is the first transaction in the account\n const chainId = await this.getChainId();\n\n const payload = await this.buildAccountDeployPayload(\n { classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress },\n {\n nonce,\n chainId,\n version,\n walletAddress: this.address,\n maxFee: ZERO,\n cairoVersion: this.cairoVersion,\n }\n );\n\n const response = await super.getDeployAccountEstimateFee(\n { ...payload },\n { version, nonce },\n blockIdentifier,\n skipValidate\n );\n const suggestedMaxFee = estimatedFeeToMaxFee(response.overall_fee);\n\n return {\n ...response,\n suggestedMaxFee,\n };\n }\n\n public async estimateDeployFee(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n transactionsDetail?: InvocationsDetails | undefined\n ): Promise {\n const calls = this.buildUDCContractPayload(payload);\n return this.estimateInvokeFee(calls, transactionsDetail);\n }\n\n public async estimateFeeBulk(\n invocations: Invocations,\n { nonce, blockIdentifier, skipValidate }: EstimateFeeDetails = {}\n ): Promise {\n const accountInvocations = await this.accountInvocationsFactory(invocations, {\n versions: [feeTransactionVersion, feeTransactionVersion_2],\n nonce,\n blockIdentifier,\n });\n\n const response = await super.getEstimateFeeBulk(accountInvocations, {\n blockIdentifier,\n skipValidate,\n });\n\n return [].concat(response as []).map((elem: any) => {\n const suggestedMaxFee = estimatedFeeToMaxFee(elem.overall_fee);\n return {\n ...elem,\n suggestedMaxFee,\n };\n });\n }\n\n public async buildInvocation(\n call: Array,\n signerDetails: InvocationsSignerDetails\n ): Promise {\n const calldata = getExecuteCalldata(call, this.cairoVersion);\n const signature = await this.signer.signTransaction(call, signerDetails);\n\n return {\n contractAddress: this.address,\n calldata,\n signature,\n };\n }\n\n public async execute(\n calls: AllowArray,\n abis: Abi[] | undefined = undefined,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const transactions = Array.isArray(calls) ? calls : [calls];\n const nonce = toBigInt(transactionsDetail.nonce ?? (await this.getNonce()));\n const maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n { type: TransactionType.INVOKE, payload: calls },\n transactionsDetail\n ));\n const version = toBigInt(transactionVersion);\n const chainId = await this.getChainId();\n\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce,\n maxFee,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n\n const signature = await this.signer.signTransaction(transactions, signerDetails, abis);\n\n const calldata = getExecuteCalldata(transactions, this.cairoVersion);\n\n return this.invokeFunction(\n { contractAddress: this.address, calldata, signature },\n {\n nonce,\n maxFee,\n version,\n }\n );\n }\n\n /**\n * First check if contract is already declared, if not declare it\n * If contract already declared returned transaction_hash is ''.\n * Method will pass even if contract is already declared\n * @param payload DeclareContractPayload\n * @param transactionsDetail (optional) InvocationsDetails = \\{\\}\n * @returns DeclareContractResponse\n */\n public async declareIfNot(\n payload: DeclareContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const declareContractPayload = extractContractHashes(payload);\n try {\n await this.getClassByHash(declareContractPayload.classHash);\n } catch (error) {\n return this.declare(payload, transactionsDetail);\n }\n return {\n transaction_hash: '',\n class_hash: declareContractPayload.classHash,\n };\n }\n\n public async declare(\n payload: DeclareContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const declareContractPayload = extractContractHashes(payload);\n const details = {} as Details;\n\n details.nonce = toBigInt(transactionsDetail.nonce ?? (await this.getNonce()));\n details.maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n {\n type: TransactionType.DECLARE,\n payload: declareContractPayload,\n },\n transactionsDetail\n ));\n details.version = !isSierra(payload.contract) ? transactionVersion : transactionVersion_2;\n details.chainId = await this.getChainId();\n\n const declareContractTransaction = await this.buildDeclarePayload(declareContractPayload, {\n ...details,\n walletAddress: this.address,\n cairoVersion: this.cairoVersion,\n });\n\n return this.declareContract(declareContractTransaction, details);\n }\n\n public async deploy(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise {\n const params = [].concat(payload as []).map((it) => {\n const {\n classHash,\n salt,\n unique = true,\n constructorCalldata = [],\n } = it as UniversalDeployerContractPayload;\n\n const compiledConstructorCallData = CallData.compile(constructorCalldata);\n const deploySalt = salt ?? randomAddress();\n\n return {\n call: {\n contractAddress: UDC.ADDRESS,\n entrypoint: UDC.ENTRYPOINT,\n calldata: [\n classHash,\n deploySalt,\n toCairoBool(unique),\n compiledConstructorCallData.length,\n ...compiledConstructorCallData,\n ],\n },\n address: calculateContractAddressFromHash(\n unique ? starkCurve.pedersen(this.address, deploySalt) : deploySalt,\n classHash,\n compiledConstructorCallData,\n unique ? UDC.ADDRESS : 0\n ),\n };\n });\n\n const calls = params.map((it) => it.call);\n const addresses = params.map((it) => it.address);\n const invokeResponse = await this.execute(calls, undefined, details);\n\n return {\n ...invokeResponse,\n contract_address: addresses,\n };\n }\n\n public async deployContract(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise {\n const deployTx = await this.deploy(payload, details);\n const txReceipt = await this.waitForTransaction(deployTx.transaction_hash);\n return parseUDCEvent(txReceipt);\n }\n\n public async declareAndDeploy(\n payload: DeclareAndDeployContractPayload,\n details?: InvocationsDetails | undefined\n ): Promise {\n const { constructorCalldata, salt, unique } = payload;\n let declare = await this.declareIfNot(payload, details);\n if (declare.transaction_hash !== '') {\n const tx = await this.waitForTransaction(declare.transaction_hash);\n declare = { ...declare, ...tx };\n }\n const deploy = await this.deployContract(\n { classHash: declare.class_hash, salt, unique, constructorCalldata },\n details\n );\n return { declare: { ...declare }, deploy };\n }\n\n public deploySelf = this.deployAccount;\n\n public async deployAccount(\n {\n classHash,\n constructorCalldata = [],\n addressSalt = 0,\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n transactionsDetail: InvocationsDetails = {}\n ): Promise {\n const version = toBigInt(transactionVersion);\n const nonce = ZERO; // DEPLOY_ACCOUNT transaction will have a nonce zero as it is the first transaction in the account\n const chainId = await this.getChainId();\n\n const compiledCalldata = CallData.compile(constructorCalldata);\n const contractAddress =\n providedContractAddress ??\n calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);\n\n const maxFee =\n transactionsDetail.maxFee ??\n (await this.getSuggestedMaxFee(\n {\n type: TransactionType.DEPLOY_ACCOUNT,\n payload: {\n classHash,\n constructorCalldata: compiledCalldata,\n addressSalt,\n contractAddress,\n },\n },\n transactionsDetail\n ));\n\n const signature = await this.signer.signDeployAccountTransaction({\n classHash,\n constructorCalldata: compiledCalldata,\n contractAddress,\n addressSalt,\n chainId,\n maxFee,\n version,\n nonce,\n });\n\n return this.deployAccountContract(\n { classHash, addressSalt, constructorCalldata, signature },\n {\n nonce,\n maxFee,\n version,\n }\n );\n }\n\n public async signMessage(typedData: TypedData): Promise {\n return this.signer.signMessage(typedData, this.address);\n }\n\n public async hashMessage(typedData: TypedData): Promise {\n return getMessageHash(typedData, this.address);\n }\n\n public async verifyMessageHash(hash: BigNumberish, signature: Signature): Promise {\n try {\n await this.callContract({\n contractAddress: this.address,\n entrypoint: 'isValidSignature',\n calldata: CallData.compile({\n hash: toBigInt(hash).toString(),\n signature: formatSignature(signature),\n }),\n });\n return true;\n } catch {\n return false;\n }\n }\n\n public async verifyMessage(typedData: TypedData, signature: Signature): Promise {\n const hash = await this.hashMessage(typedData);\n return this.verifyMessageHash(hash, signature);\n }\n\n public async getSuggestedMaxFee(\n { type, payload }: EstimateFeeAction,\n details: EstimateFeeDetails\n ) {\n let feeEstimate: EstimateFee;\n\n switch (type) {\n case TransactionType.INVOKE:\n feeEstimate = await this.estimateInvokeFee(payload, details);\n break;\n\n case TransactionType.DECLARE:\n feeEstimate = await this.estimateDeclareFee(payload, details);\n break;\n\n case TransactionType.DEPLOY_ACCOUNT:\n feeEstimate = await this.estimateAccountDeployFee(payload, details);\n break;\n\n case TransactionType.DEPLOY:\n feeEstimate = await this.estimateDeployFee(payload, details);\n break;\n\n default:\n feeEstimate = { suggestedMaxFee: ZERO, overall_fee: ZERO };\n break;\n }\n\n return feeEstimate.suggestedMaxFee;\n }\n\n /**\n * will be renamed to buildDeclareContractTransaction\n */\n public async buildDeclarePayload(\n payload: DeclareContractPayload,\n { nonce, chainId, version, walletAddress, maxFee }: InvocationsSignerDetails\n ): Promise {\n const { classHash, contract, compiledClassHash } = extractContractHashes(payload);\n const compressedCompiledContract = parseContract(contract);\n const signature = await this.signer.signDeclareTransaction({\n classHash,\n compiledClassHash,\n senderAddress: walletAddress,\n chainId,\n maxFee,\n version,\n nonce,\n });\n\n return {\n senderAddress: walletAddress,\n signature,\n contract: compressedCompiledContract,\n compiledClassHash,\n };\n }\n\n public async buildAccountDeployPayload(\n {\n classHash,\n addressSalt = 0,\n constructorCalldata = [],\n contractAddress: providedContractAddress,\n }: DeployAccountContractPayload,\n { nonce, chainId, version, maxFee }: InvocationsSignerDetails\n ): Promise {\n const compiledCalldata = CallData.compile(constructorCalldata);\n const contractAddress =\n providedContractAddress ??\n calculateContractAddressFromHash(addressSalt, classHash, compiledCalldata, 0);\n\n const signature = await this.signer.signDeployAccountTransaction({\n classHash,\n contractAddress,\n chainId,\n maxFee,\n version,\n nonce,\n addressSalt,\n constructorCalldata: compiledCalldata,\n });\n\n return {\n classHash,\n addressSalt,\n constructorCalldata: compiledCalldata,\n signature,\n };\n }\n\n public buildUDCContractPayload(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]\n ): Call[] {\n const calls = [].concat(payload as []).map((it) => {\n const {\n classHash,\n salt = '0',\n unique = true,\n constructorCalldata = [],\n } = it as UniversalDeployerContractPayload;\n const compiledConstructorCallData = CallData.compile(constructorCalldata);\n\n return {\n contractAddress: UDC.ADDRESS,\n entrypoint: UDC.ENTRYPOINT,\n calldata: [\n classHash,\n salt,\n toCairoBool(unique),\n compiledConstructorCallData.length,\n ...compiledConstructorCallData,\n ],\n };\n });\n return calls;\n }\n\n public async simulateTransaction(\n invocations: Invocations,\n { nonce, blockIdentifier, skipValidate, skipExecute }: SimulateTransactionDetails = {}\n ): Promise {\n const accountInvocations = await this.accountInvocationsFactory(invocations, {\n versions: [transactionVersion, transactionVersion_2],\n nonce,\n blockIdentifier,\n });\n\n return super.getSimulateTransaction(accountInvocations, {\n blockIdentifier,\n skipValidate,\n skipExecute,\n });\n }\n\n public async accountInvocationsFactory(\n invocations: Invocations,\n { versions, nonce, blockIdentifier }: AccountInvocationsFactoryDetails\n ) {\n const version = versions[0];\n const safeNonce = await this.getNonceSafe(nonce);\n const chainId = await this.getChainId();\n\n return Promise.all(\n ([] as Invocations).concat(invocations).map(async (transaction, index: number) => {\n const signerDetails: InvocationsSignerDetails = {\n walletAddress: this.address,\n nonce: toBigInt(Number(safeNonce) + index),\n maxFee: ZERO,\n version,\n chainId,\n cairoVersion: this.cairoVersion,\n };\n const txPayload: any = 'payload' in transaction ? transaction.payload : transaction;\n const common = {\n type: transaction.type,\n version,\n nonce: toBigInt(Number(safeNonce) + index),\n blockIdentifier,\n };\n\n if (transaction.type === TransactionType.INVOKE) {\n const payload = await this.buildInvocation(\n ([] as Call[]).concat(txPayload),\n signerDetails\n );\n return {\n ...common,\n ...payload,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DECLARE) {\n signerDetails.version = !isSierra(txPayload.contract)\n ? toBigInt(versions[0])\n : toBigInt(versions[1]);\n const payload = await this.buildDeclarePayload(txPayload, signerDetails);\n return {\n ...common,\n ...payload,\n version: signerDetails.version,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DEPLOY_ACCOUNT) {\n const payload = await this.buildAccountDeployPayload(txPayload, signerDetails);\n return {\n ...common,\n ...payload,\n } as AccountInvocationItem;\n }\n if (transaction.type === TransactionType.DEPLOY) {\n const calls = this.buildUDCContractPayload(txPayload);\n const payload = await this.buildInvocation(calls, signerDetails);\n return {\n ...common,\n ...payload,\n type: TransactionType.INVOKE,\n } as AccountInvocationItem;\n }\n throw Error(`accountInvocationsFactory: unsupported transaction type: ${transaction}`);\n })\n ) as Promise;\n }\n\n public override async getStarkName(\n address: BigNumberish = this.address, // default to the wallet address\n StarknetIdContract?: string\n ): Promise {\n return super.getStarkName(address, StarknetIdContract);\n }\n}\n","import { StarknetChainId } from '../constants';\nimport type {\n AccountInvocations,\n BigNumberish,\n BlockIdentifier,\n Call,\n CallContractResponse,\n ContractClassResponse,\n DeclareContractResponse,\n DeclareContractTransaction,\n DeployAccountContractPayload,\n DeployAccountContractTransaction,\n DeployContractResponse,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n GetBlockResponse,\n GetCodeResponse,\n GetTransactionReceiptResponse,\n GetTransactionResponse,\n Invocation,\n InvocationsDetailsWithNonce,\n InvokeFunctionResponse,\n Nonce,\n SimulateTransactionResponse,\n StateUpdateResponse,\n Storage,\n getEstimateFeeBulkOptions,\n getSimulateTransactionOptions,\n waitForTransactionOptions,\n} from '../types';\n\nexport abstract class ProviderInterface {\n /**\n * Gets the Starknet chain Id\n *\n * @returns the chain Id\n */\n public abstract getChainId(): Promise;\n\n /**\n * Calls a function on the Starknet contract.\n *\n * @param call transaction to be called\n * @param blockIdentifier block identifier\n * @returns the result of the function on the smart contract.\n */\n public abstract callContract(\n call: Call,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the block information\n *\n * @param blockIdentifier block identifier\n * @returns the block object\n */\n public abstract getBlock(blockIdentifier: BlockIdentifier): Promise;\n\n /**\n * @deprecated The method should not be used\n */\n public abstract getCode(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the contract class of the deployed contract.\n *\n * @param contractAddress - contract address\n * @param blockIdentifier - block identifier\n * @returns Contract class of compiled contract\n */\n public abstract getClassAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Returns the class hash deployed under the given address.\n *\n * @param contractAddress - contract address\n * @param blockIdentifier - block identifier\n * @returns Class hash\n */\n public abstract getClassHashAt(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Returns the contract class deployed under the given class hash.\n *\n * @param classHash - class hash\n * @returns Contract class of compiled contract\n */\n public abstract getClassByHash(classHash: string): Promise;\n\n /**\n * Gets the nonce of a contract with respect to a specific block\n *\n * @param contractAddress - contract address\n * @returns the hex nonce\n */\n public abstract getNonceForAddress(\n contractAddress: string,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the contract's storage variable at a specific key.\n *\n * @param contractAddress\n * @param key - from getStorageVarAddress('') (WIP)\n * @param blockIdentifier - block identifier\n * @returns the value of the storage variable\n */\n public abstract getStorageAt(\n contractAddress: string,\n key: BigNumberish,\n blockIdentifier?: BlockIdentifier\n ): Promise;\n\n /**\n * Gets the transaction information from a tx id.\n *\n * @param txHash\n * @returns the transaction object \\{ transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? \\}\n */\n public abstract getTransaction(transactionHash: BigNumberish): Promise;\n\n /**\n * Gets the transaction receipt from a tx hash.\n *\n * @param txHash\n * @returns the transaction receipt object\n */\n public abstract getTransactionReceipt(\n transactionHash: BigNumberish\n ): Promise;\n\n /**\n * Deploys a given compiled Account contract (json) to starknet\n *\n * @param payload payload to be deployed containing:\n * - compiled contract code\n * - constructor calldata\n * - address salt\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract deployAccountContract(\n payload: DeployAccountContractPayload,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Invokes a function on starknet\n * @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * - maxFee - optional maxFee\n * @returns response from addTransaction\n */\n public abstract invokeFunction(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Declares a given compiled contract (json) to starknet\n * @param transaction transaction payload to be deployed containing:\n * - compiled contract code\n * - sender address\n * - signature\n * @param details Invocation Details containing:\n * - nonce\n * - optional version\n * - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract declareContract(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce\n ): Promise;\n\n /**\n * Estimates the fee for a given INVOKE transaction\n * @deprecated Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getEstimateFee(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce,\n blockIdentifier: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given INVOKE transaction\n *\n * @param invocation the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce - optional nonce\n * - version - optional version\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getInvokeEstimateFee(\n invocation: Invocation,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given DECLARE transaction\n *\n * @param transaction transaction payload to be declared containing:\n * - compiled contract code\n * - sender address\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce\n * - version - optional version\n * - optional maxFee\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getDeclareEstimateFee(\n transaction: DeclareContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a given DEPLOY_ACCOUNT transaction\n *\n * @param transaction transaction payload to be deployed containing:\n * - classHash\n * - constructorCalldata\n * - addressSalt\n * - signature - (defaults to []) the signature\n * @param details - optional details containing:\n * - nonce\n * - version - optional version\n * - optional maxFee\n * @param blockIdentifier - (optional) block identifier\n * @param skipValidate - (optional) skip cairo __validate__ method\n * @returns the estimated fee\n */\n public abstract getDeployAccountEstimateFee(\n transaction: DeployAccountContractTransaction,\n details: InvocationsDetailsWithNonce,\n blockIdentifier?: BlockIdentifier,\n skipValidate?: boolean\n ): Promise;\n\n /**\n * Estimates the fee for a list of INVOKE transaction\n *\n * @param invocations AccountInvocations - Complete invocations array with account details\n * @param options getEstimateFeeBulkOptions\n * - (optional) blockIdentifier - BlockIdentifier\n * - (optional) skipValidate - boolean (default false)\n * @returns the estimated fee\n */\n public abstract getEstimateFeeBulk(\n invocations: AccountInvocations,\n options?: getEstimateFeeBulkOptions\n ): Promise;\n\n /**\n * Wait for the transaction to be accepted\n * @param txHash - transaction hash\n * @param options waitForTransactionOptions\n * - (optional) retryInterval: number | undefined;\n * - (optional) successStates: TransactionStatus[] | undefined;\n * @return GetTransactionReceiptResponse\n */\n public abstract waitForTransaction(\n txHash: BigNumberish,\n options?: waitForTransactionOptions\n ): Promise;\n\n /**\n * Simulates the transaction and returns the transaction trace and estimated fee.\n *\n * @param invocations AccountInvocations - Complete invocations array with account details\n * @param options - getSimulateTransactionOptions\n * - (optional) blockIdentifier - block identifier\n * - (optional) skipValidate - skip cairo __validate__ method\n * - (optional) skipExecute - skip cairo __execute__ method\n * @returns an array of transaction trace and estimated fee\n */\n public abstract getSimulateTransaction(\n invocations: AccountInvocations,\n options?: getSimulateTransactionOptions\n ): Promise;\n\n /**\n * Gets the state changes in a specific block\n *\n * @param blockIdentifier - block identifier\n * @returns StateUpdateResponse\n */\n public abstract getStateUpdate(blockIdentifier?: BlockIdentifier): Promise;\n}\n","import { Provider } from './default';\n\nexport * from './default';\nexport * from './errors';\nexport * from './sequencer';\nexport * from './interface';\nexport * from './rpc';\n\nexport const defaultProvider = new Provider();\n","import { ProviderInterface } from '../provider';\nimport { SignerInterface } from '../signer';\nimport {\n Abi,\n AllowArray,\n BigNumberish,\n BlockIdentifier,\n CairoVersion,\n Call,\n DeclareAndDeployContractPayload,\n DeclareContractPayload,\n DeclareContractResponse,\n DeclareDeployUDCResponse,\n DeployAccountContractPayload,\n DeployContractResponse,\n DeployContractUDCResponse,\n EstimateFeeAction,\n EstimateFeeDetails,\n EstimateFeeResponse,\n EstimateFeeResponseBulk,\n Invocations,\n InvocationsDetails,\n InvokeFunctionResponse,\n MultiDeployContractResponse,\n Nonce,\n Signature,\n SimulateTransactionDetails,\n SimulateTransactionResponse,\n TypedData,\n UniversalDeployerContractPayload,\n} from '../types';\n\nexport abstract class AccountInterface extends ProviderInterface {\n public abstract address: string;\n\n public abstract signer: SignerInterface;\n\n public abstract cairoVersion: CairoVersion;\n\n /**\n * Estimate Fee for executing an INVOKE transaction on starknet\n *\n * @param calls the invocation object containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n *\n * @returns response from estimate_fee\n */\n public abstract estimateInvokeFee(\n calls: AllowArray,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a DECLARE transaction on starknet\n *\n * @param contractPayload the payload object containing:\n * - contract - the compiled contract to be declared\n * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.\n *\n * @returns response from estimate_fee\n */\n public abstract estimateDeclareFee(\n contractPayload: DeclareContractPayload,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet\n *\n * @param contractPayload -\n * - contract - the compiled contract to be deployed\n * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.\n * @param estimateFeeDetails -\n * - optional blockIdentifier\n * - constant nonce = 0\n * @returns response from estimate_fee\n */\n public abstract estimateAccountDeployFee(\n contractPayload: DeployAccountContractPayload,\n estimateFeeDetails?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a UDC DEPLOY transaction on starknet\n * This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC)\n \n * @param deployContractPayload containing\n * - classHash: computed class hash of compiled contract\n * - salt: address salt\n * - unique: bool if true ensure unique salt\n * - calldata: constructor calldata\n * \n * @param transactionsDetail Invocation Details containing:\n * - optional nonce\n * - optional version\n * - optional maxFee\n */\n public abstract estimateDeployFee(\n deployContractPayload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Estimate Fee for executing a list of transactions on starknet\n * Contract must be deployed for fee estimation to be possible\n *\n * @param transactions array of transaction object containing :\n * - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT'\n * - payload - the payload of the transaction\n *\n * @returns response from estimate_fee\n */\n public abstract estimateFeeBulk(\n invocations: Invocations,\n details?: EstimateFeeDetails\n ): Promise;\n\n /**\n * Invoke execute function in account contract\n *\n * @param transactions the invocation object or an array of them, containing:\n * - contractAddress - the address of the contract\n * - entrypoint - the entrypoint of the contract\n * - calldata - (defaults to []) the calldata\n * - signature - (defaults to []) the signature\n * @param abi (optional) the abi of the contract for better displaying\n *\n * @returns response from addTransaction\n */\n public abstract execute(\n transactions: AllowArray,\n abis?: Abi[],\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Declares a given compiled contract (json) to starknet\n * \n * @param contractPayload transaction payload to be deployed containing:\n - contract: compiled contract code\n - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution.\n - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string;\n - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution.\n * @param transactionsDetail Invocation Details containing:\n - optional nonce\n - optional version\n - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract declare(\n contractPayload: DeclareContractPayload,\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Deploys a declared contract to starknet - using Universal Deployer Contract (UDC)\n * support multicall\n *\n * @param payload -\n * - classHash: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details -\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - contract_address[]\n * - transaction_hash\n */\n public abstract deploy(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Simplify deploy simulating old DeployContract with same response + UDC specific response\n * Internal wait for L2 transaction, support multicall\n *\n * @param payload -\n * - classHash: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details -\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - contract_address\n * - transaction_hash\n * - address\n * - deployer\n * - unique\n * - classHash\n * - calldata_len\n * - calldata\n * - salt\n */\n public abstract deployContract(\n payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[],\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Declares and Deploy a given compiled contract (json) to starknet using UDC\n * Internal wait for L2 transaction, do not support multicall\n * Method will pass even if contract is already declared (internal using DeclareIfNot)\n *\n * @param payload\n * - contract: compiled contract code\n * - [casm=cairo1]: CairoAssembly | undefined;\n * - [compiledClassHash]: string | undefined;\n * - [classHash]: computed class hash of compiled contract\n * - [constructorCalldata] contract constructor calldata\n * - [salt=pseudorandom] deploy address salt\n * - [unique=true] ensure unique salt\n * @param details\n * - [nonce=getNonce]\n * - [version=transactionVersion]\n * - [maxFee=getSuggestedMaxFee]\n * @returns\n * - declare\n * - transaction_hash\n * - deploy\n * - contract_address\n * - transaction_hash\n * - address\n * - deployer\n * - unique\n * - classHash\n * - calldata_len\n * - calldata\n * - salt\n */\n public abstract declareAndDeploy(\n payload: DeclareAndDeployContractPayload,\n details?: InvocationsDetails | undefined\n ): Promise;\n\n /**\n * Deploy the account on Starknet\n * \n * @param contractPayload transaction payload to be deployed containing:\n - classHash: computed class hash of compiled contract\n - optional constructor calldata\n - optional address salt \n - optional contractAddress\n * @param transactionsDetail Invocation Details containing:\n - constant nonce = 0\n - optional version\n - optional maxFee\n * @returns a confirmation of sending a transaction on the starknet contract\n */\n public abstract deployAccount(\n contractPayload: DeployAccountContractPayload,\n transactionsDetail?: InvocationsDetails\n ): Promise;\n\n /**\n * Sign an JSON object for off-chain usage with the starknet private key and return the signature\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param json - JSON object to be signed\n * @returns the signature of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract signMessage(typedData: TypedData): Promise;\n\n /**\n * Hash a JSON object with pederson hash and return the hash\n * This adds a message prefix so it cant be interchanged with transactions\n *\n * @param json - JSON object to be hashed\n * @returns the hash of the JSON object\n * @throws {Error} if the JSON object is not a valid JSON\n */\n public abstract hashMessage(typedData: TypedData): Promise;\n\n /**\n * Verify a signature of a JSON object\n *\n * @param typedData - JSON object to be verified\n * @param signature - signature of the JSON object\n * @returns true if the signature is valid, false otherwise\n * @throws {Error} if the JSON object is not a valid JSON or the signature is not a valid signature\n */\n public abstract verifyMessage(typedData: TypedData, signature: Signature): Promise;\n\n /**\n * Verify a signature of a given hash\n * @warning This method is not recommended, use verifyMessage instead\n *\n * @param hash - hash to be verified\n * @param signature - signature of the hash\n * @returns true if the signature is valid, false otherwise\n * @throws {Error} if the signature is not a valid signature\n */\n public abstract verifyMessageHash(hash: BigNumberish, signature: Signature): Promise;\n\n /**\n * Gets the nonce of the account with respect to a specific block\n *\n * @param {BlockIdentifier} blockIdentifier - optional blockIdentifier. Defaults to 'pending'\n * @returns nonce of the account\n */\n public abstract getNonce(blockIdentifier?: BlockIdentifier): Promise;\n\n /**\n * Gets Suggested Max Fee based on the transaction type\n *\n * @param {EstimateFeeAction} estimateFeeAction\n * @param {EstimateFeeDetails} details\n * @returns suggestedMaxFee\n */\n public abstract getSuggestedMaxFee(\n estimateFeeAction: EstimateFeeAction,\n details: EstimateFeeDetails\n ): Promise;\n\n /**\n * Simulates an array of transaction and returns an array of transaction trace and estimated fee.\n *\n * @param invocations Invocations containing:\n * - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION\n * @param details SimulateTransactionDetails\n *\n * @returns response from simulate_transaction\n */\n public abstract simulateTransaction(\n invocations: Invocations,\n details?: SimulateTransactionDetails\n ): Promise;\n}\n","import { AccountInterface } from '../account';\nimport { ProviderInterface, defaultProvider } from '../provider';\nimport {\n Abi,\n ArgsOrCalldata,\n ArgsOrCalldataWithOptions,\n AsyncContractFunction,\n Call,\n CallOptions,\n Calldata,\n ContractFunction,\n ContractOptions,\n EstimateFeeResponse,\n FunctionAbi,\n InvokeFunctionResponse,\n InvokeOptions,\n RawArgs,\n Result,\n StructAbi,\n ValidateType,\n} from '../types';\nimport assert from '../utils/assert';\nimport { CallData, cairo } from '../utils/calldata';\nimport { createAbiParser } from '../utils/calldata/parser';\nimport { ContractInterface } from './interface';\n\nexport const splitArgsAndOptions = (args: ArgsOrCalldataWithOptions) => {\n const options = [\n 'blockIdentifier',\n 'parseRequest',\n 'parseResponse',\n 'formatResponse',\n 'maxFee',\n 'nonce',\n 'signature',\n 'addressSalt',\n ];\n const lastArg = args[args.length - 1];\n if (typeof lastArg === 'object' && options.some((x) => x in lastArg)) {\n return { args: args as ArgsOrCalldata, options: args.pop() as ContractOptions };\n }\n return { args: args as ArgsOrCalldata };\n};\n\n/**\n * Adds call methods to the contract\n */\nfunction buildCall(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n return async function (...args: ArgsOrCalldataWithOptions): Promise {\n const params = splitArgsAndOptions(args);\n return contract.call(functionAbi.name, params.args, {\n parseRequest: true,\n parseResponse: true,\n ...params.options,\n });\n };\n}\n\n/**\n * Adds invoke methods to the contract\n */\nfunction buildInvoke(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n return async function (...args: Array): Promise {\n const params = splitArgsAndOptions(args);\n return contract.invoke(functionAbi.name, params.args, {\n parseRequest: true,\n ...params.options,\n });\n };\n}\n\n/**\n * Adds call/invoke methods to the contract\n */\nfunction buildDefault(contract: Contract, functionAbi: FunctionAbi): AsyncContractFunction {\n if (functionAbi.stateMutability === 'view' || functionAbi.state_mutability === 'view') {\n return buildCall(contract, functionAbi);\n }\n return buildInvoke(contract, functionAbi);\n}\n\n/**\n * Adds populate for methods to the contract\n */\nfunction buildPopulate(contract: Contract, functionAbi: FunctionAbi): ContractFunction {\n return function (...args: Array): any {\n return contract.populate(functionAbi.name, args);\n };\n}\n\n/**\n * Adds estimateFee for methods to the contract\n */\nfunction buildEstimate(contract: Contract, functionAbi: FunctionAbi): ContractFunction {\n return function (...args: Array): any {\n return contract.estimate(functionAbi.name, args);\n };\n}\n\nexport function getCalldata(args: RawArgs, callback: Function): Calldata {\n // Check if Calldata in args or args[0] else compile\n if (Array.isArray(args) && '__compiled__' in args) return args as Calldata;\n if (Array.isArray(args) && Array.isArray(args[0]) && '__compiled__' in args[0])\n return args[0] as Calldata;\n return callback();\n}\n\n/**\n * Not used at the moment\n */\n/* const detectCairoVersion = (abi: Abi) => {\n if (!abi) return '0';\n return abi.find((it) => 'state_mutability' in it) ? '1' : '0';\n}; */\n\nexport class Contract implements ContractInterface {\n abi: Abi;\n\n address: string;\n\n providerOrAccount: ProviderInterface | AccountInterface;\n\n deployTransactionHash?: string;\n\n protected readonly structs: { [name: string]: StructAbi };\n\n readonly functions!: { [name: string]: AsyncContractFunction };\n\n readonly callStatic!: { [name: string]: AsyncContractFunction };\n\n readonly populateTransaction!: { [name: string]: ContractFunction };\n\n readonly estimateFee!: { [name: string]: ContractFunction };\n\n readonly [key: string]: AsyncContractFunction | any;\n\n private callData: CallData;\n\n /**\n * Contract class to handle contract methods\n *\n * @param abi - Abi of the contract object\n * @param address (optional) - address to connect to\n * @param providerOrAccount (optional) - Provider or Account to attach to\n */\n constructor(\n abi: Abi,\n address: string,\n providerOrAccount: ProviderInterface | AccountInterface = defaultProvider\n ) {\n this.address = address && address.toLowerCase();\n this.providerOrAccount = providerOrAccount;\n this.callData = new CallData(abi);\n this.structs = CallData.getAbiStruct(abi);\n const parser = createAbiParser(abi);\n this.abi = parser.getLegacyFormat();\n\n const options = { enumerable: true, value: {}, writable: false };\n Object.defineProperties(this, {\n functions: { enumerable: true, value: {}, writable: false },\n callStatic: { enumerable: true, value: {}, writable: false },\n populateTransaction: { enumerable: true, value: {}, writable: false },\n estimateFee: { enumerable: true, value: {}, writable: false },\n });\n this.abi.forEach((abiElement) => {\n if (abiElement.type !== 'function') return;\n const signature = abiElement.name;\n if (!this[signature]) {\n Object.defineProperty(this, signature, {\n ...options,\n value: buildDefault(this, abiElement),\n });\n }\n if (!this.functions[signature]) {\n Object.defineProperty(this.functions, signature, {\n ...options,\n value: buildDefault(this, abiElement),\n });\n }\n if (!this.callStatic[signature]) {\n Object.defineProperty(this.callStatic, signature, {\n ...options,\n value: buildCall(this, abiElement),\n });\n }\n if (!this.populateTransaction[signature]) {\n Object.defineProperty(this.populateTransaction, signature, {\n ...options,\n value: buildPopulate(this, abiElement),\n });\n }\n if (!this.estimateFee[signature]) {\n Object.defineProperty(this.estimateFee, signature, {\n ...options,\n value: buildEstimate(this, abiElement),\n });\n }\n });\n }\n\n public attach(address: string): void {\n this.address = address;\n }\n\n public connect(providerOrAccount: ProviderInterface | AccountInterface) {\n this.providerOrAccount = providerOrAccount;\n }\n\n public async deployed(): Promise {\n if (this.deployTransactionHash) {\n await this.providerOrAccount.waitForTransaction(this.deployTransactionHash);\n this.deployTransactionHash = undefined;\n }\n return this;\n }\n\n public async call(\n method: string,\n args: ArgsOrCalldata = [],\n {\n parseRequest = true,\n parseResponse = true,\n formatResponse = undefined,\n blockIdentifier = undefined,\n }: CallOptions = {}\n ): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n const calldata = getCalldata(args, () => {\n if (parseRequest) {\n this.callData.validate(ValidateType.CALL, method, args);\n return this.callData.compile(method, args);\n }\n // eslint-disable-next-line no-console\n console.warn('Call skipped parsing but provided rawArgs, possible malfunction request');\n return args;\n });\n\n return this.providerOrAccount\n .callContract(\n {\n contractAddress: this.address,\n calldata,\n entrypoint: method,\n },\n blockIdentifier\n )\n .then((x) => {\n if (!parseResponse) {\n return x.result;\n }\n if (formatResponse) {\n return this.callData.format(method, x.result, formatResponse);\n }\n return this.callData.parse(method, x.result);\n });\n }\n\n public invoke(\n method: string,\n args: ArgsOrCalldata = [],\n { parseRequest = true, maxFee, nonce, signature }: InvokeOptions = {}\n ): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n const calldata = getCalldata(args, () => {\n if (parseRequest) {\n this.callData.validate(ValidateType.INVOKE, method, args);\n return this.callData.compile(method, args);\n }\n // eslint-disable-next-line no-console\n console.warn('Invoke skipped parsing but provided rawArgs, possible malfunction request');\n return args;\n });\n\n const invocation = {\n contractAddress: this.address,\n calldata,\n entrypoint: method,\n };\n if ('execute' in this.providerOrAccount) {\n return this.providerOrAccount.execute(invocation, undefined, {\n maxFee,\n nonce,\n });\n }\n\n if (!nonce) throw new Error(`Nonce is required when invoking a function without an account`);\n // eslint-disable-next-line no-console\n console.warn(`Invoking ${method} without an account. This will not work on a public node.`);\n\n return this.providerOrAccount.invokeFunction(\n {\n ...invocation,\n signature,\n },\n {\n nonce,\n }\n );\n }\n\n public async estimate(method: string, args: ArgsOrCalldata = []): Promise {\n assert(this.address !== null, 'contract is not connected to an address');\n\n if (!getCalldata(args, () => false)) {\n this.callData.validate(ValidateType.INVOKE, method, args);\n }\n\n const invocation = this.populate(method, args);\n if ('estimateInvokeFee' in this.providerOrAccount) {\n return this.providerOrAccount.estimateInvokeFee(invocation);\n }\n throw Error('Contract must be connected to the account contract to estimate');\n }\n\n public populate(method: string, args: RawArgs = []): Call {\n const calldata: Calldata = getCalldata(args, () => this.callData.compile(method, args));\n return {\n contractAddress: this.address,\n entrypoint: method,\n calldata,\n };\n }\n\n public isCairo1(): boolean {\n return cairo.isCairo1Abi(this.abi);\n }\n}\n","import { AccountInterface } from '../account';\nimport { ProviderInterface } from '../provider';\nimport {\n Abi,\n ArgsOrCalldata,\n AsyncContractFunction,\n BlockIdentifier,\n CallOptions,\n ContractFunction,\n EstimateFeeResponse,\n Invocation,\n InvokeFunctionResponse,\n InvokeOptions,\n Result,\n} from '../types';\n\nexport abstract class ContractInterface {\n public abstract abi: Abi;\n\n public abstract address: string;\n\n public abstract providerOrAccount: ProviderInterface | AccountInterface;\n\n public abstract deployTransactionHash?: string;\n\n readonly functions!: { [name: string]: AsyncContractFunction };\n\n readonly callStatic!: { [name: string]: AsyncContractFunction };\n\n readonly populateTransaction!: { [name: string]: ContractFunction };\n\n readonly estimateFee!: { [name: string]: ContractFunction };\n\n readonly [key: string]: AsyncContractFunction | any;\n\n /**\n * Saves the address of the contract deployed on network that will be used for interaction\n *\n * @param address - address of the contract\n */\n public abstract attach(address: string): void;\n\n /**\n * Attaches to new Provider or Account\n *\n * @param providerOrAccount - new Provider or Account to attach to\n */\n public abstract connect(providerOrAccount: ProviderInterface | AccountInterface): void;\n\n /**\n * Resolves when contract is deployed on the network or when no deployment transaction is found\n *\n * @returns Promise that resolves when contract is deployed on the network or when no deployment transaction is found\n * @throws When deployment fails\n */\n public abstract deployed(): Promise;\n\n /**\n * Calls a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call\n * @param options optional blockIdentifier\n * @returns Result of the call as an array with key value pars\n */\n public abstract call(\n method: string,\n args?: ArgsOrCalldata,\n options?: CallOptions\n ): Promise;\n\n /**\n * Invokes a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the invoke or Calldata\n * @param options\n * @returns Add Transaction Response\n */\n public abstract invoke(\n method: string,\n args?: ArgsOrCalldata,\n options?: InvokeOptions\n ): Promise;\n\n /**\n * Estimates a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call or Calldata\n * @param options optional blockIdentifier\n */\n public abstract estimate(\n method: string,\n args?: ArgsOrCalldata,\n options?: {\n blockIdentifier?: BlockIdentifier;\n }\n ): Promise;\n\n /**\n * Calls a method on a contract\n *\n * @param method name of the method\n * @param args Array of the arguments for the call or Calldata\n * @returns Invocation object\n */\n public abstract populate(method: string, args?: ArgsOrCalldata): Invocation;\n\n /**\n * tells if the contract comes from a Cairo 1 contract\n *\n * @returns TRUE if the contract comes from a Cairo1 contract\n * @example\n * ```typescript\n * const isCairo1: boolean = myContract.isCairo1();\n * ```\n */\n public abstract isCairo1(): boolean;\n}\n","import { AccountInterface } from '../account';\nimport {\n Abi,\n ArgsOrCalldataWithOptions,\n CairoAssembly,\n CompiledContract,\n ValidateType,\n} from '../types';\nimport assert from '../utils/assert';\nimport { CallData } from '../utils/calldata';\nimport { Contract, getCalldata, splitArgsAndOptions } from './default';\n\nexport type ContractFactoryParams = {\n compiledContract: CompiledContract;\n account: any;\n casm?: CairoAssembly;\n classHash?: string;\n compiledClassHash?: string;\n abi?: Abi;\n};\n\nexport class ContractFactory {\n compiledContract: CompiledContract;\n\n account: AccountInterface;\n\n abi: Abi;\n\n classHash?: string;\n\n casm?: CairoAssembly;\n\n compiledClassHash?: string;\n\n private CallData: CallData;\n\n /**\n * @param params CFParams\n * - compiledContract: CompiledContract;\n * - account: AccountInterface;\n * - casm?: CairoAssembly;\n * - classHash?: string;\n * - compiledClassHash?: string;\n * - abi?: Abi;\n */\n constructor(params: ContractFactoryParams) {\n this.compiledContract = params.compiledContract;\n this.account = params.account;\n this.casm = params.casm;\n this.abi = params.abi ?? params.compiledContract.abi;\n this.classHash = params.classHash;\n this.compiledClassHash = params.compiledClassHash;\n this.CallData = new CallData(this.abi);\n }\n\n /**\n * Deploys contract and returns new instance of the Contract\n * If contract is not declared it will first declare it, and then deploy\n *\n * @param args - Array of the constructor arguments for deployment\n * @param options (optional) Object - parseRequest, parseResponse, addressSalt\n * @returns deployed Contract\n */\n public async deploy(...args: ArgsOrCalldataWithOptions): Promise {\n const { args: param, options = { parseRequest: true } } = splitArgsAndOptions(args);\n\n const constructorCalldata = getCalldata(param, () => {\n if (options.parseRequest) {\n this.CallData.validate(ValidateType.DEPLOY, 'constructor', param);\n return this.CallData.compile('constructor', param);\n }\n // eslint-disable-next-line no-console\n console.warn('Call skipped parsing but provided rawArgs, possible malfunction request');\n return param;\n });\n\n const {\n deploy: { contract_address, transaction_hash },\n } = await this.account.declareAndDeploy({\n contract: this.compiledContract,\n casm: this.casm,\n classHash: this.classHash,\n compiledClassHash: this.compiledClassHash,\n constructorCalldata,\n salt: options.addressSalt,\n });\n assert(Boolean(contract_address), 'Deployment of the contract failed');\n\n const contractInstance = new Contract(\n this.compiledContract.abi,\n contract_address!,\n this.account\n );\n contractInstance.deployTransactionHash = transaction_hash;\n\n return contractInstance;\n }\n\n /**\n * Attaches to new Account\n *\n * @param account - new Provider or Account to attach to\n * @returns ContractFactory\n */\n connect(account: AccountInterface): ContractFactory {\n this.account = account;\n return this;\n }\n\n /**\n * Attaches current abi and account to the new address\n *\n * @param address - Contract address\n * @returns Contract\n */\n attach(address: string): Contract {\n return new Contract(this.abi, address, this.account);\n }\n\n // ethers.js' getDeployTransaction cant be supported as it requires the account or signer to return a signed transaction which is not possible with the current implementation\n}\n","/* eslint-disable no-bitwise */\nimport { hexToBytes } from '@noble/curves/abstract/utils';\n\nimport { MASK_251, ZERO } from '../constants';\nimport { BigNumberish } from '../types';\nimport { addHexPrefix, removeHexPrefix } from './encode';\nimport { keccakBn } from './hash';\nimport { assertInRange, toHex } from './num';\n\nexport function addAddressPadding(address: BigNumberish): string {\n return addHexPrefix(removeHexPrefix(toHex(address)).padStart(64, '0'));\n}\n\nexport function validateAndParseAddress(address: BigNumberish): string {\n assertInRange(address, ZERO, MASK_251, 'Starknet Address');\n\n const result = addAddressPadding(address);\n\n if (!result.match(/^(0x)?[0-9a-fA-F]{64}$/)) {\n throw new Error('Invalid Address Format');\n }\n\n return result;\n}\n\n// from https://github.com/ethers-io/ethers.js/blob/fc1e006575d59792fa97b4efb9ea2f8cca1944cf/packages/address/src.ts/index.ts#L12\nexport function getChecksumAddress(address: BigNumberish): string {\n const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split('');\n const hex = removeHexPrefix(keccakBn(address));\n const hashed = hexToBytes(hex.padStart(64, '0'));\n\n for (let i = 0; i < chars.length; i += 2) {\n if (hashed[i >> 1] >> 4 >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n\n return addHexPrefix(chars.join(''));\n}\n\nexport function validateChecksumAddress(address: string): boolean {\n return getChecksumAddress(address) === address;\n}\n","/**\n * Main\n */\nexport * from './account';\nexport * from './contract';\nexport * from './provider';\nexport * from './signer';\n\n// TODO: decide on final export style\nexport * from './types';\nexport * as types from './types';\n\n/**\n * Utils\n */\nexport * as constants from './constants';\nexport * as encode from './utils/encode';\nexport * as hash from './utils/hash';\nexport * as json from './utils/json';\nexport * as num from './utils/num';\nexport * as transaction from './utils/transaction';\nexport * as stark from './utils/stark';\nexport * as merkle from './utils/merkle';\nexport * as uint256 from './utils/uint256';\nexport * as shortString from './utils/shortString';\nexport * as typedData from './utils/typedData';\nexport * as ec from './utils/ec';\nexport * as starknetId from './utils/starknetId';\nexport * as provider from './utils/provider';\nexport * as selector from './utils/selector';\nexport * from './utils/address';\nexport * from './utils/url';\nexport * from './utils/calldata';\nexport * from './utils/contract';\nexport * from './utils/events';\n\n/**\n * Deprecated\n */\n/* eslint-disable import/first */\nimport * as num from './utils/num';\n\n/** @deprecated prefer the 'num' naming */\nexport const number = num;\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAM,aAAa,OAAO,WAAW;AAE5C,IAAM,cAAc;AAEb,SAAS,oBAAoB,OAA4B;AAC9D,SAAO,IAAI,WAAW,KAAK,EAAE,OAAO,CAAC,MAAM,SAAS,OAAO,OAAO,aAAa,IAAI,GAAG,EAAE;AAC1F;AAEO,SAAS,oBAAoB,GAAuB;AACzD,SAAO,WAAW,KAAK,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAClD;AAEO,SAAS,cAAc,GAAuB;AACnD,SAAO,aAAa,oBAAoB,KAAK,CAAC,CAAC,IAAI,OAAO,KAAK,GAAG,QAAQ;AAC5E;AAEO,SAAS,cAAc,GAAwB;AACpD,SAAO,aAAa,KAAK,oBAAoB,CAAC,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE,SAAS,QAAQ;AACrF;AAEO,SAAS,QAAQ,QAAoB;AAC1C,SAAO,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE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ACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AAAA,EACA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AAI,OAAO,KAAK,CAAC,KAAK,KAAK,GAAG;AAC5B,YAAM,CAAC,IAAI,MAAM,CAAC,EAAE,YAAY;AAAA,IAClC;AACA,SAAK,OAAO,KAAK,CAAC,IAAI,OAAS,GAAG;AAChC,YAAM,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,YAAY;AAAA,IAC1C;AAAA,EACF;AAEA,SAAO,aAAa,MAAM,KAAK,EAAE,CAAC;AACpC;AAEO,SAAS,wBAAwB,SAA0B;AAChE,SAAO,mBAAmB,OAAO,MAAM;AACzC;;;ACFO,IAAM,SAAS;","names":["BaseUrl","NetworkName","StarknetChainId","TransactionHashPrefix","SIMULATION_FLAG","ValidateType","Uint","EntryPointType","TransactionType","TransactionStatus","BlockStatus","BlockTag","TransactionType","number","uint256","parseBaseTypes","parse","stringify","json","stringify","parse","stringify","parse","parse","stringify","parse","StarknetIdContract","StarknetIdContract","stringify","StarknetIdContract","urljoin","defaultOptions","urljoin","stringify","parse","StarknetIdContract","StarknetIdContract","StarknetIdContract","hexToBytes","hexToBytes"]} \ No newline at end of file diff --git a/web/lib/starknet-estfee-tx-ver/package.json b/web/lib/starknet-estfee-tx-ver/package.json new file mode 100644 index 000000000..35c5c28e2 --- /dev/null +++ b/web/lib/starknet-estfee-tx-ver/package.json @@ -0,0 +1,124 @@ +{ + "name": "starknet", + "version": "5.17.0", + "description": "JavaScript library for Starknet", + "main": "dist/index.js", + "module": "dist/index.mjs", + "jsdelivr": "dist/index.global.js", + "unpkg": "dist/index.global.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "browser": "./dist/index.global.js", + "types": "./dist/index.d.ts" + } + }, + "files": [ + "CHANGELOG.md", + "dist" + ], + "scripts": { + "prepare": "npm run build && husky install", + "build": "tsup && npm run build:esm && npm run build:iife && npm run build:dts", + "build:esm": "tsup --clean false --format esm --platform node", + "build:iife": "tsup --clean false --format iife --platform browser", + "build:dts": "tsup --clean false --dts-only", + "pretest": "npm run lint && npm run ts:check", + "test": "jest -i", + "posttest": "npm run format", + "test:watch": "jest --watch", + "docs": "cd www && npm run start", + "docs:build": "cd www && GIT_REVISION_OVERRIDE=${npm_config_git_revision_override} npm run build", + "docs:build:version": "v=$(npm run info:version -s) && npm run docs:build --git-revision-override=${npm_config_git_revision_override=v$v}", + "docs:version": "v=$(npm run info:version -s) && cd www && npm run version ${npm_config_version_override=$v}", + "info:version": "npm pkg get version | xargs", + "format": "prettier --loglevel warn --write \"**/*.{ts,js,md,yml,json}\"", + "lint": "eslint . --cache --fix --ext .ts", + "ts:check": "tsc --noEmit --resolveJsonModule --project tsconfig.eslint.json" + }, + "keywords": [ + "starknet", + "cairo", + "starkware", + "l2", + "zk", + "rollup" + ], + "repository": "github:0xs34n/starknet.js", + "author": "Sean Han", + "license": "MIT", + "devDependencies": { + "@babel/plugin-transform-modules-commonjs": "^7.18.2", + "@babel/preset-env": "^7.18.2", + "@babel/preset-typescript": "^7.17.12", + "@commitlint/cli": "^17.0.2", + "@commitlint/config-conventional": "^17.0.2", + "@semantic-release/changelog": "^6.0.1", + "@semantic-release/commit-analyzer": "^9.0.2", + "@semantic-release/git": "^10.0.1", + "@semantic-release/npm": "^10.0.0", + "@semantic-release/release-notes-generator": "^11.0.0", + "@types/isomorphic-fetch": "^0.0.36", + "@types/jest": "^29.5.0", + "@types/jest-json-schema": "^6.1.1", + "@types/pako": "^2.0.0", + "@types/url-join": "^4.0.1", + "@typescript-eslint/eslint-plugin": "^5.28.0", + "@typescript-eslint/parser": "^5.28.0", + "ajv": "^8.12.0", + "ajv-keywords": "^5.1.0", + "eslint": "^8.17.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.0.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-prettier": "^4.0.0", + "fetch-intercept": "^2.4.0", + "husky": "^8.0.1", + "import-sort-style-module": "^6.0.0", + "jest": "^29.5.0", + "jest-environment-jsdom": "^29.5.0", + "jest-json-schema": "^6.1.0", + "lint-staged": "^13.0.1", + "prettier": "^2.7.0", + "prettier-plugin-import-sort": "^0.0.7", + "tsup": "^6.7.0", + "typedoc": "^0.24.7", + "typescript": "^5.0.4" + }, + "dependencies": { + "@noble/curves": "~1.0.0", + "isomorphic-fetch": "^3.0.0", + "lossless-json": "^2.0.8", + "micro-starknet": "~0.2.1", + "pako": "^2.0.4", + "url-join": "^4.0.1" + }, + "lint-staged": { + "*.ts": "eslint --cache --fix", + "*.{ts,js,md,yml,json}": "prettier --write" + }, + "jest": { + "snapshotFormat": { + "escapeString": true, + "printBasicPrototype": true + }, + "testMatch": [ + "**/__tests__/**/(*.)+(spec|test).[jt]s?(x)" + ], + "setupFilesAfterEnv": [ + "./__tests__/jest.setup.ts" + ], + "sandboxInjectedGlobals": [ + "Math" + ] + }, + "importSort": { + ".js, .jsx, .ts, .tsx": { + "style": "module", + "parser": "typescript" + } + } +} diff --git a/web/package.json b/web/package.json index 35b3fc330..1c682c475 100644 --- a/web/package.json +++ b/web/package.json @@ -27,7 +27,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-query": "^3.39.2", - "starknet": "https://github.com/broody/starknet.js#551eece1857ecf8f81671ca87afc198de5ef2a5a", + "starknet": "./lib/starknet-estfee-tx-ver", "use-caret-position": "^0.0.2", "zustand": "^4.3.7" }, diff --git a/web/public/images/muggers.gif b/web/public/images/muggers.gif new file mode 100644 index 000000000..fce55c977 Binary files /dev/null and b/web/public/images/muggers.gif differ diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index 33962c228..469419bda 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -1,26 +1,16 @@ -import { Clock, Gem, Bag, Chat, Home, Link, Sound, Arrow } from "./icons"; -import { Box, Button, Divider, Flex, HStack, Text } from "@chakra-ui/react"; +import { Clock, Gem, Bag, Arrow } from "./icons"; +import { Divider, HStack, Text } from "@chakra-ui/react"; import { useEffect, useState } from "react"; import { IsMobile, generatePixelBorderPath } from "@/utils/ui"; import { useRouter } from "next/router"; -import { - useSoundStore, - Sounds, - toggleIsMuted, - playSound, - stopSound, - initSoundStore, -} from "@/hooks/sound"; -import { useUiStore, setIsConnected } from "@/hooks/ui"; +import { initSoundStore } from "@/hooks/sound"; import HeaderButton from "@/components/HeaderButton"; import MediaPlayer from "@/components/MediaPlayer"; import MobileMenu from "@/components/MobileMenu"; -import { play } from "@/hooks/media"; -import { usePlayerEntityQuery, Entity } from "@/generated/graphql"; -import { usePlayerEntity } from "@/hooks/dojo/entities/usePlayerEntity"; -import { useGameEntity } from "@/hooks/dojo/entities/useGameEntity"; +import { usePlayerEntity } from "@/dojo/entities/usePlayerEntity"; +import { useGameEntity } from "@/dojo/entities/useGameEntity"; import { formatCash } from "@/utils/ui"; -import { useDojo } from "@/hooks/dojo"; +import { useDojo } from "@/dojo"; // TODO: constrain this on contract side const MAX_INVENTORY = 100; @@ -35,18 +25,15 @@ const Header = ({ back }: HeaderProps) => { const [inventory, setInventory] = useState(0); const { account } = useDojo(); - const { player: playerEntity, isFetched: isFetchedPlayer } = usePlayerEntity({ + const { player: playerEntity } = usePlayerEntity({ gameId, address: account?.address, }); - const { game: gameEntity, isFetched: isFetchedGame } = useGameEntity({ + const { game: gameEntity } = useGameEntity({ gameId, }); const isMobile = IsMobile(); - const isMuted = useSoundStore((state) => state.isMuted); - const isConnected = useUiStore((state) => state.isConnected); - const hasNewMessages = true; useEffect(() => { const init = async () => { @@ -89,7 +76,7 @@ const Header = ({ back }: HeaderProps) => { - {inventory} + {inventory === 100 ? "Full" : `${inventory}/100`} diff --git a/web/src/components/Inventory.tsx b/web/src/components/Inventory.tsx index 13f24cc3e..6f2c8220d 100644 --- a/web/src/components/Inventory.tsx +++ b/web/src/components/Inventory.tsx @@ -8,10 +8,10 @@ import { } from "@chakra-ui/react"; import React from "react"; -import { usePlayerEntity } from "@/hooks/dojo/entities/usePlayerEntity"; +import { usePlayerEntity } from "@/dojo/entities/usePlayerEntity"; import { useRouter } from "next/router"; -import { getDrugByName } from "@/hooks/ui"; -import { useDojo } from "@/hooks/dojo"; +import { useDojo } from "@/dojo"; +import { getDrugById } from "@/dojo/helpers"; export const Inventory = ({ ...props }: StyleProps) => { const router = useRouter(); @@ -41,7 +41,7 @@ export const Inventory = ({ ...props }: StyleProps) => { }} > - {playerEntity?.drugs.length === 0 ? ( + {playerEntity?.drugCount === 0 ? ( Your bag is empty ) : ( playerEntity?.drugs.map((drug, index) => { @@ -50,7 +50,7 @@ export const Inventory = ({ ...props }: StyleProps) => { <> - {getDrugByName(drug.name).icon({ boxSize: "26" })} + {getDrugById(drug.id).icon({ boxSize: "26" })} {drug.quantity} {index < playerEntity.drugs.length - 1 && ( diff --git a/web/src/components/Layout.tsx b/web/src/components/Layout.tsx index cf9b39ca6..58ece2c5c 100644 --- a/web/src/components/Layout.tsx +++ b/web/src/components/Layout.tsx @@ -12,26 +12,31 @@ import { ReactNode } from "react"; import Header from "./Header"; import { motion } from "framer-motion"; +import CrtEffect from "./CrtEffect"; + export interface LayoutProps { - title: string; - map: ReactNode; - imageSrc: string; - prefixTitle: string; + leftPanelProps?: LeftPanelProps; showBack?: boolean; actions?: ReactNode; + showMap?: boolean; children: ReactNode; + isSinglePanel?: boolean; } -import CrtEffect from "./CrtEffect"; +export interface LeftPanelProps { + title: string; + prefixTitle?: string; + imageSrc?: string; + map?: ReactNode; +} const Layout = ({ - title, - prefixTitle, - map, - imageSrc, + leftPanelProps, showBack, + showMap, children, -}: Partial) => { + isSinglePanel = false, +}: LayoutProps) => { return ( <>
- - {children} + {!isSinglePanel && } + {children} @@ -66,12 +65,7 @@ const LeftPanel = ({ map, imageSrc, ...props -}: { - title?: string; - prefixTitle?: string; - map?: ReactNode; - imageSrc?: string; -} & StyleProps) => { +}: Partial & StyleProps) => { return ( { +export const Callout = ({ location }: { location: Location }) => { return ( { viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" > - + { fill="#11ED83" /> - + { fill="#11ED83" /> - + { fill="#11ED83" /> - + { /> - + { fill="#11ED83" /> - + void; + onSelect: (target: Location) => void; }) => ( onSelect(Locations.Brooklyn)} + onClick={() => onSelect(Location.Brooklyn)} cursor="pointer" d="M74.5421 213.359H74.3667L74.2297 213.469L72.4986 214.853H65.5236L61.9527 206.998L60.3885 193.839L65.6573 179.881L74.8394 162.986H77.0794L79.286 163.692L85.6821 167.493L85.7308 167.522L85.7848 167.539L90.7352 169.127L90.8923 169.178L91.0485 169.125L112.532 161.839L112.551 161.832L112.571 161.824L155.569 143.105L164.752 153.962L171.846 165.577L171.861 165.601L171.878 165.623L176.619 171.727L172.86 172.745L172.767 172.77L172.69 172.828L160.663 181.872L143.873 191.853L143.629 191.998V192.282V193.31V193.741L144.055 193.804L150.541 194.769V197.104L149.575 198.86L149.439 199.107L149.58 199.352L150.541 201.01V202.596L149.65 203.973L147.34 205.513H144.129H143.88L143.73 205.711L141.395 208.793L141.294 208.927V209.095V215.755L139.178 218.753L135.628 221.859H132.766V219.09V218.766L132.47 218.633L125.372 215.457L125.274 215.414H125.168H120.684H120.184V215.914V217.489L115.345 222.597L113.665 223.353H107.589L102.836 221.891L84.3716 213.405L84.2722 213.359H84.1628H80.9966L79.8328 212.278L79.4797 211.95L79.139 212.291L78.0712 213.359H74.5421Z" /> onSelect(Locations.Queens)} + onClick={() => onSelect(Location.Queens)} cursor="pointer" d="M188.692 98.475L194.358 100.675L194.867 103.537L194.912 103.787L195.14 103.899L197.719 105.157V109.587V109.983L198.104 110.074L200.37 110.61V112.249L199.546 112.798L199.233 113.007L199.347 113.366L199.835 114.9L199.927 115.189L200.226 115.241L203.338 115.782L208.486 119.008L208.568 119.06L208.663 119.077L212.506 119.77V121.356L210.435 124.295L210.214 124.609L210.46 124.904L212.623 127.485L212.927 127.848L213.306 127.564L214.568 126.618H218.621L220.758 128.315L222.271 131.801V134.454L220.401 136.829L220.227 137.05L220.326 137.314L221.23 139.71L219.021 142.7L218.923 142.832V142.997V144.88V145.38H219.423H222.458L223.387 147.297V153.378H218.795H218.603L218.461 153.506L217.208 154.633H214.645L212.284 151.616L211.981 151.229L211.589 151.526L208.45 153.897L208.251 154.047V154.296V157.086V157.346L208.465 157.496L210.344 158.811V160.5L209.172 162.375H205.613H205.327L205.182 162.622L203.932 164.747H202.265H202.05L201.903 164.902L200.655 166.211H197.464V164.764L198 163.022L198.065 162.81L197.952 162.62L196.626 160.388L196.332 159.892L195.883 160.254L187.304 167.159L186.831 167.539L187.295 167.93L189.349 169.664V172.631L188.677 173.256H186.887L186.34 172.544L186.205 172.37L185.986 172.351L179.714 171.817L178.024 168.308L178.009 168.277L177.991 168.249L169.138 154.866L169.133 154.857L159.636 139.826L168.265 129.294L168.346 129.196L168.37 129.072L168.718 127.258L168.757 127.057L168.643 126.886L167.751 125.548V121.514V121.402L167.703 121.3L163.485 112.382L162.817 105.496L167.631 99.8683L167.751 99.728V99.5433V89.1508V88.9906L167.658 88.8602L166.705 87.5259V83.0826V82.5826H166.205H164.17L158.893 74.7004V71.5172L161.807 67.1798L161.892 67.0533V66.901V63.5133L167.369 60.7748H171.52L179.654 65.1086V67.6608L178.696 68.5589L178.538 68.7071V68.9237V72.4111V72.6127L178.678 72.7579L180.352 74.4959V77.0145V77.3378L180.647 77.4705L183.36 78.6916L185.443 80.6485V83.0826V83.3126L185.618 83.4623L188.059 85.5547L188.23 85.7009L188.452 85.6705L191.521 85.252L191.667 85.2321L191.779 85.1362L193.592 83.5826H196.735L198.277 85.3616V87.3375L194.629 88.6816L194.617 88.6861L194.605 88.6912L192.831 89.4514L190.644 88.6793L190.207 88.5253L190.02 88.9485C189.751 89.5553 189.349 90.4834 189.012 91.2963C188.845 91.7021 188.692 92.0834 188.58 92.3829C188.524 92.5321 188.477 92.6666 188.443 92.7762C188.426 92.8308 188.41 92.8848 188.398 92.9346C188.389 92.9745 188.373 93.0479 188.373 93.1265C188.373 93.3489 188.485 93.5491 188.554 93.6604C188.639 93.7972 188.748 93.9382 188.857 94.0679C189.016 94.257 189.196 94.445 189.349 94.5954V96.2645L188.446 97.7489L188.135 98.2589L188.692 98.475Z" /> onSelect(Locations.Central)} + onClick={() => onSelect(Location.Central)} cursor="pointer" d="M103.019 155.7L102.948 155.711L102.883 155.74L96.675 158.562H89.1351L78.0715 154.356L79.0064 150.532L83.2865 141.211L83.2907 141.201L83.2946 141.192L88.3529 128.88L94.5456 116.209L105.139 99.2217L105.161 99.1857L105.177 99.1464L112.249 81.8506L112.276 81.7822L112.283 81.7086L113.248 71.5359L116.541 74.1234L116.859 74.3727L117.169 74.1153L123.719 68.688H129.307L135.362 70.2019L135.422 70.2169H135.484H141.408H141.574L141.706 70.1182L144.918 67.7324H147.792L150.997 73.9591L151.009 73.9824L151.023 74.0043L160.049 87.7804L160.585 90.3724L159.467 98.1082L157.356 101.363L153.756 101.903L153.331 101.967V102.397V104.786V104.988L153.471 105.134L156.102 107.855V113.386V113.452L156.119 113.516L158.873 123.772V127.056L156.915 128.248L156.885 128.267L156.857 128.289L144.518 138.445L136.882 140.519L136.828 140.534L136.778 140.56C134.707 141.66 131.585 143.328 128.952 144.76C127.636 145.476 126.44 146.134 125.558 146.632C125.117 146.881 124.751 147.093 124.487 147.252C124.356 147.332 124.244 147.401 124.16 147.458C124.118 147.486 124.078 147.514 124.043 147.541L124.041 147.542C124.028 147.553 124 147.574 123.969 147.604C123.965 147.606 123.96 147.609 123.955 147.611C123.907 147.636 123.83 147.671 123.723 147.715C123.511 147.803 123.209 147.917 122.834 148.051C122.085 148.319 121.067 148.66 119.942 149.026C117.693 149.759 115.03 150.59 113.264 151.131L113.177 151.157L113.105 151.212L108.24 154.955L103.019 155.7Z" /> onSelect(Locations.Bronx)} + onClick={() => onSelect(Location.Bronx)} cursor="pointer" d="M142.29 24.7098V16.6864L142.794 15.463H146.035L146.833 15.9951V22.7031V23.0533L147.162 23.173L149.082 23.8714L149.948 25.516L150.033 25.6778L150.203 25.7465L153.738 27.1798L154.426 27.4587V26.7165V18.2831L155.323 17.0875H159.733V28.7232V28.9399L159.891 29.0881L165.911 34.726L165.982 34.7924L166.073 34.8275L171.2 36.8062V40.2855V40.3967L171.247 40.4975L173.302 44.8879V48.7678H171.7H171.304L171.213 49.1533L170.482 52.2602L167.101 55.5523H163.099H162.929L162.795 55.656L161.594 56.5797L152.316 61.0294L149.3 61.8777L149.231 61.897L149.171 61.9345L140.692 67.2102H135.744L130.078 65.6047L130.011 65.5857H129.941H123.252H123.105L122.982 65.6655L116.021 70.1533L111.808 66.8002V60.5435V60.4007L111.733 60.2795L109.61 56.8651V40.8588V40.6424L109.452 40.4943L104.928 36.2468V34.361V34.1398L104.764 33.991L102.826 32.2287V30.8555L104.764 29.0931L104.871 28.9961L104.91 28.857L105.763 25.7831H110.639H110.988L111.108 25.456L111.749 23.7165L113.459 21.5786H115.131L117.664 23.8405L117.885 24.038L118.164 23.9387L122.464 22.4098L122.797 22.2915V21.9387V20.432H125.852L126.436 20.8859L126.874 22.8139L126.931 23.0634L127.166 23.1634L130.319 24.5012L130.413 24.5409H130.515H132.426H132.926V24.0409V17.5881L133.799 12.7875H135.295L136.14 15.8286L136.708 19.9995L136.72 20.0851L136.76 20.1617L138.193 22.9328L138.255 23.0526L138.369 23.1249L141.522 25.1316L142.29 25.6207V24.7098Z" /> onSelect(Locations.Jersey)} + onClick={() => onSelect(Location.Jersey)} cursor="pointer" d="M56.1862 32.287L57.2874 30.1847H59.69L60.8412 30.8855L62.3429 29.3338L66.2971 28.6331L67.2982 26.2305H69.6007L70.5517 28.6331L73.5549 30.5351L78.8106 31.2359L79.4112 33.8387L81.3633 30.1847H83.7158L85.6679 31.6363H88.4209L89.1717 28.0825H91.6744L93.2261 29.3338V32.287L94.8779 33.0378L95.4284 35.8408H96.9801L98.3316 35.2401H101.785L102.937 39.4447L103.187 48.3542L103.988 49.3553V53.6099L103.187 57.8144L101.335 59.316L100.934 66.5738L101.785 67.3246V73.5814L100.934 74.182L101.785 75.4334V79.1874L102.636 80.4888V83.492L101.335 84.3429L100.934 88.6976L97.6809 94.8543L94.5275 95.4048L93.5264 97.6573L82.2142 114.175L74.2056 129.291L59.69 154.468L57.2374 160.024L47.3267 169.885L46.626 175.741H44.2734L43.2724 173.639L41.5705 174.94L38.3671 175.291L38.0668 178.494L36.6152 179.796H33.2616L32.711 173.639L30.2083 172.688V168.383L31.81 167.683V165.48L30.9591 164.579V161.626L31.81 160.525L30.2083 160.024L29.5076 158.523L26.6545 157.271L24.5022 158.873H22.3498L19.2465 155.77V153.417L20.2476 151.415L21.6491 150.514L20.2476 149.763L19.697 146.51L17.2444 145.859L17.5447 141.655L18.5458 139.302L19.2465 135.548L21.2487 133.246H23.7013L25.7035 135.148L26.9048 136.95L28.056 135.548L29.5076 134.897L30.2083 131.243L32.2605 130.843L33.2616 129.291H38.7174L41.5705 131.243L42.4715 130.242H45.3246L46.2756 131.243L54.2842 130.843L55.8859 129.291L55.4855 127.89L51.331 129.792H48.1276L48.9284 122.684L48.1276 115.276L49.2788 112.223L51.9317 111.622L50.9806 110.621L51.331 108.419L55.4855 107.868L55.8859 106.667L51.9317 101.361L51.6313 98.2079L50.6803 99.0087L46.2756 98.6083V95.4048L49.5791 94.4538L44.0232 93.7531V90.4996L45.3246 89.048L50.6803 88.6976L51.331 85.2439L56.4866 84.3429L54.9349 82.2907L47.2266 81.6901V79.1874L49.5791 78.5868L50.2799 76.1842L53.2331 75.133H59.1394L62.9435 73.9318L66.8978 71.9296L67.6986 65.4727L65.5463 61.4683L63.5942 62.9199H58.2384V60.3171L59.69 59.6664L60.8412 57.3639L59.69 55.5119L57.2874 54.7611V52.1083L59.69 51.7078L60.1405 50.4065L61.0915 49.3553L63.5942 48.6045L64.1948 44.1497L66.5974 43.7493L68.4995 42.548L68.95 39.4447L70.1513 38.3935H74.9064L75.457 40.3957H76.7083V35.2401H70.5517L69.6007 35.8408H58.2384L56.1862 34.6895V32.287Z" /> onSelect(Locations.Coney)} + onClick={() => onSelect(Location.Coney)} cursor="pointer" d="M201.505 223.521V227.182H199.568V224.99V224.521L199.1 224.491L194.794 224.215V219.91V219.41H194.294H190.071H189.762L189.624 219.687L189.212 220.512H187.793L187.238 218.948L187.187 218.805L187.066 218.714L182.721 215.471L182.588 215.371H182.422H180.831H180.57L180.421 215.584L179.285 217.207H177.853L177.562 214.497L178.331 213.873L178.732 213.546L178.392 213.156L176.74 211.259L176.545 211.035L176.255 211.099L174.656 211.455H168.929L168.076 209.321L167.854 208.766L167.347 209.083L166.549 209.581L164.579 209.076L163.767 207.603V203.264L164.696 199.487L165.608 198.624H172.537L173.429 199.569L173.865 200.03L174.211 199.498L175.129 198.091L175.205 197.975L175.21 197.837L175.632 186.63L176.591 185.527H180.221L182.397 188.275L182.547 188.465H182.789H184.38H184.694L184.83 188.183L185.611 186.568H190.071H190.571V186.068V179.591H197.364L197.956 193.555L197.974 193.968L198.383 194.029L202.354 194.613L207.801 201.196L208.1 201.558L208.48 201.282L209.695 200.398H214.121L214.791 204.808L214.829 205.059L215.054 205.177L216.378 205.865L216.817 207.84L216.887 208.158L217.207 208.222L219.268 208.634L221.272 209.795V211.587V211.846L221.484 211.996L222.313 212.581V215.305L221.409 216.262L221.256 216.424L221.274 216.646L221.58 220.44L221.6 220.687L221.809 220.821L223.108 221.653V223.308L221.877 224.49H218.284H218.086L217.942 224.625L217.146 225.371L215.383 225.05L211.413 224.195L211.413 224.195L211.399 224.192L205.283 223.053L203.362 221.482L202.924 221.123L202.622 221.602L201.582 223.255L201.505 223.377V223.521Z" /> diff --git a/web/src/components/map/Map.tsx b/web/src/components/map/Map.tsx index 15d2a7434..047c3f33d 100644 --- a/web/src/components/map/Map.tsx +++ b/web/src/components/map/Map.tsx @@ -1,30 +1,30 @@ import { Flex, Image, useBreakpointValue } from "@chakra-ui/react"; import { motion, useAnimate } from "framer-motion"; import { useEffect } from "react"; -import { Locations } from "@/hooks/state"; import { HitBox } from "./HitBox"; import { Outline } from "./Outline"; import { Markers } from "./Markers"; +import { Location } from "@/dojo/types"; type CoordinateType = { - [key in Locations]: { x: number; y: number }; + [key in Location]: { x: number; y: number }; }; const coordinate: CoordinateType = { - [Locations.Queens]: { x: -150, y: 150 }, - [Locations.Jersey]: { x: 150, y: 150 }, - [Locations.Bronx]: { x: 0, y: 300 }, - [Locations.Central]: { x: 0, y: 150 }, - [Locations.Coney]: { x: -150, y: -0 }, - [Locations.Brooklyn]: { x: 0, y: -0 }, + [Location.Queens]: { x: -150, y: 150 }, + [Location.Jersey]: { x: 150, y: 150 }, + [Location.Bronx]: { x: 0, y: 300 }, + [Location.Central]: { x: 0, y: 150 }, + [Location.Coney]: { x: -150, y: -0 }, + [Location.Brooklyn]: { x: 0, y: -0 }, }; export const Map = ({ highlight, onSelect, }: { - highlight?: Locations; - onSelect: (selected: Locations) => void; + highlight?: Location; + onSelect: (selected: Location) => void; }) => { const [scope, animate] = useAnimate(); const isMobile = useBreakpointValue([true, false]); diff --git a/web/src/components/map/Markers.tsx b/web/src/components/map/Markers.tsx index 3b2d934ee..e6370ac1a 100644 --- a/web/src/components/map/Markers.tsx +++ b/web/src/components/map/Markers.tsx @@ -1,7 +1,7 @@ +import { Location } from "@/dojo/types"; import { Icon } from "@chakra-ui/react"; -import { Locations } from "@/hooks/state"; -export const Markers = ({ location }: { location?: Locations }) => { +export const Markers = ({ location }: { location?: Location }) => { return ( { viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" > - + { fill="#0CA85D" /> - + { fill="#0CA85D" /> - + { fill="#0CA85D" /> - + { /> - + { fill="#0CA85D" /> - + { +export const Outline = ({ location }: { location?: Location }) => { if (!location) { return <>; } @@ -41,7 +41,7 @@ export const Outline = ({ location }: { location?: Locations }) => { ); }; -const SvgHighlight = ({ location }: { location: Locations }) => { +const SvgHighlight = ({ location }: { location: Location }) => { return ( { xmlns="http://www.w3.org/2000/svg" > - + { /> - + { - + { /> - + { - const components = edge.node?.components || []; - return components[0]!.__typename === "Risks"; - }) as Risks; + return edge.node?.components?.some( + (component) => component?.__typename === "Risks", + ); + })?.node?.components?.[0] as Risks; const drugMarketEntities = edges.filter((edge) => { - edge.node?.components?.find( + return edge.node?.components?.find( (component) => component?.__typename === "Market", ); }) as EntityEdge[]; @@ -59,16 +52,15 @@ export class LocationEntity { ) as Market; const keys = edge.node?.keys || []; - const drugName = keys[2]!; + const drugId = num.toHexString(keys[2]!); - const drugId = shortString.decodeShortString(drugName); const price = Number(marketComponent.cash) / Number(marketComponent.quantity) / SCALING_FACTOR; return { - name: drugId, + id: drugId, price: price, marketPool: marketComponent, }; @@ -77,10 +69,10 @@ export class LocationEntity { if (!risksComponent || drugMarkets.length === 0) return undefined; // sort by name - drugMarkets.sort((a, b) => a.name.localeCompare(b.name)); + drugMarkets.sort((a, b) => a.id.localeCompare(b.id)); return { - name: shortString.decodeShortString(locationId), + id: locationId, risks: risksComponent, drugMarkets: drugMarkets, }; @@ -104,7 +96,7 @@ export const useLocationEntity = ({ const { data, isFetched } = useLocationEntitiesQuery( { gameId: gameId || "", - locationId: shortString.encodeShortString(locationId || ""), + locationId: locationId || "", }, { enabled: !!gameId && !!locationId, diff --git a/web/src/hooks/dojo/entities/usePlayerEntity.tsx b/web/src/dojo/entities/usePlayerEntity.tsx similarity index 80% rename from web/src/hooks/dojo/entities/usePlayerEntity.tsx rename to web/src/dojo/entities/usePlayerEntity.tsx index 018bb6194..2eb137250 100644 --- a/web/src/hooks/dojo/entities/usePlayerEntity.tsx +++ b/web/src/dojo/entities/usePlayerEntity.tsx @@ -1,7 +1,6 @@ import { Player, Drug as DrugType, - Name, usePlayerEntityQuery, EntityEdge, } from "@/generated/graphql"; @@ -9,8 +8,14 @@ import { useCallback, useEffect, useState } from "react"; import { shortString } from "starknet"; import { REFETCH_INTERVAL, SCALING_FACTOR } from ".."; +export enum PlayerStatus { + Normal, + BeingMugged, + BeingArrested, +} + type Drug = { - name: string; + id: string; quantity: number; }; @@ -18,30 +23,30 @@ export class PlayerEntity { cash: number; health: number; turnsRemaining: number; + drugCount: number; locationId: string; + status: PlayerStatus; drugs: Drug[]; constructor(player: Player, drugs: Drug[]) { this.cash = Number(player.cash) / SCALING_FACTOR; this.health = player.health; this.turnsRemaining = player.turns_remaining; + this.drugCount = player.drug_count; this.locationId = player.location_id; + this.status = player.status; this.drugs = drugs; } static create(edges: EntityEdge[]): PlayerEntity | undefined { if (!edges || edges.length === 0) return undefined; - // player related entities - const playerEdges = edges.find((edge) => { - edge.node?.components?.find( + // player component + const playerComponent = edges.find((edge) => { + return edge.node?.components?.some( (component) => component?.__typename === "Player", ); - }); - - const playerComponent = playerEdges?.node?.components?.find( - (component) => component?.__typename === "Player", - ) as Player; + })?.node?.components?.[0] as Player; // drug entities const drugEdges = edges.filter((edge) => @@ -55,17 +60,13 @@ export class PlayerEntity { (component) => component?.__typename === "Drug", ) as DrugType; - const nameComponent = edge.node?.components?.find( - (component) => component?.__typename === "Name", - ) as Name; - return { - name: shortString.decodeShortString(nameComponent.short_string), + id: drugComponent.drug_id, quantity: drugComponent.quantity, }; }); - if (!playerEdges) return undefined; + if (!playerComponent) return undefined; return new PlayerEntity(playerComponent, drugs); } @@ -84,7 +85,6 @@ export const usePlayerEntity = ({ address?: string; }): PlayerInterface => { const [player, setPlayer] = useState(); - // TODO: remove leading zeros in address, maybe implemented in torii const { data, isFetched, refetch } = usePlayerEntityQuery( { gameId: gameId || "", playerId: address || "" }, @@ -93,6 +93,7 @@ export const usePlayerEntity = ({ refetchInterval: REFETCH_INTERVAL, // TODO: long polling, }, ); + useEffect(() => { const player_ = PlayerEntity.create(data?.entities?.edges as EntityEdge[]); if (player_) setPlayer(player_); diff --git a/web/src/dojo/events.ts b/web/src/dojo/events.ts new file mode 100644 index 000000000..449caca0e --- /dev/null +++ b/web/src/dojo/events.ts @@ -0,0 +1,112 @@ +import { PlayerStatus } from "@/dojo/entities/usePlayerEntity"; +import { Action, Outcome } from "@/dojo/types"; +import { InvokeTransactionReceiptResponse, num, shortString } from "starknet"; + +// events are keyed by the hash of the event name +export enum RyoEvents { + GameCreated = "0x230f942bb2087887c3b1dd964c716614bb6df172214f22409fefb734d96a4d2", + PlayerJoined = "0x214916ce0265d355fd91110809ffba7b5e672b108a8beea3dd235818431264b", + Traveled = "0x2c4d9d5da873550ed167876bf0bc2ae300ce1db2eeff67927a85693680a2328", + Bought = "0x20cb8131637de1953a75938db3477cc6b648e5ed255f5b3fe3f0fb9299f0afc", + Sold = "0x123e760cef925d0b4f685db5e1ac87aadaf1ad9f8069122a5bb03353444c386", + AdverseEvent = "0x3605d6af5b08d01a1b42fa16a5f4dc202724f1664912948dcdbe99f5c93d0a0", + Decision = "0xc9315f646a66dd126a564fa76bfdc00bdb47abe0d8187e464f69215dbf432a", + Consqeuence = "0x1335a57b72e0bcb464f40bf1f140f691ec93e4147b91d0760640c19999b841d", +} + +export interface BaseEventData { + gameId: string; +} + +export interface AdverseEventData extends BaseEventData { + playerId: string; + playerStatus: PlayerStatus; +} + +export interface CreateEventData extends BaseEventData { + creator: string; + startTime: number; + maxTurns: number; + maxPlayers: number; +} + +export interface JoinedEventData extends BaseEventData { + playerId: string; + locationId: string; +} + +export interface BoughtEventData extends BaseEventData { + playerId: string; + drugId: string; + quantity: number; + price: number; +} + +export interface SoldEventData extends BaseEventData { + playerId: string; + drugId: string; + quantity: number; + price: number; +} + +export interface DecisionEventData extends BaseEventData { + playerId: string; + action: Action; +} + +export interface ConsequenceEventData extends BaseEventData { + playerId: string; + outcome: Outcome; +} + +export const parseEvent = ( + receipt: InvokeTransactionReceiptResponse, + eventType: RyoEvents, +): BaseEventData => { + const raw = receipt.events?.find((e) => e.keys[0] === eventType); + + if (!raw) { + throw new Error(`event not found`); + } + + switch (eventType) { + case RyoEvents.GameCreated: + return { + gameId: num.toHexString(raw.data[0]), + creator: num.toHexString(raw.data[1]), + startTime: Number(raw.data[2]), + maxTurns: Number(raw.data[3]), + maxPlayers: Number(raw.data[4]), + } as CreateEventData; + + case RyoEvents.AdverseEvent: + return { + gameId: num.toHexString(raw.data[0]), + playerId: num.toHexString(raw.data[1]), + playerStatus: Number(raw.data[2]), + } as AdverseEventData; + + case RyoEvents.PlayerJoined: + return { + gameId: num.toHexString(raw.data[0]), + playerId: num.toHexString(raw.data[1]), + locationId: num.toHexString(raw.data[2]), + } as JoinedEventData; + case RyoEvents.Decision: + return { + gameId: num.toHexString(raw.data[0]), + playerId: num.toHexString(raw.data[1]), + action: Number(raw.data[2]), + } as DecisionEventData; + case RyoEvents.Consqeuence: + return { + gameId: num.toHexString(raw.data[0]), + playerId: num.toHexString(raw.data[1]), + outcome: Number(raw.data[2]), + } as ConsequenceEventData; + case RyoEvents.Traveled: + case RyoEvents.Bought: + case RyoEvents.Sold: + throw new Error(`event parse not implemented: ${eventType}`); + } +}; diff --git a/web/src/dojo/helpers.ts b/web/src/dojo/helpers.ts new file mode 100644 index 000000000..077034426 --- /dev/null +++ b/web/src/dojo/helpers.ts @@ -0,0 +1,172 @@ +import { + Brooklyn, + CentralPark, + ConeyIsland, + Manhattan, + Queens, + Bronx, +} from "@/components/icons/locations"; + +import { + Ludes, + Weed, + Acid, + Speed, + Heroin, + Cocaine, +} from "@/components/icons/drugs"; + +import { + Drug, + DrugInfo, + Location, + LocationInfo, + Outcome, + OutcomeInfo, +} from "./types"; +import { getNarration } from "@/narrations"; + +export const locations: LocationInfo[] = [ + { + type: Location.Central, + name: "Central Park", + slug: "central", + id: "0x43656e7472616c205061726b", + icon: CentralPark, + }, + { + type: Location.Queens, + name: "Queens", + slug: "queens", + id: "0x517565656e73", + icon: Queens, + }, + { + type: Location.Bronx, + name: "The Bronx", + slug: "bronx", + id: "0x5468652042726f6e78", + icon: Bronx, + }, + { + type: Location.Jersey, + name: "Jersey City", + slug: "jersey", + id: "0x4a65727365792043697479", + icon: Manhattan, + }, + { + type: Location.Coney, + name: "Coney Island", + slug: "coney", + id: "0x436f6e65792049736c616e64", + icon: ConeyIsland, + }, + { + type: Location.Brooklyn, + name: "Brooklyn", + slug: "brooklyn", + id: "0x42726f6f6b6c796e", + icon: Brooklyn, + }, +]; + +const drugs: DrugInfo[] = [ + { + type: Drug.Ludes, + name: "Ludes", + slug: "ludes", + id: "0x4c75646573", + icon: Ludes, + }, + { + type: Drug.Speed, + name: "Speed", + slug: "speed", + id: "0x5370656564", + icon: Speed, + }, + { + type: Drug.Weed, + name: "Weed", + slug: "weed", + id: "0x57656564", + icon: Weed, + }, + { + type: Drug.Acid, + name: "Acid", + slug: "acid", + id: "0x41636964", + icon: Acid, + }, + { + type: Drug.Heroin, + name: "Heroin", + slug: "heroin", + id: "0x4865726f696e", + icon: Heroin, + }, + { + type: Drug.Cocaine, + name: "Cocaine", + slug: "cocaine", + id: "0x436f6361696e65", + icon: Cocaine, + }, +]; + +export const outcomes: OutcomeInfo[] = [ + { + name: "Paid Up", + type: Outcome.Paid, + imageSrc: "/images/sunset.png", + getNarration: (isInitial: boolean) => getNarration(Outcome.Paid, isInitial), + }, + { + name: "Captured", + type: Outcome.Captured, + imageSrc: "/images/events/smoking_gun.gif", + getNarration: (isInitial: boolean) => + getNarration(Outcome.Captured, isInitial), + }, + { + name: "Escaped", + type: Outcome.Escaped, + imageSrc: "/images/sunset.png", + getNarration: (isInitial: boolean) => + getNarration(Outcome.Escaped, isInitial), + }, +]; + +function findBy(array: T[], key: keyof T, value: any): T | undefined { + return array.find((item) => item[key] === value); +} + +export function getLocationByType(type: Location): LocationInfo { + return findBy(locations, "type", type) || locations[0]; +} + +export function getLocationById(id: string): LocationInfo { + return findBy(locations, "id", id) || locations[0]; +} + +export function getLocationBySlug(slug: string): LocationInfo { + return findBy(locations, "slug", slug) || locations[0]; +} + +export function getDrugById(id: string): DrugInfo { + return findBy(drugs, "id", id) || drugs[0]; +} + +export function getDrugBySlug(slug: string): DrugInfo { + return findBy(drugs, "slug", slug) || drugs[0]; +} + +export function getDrugByType(type: Drug): DrugInfo { + return findBy(drugs, "type", type) || drugs[0]; +} + +export function getOutcomeByType(type: Outcome): OutcomeInfo { + return findBy(outcomes, "type", type) || outcomes[0]; +} diff --git a/web/src/hooks/dojo/index.tsx b/web/src/dojo/index.tsx similarity index 98% rename from web/src/hooks/dojo/index.tsx rename to web/src/dojo/index.tsx index 5eb409fbe..617a159c7 100644 --- a/web/src/hooks/dojo/index.tsx +++ b/web/src/dojo/index.tsx @@ -13,7 +13,7 @@ import { shortString, TransactionStatus, } from "starknet"; -import { useBurner } from "../burner"; +import { useBurner } from "../hooks/burner"; export const SCALING_FACTOR = 10000; export const REFETCH_INTERVAL = 1000; // really need graphql subscriptions... diff --git a/web/src/hooks/dojo/systems/useSystems.tsx b/web/src/dojo/systems/useSystems.tsx similarity index 84% rename from web/src/hooks/dojo/systems/useSystems.tsx rename to web/src/dojo/systems/useSystems.tsx index 9fff80bf7..a2a251b35 100644 --- a/web/src/hooks/dojo/systems/useSystems.tsx +++ b/web/src/dojo/systems/useSystems.tsx @@ -1,6 +1,7 @@ -import { BaseEventData, parseEvent, RyoEvents } from "@/utils/event"; import { useCallback } from "react"; import { useDojo } from ".."; +import { BaseEventData, parseEvent, RyoEvents } from "../events"; +import { Action } from "../types"; export interface SystemsInterface { create: ( @@ -23,6 +24,11 @@ export interface SystemsInterface { quantity: number, ) => Promise; setName: (gameId: string, playerName: string) => Promise; + decide: ( + gameId: string, + action: Action, + nextLocationId: string, + ) => Promise; isPending: boolean; error?: Error; } @@ -59,6 +65,7 @@ export const useSystems = (): SystemsInterface => { maxPlayers, maxTurns, ]); + // using joined event instead of created event to get initial location const event = parseEvent(receipt, RyoEvents.PlayerJoined); @@ -76,7 +83,7 @@ export const useSystems = (): SystemsInterface => { let result = { hash: receipt.transaction_hash } as SystemExecuteResult; try { - result.event = parseEvent(receipt, RyoEvents.RandomEvent); + result.event = parseEvent(receipt, RyoEvents.AdverseEvent); } catch (err) { // no random event occured } @@ -152,6 +159,24 @@ export const useSystems = (): SystemsInterface => { [executeAndReciept], ); + const decide = useCallback( + async (gameId: string, action: Action, nextLocationId: string) => { + const receipt = await executeAndReciept("decide", [ + gameId, + action, + nextLocationId, + ]); + + const event = parseEvent(receipt, RyoEvents.Consqeuence); + + return { + hash: receipt.transaction_hash, + event, + }; + }, + [executeAndReciept], + ); + return { create, join, @@ -159,6 +184,7 @@ export const useSystems = (): SystemsInterface => { buy, sell, setName, + decide, error, isPending, }; diff --git a/web/src/dojo/types.ts b/web/src/dojo/types.ts new file mode 100644 index 000000000..f3433c70a --- /dev/null +++ b/web/src/dojo/types.ts @@ -0,0 +1,51 @@ +export enum Location { + Queens, + Bronx, + Brooklyn, + Coney, + Jersey, + Central, +} + +export enum Drug { + Acid, + Weed, + Ludes, + Speed, + Heroin, + Cocaine, +} + +export enum Action { + Pay, + Run, +} + +export enum Outcome { + Paid, + Escaped, + Captured, +} + +export interface LocationInfo { + type: Location; + name: string; + slug: string; + id: string; + icon: React.FC; +} + +export interface DrugInfo { + type: Drug; + name: string; + slug: string; + id: string; + icon: React.FC; +} + +export interface OutcomeInfo { + type: Outcome; + name: string; + imageSrc: string; + getNarration: (isInitial: boolean) => string; +} diff --git a/web/src/generated/graphql.ts b/web/src/generated/graphql.ts index a3752b7d1..461d7c3e2 100644 --- a/web/src/generated/graphql.ts +++ b/web/src/generated/graphql.ts @@ -1,10 +1,22 @@ -import { useQuery, useInfiniteQuery, UseQueryOptions, UseInfiniteQueryOptions, QueryFunctionContext } from 'react-query'; -import { useFetchData } from '@/hooks/fetcher'; +import { + useQuery, + useInfiniteQuery, + UseQueryOptions, + UseInfiniteQueryOptions, + QueryFunctionContext, +} from "react-query"; +import { useFetchData } from "@/hooks/fetcher"; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -15,36 +27,62 @@ export type Scalars = { ContractAddress: any; Cursor: any; DateTime: any; + Enum: any; bool: any; felt252: any; u8: any; + u32: any; u64: any; u128: any; usize: any; }; +export type Component = { + __typename?: "Component"; + classHash?: Maybe; + createdAt?: Maybe; + id?: Maybe; + name?: Maybe; + transactionHash?: Maybe; +}; + +export type ComponentConnection = { + __typename?: "ComponentConnection"; + edges?: Maybe>>; + totalCount: Scalars["Int"]; +}; + +export type ComponentEdge = { + __typename?: "ComponentEdge"; + cursor: Scalars["Cursor"]; + node?: Maybe; +}; + export type ComponentUnion = Drug | Game | Market | Name | Player | Risks; export enum Direction { - Asc = 'ASC', - Desc = 'DESC' + Asc = "ASC", + Desc = "DESC", } export type Drug = { - __typename?: 'Drug'; + __typename?: "Drug"; + drug_id?: Maybe; entity?: Maybe; - quantity?: Maybe; + game_id?: Maybe; + player_id?: Maybe; + quantity?: Maybe; }; export type DrugConnection = { - __typename?: 'DrugConnection'; + __typename?: "DrugConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type DrugEdge = { - __typename?: 'DrugEdge'; - cursor: Scalars['Cursor']; + __typename?: "DrugEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -54,82 +92,104 @@ export type DrugOrder = { }; export enum DrugOrderOrderField { - Quantity = 'QUANTITY' + DrugId = "DRUG_ID", + GameId = "GAME_ID", + PlayerId = "PLAYER_ID", + Quantity = "QUANTITY", } export type DrugWhereInput = { - quantity?: InputMaybe; - quantityGT?: InputMaybe; - quantityGTE?: InputMaybe; - quantityLT?: InputMaybe; - quantityLTE?: InputMaybe; - quantityNEQ?: InputMaybe; + drug_id?: InputMaybe; + drug_idGT?: InputMaybe; + drug_idGTE?: InputMaybe; + drug_idLT?: InputMaybe; + drug_idLTE?: InputMaybe; + drug_idNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + player_id?: InputMaybe; + player_idGT?: InputMaybe; + player_idGTE?: InputMaybe; + player_idLT?: InputMaybe; + player_idLTE?: InputMaybe; + player_idNEQ?: InputMaybe; + quantity?: InputMaybe; + quantityGT?: InputMaybe; + quantityGTE?: InputMaybe; + quantityLT?: InputMaybe; + quantityLTE?: InputMaybe; + quantityNEQ?: InputMaybe; }; export type Entity = { - __typename?: 'Entity'; - componentNames?: Maybe; + __typename?: "Entity"; + componentNames?: Maybe; components?: Maybe>>; - createdAt?: Maybe; - id?: Maybe; - keys?: Maybe>>; - updatedAt?: Maybe; + createdAt?: Maybe; + id?: Maybe; + keys?: Maybe>>; + updatedAt?: Maybe; }; export type EntityConnection = { - __typename?: 'EntityConnection'; + __typename?: "EntityConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type EntityEdge = { - __typename?: 'EntityEdge'; - cursor: Scalars['Cursor']; + __typename?: "EntityEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; export type Event = { - __typename?: 'Event'; - createdAt?: Maybe; - data?: Maybe; - id?: Maybe; - keys?: Maybe; + __typename?: "Event"; + createdAt?: Maybe; + data?: Maybe; + id?: Maybe; + keys?: Maybe; systemCall: SystemCall; - systemCallId?: Maybe; + systemCallId?: Maybe; }; export type EventConnection = { - __typename?: 'EventConnection'; + __typename?: "EventConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type EventEdge = { - __typename?: 'EventEdge'; - cursor: Scalars['Cursor']; + __typename?: "EventEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; export type Game = { - __typename?: 'Game'; - creator?: Maybe; + __typename?: "Game"; + creator?: Maybe; entity?: Maybe; - is_finished?: Maybe; - max_players?: Maybe; - max_turns?: Maybe; - num_players?: Maybe; - start_time?: Maybe; + game_id?: Maybe; + is_finished?: Maybe; + max_players?: Maybe; + max_turns?: Maybe; + num_players?: Maybe; + start_time?: Maybe; }; export type GameConnection = { - __typename?: 'GameConnection'; + __typename?: "GameConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type GameEdge = { - __typename?: 'GameEdge'; - cursor: Scalars['Cursor']; + __typename?: "GameEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -139,69 +199,79 @@ export type GameOrder = { }; export enum GameOrderOrderField { - Creator = 'CREATOR', - IsFinished = 'IS_FINISHED', - MaxPlayers = 'MAX_PLAYERS', - MaxTurns = 'MAX_TURNS', - NumPlayers = 'NUM_PLAYERS', - StartTime = 'START_TIME' + Creator = "CREATOR", + GameId = "GAME_ID", + IsFinished = "IS_FINISHED", + MaxPlayers = "MAX_PLAYERS", + MaxTurns = "MAX_TURNS", + NumPlayers = "NUM_PLAYERS", + StartTime = "START_TIME", } export type GameWhereInput = { - creator?: InputMaybe; - creatorGT?: InputMaybe; - creatorGTE?: InputMaybe; - creatorLT?: InputMaybe; - creatorLTE?: InputMaybe; - creatorNEQ?: InputMaybe; - is_finished?: InputMaybe; - is_finishedGT?: InputMaybe; - is_finishedGTE?: InputMaybe; - is_finishedLT?: InputMaybe; - is_finishedLTE?: InputMaybe; - is_finishedNEQ?: InputMaybe; - max_players?: InputMaybe; - max_playersGT?: InputMaybe; - max_playersGTE?: InputMaybe; - max_playersLT?: InputMaybe; - max_playersLTE?: InputMaybe; - max_playersNEQ?: InputMaybe; - max_turns?: InputMaybe; - max_turnsGT?: InputMaybe; - max_turnsGTE?: InputMaybe; - max_turnsLT?: InputMaybe; - max_turnsLTE?: InputMaybe; - max_turnsNEQ?: InputMaybe; - num_players?: InputMaybe; - num_playersGT?: InputMaybe; - num_playersGTE?: InputMaybe; - num_playersLT?: InputMaybe; - num_playersLTE?: InputMaybe; - num_playersNEQ?: InputMaybe; - start_time?: InputMaybe; - start_timeGT?: InputMaybe; - start_timeGTE?: InputMaybe; - start_timeLT?: InputMaybe; - start_timeLTE?: InputMaybe; - start_timeNEQ?: InputMaybe; + creator?: InputMaybe; + creatorGT?: InputMaybe; + creatorGTE?: InputMaybe; + creatorLT?: InputMaybe; + creatorLTE?: InputMaybe; + creatorNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + is_finished?: InputMaybe; + is_finishedGT?: InputMaybe; + is_finishedGTE?: InputMaybe; + is_finishedLT?: InputMaybe; + is_finishedLTE?: InputMaybe; + is_finishedNEQ?: InputMaybe; + max_players?: InputMaybe; + max_playersGT?: InputMaybe; + max_playersGTE?: InputMaybe; + max_playersLT?: InputMaybe; + max_playersLTE?: InputMaybe; + max_playersNEQ?: InputMaybe; + max_turns?: InputMaybe; + max_turnsGT?: InputMaybe; + max_turnsGTE?: InputMaybe; + max_turnsLT?: InputMaybe; + max_turnsLTE?: InputMaybe; + max_turnsNEQ?: InputMaybe; + num_players?: InputMaybe; + num_playersGT?: InputMaybe; + num_playersGTE?: InputMaybe; + num_playersLT?: InputMaybe; + num_playersLTE?: InputMaybe; + num_playersNEQ?: InputMaybe; + start_time?: InputMaybe; + start_timeGT?: InputMaybe; + start_timeGTE?: InputMaybe; + start_timeLT?: InputMaybe; + start_timeLTE?: InputMaybe; + start_timeNEQ?: InputMaybe; }; export type Market = { - __typename?: 'Market'; - cash?: Maybe; + __typename?: "Market"; + cash?: Maybe; + drug_id?: Maybe; entity?: Maybe; - quantity?: Maybe; + game_id?: Maybe; + location_id?: Maybe; + quantity?: Maybe; }; export type MarketConnection = { - __typename?: 'MarketConnection'; + __typename?: "MarketConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type MarketEdge = { - __typename?: 'MarketEdge'; - cursor: Scalars['Cursor']; + __typename?: "MarketEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -211,40 +281,63 @@ export type MarketOrder = { }; export enum MarketOrderOrderField { - Cash = 'CASH', - Quantity = 'QUANTITY' + Cash = "CASH", + DrugId = "DRUG_ID", + GameId = "GAME_ID", + LocationId = "LOCATION_ID", + Quantity = "QUANTITY", } export type MarketWhereInput = { - cash?: InputMaybe; - cashGT?: InputMaybe; - cashGTE?: InputMaybe; - cashLT?: InputMaybe; - cashLTE?: InputMaybe; - cashNEQ?: InputMaybe; - quantity?: InputMaybe; - quantityGT?: InputMaybe; - quantityGTE?: InputMaybe; - quantityLT?: InputMaybe; - quantityLTE?: InputMaybe; - quantityNEQ?: InputMaybe; + cash?: InputMaybe; + cashGT?: InputMaybe; + cashGTE?: InputMaybe; + cashLT?: InputMaybe; + cashLTE?: InputMaybe; + cashNEQ?: InputMaybe; + drug_id?: InputMaybe; + drug_idGT?: InputMaybe; + drug_idGTE?: InputMaybe; + drug_idLT?: InputMaybe; + drug_idLTE?: InputMaybe; + drug_idNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + location_id?: InputMaybe; + location_idGT?: InputMaybe; + location_idGTE?: InputMaybe; + location_idLT?: InputMaybe; + location_idLTE?: InputMaybe; + location_idNEQ?: InputMaybe; + quantity?: InputMaybe; + quantityGT?: InputMaybe; + quantityGTE?: InputMaybe; + quantityLT?: InputMaybe; + quantityLTE?: InputMaybe; + quantityNEQ?: InputMaybe; }; export type Name = { - __typename?: 'Name'; + __typename?: "Name"; entity?: Maybe; - short_string?: Maybe; + game_id?: Maybe; + player_id?: Maybe; + short_string?: Maybe; }; export type NameConnection = { - __typename?: 'NameConnection'; + __typename?: "NameConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type NameEdge = { - __typename?: 'NameEdge'; - cursor: Scalars['Cursor']; + __typename?: "NameEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -254,36 +347,55 @@ export type NameOrder = { }; export enum NameOrderOrderField { - ShortString = 'SHORT_STRING' + GameId = "GAME_ID", + PlayerId = "PLAYER_ID", + ShortString = "SHORT_STRING", } export type NameWhereInput = { - short_string?: InputMaybe; - short_stringGT?: InputMaybe; - short_stringGTE?: InputMaybe; - short_stringLT?: InputMaybe; - short_stringLTE?: InputMaybe; - short_stringNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + player_id?: InputMaybe; + player_idGT?: InputMaybe; + player_idGTE?: InputMaybe; + player_idLT?: InputMaybe; + player_idLTE?: InputMaybe; + player_idNEQ?: InputMaybe; + short_string?: InputMaybe; + short_stringGT?: InputMaybe; + short_stringGTE?: InputMaybe; + short_stringLT?: InputMaybe; + short_stringLTE?: InputMaybe; + short_stringNEQ?: InputMaybe; }; export type Player = { - __typename?: 'Player'; - cash?: Maybe; + __typename?: "Player"; + bag_limit?: Maybe; + cash?: Maybe; + drug_count?: Maybe; entity?: Maybe; - health?: Maybe; - location_id?: Maybe; - turns_remaining?: Maybe; + game_id?: Maybe; + health?: Maybe; + location_id?: Maybe; + player_id?: Maybe; + status?: Maybe; + turns_remaining?: Maybe; }; export type PlayerConnection = { - __typename?: 'PlayerConnection'; + __typename?: "PlayerConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type PlayerEdge = { - __typename?: 'PlayerEdge'; - cursor: Scalars['Cursor']; + __typename?: "PlayerEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -293,41 +405,78 @@ export type PlayerOrder = { }; export enum PlayerOrderOrderField { - Cash = 'CASH', - Health = 'HEALTH', - LocationId = 'LOCATION_ID', - TurnsRemaining = 'TURNS_REMAINING' + BagLimit = "BAG_LIMIT", + Cash = "CASH", + DrugCount = "DRUG_COUNT", + GameId = "GAME_ID", + Health = "HEALTH", + LocationId = "LOCATION_ID", + PlayerId = "PLAYER_ID", + Status = "STATUS", + TurnsRemaining = "TURNS_REMAINING", } export type PlayerWhereInput = { - cash?: InputMaybe; - cashGT?: InputMaybe; - cashGTE?: InputMaybe; - cashLT?: InputMaybe; - cashLTE?: InputMaybe; - cashNEQ?: InputMaybe; - health?: InputMaybe; - healthGT?: InputMaybe; - healthGTE?: InputMaybe; - healthLT?: InputMaybe; - healthLTE?: InputMaybe; - healthNEQ?: InputMaybe; - location_id?: InputMaybe; - location_idGT?: InputMaybe; - location_idGTE?: InputMaybe; - location_idLT?: InputMaybe; - location_idLTE?: InputMaybe; - location_idNEQ?: InputMaybe; - turns_remaining?: InputMaybe; - turns_remainingGT?: InputMaybe; - turns_remainingGTE?: InputMaybe; - turns_remainingLT?: InputMaybe; - turns_remainingLTE?: InputMaybe; - turns_remainingNEQ?: InputMaybe; + bag_limit?: InputMaybe; + bag_limitGT?: InputMaybe; + bag_limitGTE?: InputMaybe; + bag_limitLT?: InputMaybe; + bag_limitLTE?: InputMaybe; + bag_limitNEQ?: InputMaybe; + cash?: InputMaybe; + cashGT?: InputMaybe; + cashGTE?: InputMaybe; + cashLT?: InputMaybe; + cashLTE?: InputMaybe; + cashNEQ?: InputMaybe; + drug_count?: InputMaybe; + drug_countGT?: InputMaybe; + drug_countGTE?: InputMaybe; + drug_countLT?: InputMaybe; + drug_countLTE?: InputMaybe; + drug_countNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + health?: InputMaybe; + healthGT?: InputMaybe; + healthGTE?: InputMaybe; + healthLT?: InputMaybe; + healthLTE?: InputMaybe; + healthNEQ?: InputMaybe; + location_id?: InputMaybe; + location_idGT?: InputMaybe; + location_idGTE?: InputMaybe; + location_idLT?: InputMaybe; + location_idLTE?: InputMaybe; + location_idNEQ?: InputMaybe; + player_id?: InputMaybe; + player_idGT?: InputMaybe; + player_idGTE?: InputMaybe; + player_idLT?: InputMaybe; + player_idLTE?: InputMaybe; + player_idNEQ?: InputMaybe; + status?: InputMaybe; + statusGT?: InputMaybe; + statusGTE?: InputMaybe; + statusLT?: InputMaybe; + statusLTE?: InputMaybe; + statusNEQ?: InputMaybe; + turns_remaining?: InputMaybe; + turns_remainingGT?: InputMaybe; + turns_remainingGTE?: InputMaybe; + turns_remainingLT?: InputMaybe; + turns_remainingLTE?: InputMaybe; + turns_remainingNEQ?: InputMaybe; }; export type Query = { - __typename?: 'Query'; + __typename?: "Query"; + component: Component; + components?: Maybe; drugComponents?: Maybe; entities?: Maybe; entity: Entity; @@ -344,113 +493,106 @@ export type Query = { systems?: Maybe; }; +export type QueryComponentArgs = { + id: Scalars["ID"]; +}; export type QueryDrugComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryEntitiesArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - keys?: InputMaybe>>; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + keys?: InputMaybe>>; + last?: InputMaybe; }; - export type QueryEntityArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QueryEventArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QueryGameComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryMarketComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryNameComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryPlayerComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryRisksComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QuerySystemArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QuerySystemCallArgs = { - id: Scalars['Int']; + id: Scalars["Int"]; }; export type Risks = { - __typename?: 'Risks'; - arrested?: Maybe; + __typename?: "Risks"; entity?: Maybe; - hurt?: Maybe; - mugged?: Maybe; - travel?: Maybe; + game_id?: Maybe; + location_id?: Maybe; + run?: Maybe; + travel?: Maybe; }; export type RisksConnection = { - __typename?: 'RisksConnection'; + __typename?: "RisksConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type RisksEdge = { - __typename?: 'RisksEdge'; - cursor: Scalars['Cursor']; + __typename?: "RisksEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -460,118 +602,239 @@ export type RisksOrder = { }; export enum RisksOrderOrderField { - Arrested = 'ARRESTED', - Hurt = 'HURT', - Mugged = 'MUGGED', - Travel = 'TRAVEL' + GameId = "GAME_ID", + LocationId = "LOCATION_ID", + Run = "RUN", + Travel = "TRAVEL", } export type RisksWhereInput = { - arrested?: InputMaybe; - arrestedGT?: InputMaybe; - arrestedGTE?: InputMaybe; - arrestedLT?: InputMaybe; - arrestedLTE?: InputMaybe; - arrestedNEQ?: InputMaybe; - hurt?: InputMaybe; - hurtGT?: InputMaybe; - hurtGTE?: InputMaybe; - hurtLT?: InputMaybe; - hurtLTE?: InputMaybe; - hurtNEQ?: InputMaybe; - mugged?: InputMaybe; - muggedGT?: InputMaybe; - muggedGTE?: InputMaybe; - muggedLT?: InputMaybe; - muggedLTE?: InputMaybe; - muggedNEQ?: InputMaybe; - travel?: InputMaybe; - travelGT?: InputMaybe; - travelGTE?: InputMaybe; - travelLT?: InputMaybe; - travelLTE?: InputMaybe; - travelNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + location_id?: InputMaybe; + location_idGT?: InputMaybe; + location_idGTE?: InputMaybe; + location_idLT?: InputMaybe; + location_idLTE?: InputMaybe; + location_idNEQ?: InputMaybe; + run?: InputMaybe; + runGT?: InputMaybe; + runGTE?: InputMaybe; + runLT?: InputMaybe; + runLTE?: InputMaybe; + runNEQ?: InputMaybe; + travel?: InputMaybe; + travelGT?: InputMaybe; + travelGTE?: InputMaybe; + travelLT?: InputMaybe; + travelLTE?: InputMaybe; + travelNEQ?: InputMaybe; +}; + +export type Subscription = { + __typename?: "Subscription"; + componentRegistered: Component; + entityUpdated: Entity; }; export type System = { - __typename?: 'System'; - classHash?: Maybe; - createdAt?: Maybe; - id?: Maybe; - name?: Maybe; + __typename?: "System"; + classHash?: Maybe; + createdAt?: Maybe; + id?: Maybe; + name?: Maybe; systemCalls: Array; - transactionHash?: Maybe; + transactionHash?: Maybe; }; export type SystemCall = { - __typename?: 'SystemCall'; - createdAt?: Maybe; - data?: Maybe; - id?: Maybe; + __typename?: "SystemCall"; + createdAt?: Maybe; + data?: Maybe; + id?: Maybe; system: System; - systemId?: Maybe; - transactionHash?: Maybe; + systemId?: Maybe; + transactionHash?: Maybe; }; export type SystemCallConnection = { - __typename?: 'SystemCallConnection'; + __typename?: "SystemCallConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type SystemCallEdge = { - __typename?: 'SystemCallEdge'; - cursor: Scalars['Cursor']; + __typename?: "SystemCallEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; export type SystemConnection = { - __typename?: 'SystemConnection'; + __typename?: "SystemConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type SystemEdge = { - __typename?: 'SystemEdge'; - cursor: Scalars['Cursor']; + __typename?: "SystemEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; -export type AvailableGamesQueryVariables = Exact<{ [key: string]: never; }>; - - -export type AvailableGamesQuery = { __typename?: 'Query', gameComponents?: { __typename?: 'GameConnection', totalCount: number, edges?: Array<{ __typename?: 'GameEdge', cursor: any, node?: { __typename?: 'Game', creator?: any | null, num_players?: any | null, max_players?: any | null, max_turns?: any | null, start_time?: any | null } | null } | null> | null } | null }; +export type AvailableGamesQueryVariables = Exact<{ [key: string]: never }>; + +export type AvailableGamesQuery = { + __typename?: "Query"; + gameComponents?: { + __typename?: "GameConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "GameEdge"; + cursor: any; + node?: { + __typename?: "Game"; + creator?: any | null; + num_players?: any | null; + max_players?: any | null; + max_turns?: any | null; + start_time?: any | null; + } | null; + } | null> | null; + } | null; +}; export type GlobalScoresQueryVariables = Exact<{ - limit?: InputMaybe; + limit?: InputMaybe; }>; - -export type GlobalScoresQuery = { __typename?: 'Query', playerComponents?: { __typename?: 'PlayerConnection', totalCount: number, edges?: Array<{ __typename?: 'PlayerEdge', cursor: any, node?: { __typename?: 'Player', cash?: any | null, entity?: { __typename?: 'Entity', keys?: Array | null, components?: Array<{ __typename: 'Drug' } | { __typename: 'Game' } | { __typename: 'Market' } | { __typename: 'Name', short_string?: any | null } | { __typename: 'Player' } | { __typename: 'Risks' } | null> | null } | null } | null } | null> | null } | null }; +export type GlobalScoresQuery = { + __typename?: "Query"; + playerComponents?: { + __typename?: "PlayerConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "PlayerEdge"; + cursor: any; + node?: { + __typename?: "Player"; + cash?: any | null; + entity?: { + __typename?: "Entity"; + keys?: Array | null; + components?: Array< + | { __typename: "Drug" } + | { __typename: "Game" } + | { __typename: "Market" } + | { __typename: "Name"; short_string?: any | null } + | { __typename: "Player" } + | { __typename: "Risks" } + | null + > | null; + } | null; + } | null; + } | null> | null; + } | null; +}; export type GameEntityQueryVariables = Exact<{ - id: Scalars['ID']; + id: Scalars["ID"]; }>; - -export type GameEntityQuery = { __typename?: 'Query', entity: { __typename?: 'Entity', components?: Array<{ __typename: 'Drug' } | { __typename: 'Game', creator?: any | null, is_finished?: any | null, max_players?: any | null, max_turns?: any | null, num_players?: any | null, start_time?: any | null } | { __typename: 'Market' } | { __typename: 'Name' } | { __typename: 'Player' } | { __typename: 'Risks' } | null> | null } }; +export type GameEntityQuery = { + __typename?: "Query"; + entity: { + __typename?: "Entity"; + components?: Array< + | { __typename: "Drug" } + | { + __typename: "Game"; + creator?: any | null; + is_finished?: any | null; + max_players?: any | null; + max_turns?: any | null; + num_players?: any | null; + start_time?: any | null; + } + | { __typename: "Market" } + | { __typename: "Name" } + | { __typename: "Player" } + | { __typename: "Risks" } + | null + > | null; + }; +}; export type PlayerEntityQueryVariables = Exact<{ - gameId: Scalars['String']; - playerId: Scalars['String']; + gameId: Scalars["String"]; + playerId: Scalars["String"]; }>; - -export type PlayerEntityQuery = { __typename?: 'Query', entities?: { __typename?: 'EntityConnection', totalCount: number, edges?: Array<{ __typename?: 'EntityEdge', cursor: any, node?: { __typename?: 'Entity', components?: Array<{ __typename: 'Drug', quantity?: any | null } | { __typename: 'Game' } | { __typename: 'Market' } | { __typename: 'Name', short_string?: any | null } | { __typename: 'Player', cash?: any | null, health?: any | null, turns_remaining?: any | null } | { __typename: 'Risks' } | null> | null } | null } | null> | null } | null }; +export type PlayerEntityQuery = { + __typename?: "Query"; + entities?: { + __typename?: "EntityConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "EntityEdge"; + cursor: any; + node?: { + __typename?: "Entity"; + keys?: Array | null; + components?: Array< + | { __typename: "Drug"; drug_id?: any | null; quantity?: any | null } + | { __typename: "Game" } + | { __typename: "Market" } + | { __typename: "Name" } + | { + __typename: "Player"; + cash?: any | null; + health?: any | null; + turns_remaining?: any | null; + drug_count?: any | null; + location_id?: any | null; + status?: any | null; + } + | { __typename: "Risks" } + | null + > | null; + } | null; + } | null> | null; + } | null; +}; export type LocationEntitiesQueryVariables = Exact<{ - gameId: Scalars['String']; - locationId: Scalars['String']; + gameId: Scalars["String"]; + locationId: Scalars["String"]; }>; - -export type LocationEntitiesQuery = { __typename?: 'Query', entities?: { __typename?: 'EntityConnection', totalCount: number, edges?: Array<{ __typename?: 'EntityEdge', cursor: any, node?: { __typename?: 'Entity', keys?: Array | null, components?: Array<{ __typename: 'Drug' } | { __typename: 'Game' } | { __typename: 'Market', cash?: any | null, quantity?: any | null } | { __typename: 'Name' } | { __typename: 'Player' } | { __typename: 'Risks', arrested?: any | null, hurt?: any | null, mugged?: any | null, travel?: any | null } | null> | null } | null } | null> | null } | null }; - +export type LocationEntitiesQuery = { + __typename?: "Query"; + entities?: { + __typename?: "EntityConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "EntityEdge"; + cursor: any; + node?: { + __typename?: "Entity"; + keys?: Array | null; + components?: Array< + | { __typename: "Drug" } + | { __typename: "Game" } + | { __typename: "Market"; cash?: any | null; quantity?: any | null } + | { __typename: "Name" } + | { __typename: "Player" } + | { __typename: "Risks"; travel?: any | null; run?: any | null } + | null + > | null; + } | null; + } | null> | null; + } | null; +}; export const AvailableGamesDocument = ` query AvailableGames { @@ -591,39 +854,49 @@ export const AvailableGamesDocument = ` } `; export const useAvailableGamesQuery = < - TData = AvailableGamesQuery, - TError = unknown - >( - variables?: AvailableGamesQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - variables === undefined ? ['AvailableGames'] : ['AvailableGames', variables], - useFetchData(AvailableGamesDocument).bind(null, variables), - options - ); - -useAvailableGamesQuery.getKey = (variables?: AvailableGamesQueryVariables) => variables === undefined ? ['AvailableGames'] : ['AvailableGames', variables]; -; - + TData = AvailableGamesQuery, + TError = unknown, +>( + variables?: AvailableGamesQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + variables === undefined + ? ["AvailableGames"] + : ["AvailableGames", variables], + useFetchData( + AvailableGamesDocument, + ).bind(null, variables), + options, + ); + +useAvailableGamesQuery.getKey = (variables?: AvailableGamesQueryVariables) => + variables === undefined ? ["AvailableGames"] : ["AvailableGames", variables]; export const useInfiniteAvailableGamesQuery = < - TData = AvailableGamesQuery, - TError = unknown - >( - variables?: AvailableGamesQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(AvailableGamesDocument) - return useInfiniteQuery( - variables === undefined ? ['AvailableGames.infinite'] : ['AvailableGames.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteAvailableGamesQuery.getKey = (variables?: AvailableGamesQueryVariables) => variables === undefined ? ['AvailableGames.infinite'] : ['AvailableGames.infinite', variables]; -; + TData = AvailableGamesQuery, + TError = unknown, +>( + variables?: AvailableGamesQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + AvailableGamesDocument, + ); + return useInfiniteQuery( + variables === undefined + ? ["AvailableGames.infinite"] + : ["AvailableGames.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfiniteAvailableGamesQuery.getKey = ( + variables?: AvailableGamesQueryVariables, +) => + variables === undefined + ? ["AvailableGames.infinite"] + : ["AvailableGames.infinite", variables]; export const GlobalScoresDocument = ` query GlobalScores($limit: Int) { playerComponents( @@ -651,39 +924,47 @@ export const GlobalScoresDocument = ` } `; export const useGlobalScoresQuery = < - TData = GlobalScoresQuery, - TError = unknown - >( - variables?: GlobalScoresQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - variables === undefined ? ['GlobalScores'] : ['GlobalScores', variables], - useFetchData(GlobalScoresDocument).bind(null, variables), - options - ); - -useGlobalScoresQuery.getKey = (variables?: GlobalScoresQueryVariables) => variables === undefined ? ['GlobalScores'] : ['GlobalScores', variables]; -; - + TData = GlobalScoresQuery, + TError = unknown, +>( + variables?: GlobalScoresQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + variables === undefined ? ["GlobalScores"] : ["GlobalScores", variables], + useFetchData( + GlobalScoresDocument, + ).bind(null, variables), + options, + ); + +useGlobalScoresQuery.getKey = (variables?: GlobalScoresQueryVariables) => + variables === undefined ? ["GlobalScores"] : ["GlobalScores", variables]; export const useInfiniteGlobalScoresQuery = < - TData = GlobalScoresQuery, - TError = unknown - >( - variables?: GlobalScoresQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(GlobalScoresDocument) - return useInfiniteQuery( - variables === undefined ? ['GlobalScores.infinite'] : ['GlobalScores.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteGlobalScoresQuery.getKey = (variables?: GlobalScoresQueryVariables) => variables === undefined ? ['GlobalScores.infinite'] : ['GlobalScores.infinite', variables]; -; + TData = GlobalScoresQuery, + TError = unknown, +>( + variables?: GlobalScoresQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + GlobalScoresDocument, + ); + return useInfiniteQuery( + variables === undefined + ? ["GlobalScores.infinite"] + : ["GlobalScores.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfiniteGlobalScoresQuery.getKey = ( + variables?: GlobalScoresQueryVariables, +) => + variables === undefined + ? ["GlobalScores.infinite"] + : ["GlobalScores.infinite", variables]; export const GameEntityDocument = ` query GameEntity($id: ID!) { entity(id: $id) { @@ -701,59 +982,64 @@ export const GameEntityDocument = ` } } `; -export const useGameEntityQuery = < - TData = GameEntityQuery, - TError = unknown - >( - variables: GameEntityQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - ['GameEntity', variables], - useFetchData(GameEntityDocument).bind(null, variables), - options - ); - -useGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => ['GameEntity', variables]; -; - +export const useGameEntityQuery = ( + variables: GameEntityQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + ["GameEntity", variables], + useFetchData( + GameEntityDocument, + ).bind(null, variables), + options, + ); + +useGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => [ + "GameEntity", + variables, +]; export const useInfiniteGameEntityQuery = < - TData = GameEntityQuery, - TError = unknown - >( - variables: GameEntityQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(GameEntityDocument) - return useInfiniteQuery( - ['GameEntity.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => ['GameEntity.infinite', variables]; -; + TData = GameEntityQuery, + TError = unknown, +>( + variables: GameEntityQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + GameEntityDocument, + ); + return useInfiniteQuery( + ["GameEntity.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfiniteGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => [ + "GameEntity.infinite", + variables, +]; export const PlayerEntityDocument = ` query PlayerEntity($gameId: String!, $playerId: String!) { entities(keys: [$gameId, $playerId]) { totalCount edges { node { + keys components { __typename ... on Player { cash health turns_remaining + drug_count + location_id + status } ... on Drug { + drug_id quantity } - ... on Name { - short_string - } } } cursor @@ -762,39 +1048,44 @@ export const PlayerEntityDocument = ` } `; export const usePlayerEntityQuery = < - TData = PlayerEntityQuery, - TError = unknown - >( - variables: PlayerEntityQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - ['PlayerEntity', variables], - useFetchData(PlayerEntityDocument).bind(null, variables), - options - ); - -usePlayerEntityQuery.getKey = (variables: PlayerEntityQueryVariables) => ['PlayerEntity', variables]; -; - + TData = PlayerEntityQuery, + TError = unknown, +>( + variables: PlayerEntityQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + ["PlayerEntity", variables], + useFetchData( + PlayerEntityDocument, + ).bind(null, variables), + options, + ); + +usePlayerEntityQuery.getKey = (variables: PlayerEntityQueryVariables) => [ + "PlayerEntity", + variables, +]; export const useInfinitePlayerEntityQuery = < - TData = PlayerEntityQuery, - TError = unknown - >( - variables: PlayerEntityQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(PlayerEntityDocument) - return useInfiniteQuery( - ['PlayerEntity.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfinitePlayerEntityQuery.getKey = (variables: PlayerEntityQueryVariables) => ['PlayerEntity.infinite', variables]; -; + TData = PlayerEntityQuery, + TError = unknown, +>( + variables: PlayerEntityQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + PlayerEntityDocument, + ); + return useInfiniteQuery( + ["PlayerEntity.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfinitePlayerEntityQuery.getKey = ( + variables: PlayerEntityQueryVariables, +) => ["PlayerEntity.infinite", variables]; export const LocationEntitiesDocument = ` query LocationEntities($gameId: String!, $locationId: String!) { entities(keys: [$gameId, $locationId]) { @@ -809,10 +1100,8 @@ export const LocationEntitiesDocument = ` quantity } ... on Risks { - arrested - hurt - mugged travel + run } } } @@ -822,35 +1111,41 @@ export const LocationEntitiesDocument = ` } `; export const useLocationEntitiesQuery = < - TData = LocationEntitiesQuery, - TError = unknown - >( - variables: LocationEntitiesQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - ['LocationEntities', variables], - useFetchData(LocationEntitiesDocument).bind(null, variables), - options - ); - -useLocationEntitiesQuery.getKey = (variables: LocationEntitiesQueryVariables) => ['LocationEntities', variables]; -; - + TData = LocationEntitiesQuery, + TError = unknown, +>( + variables: LocationEntitiesQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + ["LocationEntities", variables], + useFetchData( + LocationEntitiesDocument, + ).bind(null, variables), + options, + ); + +useLocationEntitiesQuery.getKey = ( + variables: LocationEntitiesQueryVariables, +) => ["LocationEntities", variables]; export const useInfiniteLocationEntitiesQuery = < - TData = LocationEntitiesQuery, - TError = unknown - >( - variables: LocationEntitiesQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(LocationEntitiesDocument) - return useInfiniteQuery( - ['LocationEntities.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteLocationEntitiesQuery.getKey = (variables: LocationEntitiesQueryVariables) => ['LocationEntities.infinite', variables]; -; + TData = LocationEntitiesQuery, + TError = unknown, +>( + variables: LocationEntitiesQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData< + LocationEntitiesQuery, + LocationEntitiesQueryVariables + >(LocationEntitiesDocument); + return useInfiniteQuery( + ["LocationEntities.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; + +useInfiniteLocationEntitiesQuery.getKey = ( + variables: LocationEntitiesQueryVariables, +) => ["LocationEntities.infinite", variables]; diff --git a/web/src/generated/introspection.ts b/web/src/generated/introspection.ts index 5cd553c8b..69f089f8e 100644 --- a/web/src/generated/introspection.ts +++ b/web/src/generated/introspection.ts @@ -1,20 +1,11 @@ - - export interface PossibleTypesResultData { - possibleTypes: { - [key: string]: string[] - } - } - const result: PossibleTypesResultData = { - "possibleTypes": { - "ComponentUnion": [ - "Drug", - "Game", - "Market", - "Name", - "Player", - "Risks" - ] - } +export interface PossibleTypesResultData { + possibleTypes: { + [key: string]: string[]; + }; +} +const result: PossibleTypesResultData = { + possibleTypes: { + ComponentUnion: ["Drug", "Game", "Market", "Name", "Player", "Risks"], + }, }; - export default result; - \ No newline at end of file +export default result; diff --git a/web/src/graphql/entities.graphql b/web/src/graphql/entities.graphql index 941f96d83..3fd1d82b1 100644 --- a/web/src/graphql/entities.graphql +++ b/web/src/graphql/entities.graphql @@ -14,31 +14,26 @@ query GameEntity($id: ID!) { } } -# NOTE: There is an issue with entities (plural) query, dojo joins -# entity keys as csv and stores it as a string, then we do simple pattern matching. -# However, this means the query can return components we may not want. -# -# TODO: refactor entities queries below once dojo starts storing each key -# parts in its own column in entities db - query PlayerEntity($gameId: String!, $playerId: String!) { entities(keys: [$gameId, $playerId]) { totalCount edges { node { + keys components { __typename ... on Player { cash health turns_remaining + drug_count + location_id + status } ... on Drug { + drug_id quantity } - ... on Name { - short_string - } } } cursor @@ -59,10 +54,8 @@ query LocationEntities($gameId: String!, $locationId: String!) { quantity } ... on Risks { - arrested - hurt - mugged travel + run } } } @@ -70,3 +63,46 @@ query LocationEntities($gameId: String!, $locationId: String!) { } } } + +# TODO: Query entire game state per gameId in one query +# query GameState($gameId: String!) { +# entities (first: 100, keys: [$gameId]]) { +# totalCount +# edges { +# node { +# componentNames +# components { +# __typename +# ... on Game { +# creator +# is_finished +# max_players +# max_turns +# num_players +# start_time +# } +# ... on Player { +# cash +# health +# turns_remaining +# } +# ... on Drug { +# quantity +# } +# ... on Market { +# drug_id +# location_id +# cash +# quantity +# } +# ... on Risks { +# arrested +# hurt +# mugged +# travel +# } +# } +# } +# } +# } +# } diff --git a/web/src/hooks/burner.tsx b/web/src/hooks/burner.tsx index 1b6663522..8984150dc 100644 --- a/web/src/hooks/burner.tsx +++ b/web/src/hooks/burner.tsx @@ -45,7 +45,9 @@ export const useBurner = () => { admin.getTransactionReceipt(storage[firstAddr].deployTx).catch(() => { setAccount(undefined); Storage.remove("burners"); - throw new Error("burners not deployed, chain may have restarted"); + //throw new Error("burners not deployed, chain may have restarted"); + console.log("burners not deployed, resetting local storage"); + return; }); // set active account diff --git a/web/src/hooks/state.tsx b/web/src/hooks/state.tsx index 8157a9f16..b5f9e6c12 100644 --- a/web/src/hooks/state.tsx +++ b/web/src/hooks/state.tsx @@ -1,37 +1,12 @@ -import { Account } from "starknet"; import { create } from "zustand"; -import { DrugProps, getDrugByName } from "./ui"; +import { Drug, Outcome } from "../dojo/types"; -export enum Locations { - Queens = "Queens", - Bronx = "The Bronx", - Brooklyn = "Brooklyn", - Coney = "Coney Island", - Jersey = "Jersey City", - Central = "Central Park", -} - -export enum Drugs { - Acid = "Acid", - Weed = "Weed", - Ludes = "Ludes", - Speed = "Speed", - Heroin = "Heroin", - Cocaine = "Cocaine", -} - -export type DrugsType = { - [key in Drugs]: { +export type DrugType = { + [key in Drug]: { quantity: number; }; }; -export enum TravelEvents { - Mugged = "Mugged", - Arrested = "Arrested", - None = "", -} - export enum TradeDirection { Buy, Sell, @@ -42,20 +17,26 @@ export type TradeType = { direction: TradeDirection; }; -export interface PlayerState { - events: TravelEvents[]; - trades: Map; - addEvent: (event: TravelEvents) => void; - addTrade: (drug: Drugs, trade: TradeType) => void; - clearState: () => void; +export interface PlayerStore { + outcomes: Outcome[]; + history: Outcome[]; + trades: Map; + addOutcome: (outcome: Outcome) => void; + addTrade: (drug: Drug, trade: TradeType) => void; + clearTradesAndOutcomes: () => void; + clearAll: () => void; } -export const usePlayerState = create((set) => ({ - events: [], +export const usePlayerStore = create((set) => ({ + outcomes: [], + history: [], trades: new Map(), - addEvent: (event: TravelEvents) => - set((state) => ({ events: [...state.events, event] })), - addTrade: (drug: Drugs, trade: TradeType) => + addOutcome: (outcome: Outcome) => + set((state) => ({ + outcomes: [...state.outcomes, outcome], + history: [...state.history, outcome], + })), + addTrade: (drug: Drug, trade: TradeType) => set((state) => { const existingTrade = state.trades.get(drug); @@ -89,316 +70,10 @@ export const usePlayerState = create((set) => ({ state.trades.set(drug, { quantity, direction }); return { trades: new Map(state.trades) }; }), - clearState: () => set({ trades: new Map(), events: [] }), + clearTradesAndOutcomes: () => { + set({ trades: new Map(), outcomes: [] }); + }, + clearAll: () => { + set({ trades: new Map(), outcomes: [], history: [] }); + }, })); - -// NOTE: Keeping this for posterity, game state is retrieved from Torii -// and not kept in the client anymore. - -// export type Trade = { -// direction: TradeDirection; -// drug: DrugProps; -// quantity: number; -// price: number; -// }; - -// export type LocationMenu = { -// [key in Drugs]: { -// price: number; -// available: number; -// }; -// }; - -// export type InventoryType = { -// cash: number; -// drugs: DrugsType; -// capacity: number; -// }; - -// export interface GameState { -// // isInitialized: Boolean; -// players: string[]; -// inventory: InventoryType; -// turns: { -// total: number; -// current: number; -// }; -// location: Locations | undefined; -// menu: LocationMenu | undefined; -// trades: Trade[]; -// travelEvent: { -// event: TravelEvents; -// description: string; -// }; -// } - -// const getRandom = (min: number, max: number): number => -// Math.floor(Math.random() * max) + min; - -// const getMenu = (location: Locations): LocationMenu => { -// return { -// [Drugs.Acid]: { -// available: 999999, -// price: getRandom(7, 48), -// }, -// [Drugs.Weed]: { -// available: 999999, -// price: getRandom(3, 20), -// }, -// [Drugs.Ludes]: { -// available: 999999, -// price: getRandom(1, 6), -// }, -// [Drugs.Speed]: { -// available: 999999, -// price: getRandom(5, 35), -// }, -// [Drugs.Heroin]: { -// available: 999999, -// price: getRandom(52, 365), -// }, -// [Drugs.Cocaine]: { -// available: 999999, -// price: getRandom(38, 285), -// }, -// }; -// }; - -// export const initGameState = (turns: number, cash: number): GameState => { -// return { -// players: [], -// location: undefined, -// turns: { -// total: turns, -// current: 1, -// }, -// inventory: { -// cash: cash, -// drugs: { -// [Drugs.Acid]: { quantity: 0 }, -// [Drugs.Weed]: { quantity: 0 }, -// [Drugs.Ludes]: { quantity: 0 }, -// [Drugs.Speed]: { quantity: 0 }, -// [Drugs.Heroin]: { quantity: 0 }, -// [Drugs.Cocaine]: { quantity: 0 }, -// }, -// capacity: 100, -// }, -// trades: [], -// menu: undefined, -// travelEvent: { -// event: TravelEvents.None, -// description: "", -// }, -// }; -// }; - -// export const useGameStore = create(() => ({ -// ...initGameState(20, 100), -// })); - -// export const updateLocation = (location: Locations) => -// useGameStore.setState({ location }); - -// export const updateDrug = (drug: Drugs, quantity: number) => -// useGameStore.setState((state) => ({ -// inventory: { -// ...state.inventory, -// drugs: { -// ...state.inventory.drugs, -// [drug]: { -// quantity: state.inventory.drugs[drug].quantity + quantity, -// }, -// }, -// }, -// })); - -// export const updateCash = (amount: number) => -// useGameStore.setState((state) => ({ -// inventory: { ...state.inventory, cash: state.inventory.cash + amount }, -// })); - -// export const addPlayer = (player: string) => -// useGameStore.setState((state) => ({ players: [...state.players, player] })); - -// export const removePlayer = (player: string) => -// useGameStore.setState((state) => ({ -// players: state.players.filter((p) => p !== player), -// })); - -// export const updateLocationMenu = (menu: LocationMenu) => -// useGameStore.setState((state) => ({ -// menu, -// })); - -// export const getDrugPrice = (drug: Drugs): number => { -// const { menu } = useGameStore.getState(); -// return (menu && menu[drug].price) || Number.MAX_VALUE; -// }; - -// export const getInventoryInfos = () => { -// const { inventory } = useGameStore.getState(); - -// const used = Object.keys(Drugs) -// .map((d) => inventory.drugs[d as Drugs].quantity) -// .reduce((prev, curr) => prev + curr, 0); - -// return { -// used: used, -// left: inventory.capacity - used, -// capacity: inventory.capacity, -// }; -// }; - -// const addPendingTrade = ( -// direction: TradeDirection, -// drug: Drugs, -// quantity: number, -// price: number, -// ) => { -// const drugConfig = getDrugByName(drug); -// if (!drugConfig) return; - -// const trade: Trade = { -// direction, -// drug: drugConfig, -// quantity, -// price, -// }; - -// useGameStore.setState((state) => ({ -// trades: [...state.trades, trade], -// })); -// }; - -// const cleartrades = () => { -// useGameStore.setState((state) => ({ -// trades: [], -// })); -// }; - -// const clearTravelEvents = () => { -// useGameStore.setState((state) => ({ -// travelEvent: { -// event: TravelEvents.None, -// description: "", -// }, -// })); -// }; - -// const updateTravelEvent = (event: TravelEvents, description: string) => -// useGameStore.setState((state) => ({ -// travelEvent: { -// event, -// description, -// }, -// })); - -// export const startGame = () => { -// //set clean state -// useGameStore.setState({ -// ...initGameState(20, 420), -// }); -// }; - -// export const travelTo = (location: Locations) => { -// // clean travel events -// clearTravelEvents(); - -// // update location -// updateLocation(location); - -// // retrieve new location Menu -// updateLocationMenu(getMenu(location)); -// }; - -// const getRandomTravelEvent = (): TravelEvents => { -// const rand = getRandom(0, 100); - -// if (rand < 4) return TravelEvents.Killed; -// if (rand < 10) return TravelEvents.Mugged; -// if (rand < 20) return TravelEvents.Rugged; -// return TravelEvents.None; -// }; - -// const handleTravelEvent = () => { -// const event = getRandomTravelEvent(); -// const { cash, drugs } = useGameStore.getState().inventory; - -// if (event === TravelEvents.None) return; - -// if (event === TravelEvents.Killed) { -// updateCash(-cash); -// updateDrug(Drugs.Acid, -drugs[Drugs.Acid].quantity); -// updateDrug(Drugs.Cocaine, -drugs[Drugs.Cocaine].quantity); -// updateDrug(Drugs.Heroin, -drugs[Drugs.Heroin].quantity); -// updateDrug(Drugs.Ludes, -drugs[Drugs.Ludes].quantity); -// updateDrug(Drugs.Speed, -drugs[Drugs.Speed].quantity); -// updateDrug(Drugs.Weed, -drugs[Drugs.Weed].quantity); - -// updateTravelEvent(event, "You got killed ! R.I.P. "); -// } - -// if (event === TravelEvents.Rugged) { -// updateCash(-Math.ceil(cash / 2)); - -// updateTravelEvent(event, "You got rugged and lost 50% of your cash"); -// } - -// if (event === TravelEvents.Mugged) { -// updateDrug(Drugs.Acid, -Math.ceil(drugs[Drugs.Acid].quantity / 2)); -// updateDrug(Drugs.Cocaine, -Math.ceil(drugs[Drugs.Cocaine].quantity / 2)); -// updateDrug(Drugs.Heroin, -Math.ceil(drugs[Drugs.Heroin].quantity / 2)); -// updateDrug(Drugs.Ludes, -Math.ceil(drugs[Drugs.Ludes].quantity / 2)); -// updateDrug(Drugs.Speed, -Math.ceil(drugs[Drugs.Speed].quantity / 2)); -// updateDrug(Drugs.Weed, -Math.ceil(drugs[Drugs.Weed].quantity / 2)); - -// updateTravelEvent(event, "You got mugged and lost 50% of your stocks"); -// } -// }; - -// export const travelAndEndTurn = () => { -// // special events while traveling -// handleTravelEvent(); -// }; - -// export const endTurn = () => { -// // process trades -// cleartrades(); - -// // update turns -// const { turns } = useGameStore.getState(); -// if (turns.current < turns.total) { -// useGameStore.setState((state) => ({ -// turns: { -// current: turns.current + 1, -// total: turns.total, -// }, -// })); -// } else { -// alert("Game end !"); -// } -// }; - -// export const trade = ( -// direction: TradeDirection, -// drug: Drugs, -// quantity: number, -// ) => { -// //retrieve drug price -// const drugPrice = getDrugPrice(drug); - -// // add pending trade -// addPendingTrade(direction, drug, quantity, drugPrice); - -// // update cash / inventory -// if (direction === TradeDirection.Buy) { -// const totalPrice = drugPrice * quantity; -// updateCash(-totalPrice); -// updateDrug(drug, quantity); -// } else if (direction === TradeDirection.Sell) { -// const totalPrice = drugPrice * quantity; -// updateCash(totalPrice); -// updateDrug(drug, -quantity); -// } -// }; diff --git a/web/src/hooks/ui.tsx b/web/src/hooks/ui.tsx deleted file mode 100644 index 3950b6413..000000000 --- a/web/src/hooks/ui.tsx +++ /dev/null @@ -1,195 +0,0 @@ -import { create } from "zustand"; - -import { - Brooklyn, - CentralPark, - ConeyIsland, - Manhattan, - Queens, - Bronx, -} from "@/components/icons/locations"; - -import { - Ludes, - Weed, - Acid, - Speed, - Heroin, - Cocaine, -} from "@/components/icons/drugs"; - -import { Drugs, Locations, TravelEvents } from "./state"; - -import { Router, useRouter } from "next/router"; -import React from "react"; - -export interface LocationProps { - name: Locations; - slug: string; - icon: React.FC; -} - -export const locations: LocationProps[] = [ - { - name: Locations.Central, - slug: "central", - icon: CentralPark, - }, - { - name: Locations.Queens, - slug: "queens", - icon: Queens, - }, - { - name: Locations.Bronx, - slug: "bronx", - icon: Bronx, - }, - { - name: Locations.Jersey, - slug: "jersey", - icon: Manhattan, - }, - { - name: Locations.Coney, - slug: "coney", - icon: ConeyIsland, - }, - { - name: Locations.Brooklyn, - slug: "brooklyn", - icon: Brooklyn, - }, -]; - -export interface DrugProps { - name: Drugs; - slug: string; - icon: React.FC; -} - -const drugs: DrugProps[] = [ - { - name: Drugs.Ludes, - slug: "ludes", - icon: Ludes, - }, - { - name: Drugs.Speed, - slug: "speed", - icon: Speed, - }, - { - name: Drugs.Weed, - slug: "weed", - icon: Weed, - }, - { - name: Drugs.Acid, - slug: "acid", - icon: Acid, - }, - { - name: Drugs.Heroin, - slug: "heroin", - icon: Heroin, - }, - { - name: Drugs.Cocaine, - slug: "cocaine", - icon: Cocaine, - }, -]; - -export interface EventProps { - name: TravelEvents; - slug: string; - description: string; - imageSrc: string; -} - -export const events: EventProps[] = [ - { - name: TravelEvents.Arrested, - slug: "arrested", - description: "You lost a turn", - imageSrc: "/images/events/police_cruiser.gif", - }, - { - name: TravelEvents.Mugged, - slug: "mugged", - description: "You lost half your cash", - imageSrc: "/images/events/smoking_gun.gif", - }, -]; - -export interface UiState { - isConnected: boolean; - locations: LocationProps[]; - drugs: DrugProps[]; - events: EventProps[]; - getLocationBySlug: (slug: string) => LocationProps; - getLocationByName: (name: string) => LocationProps; - getDrugBySlug: (slug: string) => DrugProps; - getDrugByName: (name: string) => DrugProps; - getEventBySlug: (slug: string) => EventProps; - getEventByName: (name: string) => EventProps; - isBackButtonVisible: (pathname: string) => Boolean; -} - -export const setIsConnected = (isConnected: boolean) => - useUiStore.setState((state) => ({ isConnected })); - -export const isBackButtonVisible = (pathname: string): Boolean => { - return ["/[game]/[locationSlug]/[drugSlug]"].includes(pathname); -}; - -export const getLocationBySlug = (slug: string): LocationProps => { - const { locations } = useUiStore.getState(); - const location = locations.find((i) => i.slug === slug); - return location || locations[0]; -}; - -export const getLocationByName = (name: string): LocationProps => { - const { locations } = useUiStore.getState(); - const location = locations.find((i) => i.name === name); - return location || locations[0]; -}; - -export const getDrugBySlug = (slug: string): DrugProps => { - const { drugs } = useUiStore.getState(); - const drug = drugs.find((i) => i.slug === slug); - return drug || drugs[0]; -}; - -export const getDrugByName = (name: string): DrugProps => { - const { drugs } = useUiStore.getState(); - const drug = drugs.find((i) => i.name === name); - return drug || drugs[0]; -}; - -export const getEventByName = (name: string): EventProps => { - const { events } = useUiStore.getState(); - const event = events.find((i) => i.name === name); - return event || events[0]; -}; - -export const getEventBySlug = (slug: string): EventProps => { - const { events } = useUiStore.getState(); - const event = events.find((i) => i.slug === slug); - return event || events[0]; -}; - -export const useUiStore = create(() => ({ - isConnected: false, - locations, - drugs, - events, - getLocationBySlug, - getLocationByName, - getDrugBySlug, - getDrugByName, - getEventBySlug, - getEventByName, - isBackButtonVisible, -})); diff --git a/web/src/narrations.ts b/web/src/narrations.ts new file mode 100644 index 000000000..dd3662c50 --- /dev/null +++ b/web/src/narrations.ts @@ -0,0 +1,68 @@ +import { Outcome } from "./dojo/types"; + +type Encounter = "initial" | "repeat"; + +const Narrations: Record> = { + [Outcome.Paid]: { + initial: [ + "Smart move, handing over the cash. But know that we're always watching.", + "The streets have their own tax. Good on you for understanding.", + "Easiest way to keep your bones unbroken. Now get lost.", + "Blood or money, always easier when it's the latter. Move along.", + "We could've taken it by force, but you're wise to avoid the pain.", + ], + repeat: [ + "You again? It's like a subscription service with you. Convenient.", + "Your pockets seem to refill just for us. Do keep coming back.", + "Another day, another payout. Maybe consider a different route?", + "Consistency is key, huh? We appreciate your 'donations'.", + "Back so soon? At this rate, we should give you a loyalty card.", + ], + }, + [Outcome.Escaped]: { + initial: [ + "You might've outrun us this time, but the shadows talk. We'll find you.", + "Swift move, but luck only lasts so long. The streets don't forget.", + "Sprinting away won't save you forever. Next time, you won't see us coming.", + "Think you're a ghost? We have a knack for hunting phantoms.", + "Quick on your feet, huh? Makes the eventual catch even sweeter.", + ], + repeat: [ + "Again? Starting to admire your nerve, if not your wisdom.", + "You're getting good at this game, but remember, every chase ends eventually.", + "Lightning fast once more, but the storm is still coming.", + "Twice the escape, double the desire to get you next time.", + "Fancy footwork won't save you every time. Your luck is running thin.", + ], + }, + [Outcome.Captured]: { + initial: [ + "Thought you could outrun us? Now your cash and stash are ours.", + "Every step you took, we were right behind. Thanks for the bonus haul.", + "Nice try, but your pockets are a lot lighter now. Oh, and we'll be taking those drugs, too.", + "You might be fast, but not fast enough to keep your money or your stash.", + "Your escape plan had one flaw: leaving us your loot. Better luck next time.", + ], + repeat: [ + "Back again? Your pockets are like an ATM for us. Oh, and we'll help ourselves to those drugs again.", + "You're like a broken record: run, get caught, lose loot. When will you learn?", + "Twice in our net, and twice the profits. Thanks for the consistent supply, pal.", + "Starting to think you're doing this on purpose. Easy pickings for us either way.", + "Deja vu? For us, it's like hitting the jackpot every time. Your stash will do nicely.", + ], + }, +}; + +function getRandomIdx(length: number): number { + return Math.floor(Math.random() * length); +} + +// if first time, use initial response. repeat is a mix of initial and repeat +export function getNarration(outcome: Outcome, isInitial: boolean): string { + const encounterType = isInitial ? "initial" : "repeat"; + const lines = isInitial + ? Narrations[outcome][encounterType] + : [...Narrations[outcome].initial, ...Narrations[outcome].repeat]; + + return lines[getRandomIdx(lines.length)]; +} diff --git a/web/src/pages/[gameId]/[locationSlug]/[drugSlug].tsx b/web/src/pages/[gameId]/[locationSlug]/[drugSlug].tsx index f4520f3e4..15eadb616 100644 --- a/web/src/pages/[gameId]/[locationSlug]/[drugSlug].tsx +++ b/web/src/pages/[gameId]/[locationSlug]/[drugSlug].tsx @@ -1,45 +1,29 @@ -import { ReactNode, useCallback, useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { Box, Text, VStack, HStack, Card, Button } from "@chakra-ui/react"; import Layout from "@/components/Layout"; import { useRouter } from "next/router"; import { Alert, ArrowEnclosed, Cart } from "@/components/icons"; import Image from "next/image"; import { Footer } from "@/components/Footer"; -import { DrugProps, getDrugBySlug, getLocationBySlug } from "@/hooks/ui"; -import { - Slider, - SliderTrack, - SliderFilledTrack, - SliderThumb, - SliderMark, -} from "@chakra-ui/react"; +import { Slider, SliderTrack, SliderFilledTrack } from "@chakra-ui/react"; -import { - Tabs, - TabList, - TabPanels, - Tab, - TabPanel, - TabIndicator, -} from "@chakra-ui/react"; +import { Tabs, TabList, TabPanels, Tab, TabPanel } from "@chakra-ui/react"; import { Sounds, playSound } from "@/hooks/sound"; -import { TradeDirection, TradeType, usePlayerState } from "@/hooks/state"; +import { TradeDirection, TradeType, usePlayerStore } from "@/hooks/state"; import AlertMessage from "@/components/AlertMessage"; -import { cardPixelatedStyle } from "@/theme/styles"; import { DrugMarket, useLocationEntity, -} from "@/hooks/dojo/entities/useLocationEntity"; -import { - PlayerEntity, - usePlayerEntity, -} from "@/hooks/dojo/entities/usePlayerEntity"; +} from "@/dojo/entities/useLocationEntity"; +import { PlayerEntity, usePlayerEntity } from "@/dojo/entities/usePlayerEntity"; import { formatQuantity, formatCash } from "@/utils/ui"; -import { useSystems } from "@/hooks/dojo/systems/useSystems"; +import { useSystems } from "@/dojo/systems/useSystems"; import { calculateMaxQuantity, calculateSlippage } from "@/utils/market"; import { useToast } from "@/hooks/toast"; -import { useDojo } from "@/hooks/dojo"; +import { getDrugBySlug, getLocationBySlug } from "@/dojo/helpers"; +import { DrugInfo } from "@/dojo/types"; +import { useDojo } from "@/dojo"; export default function Market() { const router = useRouter(); @@ -60,7 +44,7 @@ export default function Market() { const { location: locationEntity } = useLocationEntity({ gameId, - locationId: location.name, + locationId: location.id, }); const { player: playerEntity } = usePlayerEntity({ gameId, @@ -73,10 +57,10 @@ export default function Market() { useEffect(() => { if (!locationEntity || !playerEntity) return; - const market = locationEntity.drugMarkets.find((d) => d.name === drug.name); + const market = locationEntity.drugMarkets.find((d) => d.id === drug.id); if (!market) return; - const playerDrug = playerEntity.drugs.find((d) => d.name === drug.name); + const playerDrug = playerEntity.drugs.find((d) => d.id === drug.id); if (playerDrug) { setCanSell(playerDrug.quantity > 0); } @@ -89,10 +73,12 @@ export default function Market() { setTradeDirection(index as TradeDirection); }; - const { buy, sell, isPending, error: txError } = useSystems(); - const { addTrade } = usePlayerState(); + const [isSubmitting, setIsSubmitting] = useState(false); + const { buy, sell, error: txError } = useSystems(); + const { addTrade } = usePlayerStore(); const onTrade = useCallback(async () => { + setIsSubmitting(true); playSound(Sounds.Trade); let toastMessage = "", hash = "", @@ -110,7 +96,7 @@ export default function Market() { toast(toastMessage, Cart, `http://amazing_explorer/${hash}`); - addTrade(drug.name, { + addTrade(drug.type, { direction: tradeDirection, quantity, } as TradeType); @@ -134,9 +120,11 @@ export default function Market() { return ( - - - - - ); -} diff --git a/web/src/pages/[gameId]/event/consequence.tsx b/web/src/pages/[gameId]/event/consequence.tsx new file mode 100644 index 000000000..8e56fc32f --- /dev/null +++ b/web/src/pages/[gameId]/event/consequence.tsx @@ -0,0 +1,69 @@ +import CrtEffect from "@/components/CrtEffect"; +import Image from "next/image"; +import { Footer } from "@/components/Footer"; +import Layout from "@/components/Layout"; +import { getOutcomeByType } from "@/dojo/helpers"; +import { Outcome } from "@/dojo/types"; +import { usePlayerStore } from "@/hooks/state"; +import { Button, Heading, Text, VStack } from "@chakra-ui/react"; +import { useRouter } from "next/router"; + +export default function Consequence() { + const router = useRouter(); + const gameId = router.query.gameId as string; + const outcome = getOutcomeByType(Number(router.query.outcome as string)); + const { history } = usePlayerStore(); + + const isInitial = history.includes(outcome.type); + const narration = outcome.getNarration(isInitial); + + if (!router.isReady) { + return <>; + } + + return ( + <> + + + + You... + + + {outcome.name} + + + {outcome.name} + + + {narration} + + {outcome.type == Outcome.Captured + ? `* Lost half your cash and stash *` + : ""} + + +
+ +
+
+
+ + + ); +} diff --git a/web/src/pages/[gameId]/event/decision.tsx b/web/src/pages/[gameId]/event/decision.tsx new file mode 100644 index 000000000..a547498cc --- /dev/null +++ b/web/src/pages/[gameId]/event/decision.tsx @@ -0,0 +1,115 @@ +import CrtEffect from "@/components/CrtEffect"; +import Image from "next/image"; +import { useDojo } from "@/dojo"; +import { PlayerStatus, usePlayerEntity } from "@/dojo/entities/usePlayerEntity"; +import { getLocationById } from "@/dojo/helpers"; +import { useSystems } from "@/dojo/systems/useSystems"; +import { Action } from "@/dojo/types"; +import { usePlayerStore } from "@/hooks/state"; +import { ConsequenceEventData } from "@/dojo/events"; +import { Button, Heading, Text, VStack } from "@chakra-ui/react"; +import { useRouter } from "next/router"; +import { useCallback, useState } from "react"; +import Layout from "@/components/Layout"; +import { Footer } from "@/components/Footer"; + +const BASE_PAYMENT = 400; + +export default function Decision() { + const router = useRouter(); + const gameId = router.query.gameId as string; + const nextLocation = getLocationById(router.query.nextId as string); + const [isPaying, setIsPaying] = useState(false); + const [isRunning, setIsRunning] = useState(false); + const { account } = useDojo(); + const { decide } = useSystems(); + const { addOutcome } = usePlayerStore(); + + const { player: playerEntity } = usePlayerEntity({ + gameId, + address: account?.address, + }); + + const onDecision = useCallback( + async (action: Action) => { + const result = await decide(gameId, action, nextLocation.id); + const event = result.event! as ConsequenceEventData; + addOutcome(event.outcome); + + router.replace(`/${gameId}/event/consequence?outcome=${event.outcome}`); + }, + [gameId, nextLocation, router, addOutcome, decide], + ); + + if (!playerEntity || !router.isReady) { + return <>; + } + + if (playerEntity.status == PlayerStatus.Normal && !isPaying && !isRunning) { + return router.push( + `/${gameId}/${getLocationById(playerEntity.locationId).slug}`, + ); + } + + return ( + <> + + + + You encountered a... + + + Gang! + + + muggers + + + Better think fast... + + * They are demanding at least{" "} + {playerEntity.cash * 0.2 < BASE_PAYMENT ? "$400" : "20%"} of your + cash * + + +
+ + +
+
+
+ + + ); +} diff --git a/web/src/pages/[gameId]/index.tsx b/web/src/pages/[gameId]/index.tsx index 9d96aeea0..baa8b6ad4 100644 --- a/web/src/pages/[gameId]/index.tsx +++ b/web/src/pages/[gameId]/index.tsx @@ -16,9 +16,11 @@ export default function Join() { const router = useRouter(); return ( diff --git a/web/src/pages/[gameId]/travel.tsx b/web/src/pages/[gameId]/travel.tsx index 512ce046e..5bad2d1f7 100644 --- a/web/src/pages/[gameId]/travel.tsx +++ b/web/src/pages/[gameId]/travel.tsx @@ -10,45 +10,39 @@ import { useEventListener, Spacer, } from "@chakra-ui/react"; -import { Locations, usePlayerState, TravelEvents } from "@/hooks/state"; import { useRouter } from "next/router"; -import React, { useCallback, useEffect, useState } from "react"; -import { IsMobile, generatePixelBorderPath } from "@/utils/ui"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; +import { generatePixelBorderPath } from "@/utils/ui"; import { Map } from "@/components/map"; import { motion } from "framer-motion"; -import { - LocationProps, - useUiStore, - getLocationByName, - getEventBySlug, -} from "@/hooks/ui"; -import { useSystems } from "@/hooks/dojo/systems/useSystems"; -import { usePlayerEntity } from "@/hooks/dojo/entities/usePlayerEntity"; -import { RandomEventData } from "@/utils/event"; +import { useSystems } from "@/dojo/systems/useSystems"; +import { usePlayerEntity } from "@/dojo/entities/usePlayerEntity"; import { useToast } from "@/hooks/toast"; -import { useDojo } from "@/hooks/dojo"; +import { useDojo } from "@/dojo"; +import { getLocationById, getLocationByType, locations } from "@/dojo/helpers"; +import { LocationInfo } from "@/dojo/types"; export default function Travel() { const router = useRouter(); const gameId = router.query.gameId as string; - const [target, setTarget] = useState(); - const [currentLocation, setCurrentLocation] = useState(); - const { locations } = useUiStore.getState(); - const { addEvent } = usePlayerState(); + const [targetId, setTargetId] = useState(""); + const [currentLocationId, setCurrentLocationId] = useState(""); + const { toast } = useToast(); const { account } = useDojo(); - const { travel, isPending, error: txError } = useSystems(); const { player: playerEntity } = usePlayerEntity({ gameId, address: account?.address, }); + const targetLocation = useMemo(() => getLocationById(targetId), [targetId]); + useEffect(() => { if (playerEntity) { - const location = getLocationByName(playerEntity.locationId).name; - setCurrentLocation(location); - setTarget(location); + const location = getLocationById(playerEntity.locationId); + setCurrentLocationId(location.id); + setTargetId(location.id); } }, [playerEntity]); @@ -66,44 +60,31 @@ export default function Travel() { }); const next = useCallback(() => { - const idx = locations.findIndex((location) => location.name === target); + const idx = locations.findIndex((location) => location.id === targetId); if (idx < locations.length - 1) { - setTarget(locations[idx + 1].name); + setTargetId(locations[idx + 1].id); } else { - setTarget(locations[0].name); + setTargetId(locations[0].id); } - }, [target, locations]); + }, [targetId]); const back = useCallback(() => { - const idx = locations.findIndex((location) => location.name === target); + const idx = locations.findIndex((location) => location.id === targetId); if (idx > 0) { - setTarget(locations[idx - 1].name); + setTargetId(locations[idx - 1].id); } else { - setTarget(locations[locations.length - 1].name); + setTargetId(locations[locations.length - 1].id); } - }, [target, locations]); + }, [targetId]); const onContinue = useCallback(async () => { - if (target) { - const { event, hash } = await travel(gameId, target); + if (targetId) { + const { event, hash } = await travel(gameId, targetId); if (event) { - const typeSlug = (event as RandomEventData).arrested - ? "arrested" - : "mugged"; - - const travelEvent = getEventBySlug(typeSlug); - addEvent(travelEvent.name); - - toast( - `${travelEvent.description}`, - Event, - `http://amazing_explorer/${hash}`, - ); - - router.push(`/${gameId}/event/${typeSlug}`); + router.push(`/${gameId}/event/decision?nextId=${targetId}`); } else { toast( - `You've traveled to ${target}`, + `You've traveled to ${targetLocation.name}`, Car, `http://amazing_explorer/${hash}`, ); @@ -111,21 +92,24 @@ export default function Travel() { router.push(`/${gameId}/turn`); } } - }, [target, router, gameId, addEvent, travel, toast]); + }, [targetId, router, gameId, targetLocation, travel, toast]); return ( { + setTargetId(getLocationByType(selected).id); + }} + /> + ), + }} + showMap={true} showBack={true} - map={ - { - setTarget(selected); - }} - /> - } > @@ -134,21 +118,21 @@ export default function Travel() { {...location} key={index} name={location.name} - isCurrent={location.name === currentLocation} - selected={location.name === target} - onClick={() => setTarget(location.name)} + isCurrent={location.id === currentLocationId} + selected={location.id === targetId} + onClick={() => setTargetId(location.id)} /> ))} - {target} + {targetLocation.name} - {target === currentLocation + {targetId === currentLocationId ? "Current Location" - : `Travel to ${target}`} + : `Travel to ${targetLocation.name}`} @@ -220,7 +204,7 @@ const Location = ({ selected: boolean; isCurrent: boolean; onClick: () => void; -} & LocationProps) => { +} & LocationInfo) => { const currentColor = isCurrent ? "yellow.400" : "neon.400"; return ( diff --git a/web/src/pages/[gameId]/turn.tsx b/web/src/pages/[gameId]/turn.tsx index 6b838ed50..7af5f48fc 100644 --- a/web/src/pages/[gameId]/turn.tsx +++ b/web/src/pages/[gameId]/turn.tsx @@ -1,14 +1,17 @@ import { Footer } from "@/components/Footer"; import { Bag, Event } from "@/components/icons"; import Layout from "@/components/Layout"; -import { useDojo } from "@/hooks/dojo"; -import { useGameEntity } from "@/hooks/dojo/entities/useGameEntity"; -import { usePlayerEntity } from "@/hooks/dojo/entities/usePlayerEntity"; -import { TradeDirection, usePlayerState } from "@/hooks/state"; +import { useDojo } from "@/dojo"; +import { useGameEntity } from "@/dojo/entities/useGameEntity"; +import { usePlayerEntity } from "@/dojo/entities/usePlayerEntity"; +import { + getDrugByType, + getLocationById, + getOutcomeByType, +} from "@/dojo/helpers"; +import { TradeDirection, usePlayerStore } from "@/hooks/state"; -import { getDrugByName, getEventByName, getLocationByName } from "@/hooks/ui"; import { - Box, Button, HStack, ListItem, @@ -30,17 +33,21 @@ export default function Turn() { gameId, }); - const { trades, events, clearState } = usePlayerState(); + const { trades, outcomes, clearTradesAndOutcomes } = usePlayerStore(); if (!playerEntity || !gameEntty) { return <>; } + const locationInfo = getLocationById(playerEntity.locationId); + return ( {trades.size > 0 && ( @@ -56,11 +63,12 @@ export default function Turn() { {Array.from(trades).map(([drug, trade]) => { const change = trade.direction === TradeDirection.Buy ? "+" : "-"; + const drugInfo = getDrugByType(drug); return ( @@ -77,23 +85,26 @@ export default function Turn() { - {getLocationByName(playerEntity.locationId).icon({})} - {playerEntity.locationId} + {locationInfo.icon({})} + {locationInfo.name} - {events.map((event, index) => ( - - - - - {event} + {outcomes.map((outcome, index) => { + const outcomeInfo = getOutcomeByType(outcome); + return ( + + + + + {outcomeInfo.name} + + + {} + - - {getEventByName(event).description} - - - - ))} + + ); + })} ;
@@ -101,12 +112,8 @@ export default function Turn() {