-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Sepolia network; Support
starknet_chainId
endpoint (#137)
- Loading branch information
Showing
11 changed files
with
97 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import BigInt | ||
import Foundation | ||
|
||
public enum StarknetChainId { | ||
case mainnet | ||
case testnet | ||
public enum StarknetChainId: String, Codable, Equatable { | ||
case mainnet = "0x534e5f4d41494e" | ||
case goerli = "0x534e5f474f45524c49" | ||
case sepolia = "0x534e5f5345504f4c4941" | ||
case integration_sepolia = "0x534e5f494e544547524154494f4e5f5345504f4c4941" | ||
|
||
public var feltValue: Felt { | ||
switch self { | ||
case .mainnet: | ||
return Felt(fromHex: "0x534e5f4d41494e")! | ||
case .testnet: | ||
return Felt(fromHex: "0x534e5f474f45524c49")! | ||
} | ||
Felt(fromHex: self.rawValue)! | ||
} | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case mainnet = "0x534e5f4d41494e" | ||
case goerli = "0x534e5f474f45524c49" | ||
case sepolia = "0x534e5f5345504f4c4941" | ||
case integration_sepolia = "0x534e5f494e544547524154494f4e5f5345504f4c4941" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.