-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport_presets.cfg
166 lines (144 loc) · 5.04 KB
/
export_presets.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
[preset.0]
name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="./index.html"
script_export_mode=1
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/export_icon=true
html/custom_html_shell=""
html/head_include="<script src=\"https://unpkg.com/@proton/web-sdk@4.1.4\"></script>
<script type=\"module\">
let link = undefined;
let session = undefined;
let accountData = undefined;
const appIdentifier = \"taskly\"
const chainId = \"384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0\"
const endpoints = [\"https://proton.greymass.com\"]
const loginButton = document.querySelector('#login-button')
const avatar = document.querySelector('#avatar')
const avatarName = document.querySelector('#avatar-name')
const avatarImage = document.querySelector('#avatar-image')
const logoutIcon = document.querySelector('#logout-icon')
const fromInput = document.querySelector('#from-input')
const toInput = document.querySelector('#to-input')
const amountInput = document.querySelector('#amount-input')
const transferButton = document.querySelector('#transfer-button')
const getAvatarImage = () => {
const avatar = accountData && accountData.avatar
if (avatar) {
if (avatar.indexOf('/9j/') !== -1) {
return `data:image/jpeg;base64,${avatar}`
} else if (avatar.indexOf('iVBORw0KGgo') !== -1) {
return `data:image/png;base64,${avatar}`
}
}
return 'https://bloks.io/img/proton_avatar.png'
}
const updateStatus = () => {
avatarImage.src = getAvatarImage()
if (session && session.auth) {
avatarName.textContent = session.auth.actor.toString()
fromInput.value = session.auth.actor.toString()
loginButton.style.display = \"none\"
avatar.style.display = \"block\"
} else {
avatarName.textContent = \"\"
fromInput.value = \"\"
loginButton.style.display = \"block\"
avatar.style.display = \"none\"
}
}
const login = async (restoreSession) => {
const { link: localLink, session: localSession } = await ProtonWebSDK({
linkOptions: {
endpoints,
chainId,
restoreSession,
},
transportOptions: {
requestAccount: appIdentifier
},
selectorOptions: {
appName: \"Taskly\",
appLogo: \"https://taskly.protonchain.com/static/media/taskly-logo.ad0bfb0f.svg\",
customStyleOptions: {
modalBackgroundColor: \"#F4F7FA\",
logoBackgroundColor: \"white\",
isLogoRound: true,
optionBackgroundColor: \"white\",
optionFontColor: \"black\",
primaryFontColor: \"black\",
secondaryFontColor: \"#6B727F\",
linkColor: \"#752EEB\"
}
}
})
link = localLink
session = localSession
updateStatus()
}
const logout = async () => {
if (link && session) {
await link.removeSession(appIdentifier, session.auth, chainId);
}
session = undefined;
link = undefined;
updateStatus()
}
const transfer = async ({ to, amount }) => {
if (!session) {
throw new Error('No Session');
}
return await session.transact({
actions: [{
// Token contract for only XPR
// Other tokens like XUSDC have contract \"xtokens\"
account: \"eosio.token\",
// Action name
name: \"transfer\",
// Action parameters
data: {
from: session.auth.actor,
to: to,
// Change precision from 4 for other assets, e.g. 6 for USDC
quantity: `${(+amount).toFixed(4)} XPR`,
memo: \"\"
},
authorization: [session.auth]
}]
}, {
broadcast: true
})
}
// Add button listeners
logoutIcon.addEventListener(\"click\", logout)
loginButton.addEventListener(\"click\", () => login(false))
transferButton.addEventListener(\"click\", () => transfer({
to: toInput.value,
amount: amountInput.value,
}))
// Restore
login(true)
</script>"
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color( 0, 0, 0, 1 )