mirror of
https://github.com/bigchaindb/site.git
synced 2025-02-14 21:10:28 +01:00
prepare transaction js
This commit is contained in:
parent
f63118a97f
commit
d3e511a33f
@ -9,27 +9,27 @@ jQuery(function($) {
|
|||||||
Newsletter.init()
|
Newsletter.init()
|
||||||
})
|
})
|
||||||
|
|
||||||
window.addEventListener('load', function load(event){
|
//=include bigchaindb-driver/dist/browser/bundle.window.min.js
|
||||||
window.removeEventListener('load', load, false)
|
|
||||||
|
window.addEventListener('DOMContentLoaded', function domload(event){
|
||||||
|
window.removeEventListener('DOMContentLoaded', domload, false)
|
||||||
|
|
||||||
const driver = window.BigchainDB
|
const driver = window.BigchainDB
|
||||||
const API_PATH = 'https://test.ipdb.io/api/v1/'
|
const API_PATH = 'https://test.ipdb.io/api/v1/'
|
||||||
const APP_ID = 'b563bf22'
|
const APP_ID = 'b563bf22'
|
||||||
const APP_KEY = 'fd639614dcf8ee90a8c51a013ac11fb0'
|
const APP_KEY = 'fd639614dcf8ee90a8c51a013ac11fb0'
|
||||||
|
|
||||||
|
const form = document.getElementById('form-transaction')
|
||||||
const postButton = document.getElementById('post')
|
const postButton = document.getElementById('post')
|
||||||
|
|
||||||
postButton.addEventListener('click', function(e) {
|
postButton.addEventListener('click', function(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
const alice = new driver.Ed25519Keypair()
|
|
||||||
|
|
||||||
const message = document.getElementById('message').value
|
const message = document.getElementById('message').value
|
||||||
const metadata = document.getElementById('metadata').value
|
|
||||||
|
|
||||||
|
const alice = new driver.Ed25519Keypair()
|
||||||
const tx = driver.Transaction.makeCreateTransaction(
|
const tx = driver.Transaction.makeCreateTransaction(
|
||||||
{ assetMessage: message },
|
{ assetMessage: message },
|
||||||
{ metaDataMessage: metadata },
|
|
||||||
[ driver.Transaction.makeOutput(
|
[ driver.Transaction.makeOutput(
|
||||||
driver.Transaction.makeEd25519Condition(alice.publicKey))
|
driver.Transaction.makeEd25519Condition(alice.publicKey))
|
||||||
],
|
],
|
||||||
|
@ -21,10 +21,10 @@ redirect_from:
|
|||||||
<div class="grid grid--full grid-small--half grid--gutters">
|
<div class="grid grid--full grid-small--half grid--gutters">
|
||||||
<div class="grid__col">
|
<div class="grid__col">
|
||||||
<h4>Request</h4>
|
<h4>Request</h4>
|
||||||
<form class="form form--transaction" action="" method="post">
|
<form id="form-transaction" class="form form--transaction js-parsley">
|
||||||
<p class="form-group">
|
<p class="form-group">
|
||||||
<input class="form-control" type="text" name="message" required>
|
<input id="message" class="form-control" type="text" name="message" required>
|
||||||
<label class="form-label" for="message">Add a message</label>
|
<label class="form-label" for="message">Message</label>
|
||||||
</p>
|
</p>
|
||||||
<p class="form-group">
|
<p class="form-group">
|
||||||
A transaction can contain a digital asset along with a message. Type something to be sent along the asset.
|
A transaction can contain a digital asset along with a message. Type something to be sent along the asset.
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
"ie >= 10"
|
"ie >= 10"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"bigchaindb-driver": "^0.1.1",
|
||||||
"is-in-viewport": "^3.0.0",
|
"is-in-viewport": "^3.0.0",
|
||||||
"jquery": "^3.2.1",
|
"jquery": "^3.2.1",
|
||||||
"normalize-css": "^2.3.1",
|
"normalize-css": "^2.3.1",
|
||||||
|
Loading…
Reference in New Issue
Block a user