@net-protocol/cli 0.1.9 → 0.1.11
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/README.md +105 -0
- package/dist/cli/index.mjs +1043 -2
- package/dist/cli/index.mjs.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -841,3 +841,108 @@ The CLI handles various error scenarios:
|
|
|
841
841
|
- Storage read errors
|
|
842
842
|
|
|
843
843
|
If a transaction fails mid-upload, you can safely retry the command - it will only upload missing chunks.
|
|
844
|
+
|
|
845
|
+
#### Bazaar Command
|
|
846
|
+
|
|
847
|
+
NFT Bazaar operations — list, buy, sell, and trade NFTs via Seaport.
|
|
848
|
+
|
|
849
|
+
**Available Subcommands:**
|
|
850
|
+
|
|
851
|
+
- `bazaar list-listings` - List active NFT listings
|
|
852
|
+
- `bazaar list-offers` - List active collection offers
|
|
853
|
+
- `bazaar list-sales` - List recent sales
|
|
854
|
+
- `bazaar owned-nfts` - List NFTs owned by an address
|
|
855
|
+
- `bazaar create-listing` - Create an NFT listing
|
|
856
|
+
- `bazaar create-offer` - Create a collection offer
|
|
857
|
+
- `bazaar submit-listing` - Submit a signed listing
|
|
858
|
+
- `bazaar submit-offer` - Submit a signed offer
|
|
859
|
+
- `bazaar buy-listing` - Buy an NFT listing
|
|
860
|
+
- `bazaar accept-offer` - Accept a collection offer
|
|
861
|
+
|
|
862
|
+
##### Read Commands
|
|
863
|
+
|
|
864
|
+
```bash
|
|
865
|
+
# List active listings (--nft-address optional for cross-collection)
|
|
866
|
+
netp bazaar list-listings [--nft-address <address>] --chain-id 8453 [--json]
|
|
867
|
+
|
|
868
|
+
# List collection offers
|
|
869
|
+
netp bazaar list-offers --nft-address <address> --chain-id 8453 [--json]
|
|
870
|
+
|
|
871
|
+
# List recent sales
|
|
872
|
+
netp bazaar list-sales --nft-address <address> --chain-id 8453 [--json]
|
|
873
|
+
|
|
874
|
+
# Check NFTs owned by an address
|
|
875
|
+
netp bazaar owned-nfts --nft-address <address> --owner <address> --chain-id 8453 [--json]
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
##### Create Commands (Dual Mode)
|
|
879
|
+
|
|
880
|
+
Create commands support two modes: with `--private-key` for full flow (approve + sign + submit), or without for EIP-712 output (external signing).
|
|
881
|
+
|
|
882
|
+
```bash
|
|
883
|
+
# Full flow with private key
|
|
884
|
+
netp bazaar create-listing \
|
|
885
|
+
--nft-address <address> --token-id <id> --price <eth> \
|
|
886
|
+
--chain-id 8453 --private-key 0x...
|
|
887
|
+
|
|
888
|
+
# Keyless: outputs EIP-712 data + approval txs for external signing
|
|
889
|
+
netp bazaar create-listing \
|
|
890
|
+
--nft-address <address> --token-id <id> --price <eth> \
|
|
891
|
+
--offerer <address> --chain-id 8453
|
|
892
|
+
|
|
893
|
+
# Same pattern for offers
|
|
894
|
+
netp bazaar create-offer \
|
|
895
|
+
--nft-address <address> --price <eth> \
|
|
896
|
+
--chain-id 8453 --private-key 0x...
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
##### Submit Commands
|
|
900
|
+
|
|
901
|
+
Follow-up to keyless create commands:
|
|
902
|
+
|
|
903
|
+
```bash
|
|
904
|
+
netp bazaar submit-listing \
|
|
905
|
+
--order-data <path> --signature <sig> \
|
|
906
|
+
--chain-id 8453 [--private-key 0x... | --encode-only]
|
|
907
|
+
|
|
908
|
+
netp bazaar submit-offer \
|
|
909
|
+
--order-data <path> --signature <sig> \
|
|
910
|
+
--chain-id 8453 [--private-key 0x... | --encode-only]
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
##### Fulfillment Commands
|
|
914
|
+
|
|
915
|
+
```bash
|
|
916
|
+
# Buy a listing
|
|
917
|
+
netp bazaar buy-listing \
|
|
918
|
+
--order-hash <hash> --nft-address <address> \
|
|
919
|
+
--chain-id 8453 [--private-key 0x... | --buyer <address> --encode-only]
|
|
920
|
+
|
|
921
|
+
# Accept an offer (sell your NFT)
|
|
922
|
+
netp bazaar accept-offer \
|
|
923
|
+
--order-hash <hash> --nft-address <address> --token-id <id> \
|
|
924
|
+
--chain-id 8453 [--private-key 0x... | --seller <address> --encode-only]
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
##### Encode-Only Mode
|
|
928
|
+
|
|
929
|
+
All write commands support `--encode-only` for agent integration:
|
|
930
|
+
|
|
931
|
+
```bash
|
|
932
|
+
netp bazaar buy-listing \
|
|
933
|
+
--order-hash 0x... --nft-address 0x... \
|
|
934
|
+
--buyer 0xAgentWallet --chain-id 8453 --encode-only
|
|
935
|
+
```
|
|
936
|
+
|
|
937
|
+
Output:
|
|
938
|
+
```json
|
|
939
|
+
{
|
|
940
|
+
"approvals": [],
|
|
941
|
+
"fulfillment": {
|
|
942
|
+
"to": "0x...",
|
|
943
|
+
"data": "0x...",
|
|
944
|
+
"chainId": 8453,
|
|
945
|
+
"value": "10000000000000"
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
```
|