@story-protocol/core-sdk 0.1.0-alpha-rc.3 → 0.1.0-alpha-rc.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.
Files changed (30) hide show
  1. package/dist/declarations/src/enums/ActionType.d.ts +5 -5
  2. package/dist/declarations/src/enums/ActionType.d.ts.map +1 -1
  3. package/dist/declarations/src/enums/HookType.d.ts +2 -2
  4. package/dist/declarations/src/enums/HookType.d.ts.map +1 -1
  5. package/dist/declarations/src/enums/Relatables.d.ts +9 -0
  6. package/dist/declarations/src/enums/Relatables.d.ts.map +1 -0
  7. package/dist/declarations/src/enums/ResourceType.d.ts +9 -9
  8. package/dist/declarations/src/enums/ResourceType.d.ts.map +1 -1
  9. package/dist/declarations/src/index.d.ts +3 -2
  10. package/dist/declarations/src/index.d.ts.map +1 -1
  11. package/dist/declarations/src/resources/relationshipReadOnly.d.ts.map +1 -1
  12. package/dist/declarations/src/types/common.d.ts +6 -0
  13. package/dist/declarations/src/types/common.d.ts.map +1 -0
  14. package/dist/declarations/src/types/resources/IPOrg.d.ts +1 -1
  15. package/dist/declarations/src/types/resources/IPOrg.d.ts.map +1 -1
  16. package/dist/declarations/src/types/resources/hook.d.ts +2 -1
  17. package/dist/declarations/src/types/resources/hook.d.ts.map +1 -1
  18. package/dist/declarations/src/types/resources/ipAsset.d.ts +9 -4
  19. package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
  20. package/dist/declarations/src/types/resources/relationship.d.ts +4 -100
  21. package/dist/declarations/src/types/resources/relationship.d.ts.map +1 -1
  22. package/dist/declarations/src/types/resources/relationshipType.d.ts +10 -5
  23. package/dist/declarations/src/types/resources/relationshipType.d.ts.map +1 -1
  24. package/dist/declarations/src/utils/platform.d.ts.map +1 -1
  25. package/dist/story-protocol-core-sdk.cjs.dev.js +943 -81
  26. package/dist/story-protocol-core-sdk.cjs.prod.js +943 -81
  27. package/dist/story-protocol-core-sdk.esm.js +944 -82
  28. package/package.json +1 -1
  29. package/dist/declarations/src/enums/IPAssetType.d.ts +0 -11
  30. package/dist/declarations/src/enums/IPAssetType.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { isAddress, parseAbi, getAddress, decodeEventLog, toHex, http, createPublicClient, createWalletClient } from 'viem';
2
+ import { isAddress, parseAbi, getAddress, decodeEventLog, encodeAbiParameters, parseAbiParameters, toHex, http, createPublicClient, createWalletClient } from 'viem';
3
3
  import { sepolia } from 'viem/chains';
4
4
  import * as dotenv from 'dotenv';
5
5
  import { formatAbi } from 'abitype';
@@ -1173,6 +1173,878 @@ var storyProtocolJson = [
1173
1173
  ],
1174
1174
  stateMutability: "nonpayable",
1175
1175
  type: "function"
