-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d5e8a1
commit 4aab3ad
Showing
12 changed files
with
223 additions
and
44 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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
export const convertVendorToSigner = (vendor: Connex.Vendor): Connex.Signer => { | ||
return { | ||
signTx: (msg, options): Promise<Connex.Vendor.TxResponse> => { | ||
const service = vendor.sign('tx', msg); | ||
|
||
if (options.gas) { | ||
service.gas(options.gas); | ||
} | ||
|
||
if (options.signer) { | ||
service.signer(options.signer); | ||
} | ||
|
||
if (options.dependsOn) { | ||
service.dependsOn(options.dependsOn); | ||
} | ||
|
||
if (options.link) { | ||
service.link(options.link); | ||
} | ||
|
||
if (options.comment) { | ||
service.comment(options.comment); | ||
} | ||
|
||
if (options.delegator) { | ||
service.delegate( | ||
options.delegator.url, | ||
options.delegator.signer, | ||
); | ||
} | ||
|
||
if (options.onAccepted) { | ||
service.accepted(options.onAccepted); | ||
} | ||
|
||
return service.request(); | ||
}, | ||
|
||
signCert: (msg, options): Promise<Connex.Vendor.CertResponse> => { | ||
const service = vendor.sign('cert', msg); | ||
|
||
if (options.signer) { | ||
service.signer(options.signer); | ||
} | ||
|
||
if (options.link) { | ||
service.link(options.link); | ||
} | ||
|
||
if (options.onAccepted) { | ||
service.accepted(options.onAccepted); | ||
} | ||
|
||
return service.request(); | ||
}, | ||
}; | ||
}; |
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
Oops, something went wrong.