@fangorn-network/sdk 0.1.5 → 0.2.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/lib/cli/cli.js +83 -46
- package/lib/cli/sell.d.ts +2 -2
- package/lib/cli/sell.js +15 -9
- package/lib/cli/stage.d.ts +21 -3
- package/lib/cli/stage.js +110 -24
- package/lib/config.d.ts +327 -1
- package/lib/config.js +11 -2
- package/lib/contracts/data-registry/abi.d.ts +42 -1
- package/lib/contracts/data-registry/abi.js +47 -1
- package/lib/contracts/data-registry/index.d.ts +45 -3
- package/lib/contracts/data-registry/index.js +69 -14
- package/lib/contracts/data-registry/mmr.d.ts +9 -2
- package/lib/contracts/data-registry/mmr.js +6 -2
- package/lib/contracts/index.d.ts +2 -2
- package/lib/contracts/index.js +2 -2
- package/lib/contracts/settlement-registry/abi.d.ts +1 -1
- package/lib/contracts/settlement-registry/abi.js +1 -1
- package/lib/contracts/write.d.ts +29 -5
- package/lib/contracts/write.js +78 -12
- package/lib/crypto/encryption.js +3 -0
- package/lib/crypto/paid.d.ts +1 -1
- package/lib/crypto/paid.js +4 -1
- package/lib/engine/index.d.ts +23 -4
- package/lib/engine/index.js +49 -21
- package/lib/engine/records.d.ts +9 -1
- package/lib/engine/records.js +32 -6
- package/lib/erc8004.d.ts +1 -1
- package/lib/erc8004.js +12 -4
- package/lib/fangorn.d.ts +12 -2
- package/lib/fangorn.js +38 -17
- package/lib/feed.d.ts +23 -2
- package/lib/feed.js +43 -6
- package/lib/index.d.ts +3 -3
- package/lib/index.js +4 -4
- package/lib/providers/storage/index.js +1 -1
- package/lib/providers/storage/pinata.js +14 -6
- package/lib/providers/storage/signed-url.js +21 -8
- package/lib/providers/storage/types.d.ts +9 -1
- package/lib/providers/storage/types.js +54 -1
- package/lib/providers/storage/utils.d.ts +3 -1
- package/lib/providers/storage/utils.js +3 -3
- package/lib/test/mem-registry.d.ts +3 -3
- package/lib/test/mem-registry.js +7 -5
- package/lib/test/testbed.d.ts +5190 -5190
- package/lib/test/testbed.js +1 -1
- package/package.json +6 -3
package/lib/config.d.ts
CHANGED
|
@@ -408,6 +408,332 @@ declare const ArbitrumSepoliaConfig: {
|
|
|
408
408
|
signedUrlWorker: string;
|
|
409
409
|
keyServer: string;
|
|
410
410
|
};
|
|
411
|
+
declare const BaseConfig: {
|
|
412
|
+
dataRegistryContractAddress: "0x3206C1FBb8fD62DEDBCBdc2eDa09cDff3039Db2B";
|
|
413
|
+
fromBlock: bigint;
|
|
414
|
+
chain: {
|
|
415
|
+
blockExplorers: {
|
|
416
|
+
readonly default: {
|
|
417
|
+
readonly name: "Basescan";
|
|
418
|
+
readonly url: "https://basescan.org";
|
|
419
|
+
readonly apiUrl: "https://api.basescan.org/api";
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
blockTime: 2000;
|
|
423
|
+
contracts: {
|
|
424
|
+
readonly disputeGameFactory: {
|
|
425
|
+
readonly 1: {
|
|
426
|
+
readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
readonly l2OutputOracle: {
|
|
430
|
+
readonly 1: {
|
|
431
|
+
readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
readonly multicall3: {
|
|
435
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
436
|
+
readonly blockCreated: 5022;
|
|
437
|
+
};
|
|
438
|
+
readonly portal: {
|
|
439
|
+
readonly 1: {
|
|
440
|
+
readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
|
|
441
|
+
readonly blockCreated: 17482143;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
readonly l1StandardBridge: {
|
|
445
|
+
readonly 1: {
|
|
446
|
+
readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
|
|
447
|
+
readonly blockCreated: 17482143;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
readonly gasPriceOracle: {
|
|
451
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
452
|
+
};
|
|
453
|
+
readonly l1Block: {
|
|
454
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
455
|
+
};
|
|
456
|
+
readonly l2CrossDomainMessenger: {
|
|
457
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
458
|
+
};
|
|
459
|
+
readonly l2Erc721Bridge: {
|
|
460
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
461
|
+
};
|
|
462
|
+
readonly l2StandardBridge: {
|
|
463
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
464
|
+
};
|
|
465
|
+
readonly l2ToL1MessagePasser: {
|
|
466
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
ensTlds?: readonly string[] | undefined;
|
|
470
|
+
id: 8453;
|
|
471
|
+
name: "Base";
|
|
472
|
+
nativeCurrency: {
|
|
473
|
+
readonly name: "Ether";
|
|
474
|
+
readonly symbol: "ETH";
|
|
475
|
+
readonly decimals: 18;
|
|
476
|
+
};
|
|
477
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
478
|
+
rpcUrls: {
|
|
479
|
+
readonly default: {
|
|
480
|
+
readonly http: readonly ["https://mainnet.base.org"];
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
sourceId: 1;
|
|
484
|
+
testnet?: boolean | undefined | undefined;
|
|
485
|
+
custom?: Record<string, unknown> | undefined;
|
|
486
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
487
|
+
fees?: viem0.ChainFees<undefined> | undefined;
|
|
488
|
+
formatters: {
|
|
489
|
+
readonly block: {
|
|
490
|
+
exclude: [] | undefined;
|
|
491
|
+
format: (args: viem_chains0.OpStackRpcBlock, action?: string | undefined) => {
|
|
492
|
+
baseFeePerGas: bigint | null;
|
|
493
|
+
blobGasUsed: bigint;
|
|
494
|
+
difficulty: bigint;
|
|
495
|
+
excessBlobGas: bigint;
|
|
496
|
+
extraData: viem0.Hex;
|
|
497
|
+
gasLimit: bigint;
|
|
498
|
+
gasUsed: bigint;
|
|
499
|
+
hash: `0x${string}` | null;
|
|
500
|
+
logsBloom: `0x${string}` | null;
|
|
501
|
+
miner: viem0.Address;
|
|
502
|
+
mixHash: viem0.Hash;
|
|
503
|
+
nonce: `0x${string}` | null;
|
|
504
|
+
number: bigint | null;
|
|
505
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
506
|
+
parentHash: viem0.Hash;
|
|
507
|
+
receiptsRoot: viem0.Hex;
|
|
508
|
+
sealFields: viem0.Hex[];
|
|
509
|
+
sha3Uncles: viem0.Hash;
|
|
510
|
+
size: bigint;
|
|
511
|
+
stateRoot: viem0.Hash;
|
|
512
|
+
timestamp: bigint;
|
|
513
|
+
totalDifficulty: bigint | null;
|
|
514
|
+
transactions: `0x${string}`[] | viem_chains0.OpStackTransaction<boolean>[];
|
|
515
|
+
transactionsRoot: viem0.Hash;
|
|
516
|
+
uncles: viem0.Hash[];
|
|
517
|
+
withdrawals?: viem0.Withdrawal[] | undefined | undefined;
|
|
518
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
519
|
+
} & {};
|
|
520
|
+
type: "block";
|
|
521
|
+
};
|
|
522
|
+
readonly transaction: {
|
|
523
|
+
exclude: [] | undefined;
|
|
524
|
+
format: (args: viem_chains0.OpStackRpcTransaction, action?: string | undefined) => ({
|
|
525
|
+
blockHash: `0x${string}` | null;
|
|
526
|
+
blockNumber: bigint | null;
|
|
527
|
+
from: viem0.Address;
|
|
528
|
+
gas: bigint;
|
|
529
|
+
hash: viem0.Hash;
|
|
530
|
+
input: viem0.Hex;
|
|
531
|
+
nonce: number;
|
|
532
|
+
r: viem0.Hex;
|
|
533
|
+
s: viem0.Hex;
|
|
534
|
+
to: viem0.Address | null;
|
|
535
|
+
transactionIndex: number | null;
|
|
536
|
+
typeHex: viem0.Hex | null;
|
|
537
|
+
v: bigint;
|
|
538
|
+
value: bigint;
|
|
539
|
+
yParity: number;
|
|
540
|
+
gasPrice?: undefined | undefined;
|
|
541
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
542
|
+
maxFeePerGas: bigint;
|
|
543
|
+
maxPriorityFeePerGas: bigint;
|
|
544
|
+
isSystemTx?: boolean;
|
|
545
|
+
mint?: bigint | undefined | undefined;
|
|
546
|
+
sourceHash: viem0.Hex;
|
|
547
|
+
type: "deposit";
|
|
548
|
+
} | {
|
|
549
|
+
r: viem0.Hex;
|
|
550
|
+
s: viem0.Hex;
|
|
551
|
+
v: bigint;
|
|
552
|
+
to: viem0.Address | null;
|
|
553
|
+
from: viem0.Address;
|
|
554
|
+
gas: bigint;
|
|
555
|
+
nonce: number;
|
|
556
|
+
value: bigint;
|
|
557
|
+
blockHash: `0x${string}` | null;
|
|
558
|
+
blockNumber: bigint | null;
|
|
559
|
+
hash: viem0.Hash;
|
|
560
|
+
input: viem0.Hex;
|
|
561
|
+
transactionIndex: number | null;
|
|
562
|
+
typeHex: viem0.Hex | null;
|
|
563
|
+
accessList?: undefined | undefined;
|
|
564
|
+
authorizationList?: undefined | undefined;
|
|
565
|
+
blobVersionedHashes?: undefined | undefined;
|
|
566
|
+
chainId?: number | undefined;
|
|
567
|
+
yParity?: undefined | undefined;
|
|
568
|
+
type: "legacy";
|
|
569
|
+
gasPrice: bigint;
|
|
570
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
571
|
+
maxFeePerGas?: undefined | undefined;
|
|
572
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
573
|
+
isSystemTx?: undefined | undefined;
|
|
574
|
+
mint?: undefined | undefined;
|
|
575
|
+
sourceHash?: undefined | undefined;
|
|
576
|
+
} | {
|
|
577
|
+
blockHash: `0x${string}` | null;
|
|
578
|
+
blockNumber: bigint | null;
|
|
579
|
+
from: viem0.Address;
|
|
580
|
+
gas: bigint;
|
|
581
|
+
hash: viem0.Hash;
|
|
582
|
+
input: viem0.Hex;
|
|
583
|
+
nonce: number;
|
|
584
|
+
r: viem0.Hex;
|
|
585
|
+
s: viem0.Hex;
|
|
586
|
+
to: viem0.Address | null;
|
|
587
|
+
transactionIndex: number | null;
|
|
588
|
+
typeHex: viem0.Hex | null;
|
|
589
|
+
v: bigint;
|
|
590
|
+
value: bigint;
|
|
591
|
+
yParity: number;
|
|
592
|
+
accessList: viem0.AccessList;
|
|
593
|
+
authorizationList?: undefined | undefined;
|
|
594
|
+
blobVersionedHashes?: undefined | undefined;
|
|
595
|
+
chainId: number;
|
|
596
|
+
type: "eip2930";
|
|
597
|
+
gasPrice: bigint;
|
|
598
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
599
|
+
maxFeePerGas?: undefined | undefined;
|
|
600
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
601
|
+
isSystemTx?: undefined | undefined;
|
|
602
|
+
mint?: undefined | undefined;
|
|
603
|
+
sourceHash?: undefined | undefined;
|
|
604
|
+
} | {
|
|
605
|
+
blockHash: `0x${string}` | null;
|
|
606
|
+
blockNumber: bigint | null;
|
|
607
|
+
from: viem0.Address;
|
|
608
|
+
gas: bigint;
|
|
609
|
+
hash: viem0.Hash;
|
|
610
|
+
input: viem0.Hex;
|
|
611
|
+
nonce: number;
|
|
612
|
+
r: viem0.Hex;
|
|
613
|
+
s: viem0.Hex;
|
|
614
|
+
to: viem0.Address | null;
|
|
615
|
+
transactionIndex: number | null;
|
|
616
|
+
typeHex: viem0.Hex | null;
|
|
617
|
+
v: bigint;
|
|
618
|
+
value: bigint;
|
|
619
|
+
yParity: number;
|
|
620
|
+
accessList: viem0.AccessList;
|
|
621
|
+
authorizationList?: undefined | undefined;
|
|
622
|
+
blobVersionedHashes?: undefined | undefined;
|
|
623
|
+
chainId: number;
|
|
624
|
+
type: "eip1559";
|
|
625
|
+
gasPrice?: undefined | undefined;
|
|
626
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
627
|
+
maxFeePerGas: bigint;
|
|
628
|
+
maxPriorityFeePerGas: bigint;
|
|
629
|
+
isSystemTx?: undefined | undefined;
|
|
630
|
+
mint?: undefined | undefined;
|
|
631
|
+
sourceHash?: undefined | undefined;
|
|
632
|
+
} | {
|
|
633
|
+
blockHash: `0x${string}` | null;
|
|
634
|
+
blockNumber: bigint | null;
|
|
635
|
+
from: viem0.Address;
|
|
636
|
+
gas: bigint;
|
|
637
|
+
hash: viem0.Hash;
|
|
638
|
+
input: viem0.Hex;
|
|
639
|
+
nonce: number;
|
|
640
|
+
r: viem0.Hex;
|
|
641
|
+
s: viem0.Hex;
|
|
642
|
+
to: viem0.Address | null;
|
|
643
|
+
transactionIndex: number | null;
|
|
644
|
+
typeHex: viem0.Hex | null;
|
|
645
|
+
v: bigint;
|
|
646
|
+
value: bigint;
|
|
647
|
+
yParity: number;
|
|
648
|
+
accessList: viem0.AccessList;
|
|
649
|
+
authorizationList?: undefined | undefined;
|
|
650
|
+
blobVersionedHashes: readonly viem0.Hex[];
|
|
651
|
+
chainId: number;
|
|
652
|
+
type: "eip4844";
|
|
653
|
+
gasPrice?: undefined | undefined;
|
|
654
|
+
maxFeePerBlobGas: bigint;
|
|
655
|
+
maxFeePerGas: bigint;
|
|
656
|
+
maxPriorityFeePerGas: bigint;
|
|
657
|
+
isSystemTx?: undefined | undefined;
|
|
658
|
+
mint?: undefined | undefined;
|
|
659
|
+
sourceHash?: undefined | undefined;
|
|
660
|
+
} | {
|
|
661
|
+
blockHash: `0x${string}` | null;
|
|
662
|
+
blockNumber: bigint | null;
|
|
663
|
+
from: viem0.Address;
|
|
664
|
+
gas: bigint;
|
|
665
|
+
hash: viem0.Hash;
|
|
666
|
+
input: viem0.Hex;
|
|
667
|
+
nonce: number;
|
|
668
|
+
r: viem0.Hex;
|
|
669
|
+
s: viem0.Hex;
|
|
670
|
+
to: viem0.Address | null;
|
|
671
|
+
transactionIndex: number | null;
|
|
672
|
+
typeHex: viem0.Hex | null;
|
|
673
|
+
v: bigint;
|
|
674
|
+
value: bigint;
|
|
675
|
+
yParity: number;
|
|
676
|
+
accessList: viem0.AccessList;
|
|
677
|
+
authorizationList: viem0.SignedAuthorizationList;
|
|
678
|
+
blobVersionedHashes?: undefined | undefined;
|
|
679
|
+
chainId: number;
|
|
680
|
+
type: "eip7702";
|
|
681
|
+
gasPrice?: undefined | undefined;
|
|
682
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
683
|
+
maxFeePerGas: bigint;
|
|
684
|
+
maxPriorityFeePerGas: bigint;
|
|
685
|
+
isSystemTx?: undefined | undefined;
|
|
686
|
+
mint?: undefined | undefined;
|
|
687
|
+
sourceHash?: undefined | undefined;
|
|
688
|
+
}) & {};
|
|
689
|
+
type: "transaction";
|
|
690
|
+
};
|
|
691
|
+
readonly transactionReceipt: {
|
|
692
|
+
exclude: [] | undefined;
|
|
693
|
+
format: (args: viem_chains0.OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
694
|
+
blobGasPrice?: bigint | undefined;
|
|
695
|
+
blobGasUsed?: bigint | undefined;
|
|
696
|
+
blockHash: viem0.Hash;
|
|
697
|
+
blockNumber: bigint;
|
|
698
|
+
blockTimestamp?: bigint | undefined;
|
|
699
|
+
contractAddress: viem0.Address | null | undefined;
|
|
700
|
+
cumulativeGasUsed: bigint;
|
|
701
|
+
effectiveGasPrice: bigint;
|
|
702
|
+
from: viem0.Address;
|
|
703
|
+
gasUsed: bigint;
|
|
704
|
+
logs: viem0.Log<bigint, number, false>[];
|
|
705
|
+
logsBloom: viem0.Hex;
|
|
706
|
+
root?: `0x${string}` | undefined;
|
|
707
|
+
status: "success" | "reverted";
|
|
708
|
+
to: viem0.Address | null;
|
|
709
|
+
transactionHash: viem0.Hash;
|
|
710
|
+
transactionIndex: number;
|
|
711
|
+
type: viem0.TransactionType;
|
|
712
|
+
l1GasPrice: bigint | null;
|
|
713
|
+
l1GasUsed: bigint | null;
|
|
714
|
+
l1Fee: bigint | null;
|
|
715
|
+
l1FeeScalar: number | null;
|
|
716
|
+
} & {};
|
|
717
|
+
type: "transactionReceipt";
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
prepareTransactionRequest?: ((args: viem0.PrepareTransactionRequestParameters, options: {
|
|
721
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
722
|
+
}) => Promise<viem0.PrepareTransactionRequestParameters>) | [fn: ((args: viem0.PrepareTransactionRequestParameters, options: {
|
|
723
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
724
|
+
}) => Promise<viem0.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
725
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
726
|
+
}] | undefined;
|
|
727
|
+
serializers: {
|
|
728
|
+
readonly transaction: typeof viem_chains0.serializeTransactionOpStack;
|
|
729
|
+
};
|
|
730
|
+
verifyHash?: ((client: viem0.Client, parameters: viem0.VerifyHashActionParameters) => Promise<viem0.VerifyHashActionReturnType>) | undefined;
|
|
731
|
+
};
|
|
732
|
+
rpcUrl: string;
|
|
733
|
+
caip2: number;
|
|
734
|
+
ipfsGateway: string;
|
|
735
|
+
logWindow: bigint;
|
|
736
|
+
};
|
|
411
737
|
/**
|
|
412
738
|
* The default network: what `Fangorn.create` uses without a `config`, and the CLI
|
|
413
739
|
* without `CHAIN_NAME`. Base Sepolia; Arbitrum Sepolia runs the same contracts.
|
|
@@ -752,4 +1078,4 @@ declare const SupportedNetworks: Record<string, NetworkConfig>;
|
|
|
752
1078
|
*/
|
|
753
1079
|
declare function getNetwork(name: string): NetworkConfig;
|
|
754
1080
|
//#endregion
|
|
755
|
-
export { ArbitrumSepoliaConfig, BaseSepoliaConfig, FangornConfig, NetworkConfig, SupportedNetworks, getNetwork as default, nonBlank };
|
|
1081
|
+
export { ArbitrumSepoliaConfig, BaseConfig, BaseSepoliaConfig, FangornConfig, NetworkConfig, SupportedNetworks, getNetwork as default, nonBlank };
|
package/lib/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { arbitrumSepolia, baseSepolia } from "viem/chains";
|
|
1
|
+
import { arbitrumSepolia, base, baseSepolia } from "viem/chains";
|
|
2
2
|
|
|
3
3
|
//#region src/config.ts
|
|
4
4
|
/**
|
|
@@ -34,6 +34,15 @@ const ArbitrumSepoliaConfig = {
|
|
|
34
34
|
signedUrlWorker: "https://arbitrum-sepolia.storage-worker.fangorn.network",
|
|
35
35
|
keyServer: "https://arbitrum-sepolia.keys-test.fangorn.network"
|
|
36
36
|
};
|
|
37
|
+
const BaseConfig = {
|
|
38
|
+
dataRegistryContractAddress: "0x3206C1FBb8fD62DEDBCBdc2eDa09cDff3039Db2B",
|
|
39
|
+
fromBlock: 59598762n,
|
|
40
|
+
chain: base,
|
|
41
|
+
rpcUrl: "https://base-rpc.publicnode.com",
|
|
42
|
+
caip2: 8453,
|
|
43
|
+
ipfsGateway: "https://ipfs-test.fangorn.network",
|
|
44
|
+
logWindow: 50000n
|
|
45
|
+
};
|
|
37
46
|
/**
|
|
38
47
|
* The default network: what `Fangorn.create` uses without a `config`, and the CLI
|
|
39
48
|
* without `CHAIN_NAME`. Base Sepolia; Arbitrum Sepolia runs the same contracts.
|
|
@@ -57,4 +66,4 @@ function getNetwork(name) {
|
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
//#endregion
|
|
60
|
-
export { ArbitrumSepoliaConfig, BaseSepoliaConfig, FangornConfig, SupportedNetworks, getNetwork as default, nonBlank };
|
|
69
|
+
export { ArbitrumSepoliaConfig, BaseConfig, BaseSepoliaConfig, FangornConfig, SupportedNetworks, getNetwork as default, nonBlank };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/contracts/data-registry/abi.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Generated from `forge inspect DataRegistry abi` in fangorn-network/contracts
|
|
4
|
-
* (
|
|
4
|
+
* (src/DataRegistry.sol). Regenerate with scripts/gen-abis.sh, do not edit.
|
|
5
5
|
*/
|
|
6
6
|
declare const DATA_REGISTRY_ABI: readonly [{
|
|
7
7
|
readonly type: "constructor";
|
|
@@ -47,6 +47,12 @@ declare const DATA_REGISTRY_ABI: readonly [{
|
|
|
47
47
|
readonly internalType: "uint64";
|
|
48
48
|
}];
|
|
49
49
|
readonly stateMutability: "view";
|
|
50
|
+
}, {
|
|
51
|
+
readonly type: "function";
|
|
52
|
+
readonly name: "acceptAdmin";
|
|
53
|
+
readonly inputs: readonly [];
|
|
54
|
+
readonly outputs: readonly [];
|
|
55
|
+
readonly stateMutability: "nonpayable";
|
|
50
56
|
}, {
|
|
51
57
|
readonly type: "function";
|
|
52
58
|
readonly name: "admin";
|
|
@@ -177,6 +183,16 @@ declare const DATA_REGISTRY_ABI: readonly [{
|
|
|
177
183
|
readonly internalType: "bytes32";
|
|
178
184
|
}];
|
|
179
185
|
readonly stateMutability: "view";
|
|
186
|
+
}, {
|
|
187
|
+
readonly type: "function";
|
|
188
|
+
readonly name: "pendingAdmin";
|
|
189
|
+
readonly inputs: readonly [];
|
|
190
|
+
readonly outputs: readonly [{
|
|
191
|
+
readonly name: "";
|
|
192
|
+
readonly type: "address";
|
|
193
|
+
readonly internalType: "address";
|
|
194
|
+
}];
|
|
195
|
+
readonly stateMutability: "view";
|
|
180
196
|
}, {
|
|
181
197
|
readonly type: "function";
|
|
182
198
|
readonly name: "proxiableUUID";
|
|
@@ -334,6 +350,21 @@ declare const DATA_REGISTRY_ABI: readonly [{
|
|
|
334
350
|
readonly internalType: "address";
|
|
335
351
|
}];
|
|
336
352
|
readonly anonymous: false;
|
|
353
|
+
}, {
|
|
354
|
+
readonly type: "event";
|
|
355
|
+
readonly name: "AdminProposed";
|
|
356
|
+
readonly inputs: readonly [{
|
|
357
|
+
readonly name: "admin";
|
|
358
|
+
readonly type: "address";
|
|
359
|
+
readonly indexed: false;
|
|
360
|
+
readonly internalType: "address";
|
|
361
|
+
}, {
|
|
362
|
+
readonly name: "pending_admin";
|
|
363
|
+
readonly type: "address";
|
|
364
|
+
readonly indexed: false;
|
|
365
|
+
readonly internalType: "address";
|
|
366
|
+
}];
|
|
367
|
+
readonly anonymous: false;
|
|
337
368
|
}, {
|
|
338
369
|
readonly type: "event";
|
|
339
370
|
readonly name: "Initialized";
|
|
@@ -377,6 +408,16 @@ declare const DATA_REGISTRY_ABI: readonly [{
|
|
|
377
408
|
readonly type: "bytes32";
|
|
378
409
|
readonly indexed: false;
|
|
379
410
|
readonly internalType: "bytes32";
|
|
411
|
+
}, {
|
|
412
|
+
readonly name: "index";
|
|
413
|
+
readonly type: "uint64";
|
|
414
|
+
readonly indexed: false;
|
|
415
|
+
readonly internalType: "uint64";
|
|
416
|
+
}, {
|
|
417
|
+
readonly name: "timestamp";
|
|
418
|
+
readonly type: "uint64";
|
|
419
|
+
readonly indexed: false;
|
|
420
|
+
readonly internalType: "uint64";
|
|
380
421
|
}];
|
|
381
422
|
readonly anonymous: false;
|
|
382
423
|
}, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/contracts/data-registry/abi.ts
|
|
2
2
|
/**
|
|
3
3
|
* Generated from `forge inspect DataRegistry abi` in fangorn-network/contracts
|
|
4
|
-
* (
|
|
4
|
+
* (src/DataRegistry.sol). Regenerate with scripts/gen-abis.sh, do not edit.
|
|
5
5
|
*/
|
|
6
6
|
const DATA_REGISTRY_ABI = [
|
|
7
7
|
{
|
|
@@ -53,6 +53,13 @@ const DATA_REGISTRY_ABI = [
|
|
|
53
53
|
}],
|
|
54
54
|
stateMutability: "view"
|
|
55
55
|
},
|
|
56
|
+
{
|
|
57
|
+
type: "function",
|
|
58
|
+
name: "acceptAdmin",
|
|
59
|
+
inputs: [],
|
|
60
|
+
outputs: [],
|
|
61
|
+
stateMutability: "nonpayable"
|
|
62
|
+
},
|
|
56
63
|
{
|
|
57
64
|
type: "function",
|
|
58
65
|
name: "admin",
|
|
@@ -199,6 +206,17 @@ const DATA_REGISTRY_ABI = [
|
|
|
199
206
|
}],
|
|
200
207
|
stateMutability: "view"
|
|
201
208
|
},
|
|
209
|
+
{
|
|
210
|
+
type: "function",
|
|
211
|
+
name: "pendingAdmin",
|
|
212
|
+
inputs: [],
|
|
213
|
+
outputs: [{
|
|
214
|
+
name: "",
|
|
215
|
+
type: "address",
|
|
216
|
+
internalType: "address"
|
|
217
|
+
}],
|
|
218
|
+
stateMutability: "view"
|
|
219
|
+
},
|
|
202
220
|
{
|
|
203
221
|
type: "function",
|
|
204
222
|
name: "proxiableUUID",
|
|
@@ -380,6 +398,22 @@ const DATA_REGISTRY_ABI = [
|
|
|
380
398
|
}],
|
|
381
399
|
anonymous: false
|
|
382
400
|
},
|
|
401
|
+
{
|
|
402
|
+
type: "event",
|
|
403
|
+
name: "AdminProposed",
|
|
404
|
+
inputs: [{
|
|
405
|
+
name: "admin",
|
|
406
|
+
type: "address",
|
|
407
|
+
indexed: false,
|
|
408
|
+
internalType: "address"
|
|
409
|
+
}, {
|
|
410
|
+
name: "pending_admin",
|
|
411
|
+
type: "address",
|
|
412
|
+
indexed: false,
|
|
413
|
+
internalType: "address"
|
|
414
|
+
}],
|
|
415
|
+
anonymous: false
|
|
416
|
+
},
|
|
383
417
|
{
|
|
384
418
|
type: "event",
|
|
385
419
|
name: "Initialized",
|
|
@@ -430,6 +464,18 @@ const DATA_REGISTRY_ABI = [
|
|
|
430
464
|
type: "bytes32",
|
|
431
465
|
indexed: false,
|
|
432
466
|
internalType: "bytes32"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
name: "index",
|
|
470
|
+
type: "uint64",
|
|
471
|
+
indexed: false,
|
|
472
|
+
internalType: "uint64"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
name: "timestamp",
|
|
476
|
+
type: "uint64",
|
|
477
|
+
indexed: false,
|
|
478
|
+
internalType: "uint64"
|
|
433
479
|
}
|
|
434
480
|
],
|
|
435
481
|
anonymous: false
|
|
@@ -74,8 +74,12 @@ interface UpdateEntry {
|
|
|
74
74
|
t: bigint;
|
|
75
75
|
/** That block's timestamp: the `t` of the paper's entry, and what the contract's log leaf hashes. */
|
|
76
76
|
timestamp: bigint;
|
|
77
|
+
/** The entry's position in the whole log (every repo), from 0. Absent on pre-upgrade (V0) logs. */
|
|
78
|
+
index?: bigint;
|
|
77
79
|
/** Unique per entry, for de-duplication across catch-up and live. */
|
|
78
80
|
id: string;
|
|
81
|
+
/** The event's indexed repo id, where the entry came from one (the contract hashes the raw name). */
|
|
82
|
+
repoId?: Hex;
|
|
79
83
|
}
|
|
80
84
|
/** A slice of the update log: every repo, one publisher's, one repo name across publishers, or one repo. */
|
|
81
85
|
interface LogFilter {
|
|
@@ -137,13 +141,51 @@ declare class ChainRegistry implements Registry {
|
|
|
137
141
|
signUpdate(u: CommitUpdate): Promise<Hex>;
|
|
138
142
|
updateBySig(publisher: Address, u: CommitUpdate, signature: Hex): Promise<Hash>;
|
|
139
143
|
private write;
|
|
140
|
-
/** U's `Updated` events, narrowed on-chain by publisher and repo. */
|
|
144
|
+
/** U's `Updated` events of one version, narrowed on-chain by publisher and repo. */
|
|
141
145
|
private source;
|
|
142
146
|
log(filter: LogFilter, from: bigint, to?: bigint): Promise<UpdateEntry[]>;
|
|
143
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Old-version logs don't carry their block's timestamp: one block read per
|
|
149
|
+
* distinct block. New-version logs carry it.
|
|
150
|
+
*/
|
|
144
151
|
private withTimestamps;
|
|
145
152
|
watch(filter: LogFilter, onEntry: (entry: UpdateEntry) => void, onError?: (err: Error) => void, pollingInterval?: number): () => void;
|
|
146
153
|
clock(): Promise<bigint>;
|
|
147
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* `Updated` as the contract emitted it before it gained `index` and `timestamp`
|
|
157
|
+
* (contracts 0f178bb). The proxy is upgraded in place, so the log before the
|
|
158
|
+
* upgrade has this topic.
|
|
159
|
+
*/
|
|
160
|
+
declare const UPDATED_V0: {
|
|
161
|
+
readonly type: "event";
|
|
162
|
+
readonly name: "Updated";
|
|
163
|
+
readonly anonymous: false;
|
|
164
|
+
readonly inputs: readonly [{
|
|
165
|
+
readonly name: "publisher";
|
|
166
|
+
readonly type: "address";
|
|
167
|
+
readonly indexed: true;
|
|
168
|
+
}, {
|
|
169
|
+
readonly name: "repo_id";
|
|
170
|
+
readonly type: "bytes32";
|
|
171
|
+
readonly indexed: true;
|
|
172
|
+
}, {
|
|
173
|
+
readonly name: "repo";
|
|
174
|
+
readonly type: "string";
|
|
175
|
+
readonly indexed: false;
|
|
176
|
+
}, {
|
|
177
|
+
readonly name: "pos";
|
|
178
|
+
readonly type: "uint64";
|
|
179
|
+
readonly indexed: false;
|
|
180
|
+
}, {
|
|
181
|
+
readonly name: "parent";
|
|
182
|
+
readonly type: "bytes32";
|
|
183
|
+
readonly indexed: false;
|
|
184
|
+
}, {
|
|
185
|
+
readonly name: "head";
|
|
186
|
+
readonly type: "bytes32";
|
|
187
|
+
readonly indexed: false;
|
|
188
|
+
}];
|
|
189
|
+
};
|
|
148
190
|
//#endregion
|
|
149
|
-
export { ChainRegistry, ChainRegistryConfig, CommitUpdate, EPOCH_SECONDS, LogFilter, Registry, RepoRef, UPDATE_TYPES, UpdateEntry, WINDOW, ZERO_HEAD, dataDomain, epochOf, repoId, updateMessage };
|
|
191
|
+
export { ChainRegistry, ChainRegistryConfig, CommitUpdate, EPOCH_SECONDS, LogFilter, Registry, RepoRef, UPDATED_V0, UPDATE_TYPES, UpdateEntry, WINDOW, ZERO_HEAD, dataDomain, epochOf, repoId, updateMessage };
|