1176
+ },
1177
+ {
1178
+ inputs: [
1179
+ {
1180
+ internalType: "uint8",
1181
+ name: "hookType",
1182
+ type: "uint8"
1183
+ }
1184
+ ],
1185
+ name: "BaseModule_HooksParamsLengthMismatch",
1186
+ type: "error"
1187
+ },
1188
+ {
1189
+ inputs: [
1190
+ ],
1191
+ name: "BaseModule_OnlyModuleRegistry",
1192
+ type: "error"
1193
+ },
1194
+ {
1195
+ inputs: [
1196
+ ],
1197
+ name: "BaseModule_ZeroIpaRegistry",
1198
+ type: "error"
1199
+ },
1200
+ {
1201
+ inputs: [
1202
+ ],
1203
+ name: "BaseModule_ZeroLicenseRegistry",
1204
+ type: "error"
1205
+ },
1206
+ {
1207
+ inputs: [
1208
+ ],
1209
+ name: "BaseModule_ZeroModuleRegistry",
1210
+ type: "error"
1211
+ },
1212
+ {
1213
+ inputs: [
1214
+ ],
1215
+ name: "BaseRelationshipProcessor_OnlyRelationshipModule",
1216
+ type: "error"
1217
+ },
1218
+ {
1219
+ inputs: [
1220
+ ],
1221
+ name: "CollectModule_CallerUnauthorized",
1222
+ type: "error"
1223
+ },
1224
+ {
1225
+ inputs: [
1226
+ ],
1227
+ name: "CollectModule_CollectNotYetInitialized",
1228
+ type: "error"
1229
+ },
1230
+ {
1231
+ inputs: [
1232
+ ],
1233
+ name: "CollectModule_CollectUnauthorized",
1234
+ type: "error"
1235
+ },
1236
+ {
1237
+ inputs: [
1238
+ ],
1239
+ name: "CollectModule_IPAssetAlreadyInitialized",
1240
+ type: "error"
1241
+ },
1242
+ {
1243
+ inputs: [
1244
+ ],
1245
+ name: "CollectModule_IPAssetNonExistent",
1246
+ type: "error"
1247
+ },
1248
+ {
1249
+ inputs: [
1250
+ ],
1251
+ name: "CollectModule_IPOrgNonExistent",
1252
+ type: "error"
1253
+ },
1254
+ {
1255
+ inputs: [
1256
+ ],
1257
+ name: "CollectNFT_AlreadyInitialized",
1258
+ type: "error"
1259
+ },
1260
+ {
1261
+ inputs: [
1262
+ ],
1263
+ name: "CollectNFT_CallerUnauthorized",
1264
+ type: "error"
1265
+ },
1266
+ {
1267
+ inputs: [
1268
+ ],
1269
+ name: "CollectNFT_CollectorInvalid",
1270
+ type: "error"
1271
+ },
1272
+ {
1273
+ inputs: [
1274
+ ],
1275
+ name: "CollectNFT_IPAssetNonExistent",
1276
+ type: "error"
1277
+ },
1278
+ {
1279
+ inputs: [
1280
+ ],
1281
+ name: "CollectPaymentModule_AmountInvalid",
1282
+ type: "error"
1283
+ },
1284
+ {
1285
+ inputs: [
1286
+ ],
1287
+ name: "CollectPaymentModule_ERC20TransferFailed",
1288
+ type: "error"
1289
+ },
1290
+ {
1291
+ inputs: [
1292
+ ],
1293
+ name: "CollectPaymentModule_ERC20TransferInvalidABIEncoding",
1294
+ type: "error"
1295
+ },
1296
+ {
1297
+ inputs: [
1298
+ ],
1299
+ name: "CollectPaymentModule_ERC20TransferInvalidReturnValue",
1300
+ type: "error"
1301
+ },
1302
+ {
1303
+ inputs: [
1304
+ ],
1305
+ name: "CollectPaymentModule_InvalidSettings",
1306
+ type: "error"
1307
+ },
1308
+ {
1309
+ inputs: [
1310
+ ],
1311
+ name: "CollectPaymentModule_NativeTokenNotAllowed",
1312
+ type: "error"
1313
+ },
1314
+ {
1315
+ inputs: [
1316
+ ],
1317
+ name: "CollectPaymentModule_NativeTransferFailed",
1318
+ type: "error"
1319
+ },
1320
+ {
1321
+ inputs: [
1322
+ ],
1323
+ name: "CollectPaymentModule_PaymentInsufficient",
1324
+ type: "error"
1325
+ },
1326
+ {
1327
+ inputs: [
1328
+ ],
1329
+ name: "CollectPaymentModule_PaymentParamsInvalid",
1330
+ type: "error"
1331
+ },
1332
+ {
1333
+ inputs: [
1334
+ ],
1335
+ name: "CollectPaymentModule_TokenInvalid",
1336
+ type: "error"
1337
+ },
1338
+ {
1339
+ inputs: [
1340
+ ],
1341
+ name: "ERC721_OwnerInvalid",
1342
+ type: "error"
1343
+ },
1344
+ {
1345
+ inputs: [
1346
+ ],
1347
+ name: "ERC721_ReceiverInvalid",
1348
+ type: "error"
1349
+ },
1350
+ {
1351
+ inputs: [
1352
+ ],
1353
+ name: "ERC721_SafeTransferUnsupported",
1354
+ type: "error"
1355
+ },
1356
+ {
1357
+ inputs: [
1358
+ ],
1359
+ name: "ERC721_SenderUnauthorized",
1360
+ type: "error"
1361
+ },
1362
+ {
1363
+ inputs: [
1364
+ ],
1365
+ name: "ERC721_TokenAlreadyMinted",
1366
+ type: "error"
1367
+ },
1368
+ {
1369
+ inputs: [
1370
+ ],
1371
+ name: "ERC721_TokenNonExistent",
1372
+ type: "error"
1373
+ },
1374
+ {
1375
+ inputs: [
1376
+ ],
1377
+ name: "EmptyArray",
1378
+ type: "error"
1379
+ },
1380
+ {
1381
+ inputs: [
1382
+ ],
1383
+ name: "HookRegistry_CallerNotIPOrgOwner",
1384
+ type: "error"
1385
+ },
1386
+ {
1387
+ inputs: [
1388
+ ],
1389
+ name: "HookRegistry_HooksConfigLengthMismatch",
1390
+ type: "error"
1391
+ },
1392
+ {
1393
+ inputs: [
1394
+ {
1395
+ internalType: "uint256",
1396
+ name: "hooksIndex",
1397
+ type: "uint256"
1398
+ }
1399
+ ],
1400
+ name: "HookRegistry_IndexOutOfBounds",
1401
+ type: "error"
1402
+ },
1403
+ {
1404
+ inputs: [
1405
+ ],
1406
+ name: "HookRegistry_MaxHooksExceeded",
1407
+ type: "error"
1408
+ },
1409
+ {
1410
+ inputs: [
1411
+ ],
1412
+ name: "HookRegistry_RegisteringDuplicatedHook",
1413
+ type: "error"
1414
+ },
1415
+ {
1416
+ inputs: [
1417
+ ],
1418
+ name: "HookRegistry_RegisteringZeroAddressHook",
1419
+ type: "error"
1420
+ },
1421
+ {
1422
+ inputs: [
1423
+ {
1424
+ internalType: "bytes32",
1425
+ name: "invalidRequestId",
1426
+ type: "bytes32"
1427
+ }
1428
+ ],
1429
+ name: "Hook_InvalidAsyncRequestId",
1430
+ type: "error"
1431
+ },
1432
+ {
1433
+ inputs: [
1434
+ {
1435
+ internalType: "address",
1436
+ name: "current",
1437
+ type: "address"
1438
+ },
1439
+ {
1440
+ internalType: "address",
1441
+ name: "expected",
1442
+ type: "address"
1443
+ }
1444
+ ],
1445
+ name: "Hook_OnlyCallbackCallerCanCallback",
1446
+ type: "error"
1447
+ },
1448
+ {
1449
+ inputs: [
1450
+ ],
1451
+ name: "Hook_UnsupportedAsyncOperation",
1452
+ type: "error"
1453
+ },
1454
+ {
1455
+ inputs: [
1456
+ ],
1457
+ name: "Hook_UnsupportedSyncOperation",
1458
+ type: "error"
1459
+ },
1460
+ {
1461
+ inputs: [
1462
+ ],
1463
+ name: "IPAccountImpl_CallerNotOwner",
1464
+ type: "error"
1465
+ },
1466
+ {
1467
+ inputs: [
1468
+ ],
1469
+ name: "IPAccountRegistry_InitializationFailed",
1470
+ type: "error"
1471
+ },
1472
+ {
1473
+ inputs: [
1474
+ ],
1475
+ name: "IPAccountRegistry_NonExistentIpAccountImpl",
1476
+ type: "error"
1477
+ },
1478
+ {
1479
+ inputs: [
1480
+ ],
1481
+ name: "IPOrgController_IPOrgNonExistent",
1482
+ type: "error"
1483
+ },
1484
+ {
1485
+ inputs: [
1486
+ ],
1487
+ name: "IPOrgController_InvalidIPOrgOwner",
1488
+ type: "error"
1489
+ },
1490
+ {
1491
+ inputs: [
1492
+ ],
1493
+ name: "IPOrgController_InvalidNewIPOrgOwner",
1494
+ type: "error"
1495
+ },
1496
+ {
1497
+ inputs: [
1498
+ ],
1499
+ name: "IPOrgController_InvalidOwner",
1500
+ type: "error"
1501
+ },
1502
+ {
1503
+ inputs: [
1504
+ ],
1505
+ name: "IPOrgController_OwnerTransferUninitialized",
1506
+ type: "error"
1507
+ },
1508
+ {
1509
+ inputs: [
1510
+ ],
1511
+ name: "IPOrg_IdDoesNotExist",
1512
+ type: "error"
1513
+ },
1514
+ {
1515
+ inputs: [
1516
+ ],
1517
+ name: "IPOrg_IdOverBounds",
1518
+ type: "error"
1519
+ },
1520
+ {
1521
+ inputs: [
1522
+ ],
1523
+ name: "IPOrg_LicensingNotConfigured",
1524
+ type: "error"
1525
+ },
1526
+ {
1527
+ inputs: [
1528
+ ],
1529
+ name: "LengthMismatch",
1530
+ type: "error"
1531
+ },
1532
+ {
1533
+ inputs: [
1534
+ ],
1535
+ name: "LibDuration_CallerNotRenewer",
1536
+ type: "error"
1537
+ },
1538
+ {
1539
+ inputs: [
1540
+ ],
1541
+ name: "LibDuration_InvalidStartTime",
1542
+ type: "error"
1543
+ },
1544
+ {
1545
+ inputs: [
1546
+ ],
1547
+ name: "LibDuration_NotRenewable",
1548
+ type: "error"
1549
+ },
1550
+ {
1551
+ inputs: [
1552
+ ],
1553
+ name: "LibDuration_ZeroTTL",
1554
+ type: "error"
1555
+ },
1556
+ {
1557
+ inputs: [
1558
+ ],
1559
+ name: "LibUintArrayMask_EmptyArray",
1560
+ type: "error"
1561
+ },
1562
+ {
1563
+ inputs: [
1564
+ ],
1565
+ name: "LicenseRegistry_CallerNotLicensingModule",
1566
+ type: "error"
1567
+ },
1568
+ {
1569
+ inputs: [
1570
+ ],
1571
+ name: "LicenseRegistry_CallerNotRevoker",
1572
+ type: "error"
1573
+ },
1574
+ {
1575
+ inputs: [
1576
+ ],
1577
+ name: "LicenseRegistry_InvalidIpa",
1578
+ type: "error"
1579
+ },
1580
+ {
1581
+ inputs: [
1582
+ ],
1583
+ name: "LicenseRegistry_InvalidLicenseStatus",
1584
+ type: "error"
1585
+ },
1586
+ {
1587
+ inputs: [
1588
+ ],
1589
+ name: "LicenseRegistry_LicenseNotPending",
1590
+ type: "error"
1591
+ },
1592
+ {
1593
+ inputs: [
1594
+ ],
1595
+ name: "LicenseRegistry_NotLicenseNFT",
1596
+ type: "error"
1597
+ },
1598
+ {
1599
+ inputs: [
1600
+ ],
1601
+ name: "LicenseRegistry_UnknownLicenseId",
1602
+ type: "error"
1603
+ },
1604
+ {
1605
+ inputs: [
1606
+ ],
1607
+ name: "LicenseRegistry_ZeroIpaRegistryAddress",
1608
+ type: "error"
1609
+ },
1610
+ {
1611
+ inputs: [
1612
+ ],
1613
+ name: "LicenseRegistry_ZeroModuleRegistryAddress",
1614
+ type: "error"
1615
+ },
1616
+ {
1617
+ inputs: [
1618
+ ],
1619
+ name: "LicensingModule_CallerNotIpOrgOwner",
1620
+ type: "error"
1621
+ },
1622
+ {
1623
+ inputs: [
1624
+ ],
1625
+ name: "LicensingModule_CallerNotLicenseOwner",
1626
+ type: "error"
1627
+ },
1628
+ {
1629
+ inputs: [
1630
+ ],
1631
+ name: "LicensingModule_CallerNotLicensor",
1632
+ type: "error"
1633
+ },
1634
+ {
1635
+ inputs: [
1636
+ ],
1637
+ name: "LicensingModule_CantFindParentLicenseOrRelatedIpa",
1638
+ type: "error"
1639
+ },
1640
+ {
1641
+ inputs: [
1642
+ ],
1643
+ name: "LicensingModule_CommercialLicenseNotAllowed",
1644
+ type: "error"
1645
+ },
1646
+ {
1647
+ inputs: [
1648
+ ],
1649
+ name: "LicensingModule_DuplicateTermId",
1650
+ type: "error"
1651
+ },
1652
+ {
1653
+ inputs: [
1654
+ ],
1655
+ name: "LicensingModule_InvalidAction",
1656
+ type: "error"
1657
+ },
1658
+ {
1659
+ inputs: [
1660
+ ],
1661
+ name: "LicensingModule_InvalidConfigType",
1662
+ type: "error"
1663
+ },
1664
+ {
1665
+ inputs: [
1666
+ ],
1667
+ name: "LicensingModule_InvalidIpa",
1668
+ type: "error"
1669
+ },
1670
+ {
1671
+ inputs: [
1672
+ ],
1673
+ name: "LicensingModule_InvalidLicenseeType",
1674
+ type: "error"
1675
+ },
1676
+ {
1677
+ inputs: [
1678
+ ],
1679
+ name: "LicensingModule_InvalidLicensorType",
1680
+ type: "error"
1681
+ },
1682
+ {
1683
+ inputs: [
1684
+ ],
1685
+ name: "LicensingModule_InvalidTermCommercialStatus",
1686
+ type: "error"
1687
+ },
1688
+ {
1689
+ inputs: [
1690
+ ],
1691
+ name: "LicensingModule_IpOrgFrameworkAlreadySet",
1692
+ type: "error"
1693
+ },
1694
+ {
1695
+ inputs: [
1696
+ ],
1697
+ name: "LicensingModule_IpOrgNotConfigured",
1698
+ type: "error"
1699
+ },
1700
+ {
1701
+ inputs: [
1702
+ ],
1703
+ name: "LicensingModule_NonCommercialTermsRequired",
1704
+ type: "error"
1705
+ },
1706
+ {
1707
+ inputs: [
1708
+ ],
1709
+ name: "LicensingModule_ParentLicenseNotActive",
1710
+ type: "error"
1711
+ },
1712
+ {
1713
+ inputs: [
1714
+ ],
1715
+ name: "LicensingModule_ShareAlikeDisabled",
1716
+ type: "error"
1717
+ },
1718
+ {
1719
+ inputs: [
1720
+ ],
1721
+ name: "LicensingModule_ipOrgTermNotFound",
1722
+ type: "error"
1723
+ },
1724
+ {
1725
+ inputs: [
1726
+ ],
1727
+ name: "LicensorApprovalHook_ApprovalAlreadyRequested",
1728
+ type: "error"
1729
+ },
1730
+ {
1731
+ inputs: [
1732
+ ],
1733
+ name: "LicensorApprovalHook_InvalidLicenseId",
1734
+ type: "error"
1735
+ },
1736
+ {
1737
+ inputs: [
1738
+ ],
1739
+ name: "LicensorApprovalHook_InvalidLicensor",
1740
+ type: "error"
1741
+ },
1742
+ {
1743
+ inputs: [
1744
+ ],
1745
+ name: "LicensorApprovalHook_InvalidResponseStatus",
1746
+ type: "error"
1747
+ },
1748
+ {
1749
+ inputs: [
1750
+ ],
1751
+ name: "LicensorApprovalHook_NoApprovalRequested",
1752
+ type: "error"
1753
+ },
1754
+ {
1755
+ inputs: [
1756
+ {
1757
+ internalType: "bytes32",
1758
+ name: "role",
1759
+ type: "bytes32"
1760
+ },
1761
+ {
1762
+ internalType: "address",
1763
+ name: "account",
1764
+ type: "address"
1765
+ }
1766
+ ],
1767
+ name: "MissingRole",
1768
+ type: "error"
1769
+ },
1770
+ {
1771
+ inputs: [
1772
+ ],
1773
+ name: "ModuleRegistry_CallerNotOrgOwner",
1774
+ type: "error"
1775
+ },
1776
+ {
1777
+ inputs: [
1778
+ {
1779
+ internalType: "string",
1780
+ name: "moduleName",
1781
+ type: "string"
1782
+ }
1783
+ ],
1784
+ name: "ModuleRegistry_ModuleNotRegistered",
1785
+ type: "error"
1786
+ },
1787
+ {
1788
+ inputs: [
1789
+ {
1790
+ internalType: "uint256",
1791
+ name: "id",
1792
+ type: "uint256"
1793
+ }
1794
+ ],
1795
+ name: "NonExistentID",
1796
+ type: "error"
1797
+ },
1798
+ {
1799
+ inputs: [
1800
+ ],
1801
+ name: "RegistrationModule_CallerNotAuthorized",
1802
+ type: "error"
1803
+ },
1804
+ {
1805
+ inputs: [
1806
+ ],
1807
+ name: "RegistrationModule_IPAssetNonExistent",
1808
+ type: "error"
1809
+ },
1810
+ {
1811
+ inputs: [
1812
+ ],
1813
+ name: "RegistrationModule_IPOrgNotConfigured",
1814
+ type: "error"
1815
+ },
1816
+ {
1817
+ inputs: [
1818
+ ],
1819
+ name: "RegistrationModule_InvalidCaller",
1820
+ type: "error"
1821
+ },
1822
+ {
1823
+ inputs: [
1824
+ ],
1825
+ name: "RegistrationModule_InvalidConfigOperation",
1826
+ type: "error"
1827
+ },
1828
+ {
1829
+ inputs: [
1830
+ ],
1831
+ name: "RegistrationModule_InvalidExecutionOperation",
1832
+ type: "error"
1833
+ },
1834
+ {
1835
+ inputs: [
1836
+ ],
1837
+ name: "RegistrationModule_InvalidIPAssetType",
1838
+ type: "error"
1839
+ },
1840
+ {
1841
+ inputs: [
1842
+ ],
1843
+ name: "RegistrationModule_TooManyAssetTypes",
1844
+ type: "error"
1845
+ },
1846
+ {
1847
+ inputs: [
1848
+ ],
1849
+ name: "RelationshipModule_CallerNotIpOrgOwner",
1850
+ type: "error"
1851
+ },
1852
+ {
1853
+ inputs: [
1854
+ ],
1855
+ name: "RelationshipModule_CannotRelateToOtherIPOrg",
1856
+ type: "error"
1857
+ },
1858
+ {
1859
+ inputs: [
1860
+ ],
1861
+ name: "RelationshipModule_IntentAlreadyRegistered",
1862
+ type: "error"
1863
+ },
1864
+ {
1865
+ inputs: [
1866
+ ],
1867
+ name: "RelationshipModule_InvalidConfigOperation",
1868
+ type: "error"
1869
+ },
1870
+ {
1871
+ inputs: [
1872
+ ],
1873
+ name: "RelationshipModule_InvalidDstAddress",
1874
+ type: "error"
1875
+ },
1876
+ {
1877
+ inputs: [
1878
+ ],
1879
+ name: "RelationshipModule_InvalidDstId",
1880
+ type: "error"
1881
+ },
1882
+ {
1883
+ inputs: [
1884
+ ],
1885
+ name: "RelationshipModule_InvalidEndTimestamp",
1886
+ type: "error"
1887
+ },
1888
+ {
1889
+ inputs: [
1890
+ ],
1891
+ name: "RelationshipModule_InvalidRelatable",
1892
+ type: "error"
1893
+ },
1894
+ {
1895
+ inputs: [
1896
+ ],
1897
+ name: "RelationshipModule_InvalidSrcAddress",
1898
+ type: "error"
1899
+ },
1900
+ {
1901
+ inputs: [
1902
+ ],
1903
+ name: "RelationshipModule_InvalidSrcId",
1904
+ type: "error"
1905
+ },
1906
+ {
1907
+ inputs: [
1908
+ ],
1909
+ name: "RelationshipModule_InvalidTTL",
1910
+ type: "error"
1911
+ },
1912
+ {
1913
+ inputs: [
1914
+ ],
1915
+ name: "RelationshipModule_IpOrgRelatableCannotBeProtocolLevel",
1916
+ type: "error"
1917
+ },
1918
+ {
1919
+ inputs: [
1920
+ ],
1921
+ name: "RelationshipModule_NonExistingRelationship",
1922
+ type: "error"
1923
+ },
1924
+ {
1925
+ inputs: [
1926
+ {
1927
+ internalType: "string",
1928
+ name: "relType",
1929
+ type: "string"
1930
+ }
1931
+ ],
1932
+ name: "RelationshipModule_RelTypeNotSet",
1933
+ type: "error"
1934
+ },
1935
+ {
1936
+ inputs: [
1937
+ ],
1938
+ name: "RelationshipModule_UnsupportedIpOrgIndexType",
1939
+ type: "error"
1940
+ },
1941
+ {
1942
+ inputs: [
1943
+ ],
1944
+ name: "RelationshipModule_UnsupportedRelationshipDst",
1945
+ type: "error"
1946
+ },
1947
+ {
1948
+ inputs: [
1949
+ ],
1950
+ name: "RelationshipModule_UnsupportedRelationshipSrc",
1951
+ type: "error"
1952
+ },
1953
+ {
1954
+ inputs: [
1955
+ {
1956
+ internalType: "uint256",
1957
+ name: "accountsLength",
1958
+ type: "uint256"
1959
+ },
1960
+ {
1961
+ internalType: "uint256",
1962
+ name: "allocationsLength",
1963
+ type: "uint256"
1964
+ }
1965
+ ],
1966
+ name: "RoyaltyNFT_AccountsAndAllocationsMismatch",
1967
+ type: "error"
1968
+ },
1969
+ {
1970
+ inputs: [
1971
+ {
1972
+ internalType: "uint32",
1973
+ name: "allocationsSum",
1974
+ type: "uint32"
1975
+ }
1976
+ ],
1977
+ name: "RoyaltyNFT_InvalidAllocationsSum",
1978
+ type: "error"
1979
+ },
1980
+ {
1981
+ inputs: [
1982
+ ],
1983
+ name: "TermsRegistry_CommercialStatusUnset",
1984
+ type: "error"
1985
+ },
1986
+ {
1987
+ inputs: [
1988
+ ],
1989
+ name: "TermsRegistry_TermAlreadyExists",
1990
+ type: "error"
1991
+ },
1992
+ {
1993
+ inputs: [
1994
+ ],
1995
+ name: "TermsRegistry_UnsupportedTerm",
1996
+ type: "error"
1997
+ },
1998
+ {
1999
+ inputs: [
2000
+ ],
2001
+ name: "TermsRegistry_UnsupportedTermCategory",
2002
+ type: "error"
2003
+ },
2004
+ {
2005
+ inputs: [
2006
+ {
2007
+ internalType: "address",
2008
+ name: "tokenAddress",
2009
+ type: "address"
2010
+ },
2011
+ {
2012
+ internalType: "address",
2013
+ name: "ownerAddress",
2014
+ type: "address"
2015
+ }
2016
+ ],
2017
+ name: "TokenGatedHook_NotTokenOwner",
2018
+ type: "error"
2019
+ },
2020
+ {
2021
+ inputs: [
2022
+ ],
2023
+ name: "Unauthorized",
2024
+ type: "error"
2025
+ },
2026
+ {
2027
+ inputs: [
2028
+ {
2029
+ internalType: "string",
2030
+ name: "name",
2031
+ type: "string"
2032
+ }
2033
+ ],
2034
+ name: "UnsupportedInterface",
2035
+ type: "error"
2036
+ },
2037
+ {
2038
+ inputs: [
2039
+ ],
2040
+ name: "ZeroAddress",
2041
+ type: "error"
2042
+ },
2043
+ {
2044
+ inputs: [
2045
+ ],
2046
+ name: "ZeroAmount",
2047
+ type: "error"
1176
2048
  }
