-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
321 lines (285 loc) · 18.2 KB
/
index.html
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MetaID Test Page</title>
<script type="importmap">
{
"imports": {
"vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
}
}
</script>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="icon" href="https://avatars.githubusercontent.com/u/130353550?s=24" />
</head>
<body class="min-h-screen bg-gradient-to-br from-sky-500 to-indigo-500 text-white">
<div id="app" class="max-w-3xl mx-auto py-8">
<h3 class="text-center font-bold text-2xl">Metaid.js Test Page</h3>
<!-- control -->
<div class="mt-16 text-sky-800 font-bold space-y-8">
<div class="">
<div class="flex items-center gap-4">
<div class="grow flex flex-col gap-y-2">
<input type="text" class="grow rounded-lg h-full text-sm p-3" placeholder="Mnemonic" v-model="mnemonic" />
<input type="text" class="grow rounded-lg h-full text-sm p-3" placeholder="Path" v-model="path" />
</div>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="connectWallet">Connect Local Wallet</button>
</div>
<!-- metalet wallet -->
<h3 class="mt-4 text-white">Metalet Wallet</h3>
<div class="mt-2 grid grid-cols-4 gap-4">
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="connectMetaletWithBtc">
Connect Metalet With Btc
</button>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="connectMetaletWithMvc">
Connect Metalet With Mvc
</button>
<!-- <button class="px-4 py-2 bg-white rounded-md shadow-md" @click="getBtcAddress">Get BTC Address</button> -->
<!-- <button class="px-4 py-2 bg-white rounded-md shadow-md" @click="getMvcAddress">Get Mvc Address</button> -->
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="getPublicKey">Get Public Key</button>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="send2k">Send 2k</button>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="createMetaidForBTC">
BTC Create MetaID
</button>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="createUserForMVC">MVC Create User</button>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="debug">Debug</button>
</div>
<p v-if="connected" class="text-teal-200 mt-2">Connected Success {{btcAddress}}</p>
</div>
<div class="flex items-center gap-4">
<input
type="text"
class="grow rounded-lg h-full text-sm p-3"
placeholder="You buzz content"
v-model="content"
/>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="createBuzzForMVC">Create Buzz</button>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="createBuzzPictureForMVC">
Create Buzz With Image
</button>
</div>
<div class="">
<div class="flex gap-4 items-center">
<div class="font-bold text-white">Buzz List</div>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="getBuzzList">Get List</button>
<button class="px-4 py-2 bg-white rounded-md shadow-md" @click="likeTheFirst">Like the first</button>
</div>
<!-- list -->
<div class="">
<div v-for="buzz in buzzes" class="bg-white rounded-md shadow-md p-4 mt-4">
<div class="flex items-center gap-4">
<div class="flex-grow">
<div class="text-sm text-gray-500">{{ buzz?.contentSummary ?? 'empty value' }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="module">
import { createApp, ref, computed, toRaw } from 'vue'
import {
// Transaction,
// Psbt,
// LocalWallet,
MetaletWalletForMvc,
MetaletWalletForBtc,
btcConnect,
mvcConnect,
} from './dist/metaid.js'
createApp({
setup() {
const mnemonic = ref('')
const path = ref(`m/44'/10001'/0'/0/0`)
const Buzz = ref(null)
const File = ref(null)
const connected = computed(() => !!Buzz.value)
const content = ref('Hello MetaID V2 !!!')
const buzzes = ref([])
const connector = ref(null)
const wallet = ref(null)
const btcAddress = computed(() => wallet.value.address)
const connectWallet = async () => {
const _wallet = await LocalWallet.create(mnemonic.value, path.value)
wallet.value = _wallet
}
const connectMetaletWithBtc = async () => {
console.log('connectMetaletWithBtc')
const _wallet = await MetaletWalletForBtc.create()
wallet.value = _wallet
btcAddress.value = await _wallet.getAddress({})
console.log(`Your btc address is ${btcAddress.value}`)
const btcConnector = await btcConnect({ wallet: _wallet, network: 'testnet' })
console.log('your metaid', btcConnector.metaid)
console.log('your btc connector address', btcConnector.address)
// if (!btcConnector.hasMetaid) {
// const metaid = await btcConnector.createMetaid()
// }
// console.log('current metaid and user info', {
// metaid: btcConnector?.metaid,
// user: btcConnector?.user,
// })
const buzzEntity = await btcConnector.use('buzz')
Buzz.value = buzzEntity
// const avatarBody =
// 'iVBORw0KGgoAAAANSUhEUgAAAEMAAABKCAYAAADgxem7AAAAAXNSR0IArs4c6QAABjBJREFUeF7tnFtsFFUYx39nZra7Ld3tYqFQqoZGjRRifNAYn0jkoiCIQFsxERSECGJiolHjGxhQY0w0Eh9QjB'
// const avatarRes = await btcConnector.inscribe(
// [{ operation: 'modify', body: avatarBody, path: '/info/avatar', encoding: 'base64' }],
// 'no'
// )
// console.log('avatar res', avatarRes)
}
const connectMetaletWithMvc = async () => {
console.log('connectMetaletWithMvc')
const _wallet = await MetaletWalletForMvc.create()
wallet.value = _wallet
const mvcConnector = await mvcConnect({ wallet: _wallet, network: 'testnet' })
const handler1 = await mvcConnector.use('buzz')
Buzz.value = handler1
const handler = await mvcConnector.use('file')
File.value = handler
}
const getBtcAddress = async () => {
const address = await toRaw(wallet.value).getAddress({ blockchain: 'btc' })
console.log({ address })
// const baseEntity = await connect(toRaw(wallet.value))
// console.log('baseEntity', baseEntity)
}
const getMvcAddress = async () => {
const address = await toRaw(wallet.value).getAddress({ blockchain: 'mvc' })
console.log({ address })
// const baseEntity = await connect(toRaw(wallet.value))
// console.log('baseEntity', baseEntity)
}
const getPublicKey = async () => {
const publicKey = await toRaw(wallet.value).getPublicKey('/0/2')
console.log({ publicKey })
}
const send2k = async () => {
const toAddress = '1F7uWqyb7mJxvPKG8HzsQJWLkP8DqAdHkW'
const res = await toRaw(wallet.value).send(toAddress, 2000)
console.log({ res })
}
const createBuzzForMVC = async () => {
console.log('I wanna publish a buzz:', content.value)
// const res = await toRaw(Buzz.value).list({
// page: 1,
// limit: 5,
// address: 'mnQFdT8SC7mmvV96wvuUQ3QPt2W9gvUT64',
// })
// console.log({ res })
await toRaw(Buzz.value).create({ data: { body: content.value }, options: { network: 'testnet' } })
}
const createBuzzPictureForMVC = async () => {
let attachMetafileUri = [
'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAVxSURBVGiB5ZpPbxNHGMafd2btODgJiRz/d5MQVDUVwrWwIieHiO0X4APwJeBQJMKpJ0IQl34JxKFV1aoXEJWMAoeIf1bCAdQSIJGdbiJkSGKceNfz9oCdJsGO116btOrvZM/MO/s8s+OZ17NLaAPxeNwrpTwuhPAppXqUEB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o3Anx1bKOmWBekoFAQAkpR9DkOWmz6UG7TRARK8t6IQ3DMIORSBA20+lWxHfEBNH7hUzmpQSAQCymEbO/k+LbbUJJubSWy+UFAPi83hwDtk6DL3136YrT3GZu7p4xc23mSjVXAj7mSxcvXLxgJ54By+f15oDKBpZOp7eZKGsn2OPx7P71dJIe1DLR29vb8FQEAJgoW30gsrsDu4GXAMxGwZlM5qZlWYV8Pr/oNLepmtja2lqyLKuQyWRu2ggzK1oBHFh5EqnUl2yaX7Uq6HNALteLzPz8H9Xv+3Kg/u7uV4K54UOFo0Iwb/R3d7/aW7bvcPf169dqeHg4bykVOVj3L8DscrsfPXjwoLi38BOR2Wx2J+j37whNC6DJJ4+dgoRQbJrPnjx5sn6wruYoG4ax4Y9GywIYhINHse2AiLgsxPPFp0/f1KqvO03Wcrm8PxYrCyLfUd0JEkKVhXi++PDhUr02h87ztVwuHxgcLJIQvkZtO4DJpvms3shXaSjKMIyNkaGhdVUuDzBRV/v01Ucwb3S53Y9qzfmD2BrVbDa7MzY2lt1RqgyljtuNawGTXK4/+3t6Fg+uNvX4/7xqcJD/7MsetTjK123+Bib+qa2rskiUAAAAAElFTkSuQmCC',
]
console.log('file', 'start')
let fileTransactions = []
let finalAttachMetafileUri = []
for (const a of attachMetafileUri) {
const { transactions: txs } = await toRaw(File.value).create({
data: {
// body: Buffer.from(a, 'base64'),
body: a,
contentType: `image/jpeg;binary`,
encoding: 'base64',
flag: 'metaid',
},
options: {
network: 'testnet',
signMessage: 'upload image file',
serialAction: 'combo',
transactions: fileTransactions,
},
})
finalAttachMetafileUri.push('metafile://' + txs[txs.length - 1].txComposer.getTxId() + 'i0')
fileTransactions = txs
}
const finalBody = { content: 'Hello World image-with-png', attachments: finalAttachMetafileUri }
await toRaw(Buzz.value).create({
data: { body: JSON.stringify(finalBody) },
options: {
network: 'testnet',
signMessage: 'create buzz',
serialAction: 'finish',
transactions: fileTransactions,
},
})
console.log('attachMetafileUri', attachMetafileUri)
// await toRaw(Buzz.value).create({ content: content.value, attachments: attachMetafileUri })
}
const getBuzzList = async () => {
console.log(toRaw(Buzz.value))
const res = await toRaw(Buzz.value).list({ page: 1, limit: 5, network: 'testnet' })
console.log('buzz res', res)
buzzes.value = res
}
const likeTheFirst = async () => {
const BuzzHandler = toRaw(Buzz.value)
const { items } = await BuzzHandler.list()
const { txid } = items[0]
console.log({ item: items[0] })
const Like = await BuzzHandler.connector.use('like')
await Like.getRoot()
await Like.create({ likeTo: txid, isLike: '1' })
}
const debug = async () => {
// give me random base64 encoded image
let avatarUri =
'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAVxSURBVGiB5ZpPbxNHGMafd2btODgJiRz/d5MQVDUVwrWwIieHiO0X4APwJeBQJMKpJ0IQl34JxKFV1aoXEJWMAoeIf1bCAdQSIJGdbiJkSGKceNfz9oCdJsGO116btOrvZM/MO/s8s+OZ17NLaAPxeNwrpTwuhPAppXqUEB5m7iJAAwAGLCLaEUptCyG2lFJvy+Xy+4WFhYLTa1Orgbque94WChGhVISA48zcVF9ExAy8V0LkfF5vLp1Ob7eio2kDyWTyWAk4SczR6gg7hQGLibJu4OXjx48/NBNr24Cu69q7YvEEm+YoAFfTKu1hksu11N/d/SqdTlt2AmwZSKVSfaVSKaGI+pzps4dg3nC73Zn5+fmNRm1lowbxeDxWBs4w0bH2yGsME3VZSkWCfv+OYRiHmjjUwOnx8VEp5Skwt2WuN4kUmhbwR6PltVwuX7dRvYrT4+OjUqmvmVl0Rp8NmEkAg/5YrK6Jmgbi8XhMSnnqSMX/AwkiX2BwsFhrOn1iIJVK9ZWBM0c0bWrDTCSEb2RoaD2bze7srdo3wrqua6VSKYHOLZNOcJVKpYSu6/sGdp+Bd8Xiic+1VLaCIup7Vyye2Fu2ayCZTB6rbFKHcn32xrk7t+/e+vWX336YmjobdCpqaups8Kcff7565/bdW9dnb5xr1J5NczSZTO4u6bsGSsBJ2Jg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ucwb3S53Y9qzfmD2BrVbDa7MzY2lt1RqgyljtuNawGTXK4/+3t6Fg+uNvX4/7xqcJD/7MsetTjK123+Bib+qa2rskiUAAAAAElFTkSuQmCC'
const buffer1 = Buffer.from(avatarUri, 'base64')
const buffer2 = Buffer.from(Buffer.from(avatarUri, 'base64').toString('hex'), 'hex')
console.log(buffer1, buffer2)
}
const createMetaidForBTC = async () => {
const _wallet = await MetaletWalletForBtc.create()
const connector = await btcConnect(_wallet)
console.log({ connector })
const res = await connector.createMetaid({ name: 'ttb' }).catch((error) => console.log('error html', error))
console.log(res)
}
const createUserForMVC = async () => {
const _wallet = await MetaletWalletForMvc.create()
const mvcConnector = await mvcConnect({ wallet: _wallet, network: 'testnet' })
console.log({ mvcConnector })
let avatarUri =
'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAVxSURBVGiB5ZpPbxNHGMafd2btODgJiRz/d5MQVDUVwrWwIieHiO0X4APwJeBQJMKpJ0IQl34JxKFV1aoXEJWMAoeIf1bCAdQSIJGdbiJkSGKceNfz9oCdJsGO116btOrvZM/MO/s8s+OZ17NLaAPxeNwrpTwuhPAppXqUEB5m7iJAAwAGLCLaEUptCyG2lFJvy+Xy+4WFhYLTa1Orgbque94WChGhVISA48zcVF9ExAy8V0LkfF5vLp1Ob7eio2kDyWTyWAk4SczR6gg7hQGLibJu4OXjx48/NBNr24Cu69q7YvEEm+YoAFfTKu1hksu11N/d/SqdTlt2AmwZSKVSfaVSKaGI+pzps4dg3nC73Zn5+fmNRm1lowbxeDxWBs4w0bH2yGsME3VZSkWCfv+OYRiHmjjUwOnx8VEp5Skwt2WuN4kUmhbwR6PltVwuX7dRvYrT4+OjUqmvmVl0Rp8NmEkAg/5YrK6Jmgbi8XhMSnnqSMX/AwkiX2BwsFhrOn1iIJVK9ZWBM0c0bWrDTCSEb2RoaD2bze7srdo3wrqua6VSKYHOLZNOcJVKpYSu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ywIYhINHse2AiLgsxPPFp0/f1KqvO03Wcrm8PxYrCyLfUd0JEkKVhXi++PDhUr02h87ztVwuHxgcLJIQvkZtO4DJpvms3shXaSjKMIyNkaGhdVUuDzBRV/v01Ucwb3S53Y9qzfmD2BrVbDa7MzY2lt1RqgyljtuNawGTXK4/+3t6Fg+uNvX4/7xqcJD/7MsetTjK123+Bib+qa2rskiUAAAAAElFTkSuQmCC'
const res = await mvcConnector
.createUserInfo({
userData: { name: 'lontar', avatar: Buffer.from(avatarUri, 'base64'), bio: 'hello world' },
})
.catch((error) => console.log('error mvc create user', error))
console.log('create mvc metaid-user res', res)
}
return {
connectWallet,
connectMetaletWithBtc,
connectMetaletWithMvc,
path,
wallet,
mnemonic,
connected,
content,
createBuzzForMVC,
createBuzzPictureForMVC,
getBuzzList,
buzzes,
getMvcAddress,
getBtcAddress,
getPublicKey,
send2k,
createMetaidForBTC,
createUserForMVC,
likeTheFirst,
btcAddress,
debug,
}
},
}).mount('#app')
</script>
</body>
</html>