1
0
mirror of https://github.com/bigchaindb/site.git synced 2024-12-24 18:36:11 +01:00

prepare transaction js

This commit is contained in:
Matthias Kretschmann 2017-06-22 17:23:48 +02:00
parent f63118a97f
commit d3e511a33f
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 10 additions and 9 deletions

View File

@ -9,27 +9,27 @@ jQuery(function($) {
Newsletter.init()
})
window.addEventListener('load', function load(event){
window.removeEventListener('load', load, false)
//=include bigchaindb-driver/dist/browser/bundle.window.min.js
window.addEventListener('DOMContentLoaded', function domload(event){
window.removeEventListener('DOMContentLoaded', domload, false)
const driver = window.BigchainDB
const API_PATH = 'https://test.ipdb.io/api/v1/'
const APP_ID = 'b563bf22'
const APP_KEY = 'fd639614dcf8ee90a8c51a013ac11fb0'
const form = document.getElementById('form-transaction')
const postButton = document.getElementById('post')
postButton.addEventListener('click', function(e) {
e.preventDefault()
const alice = new driver.Ed25519Keypair()
const message = document.getElementById('message').value
const metadata = document.getElementById('metadata').value
const alice = new driver.Ed25519Keypair()
const tx = driver.Transaction.makeCreateTransaction(
{ assetMessage: message },
{ metaDataMessage: metadata },
[ driver.Transaction.makeOutput(
driver.Transaction.makeEd25519Condition(alice.publicKey))
],

View File

@ -21,10 +21,10 @@ redirect_from:
<div class="grid grid--full grid-small--half grid--gutters">
<div class="grid__col">
<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">
<input class="form-control" type="text" name="message" required>
<label class="form-label" for="message">Add a message</label>
<input id="message" class="form-control" type="text" name="message" required>
<label class="form-label" for="message">Message</label>
</p>
<p class="form-group">
A transaction can contain a digital asset along with a message. Type something to be sent along the asset.

View File

@ -25,6 +25,7 @@
"ie >= 10"
],
"dependencies": {
"bigchaindb-driver": "^0.1.1",
"is-in-viewport": "^3.0.0",
"jquery": "^3.2.1",
"normalize-css": "^2.3.1",