1177
2049
  ];
1178
2050
 
@@ -1748,33 +2620,6 @@ function isIntegerString(s) {
1748
2620
  function parseToBigInt(num) {
1749
2621
  return BigInt(num);
1750
2622
  }
1751
- function fileToBase64(file) {
1752
- return new Promise(function (resolve, reject) {
1753
- // convert file to base64
1754
- if (file instanceof Buffer) {
1755
- resolve(file.toString("base64"));
1756
- return;
1757
- }
1758
- if (file instanceof File) {
1759
- var reader = new FileReader();
1760
- reader.readAsDataURL(file);
1761
- reader.onload = function () {
1762
- var _reader$result;
1763
- var base64 = (_reader$result = reader.result) === null || _reader$result === void 0 ? void 0 : _reader$result.toString().split(",")[1];
1764
- if (base64) {
1765
- resolve(base64);
1766
- } else {
1767
- reject(new Error("Failed to convert file to base64"));
1768
- }
1769
- };
1770
- reader.onerror = function (error) {
1771
- return reject(error);
1772
- };
1773
- return;
1774
- }
1775
- reject(new Error("Invalid file type"));
1776
- });
1777
- }
1778
2623
  function waitTxAndFilterLog(_x, _x2, _x3) {
1779
2624
  return _waitTxAndFilterLog.apply(this, arguments);
1780
2625
  }
@@ -1837,14 +2682,24 @@ function _waitTxAndFilterLog() {
1837
2682
  }));
