-
Notifications
You must be signed in to change notification settings - Fork 524
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
Showing
9 changed files
with
152 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3847,7 +3847,10 @@ return api.prepareCheckCash(address, checkCash).then(prepared => | |
|
||
## sign | ||
|
||
`sign(txJSON: string, secret: string, options: Object): {signedTransaction: string, id: string}` | ||
``` | ||
sign(txJSON: string, secret: string, options: Object): {signedTransaction: string, id: string} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
intelliot
Collaborator
|
||
sign(txJSON: string, keypair: Object, options: Object): {signedTransaction: string, id: string} | ||
``` | ||
|
||
Sign a prepared transaction. The signed transaction must subsequently be [submitted](#submit). | ||
|
||
|
@@ -3856,9 +3859,12 @@ Sign a prepared transaction. The signed transaction must subsequently be [submit | |
Name | Type | Description | ||
---- | ---- | ----------- | ||
txJSON | string | Transaction represented as a JSON string in rippled format. | ||
secret | secret string | The secret of the account that is initiating the transaction. | ||
keypair | object | *Optional* The private and public key of the account that is initiating the transaction. (This field is exclusive with secret). | ||
*keypair.* privateKey | privateKey | The uppercase hexadecimal representation of the secp256k1 or Ed25519 private key. | ||
*keypair.* publicKey | publicKey | The uppercase hexadecimal representation of the secp256k1 or Ed25519 public key. | ||
options | object | *Optional* Options that control the type of signature that will be generated. | ||
*options.* signAs | [address](#address) | *Optional* The account that the signature should count for in multisigning. | ||
secret | secret string | *Optional* The secret of the account that is initiating the transaction. (This field is exclusive with keypair). | ||
|
||
### Return Value | ||
|
||
|
@@ -3874,7 +3880,8 @@ id | [id](#transaction-id) | The [Transaction ID](#transaction-id) of the signed | |
```javascript | ||
const txJSON = '{"Flags":2147483648,"TransactionType":"AccountSet","Account":"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59","Domain":"726970706C652E636F6D","LastLedgerSequence":8820051,"Fee":"12","Sequence":23}'; | ||
const secret = 'shsWGZcmZz6YsWWmcnpfr6fLTdtFV'; | ||
return api.sign(txJSON, secret); | ||
const keypair = { privateKey: '00ACCD3309DB14D1A4FC9B1DAE608031F4408C85C73EE05E035B7DC8B25840107A', publicKey: '02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8' }; | ||
return api.sign(txJSON, secret); // or: api.sign(txJSON, keypair); | ||
``` | ||
|
||
|
||
|
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,7 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title": "privateKey", | ||
"description": "The hexadecimal representation of a secp256k1 or Ed25519 private key.", | ||
"type": "string", | ||
"pattern": "^[A-F0-9]+$" | ||
} |
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
Can't see a
signWithKeypair
:0