godprotocol 1.2.3 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Objects/Account.js +3 -3
- package/html/create.js +1 -15
- package/package.json +1 -1
package/Objects/Account.js
CHANGED
|
@@ -23,7 +23,7 @@ class Account extends Utils{
|
|
|
23
23
|
let chain = await this.chain.chain(phy)
|
|
24
24
|
|
|
25
25
|
if (compiler){
|
|
26
|
-
!from_reload && await this.manager.oracle.write(`${phy}
|
|
26
|
+
!from_reload && await this.manager.oracle.write(`${phy}.air`, sequence, {account: this.physical_address, prefix: '.codes', address: phy})
|
|
27
27
|
|
|
28
28
|
sequence = await this.compiler.to_sequence(sequence, address)
|
|
29
29
|
sequence = sequence[0]
|
|
@@ -45,7 +45,7 @@ class Account extends Utils{
|
|
|
45
45
|
config = await folder.readone(_id? {_id}: null)
|
|
46
46
|
|
|
47
47
|
if (!config){
|
|
48
|
-
let code = await this.manager.oracle.read(`${phy}
|
|
48
|
+
let code = await this.manager.oracle.read(`${phy}.air`, {account: this.physical_address, prefix: '.codes', address: phy})
|
|
49
49
|
if (code){
|
|
50
50
|
code = await this.compiler.to_sequence(code, address)
|
|
51
51
|
code = code[0]
|
|
@@ -99,7 +99,7 @@ class Account extends Utils{
|
|
|
99
99
|
let phy = `${this.physical_address}/${address}`
|
|
100
100
|
|
|
101
101
|
if (from === '.codes'){
|
|
102
|
-
let res = await this.manager.oracle.read(`${phy}
|
|
102
|
+
let res = await this.manager.oracle.read(`${phy}.air`, {account: this.physical_address, address: phy, prefix: from})
|
|
103
103
|
if (res){
|
|
104
104
|
return {result: res}
|
|
105
105
|
}else return {message: 'Code not found'}
|
package/html/create.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {message_box} from './util.js'
|
|
2
|
-
|
|
3
1
|
const script = (manager)=> {
|
|
4
2
|
return `
|
|
5
3
|
const account_id_el = document.getElementById('account_id'), account_password_el = document.getElementById('account_password'),
|
|
@@ -26,15 +24,7 @@ const account_id_el = document.getElementById('account_id'), account_password_el
|
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
method: 'POST',
|
|
31
|
-
header: {
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
Accept: 'application/json'
|
|
34
|
-
},
|
|
35
|
-
body: JSON.stringify({name, password})
|
|
36
|
-
})
|
|
37
|
-
.then(data=>data.json())
|
|
27
|
+
ftch("/create_account", JSON.stringify({name, password}))
|
|
38
28
|
.then(res=>{
|
|
39
29
|
let accs = sessionStorage.getItem('accounts')
|
|
40
30
|
if (accs) accs = JSON.parse(accs)
|
|
@@ -54,10 +44,6 @@ const account_id_el = document.getElementById('account_id'), account_password_el
|
|
|
54
44
|
}
|
|
55
45
|
|
|
56
46
|
message_box.textContent = res.uid ? 'Account signed succesfully!' : res.message
|
|
57
|
-
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
message_box.textContent = ''
|
|
60
|
-
}, 2500);
|
|
61
47
|
return;
|
|
62
48
|
})
|
|
63
49
|
.catch(err=>console.log(err))
|