1838
2683
  return _waitTxAndFilterLog.apply(this, arguments);
1839
2684
  }
1840
- var dictToQueryParams = function dictToQueryParams(params) {
2685
+ function dictToQueryParams(params) {
1841
2686
  var queryParamList = [];
1842
2687
  for (var key in params) {
1843
2688
  var value = params[key];
1844
2689
  queryParamList.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value)));
1845
2690
  }
1846
2691
  return queryParamList.join("&");
1847
- };
2692
+ }
2693
+ function typedDataArrayToBytesArray(typedDataArray) {
2694
+ var result = [];
2695
+ typedDataArray.forEach(function (typedData) {
2696
+ result.push(typedDataToBytes(typedData));
2697
+ });
2698
+ return result;
2699
+ }
2700
+ function typedDataToBytes(typedData) {
2701
+ return encodeAbiParameters(parseAbiParameters(typedData["interface"]), typedData.data);
2702
+ }
1848
2703
 
1849
2704
  /**
1850
2705
  * IPOrgClient allows you to create, update, view, search IPOrgs on
@@ -1997,8 +2852,8 @@ var RelationshipReadOnlyClient = /*#__PURE__*/function () {
1997
2852
  _context2.next = 3;
1998
2853
  return this.httpClient.post("/protocol/relationship", request, {
1999
2854
  params: {
2000
- contract: (request === null || request === void 0 ? void 0 : request.contract) || process.env.IP_ASSET_REGISTRY_CONTRACT || process.env.NEXT_PUBLIC_IP_ASSET_REGISTRY_CONTRACT,
2001
- tokenId: request === null || request === void 0 ? void 0 : request.tokenId
2855
+ contract: request.contract,
2856
+ tokenId: request.tokenId
2002
2857
  }
2003
2858
  });
2004
2859
  case 3:
@@ -3147,12 +4002,12 @@ var IPAssetClient = /*#__PURE__*/function (_IPAssetReadOnlyClien) {
3147
4002
  args: [getAddress(request.ipOrgId), {
3148
4003
  owner: getAddress(request.owner || this.wallet.account.address),
3149
4004
  name: request.name,
3150
- ipOrgAssetType: parseToBigInt(request.type),
4005
+ ipOrgAssetType: parseToBigInt(request.typeIndex),
3151
4006
  hash: toHex(request.contentHash || "", {
3152
4007
  size: 32
3153
4008
  }),
3154
4009
  mediaUrl: request.mediaUrl || ""
3155
- }, [], []],
4010
+ }, request.preHookData ? typedDataArrayToBytesArray(request.preHookData) : [], request.postHookData ? typedDataArrayToBytesArray(request.postHookData) : []],
3156
4011
  account: this.wallet.account
