-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes type mismatches between in RN & iOS libs #409
base: np/smart-contract-wallets
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,10 @@ public protocol SigningKey { | |
var isSmartContractWallet: Bool { get } | ||
|
||
/// The name of the chainId for example "1" | ||
var chainId: Int64? { get } | ||
var chainId: UInt64? { get } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually think we should keep these Int64 and change the RN to Int64. I do all the U things to it in the code already so no need for these to be UInt64 here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea I changed this here for two reasons
I don't think it matters that much either way so whatever works 👍 |
||
|
||
/// The blockNumber of the chain for example "1" | ||
var blockNumber: Int64? { get } | ||
var blockNumber: UInt64? { get } | ||
|
||
/// Sign the data and return a secp256k1 compact recoverable signature. | ||
func sign(_ data: Data) async throws -> Signature | ||
|
@@ -45,11 +45,11 @@ extension SigningKey { | |
return false | ||
} | ||
|
||
public var chainId: Int64? { | ||
public var chainId: UInt64? { | ||
return nil | ||
} | ||
|
||
public var blockNumber: Int64? { | ||
public var blockNumber: UInt64? { | ||
return nil | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you not set the boolean for
isSmartContractWallet
? Do you only set thechainId
? Wondering how we can make it more clear that the both need to be set if you're using a smart contract wallet. Though I guess we could get away with removingisSmartContractWallet
potentially if you think thechainId
will be enough? Or for ease of feature advancements we could change it to atype
EOA
orSCW
etc...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
chainId
is enough but I am not sure if dropping theisSmartContract
leads to the clearest api. I can see people just seeing that thechainId
field can be entered and passing it even with EOAs.For RN I was thinking maybe an object might work but don't think that carries over to native so well.
Could adopt the chain-specific address as it has become relatively common among SCA providers. So those including an
address
field of the form{chainId or chainShortName}:{address}
get setup as SCA — although maybe this is less clear.I wasn't actually judging the api though. I changed this is because the
chainId
needs to be unwrapped here & I just went with the condition from thebuildV3
method.