@chipi-stack/backend 14.6.0 → 14.8.0
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/dist/index.d.mts +185 -2
- package/dist/index.d.ts +185 -2
- package/dist/index.js +142 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +141 -19
- package/dist/index.mjs.map +1 -1
- package/dist/skuPurchases.js +15 -8
- package/dist/skuPurchases.js.map +1 -1
- package/dist/skuPurchases.mjs +15 -8
- package/dist/skuPurchases.mjs.map +1 -1
- package/dist/transactions.js +15 -8
- package/dist/transactions.js.map +1 -1
- package/dist/transactions.mjs +15 -8
- package/dist/transactions.mjs.map +1 -1
- package/dist/wallets.js +41 -15
- package/dist/wallets.js.map +1 -1
- package/dist/wallets.mjs +41 -15
- package/dist/wallets.mjs.map +1 -1
- package/package.json +5 -5
package/dist/skuPurchases.mjs
CHANGED
|
@@ -240,21 +240,28 @@ async function buildEd25519Envelope(params) {
|
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
const ed = await import('@noble/ed25519');
|
|
243
|
-
const garaga = await ensureGaragaInit();
|
|
244
243
|
const publicKey = await ed.getPublicKeyAsync(params.privateKey);
|
|
245
244
|
const signedBytes = ed25519SignedBytes(params.messageHash);
|
|
246
245
|
const signature = await ed.signAsync(signedBytes, params.privateKey);
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
bytesToLeBigInt(s),
|
|
252
|
-
bytesToLeBigInt(publicKey),
|
|
246
|
+
return assembleEd25519Envelope({
|
|
247
|
+
R: signature.slice(0, 32),
|
|
248
|
+
s: signature.slice(32, 64),
|
|
249
|
+
publicKey,
|
|
253
250
|
signedBytes,
|
|
251
|
+
ownerIndex
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
async function assembleEd25519Envelope(parts) {
|
|
255
|
+
const garaga = await ensureGaragaInit();
|
|
256
|
+
const payload = garaga.eddsaCalldataBuilder(
|
|
257
|
+
bytesToLeBigInt(parts.R),
|
|
258
|
+
bytesToLeBigInt(parts.s),
|
|
259
|
+
bytesToLeBigInt(parts.publicKey),
|
|
260
|
+
parts.signedBytes,
|
|
254
261
|
false
|
|
255
262
|
);
|
|
256
263
|
return wrapV2Snip12Envelope({
|
|
257
|
-
ownerId: ownerIndex,
|
|
264
|
+
ownerId: parts.ownerIndex,
|
|
258
265
|
kindTag: ED25519_KIND_TAG,
|
|
259
266
|
payload
|
|
260
267
|
});
|