3157
4012
  }));
3158
4013
  case 3:
@@ -3647,38 +4502,47 @@ var PlatformClient = /*#__PURE__*/function () {
3647
4502
  key: "uploadFile",
3648
4503
  value: function () {
3649
4504
  var _uploadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file, mimeType) {
3650
- var base64, paylod, response;
4505
+ var preSignUrlResp, data, uploadResp, confirmResp;
3651
4506
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3652
4507
  while (1) switch (_context.prev = _context.next) {
3653
4508
  case 0:
3654
4509
  _context.prev = 0;
3655
4510
  _context.next = 3;
3656
- return fileToBase64(file);
4511
+ return this.httpClient.post("/platform/file-upload/request");
3657
4512
  case 3:
3658
- base64 = _context.sent;
3659
- paylod = {
3660
- base64: base64,
3661
- mimeType: mimeType
3662
- };
4513
+ preSignUrlResp = _context.sent;
4514
+ data = preSignUrlResp.data; // upload the file to s3
3663
4515
  _context.next = 7;
3664
- return this.httpClient.post("/protocol/v2/files/upload", paylod, {
4516
+ return this.httpClient.put(data.url, file, {
3665
4517
  timeout: 0,
3666
4518
  headers: {
3667
- "Content-Type": "application/json"
4519
+ "Content-Type": mimeType
3668
4520
  }
3669
4521
  });
3670
4522
  case 7:
3671
- response = _context.sent;
3672
- return _context.abrupt("return", response.data);
3673
- case 11:
3674
- _context.prev = 11;
4523
+ uploadResp = _context.sent;
4524
+ if (!(uploadResp.status !== 200)) {
4525
+ _context.next = 10;
4526
+ break;
4527
+ }
4528
+ throw new Error("Failed to upload file to s3. Status: ".concat(uploadResp.status));
4529
+ case 10:
4530
+ _context.next = 12;
4531
+ return this.httpClient.post("/platform/file-upload/confirm", {
4532
+ key: data.key
4533
+ });
4534
+ case 12:
4535
+ confirmResp = _context.sent;
4536
+ return _context.abrupt("return", confirmResp.data);
4537
+ case 16:
4538
+ _context.prev = 16;
3675
4539
  _context.t0 = _context["catch"](0);
3676
- return _context.abrupt("return", handleError(_context.t0, ">>> Failed to upload file"));
3677
- case 14:
4540
+ return _context.abrupt("return", handleError(_context.t0, "Failed to upload file"));
4541
+ case 19:
3678
4542
  case "end":
3679
4543
  return _context.stop();
3680
4544
  }
3681
- }, _callee, this, [[0, 11]]);
4545
+ }, _callee, this, [[0, 16]]);
3682
4546
  }));
