Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

how to calculate signatures parameter in the push_transaction request ? #304

Open
DamonHu opened this issue Mar 6, 2022 · 0 comments
Open

Comments

@DamonHu
Copy link

DamonHu commented Mar 6, 2022

Sorry to bother you, I would like to ask if the signatures parameter in the push_transaction request can be calculated locally through this library.

I referred to the writing in EosioSoftkeySignatureProvider, passed in the jsonData data of the request parameters, and then calculated it together with chainIdData and contextFreeDataHash, but there was an error: 3090003 unsatisfied_after the request was made Authorization, Provided keys, permissions, and delays do not satisfy declared authorizations.

I wanted to ask if it was a mistake in my understanding, If you want to calculate locally, what is the right thing to do?

this is my code

guard let chainIdData = Data.init(hexString: chainID) else {
            return nil
        }
        let contextFreeDataHash = Data(repeating: 0, count: 32)
        
        if let publicKey = self.getPublicKey(privateKey: nil), let publicData = try? Data(eosioPublicKey: publicKey)  {
            //let data
            return try? EosioEccSign.signWithK1(publicKey: key.uncompressedPublicKey, privateKey: privateData, data: chainIdData + jsonData + contextFreeDataHash).toEosioK1Signature
        } else {
            return nil
        }
@DamonHu DamonHu closed this as completed Mar 7, 2022
@DamonHu DamonHu reopened this Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant