Skip to content

Instantly share code, notes, and snippets.

@aaroncox
aaroncox / authorityprovider.js
Last active March 15, 2024 14:57
Using a custom authority provider within eosjs for Greymass Fuel
// A custom cosigner AuthorityProvider for EOSJS v2
// This provider overrides the checks on all keys,
// allowing a partially signed transaction to be
// broadcast to the API node.
class CosignAuthorityProvider {
async getRequiredKeys(args) {
const { transaction } = args;
// Iterate over the actions and authorizations
transaction.actions.forEach((action, ti) => {
action.authorization.forEach((auth, ai) => {
did:3:kjzl6cwe1jw14bbl7uxa65m54vny1a8gs0ur532dtijod0uh8focx9uh4r7m00l