3683
4547
  function uploadFile(_x, _x2) {
3684
4548
  return _uploadFile.apply(this, arguments);
@@ -5682,7 +6546,7 @@ var RelationshipClient = /*#__PURE__*/function (_RelationshipReadOnly) {
5682
6546
  srcId: request.srcTokenId,
5683
6547
  dstAddress: request.dstContract,
5684
6548
  dstId: request.dstTokenId
5685
- }, [], []],
6549
+ }, request.preHookData ? typedDataArrayToBytesArray(request.preHookData) : [], request.postHookData ? typedDataArrayToBytesArray(request.postHookData) : []],
5686
6550
  account: this.wallet.account
5687
6551
  }));
5688
6552
  case 3:
@@ -5860,8 +6724,8 @@ var RelationshipTypeClient = /*#__PURE__*/function (_RelationshipTypeRead) {
5860
6724
  src: request.relatedElements.src,
5861
6725
  dst: request.relatedElements.dst
5862
6726
  },
5863
- allowedSrcs: request.allowedSrcs,
5864
- allowedDsts: request.allowedDsts
6727
+ allowedSrcs: request.allowedSrcIpAssetTypes,
6728
+ allowedDsts: request.allowedDstIpAssetTypes
5865
6729
  }],
5866
6730
  account: this.wallet.account
