@btc-vision/btc-runtime 1.11.3 → 1.11.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btc-vision/btc-runtime",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.4",
|
|
4
4
|
"description": "Bitcoin L1 Smart Contract Runtime for OP_NET. Build decentralized applications on Bitcoin using AssemblyScript and WebAssembly. Fully audited.",
|
|
5
5
|
"main": "btc/index.ts",
|
|
6
6
|
"types": "btc/index.ts",
|
|
@@ -410,66 +410,6 @@ export abstract class OP721 extends ReentrancyGuard implements IOP721 {
|
|
|
410
410
|
return w;
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
@method(
|
|
414
|
-
{ name: 'owner', type: ABIDataTypes.BYTES32 },
|
|
415
|
-
{ name: 'ownerTweakedPublicKey', type: ABIDataTypes.BYTES32 },
|
|
416
|
-
{ name: 'operator', type: ABIDataTypes.ADDRESS },
|
|
417
|
-
{ name: 'tokenId', type: ABIDataTypes.UINT256 },
|
|
418
|
-
{ name: 'deadline', type: ABIDataTypes.UINT64 },
|
|
419
|
-
{ name: 'signature', type: ABIDataTypes.BYTES },
|
|
420
|
-
)
|
|
421
|
-
@emit('Approved')
|
|
422
|
-
public approveBySignature(calldata: Calldata): BytesWriter {
|
|
423
|
-
const ownerAddress = calldata.readBytesArray(ADDRESS_BYTE_LENGTH);
|
|
424
|
-
const ownerTweakedPublicKey = calldata.readBytesArray(ADDRESS_BYTE_LENGTH);
|
|
425
|
-
|
|
426
|
-
const owner = new ExtendedAddress(ownerTweakedPublicKey, ownerAddress);
|
|
427
|
-
|
|
428
|
-
const operator = calldata.readAddress();
|
|
429
|
-
const tokenId = calldata.readU256();
|
|
430
|
-
const deadline = calldata.readU64();
|
|
431
|
-
const signature = calldata.readBytesWithLength();
|
|
432
|
-
|
|
433
|
-
// Verify ownership
|
|
434
|
-
const tokenOwner = this._ownerOf(tokenId);
|
|
435
|
-
if (tokenOwner !== owner) throw new Revert('Not token owner');
|
|
436
|
-
|
|
437
|
-
this._verifyApproveSignature(owner, operator, tokenId, deadline, signature);
|
|
438
|
-
|
|
439
|
-
this._approve(operator, tokenId);
|
|
440
|
-
|
|
441
|
-
return new BytesWriter(0);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
@method(
|
|
445
|
-
{ name: 'owner', type: ABIDataTypes.BYTES32 },
|
|
446
|
-
{ name: 'ownerTweakedPublicKey', type: ABIDataTypes.BYTES32 },
|
|
447
|
-
{ name: 'operator', type: ABIDataTypes.ADDRESS },
|
|
448
|
-
{ name: 'approved', type: ABIDataTypes.BOOL },
|
|
449
|
-
{ name: 'deadline', type: ABIDataTypes.UINT64 },
|
|
450
|
-
{ name: 'signature', type: ABIDataTypes.BYTES },
|
|
451
|
-
)
|
|
452
|
-
@emit('Approved')
|
|
453
|
-
public setApprovalForAllBySignature(calldata: Calldata): BytesWriter {
|
|
454
|
-
const ownerAddress = calldata.readBytesArray(ADDRESS_BYTE_LENGTH);
|
|
455
|
-
const ownerTweakedPublicKey = calldata.readBytesArray(ADDRESS_BYTE_LENGTH);
|
|
456
|
-
|
|
457
|
-
const owner = new ExtendedAddress(ownerTweakedPublicKey, ownerAddress);
|
|
458
|
-
|
|
459
|
-
const operator = calldata.readAddress();
|
|
460
|
-
const approved = calldata.readBoolean();
|
|
461
|
-
const deadline = calldata.readU64();
|
|
462
|
-
const signature = calldata.readBytesWithLength();
|
|
463
|
-
|
|
464
|
-
if (owner === operator) throw new Revert('Cannot approve self');
|
|
465
|
-
|
|
466
|
-
this._verifySetApprovalForAllSignature(owner, operator, approved, deadline, signature);
|
|
467
|
-
|
|
468
|
-
this._setApprovalForAll(owner, operator, approved);
|
|
469
|
-
|
|
470
|
-
return new BytesWriter(0);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
413
|
@method({ name: 'tokenId', type: ABIDataTypes.UINT256 })
|
|
474
414
|
@emit('Burned')
|
|
475
415
|
public burn(calldata: Calldata): BytesWriter {
|
|
@@ -21,8 +21,6 @@ export interface IOP721 {
|
|
|
21
21
|
getApproved(calldata: Calldata): BytesWriter;
|
|
22
22
|
setApprovalForAll(calldata: Calldata): BytesWriter;
|
|
23
23
|
isApprovedForAll(calldata: Calldata): BytesWriter;
|
|
24
|
-
approveBySignature(calldata: Calldata): BytesWriter;
|
|
25
|
-
setApprovalForAllBySignature(calldata: Calldata): BytesWriter;
|
|
26
24
|
|
|
27
25
|
// Advanced functions
|
|
28
26
|
burn(calldata: Calldata): BytesWriter;
|