5867
6731
  }));
@@ -6190,31 +7054,19 @@ var StoryClient = /*#__PURE__*/function () {
6190
7054
  return StoryClient;
6191
7055
  }();
6192
7056
 
6193
- /**
6194
- * @public
6195
- */
6196
- var IPAssetType = /*#__PURE__*/function (IPAssetType) {
6197
- IPAssetType[IPAssetType["STORY"] = 1] = "STORY";
6198
- IPAssetType[IPAssetType["CHARACTER"] = 2] = "CHARACTER";
6199
- IPAssetType[IPAssetType["ART"] = 3] = "ART";
6200
- IPAssetType[IPAssetType["LOCATION"] = 5] = "LOCATION";
6201
- IPAssetType[IPAssetType["ITEM"] = 6] = "ITEM";
6202
- return IPAssetType;
6203
- }({});
6204
-
6205
7057
  /**
6206
7058
  * @public
6207
7059
  */
6208
7060
  var ResourceType = /*#__PURE__*/function (ResourceType) {
6209
- ResourceType[ResourceType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
6210
- ResourceType[ResourceType["IP_ORG"] = 1] = "IP_ORG";
6211
- ResourceType[ResourceType["IP_ASSET"] = 2] = "IP_ASSET";
6212
- ResourceType[ResourceType["LICENSE"] = 3] = "LICENSE";
6213
- ResourceType[ResourceType["RELATIONSHIP"] = 4] = "RELATIONSHIP";
6214
- ResourceType[ResourceType["RELATIONSHIPTYPE"] = 5] = "RELATIONSHIPTYPE";
6215
- ResourceType[ResourceType["MODULE"] = 6] = "MODULE";
6216
- ResourceType[ResourceType["HOOK"] = 7] = "HOOK";
6217
- ResourceType[ResourceType["DISPUTE"] = 8] = "DISPUTE";
7061
+ ResourceType["Unspecified"] = "Unspecified";
7062
+ ResourceType["IPOrg"] = "IPOrg";
7063
+ ResourceType["IPAsset"] = "IPAsset";
7064
+ ResourceType["License"] = "License";
7065
+ ResourceType["Relationship"] = "Relationship";
7066
+ ResourceType["RelationshipType"] = "RelationshipType";
7067
+ ResourceType["Module"] = "Module";
7068
+ ResourceType["Hook"] = "Hook";
7069
+ ResourceType["Dispute"] = "Dispute";
6218
7070
  return ResourceType;
6219
7071
  }({});
6220
7072
 
@@ -6222,8 +7074,8 @@ var ResourceType = /*#__PURE__*/function (ResourceType) {
6222
7074
  * @public
6223
7075
  */
6224
7076
  var HookType = /*#__PURE__*/function (HookType) {
6225
- HookType[HookType["PRE_ACTION"] = 0] = "PRE_ACTION";
6226
- HookType[HookType["POST_ACTION"] = 1] = "POST_ACTION";
7077
+ HookType[HookType["PreAction"] = 0] = "PreAction";
7078
+ HookType[HookType["PostAction"] = 1] = "PostAction";
6227
7079
  return HookType;
6228
7080
  }({});
6229
7081
 
@@ -6231,14 +7083,24 @@ var HookType = /*#__PURE__*/function (HookType) {
6231
7083
  * @public
6232
7084
  */
6233
7085
  var ActionType = /*#__PURE__*/function (ActionType) {
6234
- ActionType[ActionType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
6235
- ActionType[ActionType["REGISTER"] = 1] = "REGISTER";
6236
- ActionType[ActionType["UNREGISTER"] = 2] = "UNREGISTER";
6237
- ActionType[ActionType["CONFIGURE"] = 3] = "CONFIGURE";
6238
- ActionType[ActionType["CREATE"] = 4] = "CREATE";
7086
+ ActionType["Unspecified"] = "Unspecified";
7087
+ ActionType["Register"] = "Register";
7088
+ ActionType["Unregister"] = "Unregister";
7089
+ ActionType["Configure"] = "Configure";
7090
+ ActionType["Create"] = "Create";
6239
7091
  return ActionType;
6240
7092
  }({});
6241
7093
 
7094
+ var Relatables = /*#__PURE__*/function (Relatables) {
7095
+ Relatables[Relatables["Undefined"] = 0] = "Undefined";
7096
+ Relatables[Relatables["IPA"] = 1] = "IPA";
7097
+ Relatables[Relatables["IPOrgEntry"] = 2] = "IPOrgEntry";
7098
+ Relatables[Relatables["License"] = 3] = "License";
7099
+ Relatables[Relatables["Address"] = 4] = "Address";
7100
+ Relatables[Relatables["ExternalNFT"] = 5] = "ExternalNFT";
7101
+ return Relatables;
7102
+ }({});
7103
+
6242
7104
  var AddressZero = "0x0000000000000000000000000000000000000000";
6243
7105
 
6244
- export { ActionType, AddressZero, HookReadOnlyClient, HookType, IPAssetClient, IPAssetReadOnlyClient, IPAssetType, IPOrgClient, IPOrgReadOnlyClient, LicenseClient, LicenseReadOnlyClient, ModuleReadOnlyClient, PlatformClient, RelationshipClient, ResourceType, StoryClient, TransactionClient };
7106
+ export { ActionType, AddressZero, HookReadOnlyClient, HookType, IPAssetClient, IPAssetReadOnlyClient, IPOrgClient, IPOrgReadOnlyClient, LicenseClient, LicenseReadOnlyClient, ModuleReadOnlyClient, PlatformClient, Relatables, RelationshipClient, ResourceType, StoryClient, TransactionClient };