@sage-protocol/sdk 0.2.6 → 0.2.9
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 +2 -0
- package/dist/browser/index.mjs +36 -25
- package/dist/index.cjs +251 -751
- package/dist/index.mjs +251 -751
- package/dist/node/index.cjs +251 -751
- package/dist/node/index.mjs +251 -751
- package/package.json +1 -2
- package/types/index.d.ts +194 -30
package/README.md
CHANGED
|
@@ -126,6 +126,8 @@ const res = await sdk.subdao.createOperatorSubDAO({
|
|
|
126
126
|
});
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
Note: if you call the factory's operator-creation functions directly (e.g., `createSubDAOOperator*`), you must pass a non-zero `operatorAdmin` (it may be the same as `operatorExecutor`).
|
|
130
|
+
|
|
129
131
|
### Library Fork Fees
|
|
130
132
|
|
|
131
133
|
```js
|
package/dist/browser/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var require_package = __commonJS({
|
|
|
14
14
|
"package.json"(exports, module) {
|
|
15
15
|
module.exports = {
|
|
16
16
|
name: "@sage-protocol/sdk",
|
|
17
|
-
version: "0.2.
|
|
17
|
+
version: "0.2.9",
|
|
18
18
|
description: "Backend-agnostic SDK for interacting with the Sage Protocol (governance, SubDAOs, tokens).",
|
|
19
19
|
main: "dist/index.cjs",
|
|
20
20
|
module: "dist/index.mjs",
|
|
@@ -72,7 +72,6 @@ var require_package = __commonJS({
|
|
|
72
72
|
},
|
|
73
73
|
dependencies: {
|
|
74
74
|
"@merit-systems/echo-typescript-sdk": "^1.0.17",
|
|
75
|
-
"@whetstone-research/doppler-sdk": "^0.0.1-alpha.40",
|
|
76
75
|
ai: "^5.0.52",
|
|
77
76
|
axios: "^1.11.0",
|
|
78
77
|
ethers: "^6.15.0",
|
|
@@ -140,7 +139,6 @@ var require_abi = __commonJS({
|
|
|
140
139
|
// Core factory reads
|
|
141
140
|
"function timelockMinDelay() view returns (uint256)",
|
|
142
141
|
"function premiumPromptsAddress() view returns (address)",
|
|
143
|
-
"function simpleKeyStoreAddress() view returns (address)",
|
|
144
142
|
"function governanceConfigAddress() view returns (address)",
|
|
145
143
|
"function libraryRegistryAddress() view returns (address)",
|
|
146
144
|
// Canonical per‑SubDAO mapping
|
|
@@ -165,8 +163,14 @@ var require_abi = __commonJS({
|
|
|
165
163
|
"function createSubDAOOperatorWithStableAdvanced(string name, string description, uint8 accessModel, uint256 minStakeAmount, address operatorExecutor, address operatorAdmin, bool anyoneExec, bool governorProposer, (uint256 value,uint256 deadline,uint8 v,bytes32 r,bytes32 s) permit) returns (address subDAO, address registry)",
|
|
166
164
|
"function createSubDAOOperator(string name, string description, uint8 accessModel, uint256 minStakeAmount, uint256 burnAmount, address operatorExecutor, address operatorAdmin) returns (address subDAO, address registry)",
|
|
167
165
|
"function createSubDAOOperatorAdvanced(string name, string description, uint8 accessModel, uint256 minStakeAmount, uint256 burnAmount, address operatorExecutor, address operatorAdmin, bool anyoneExec, bool governorProposer) returns (address subDAO, address registry)",
|
|
166
|
+
// Forking (legacy overloads forward with maxForkFee=type(uint256).max)
|
|
168
167
|
"function createForkedSubDAO(string newName, string newDescription, string originalName, address originalSubDAO, address forker, bool copyLibrary) returns (address subDAO, address registry)",
|
|
169
|
-
|
|
168
|
+
// Forking (preferred: explicit maxForkFee slippage cap)
|
|
169
|
+
"function createForkedSubDAO(string newName, string newDescription, string originalName, address originalSubDAO, address forker, uint256 maxForkFee, bool copyLibrary) returns (address subDAO, address registry)",
|
|
170
|
+
// Stable-fee forking (legacy overloads forward with maxForkFee=type(uint256).max)
|
|
171
|
+
"function createForkedSubDAOWithStable(string newName, string newDescription, string originalName, address originalSubDAO, address forker, uint64 authorizationNonce, (uint256 value,uint256 deadline,uint8 v,bytes32 r,bytes32 s) permit, bool copyLibrary) returns (address subDAO, address registry)",
|
|
172
|
+
// Stable-fee forking (preferred: explicit maxForkFee slippage cap)
|
|
173
|
+
"function createForkedSubDAOWithStable(string newName, string newDescription, string originalName, address originalSubDAO, address forker, uint64 authorizationNonce, (uint256 value,uint256 deadline,uint8 v,bytes32 r,bytes32 s) permit, uint256 maxForkFee, bool copyLibrary) returns (address subDAO, address registry)"
|
|
170
174
|
];
|
|
171
175
|
var TemplateModule = [
|
|
172
176
|
"function getActiveTemplates() view returns (uint256[])",
|
|
@@ -177,13 +181,11 @@ var require_abi = __commonJS({
|
|
|
177
181
|
"function maxCreationBurn() view returns (uint256)"
|
|
178
182
|
];
|
|
179
183
|
var LibraryRegistry = [
|
|
180
|
-
"function libraryByDAO(address) view returns (string manifestCID, address lastUpdater, uint256 lastUpdated, string version,
|
|
184
|
+
"function libraryByDAO(address) view returns (string manifestCID, address lastUpdater, uint256 lastUpdated, string version, uint256 nonce)",
|
|
181
185
|
"function daoTimelock(address) view returns (address)",
|
|
182
|
-
"function getLibrary(address) view returns (tuple(string manifestCID, address lastUpdater, uint256 lastUpdated, string version,
|
|
186
|
+
"function getLibrary(address) view returns (tuple(string manifestCID, address lastUpdater, uint256 lastUpdated, string version, uint256 nonce))",
|
|
183
187
|
"function getLibraryIds(address dao) view returns (bytes32[] memory)",
|
|
184
|
-
"function getLibraryStream(address dao, string libraryId) view returns (tuple(string manifestCID, address lastUpdater, uint256 lastUpdated, string version,
|
|
185
|
-
"function getLibraryForkFee(address dao) view returns (uint256)",
|
|
186
|
-
"function setLibraryForkFee(address dao, uint256 fee)",
|
|
188
|
+
"function getLibraryStream(address dao, string libraryId) view returns (tuple(string manifestCID, address lastUpdater, uint256 lastUpdated, string version, uint256 nonce))",
|
|
187
189
|
"function updateLibrary(address dao, string manifestCID, string version)",
|
|
188
190
|
"function updateLibraryCAS(address dao, string manifestCID, string version, uint256 expectedNonce)",
|
|
189
191
|
"function updateLibraryStream(address dao, string libraryId, string manifestCID, string version)",
|
|
@@ -302,9 +304,6 @@ var require_abi = __commonJS({
|
|
|
302
304
|
"function getForkBurnDiscount(address) view returns (uint256)",
|
|
303
305
|
"function totalBurned() view returns (uint256)"
|
|
304
306
|
];
|
|
305
|
-
var PersonalLibraryFacet = [
|
|
306
|
-
"function createPersonalRegistry(uint8 policy) returns (address)"
|
|
307
|
-
];
|
|
308
307
|
var PersonalMarketplace = [
|
|
309
308
|
"function setPrice(bytes32 key, uint256 price)",
|
|
310
309
|
"function purchase(address creator, bytes32 key, uint256 expectedPrice, uint256 deadline)"
|
|
@@ -327,14 +326,28 @@ var require_abi = __commonJS({
|
|
|
327
326
|
"event TokensSwept(address indexed token, address indexed to, uint256 amount)"
|
|
328
327
|
];
|
|
329
328
|
var GovernanceBoostMerkle = [
|
|
330
|
-
"function
|
|
331
|
-
"function
|
|
332
|
-
"function
|
|
329
|
+
"function createBoost(uint256 proposalId, uint256 totalPool)",
|
|
330
|
+
"function setMerkleRoot(uint256 proposalId, bytes32 root)",
|
|
331
|
+
"function finalize(uint256 proposalId)",
|
|
332
|
+
"function claim(uint256 proposalId, address account, uint256 amount, bytes32[] proof)",
|
|
333
|
+
"function getBoost(uint256 proposalId) view returns (uint256 totalPool, uint256 totalClaimed, bytes32 merkleRoot, uint256 expiresAt, bool active, bool finalized, address creator)",
|
|
334
|
+
"function claimed(uint256 proposalId, address account) view returns (bool)",
|
|
335
|
+
"event BoostCreated(uint256 indexed proposalId, address indexed creator, uint256 totalPool)",
|
|
336
|
+
"event MerkleRootSet(uint256 indexed proposalId, bytes32 merkleRoot)",
|
|
337
|
+
"event RewardClaimed(uint256 indexed proposalId, address indexed voter, uint256 amount)",
|
|
338
|
+
"event BoostFinalized(uint256 indexed proposalId, uint256 totalClaimed, uint256 refunded)"
|
|
333
339
|
];
|
|
334
340
|
var GovernanceBoostDirect = [
|
|
335
|
-
"function
|
|
336
|
-
"function
|
|
337
|
-
"function
|
|
341
|
+
"function createBoost((address governor,uint256 proposalId,uint256 perVoter,uint256 maxVoters,uint8 kind,address policy,uint96 minVotes,uint8 payoutMode,uint8 support,uint256 startAt,uint256 expiresAt) params)",
|
|
342
|
+
"function claim(uint256 proposalId, bytes data)",
|
|
343
|
+
"function finalize(uint256 proposalId)",
|
|
344
|
+
"function pause(uint256 proposalId, bool paused)",
|
|
345
|
+
"function setProtocolRake(uint96 rakeBps, address protocolTreasury)",
|
|
346
|
+
"function getBoost(uint256 proposalId) view returns (tuple(address creator, address governor, uint256 proposalId, uint256 snapshot, uint256 perVoter, uint256 maxVoters, uint256 votersPaid, uint96 minVotes, uint8 payoutMode, uint8 support, uint256 startAt, uint256 expiresAt, uint256 totalPool, uint256 totalPaid, uint8 kind, address policy, bool active, bool paused) boost)",
|
|
347
|
+
"function claimed(uint256 proposalId, address account) view returns (bool)",
|
|
348
|
+
"event BoostCreated(uint256 indexed proposalId, address indexed governor, uint256 perVoter, uint256 maxVoters, uint256 snapshot, uint8 kind, address policy, uint96 minVotes)",
|
|
349
|
+
"event BoostClaimed(uint256 indexed proposalId, address indexed claimer, uint256 amount, uint256 rake)",
|
|
350
|
+
"event BoostFinalized(uint256 indexed proposalId, uint256 paidCount, uint256 refund)"
|
|
338
351
|
];
|
|
339
352
|
var VotingMultiplierNFT = [
|
|
340
353
|
// Constants
|
|
@@ -342,6 +355,7 @@ var require_abi = __commonJS({
|
|
|
342
355
|
"function MAX_NFTS_PER_ACCOUNT() view returns (uint256)",
|
|
343
356
|
// Tier Management
|
|
344
357
|
"function createTier(address dao, string name, uint256 multiplier, uint256 maxSupply, uint256 price) returns (uint256 tierId)",
|
|
358
|
+
"function createTierViaGovernance(address subdao, string name, uint256 multiplier, uint256 maxSupply, uint256 price) returns (uint256 tierId)",
|
|
345
359
|
"function getTier(uint256 tierId) view returns (tuple(string name, uint256 multiplier, uint256 maxSupply, uint256 minted, uint256 price, address dao))",
|
|
346
360
|
"function tierCount() view returns (uint256)",
|
|
347
361
|
"function tiers(uint256) view returns (string name, uint256 multiplier, uint256 maxSupply, uint256 minted, uint256 price, address dao)",
|
|
@@ -414,7 +428,7 @@ var require_abi = __commonJS({
|
|
|
414
428
|
"function weth() view returns (address)",
|
|
415
429
|
"function timeBuffer() view returns (uint256)",
|
|
416
430
|
"function reservePrice() view returns (uint256)",
|
|
417
|
-
"function
|
|
431
|
+
"function minBidIncrementBps() view returns (uint256)",
|
|
418
432
|
"function duration() view returns (uint256)",
|
|
419
433
|
"function mintTierId() view returns (uint256)",
|
|
420
434
|
"function defaultTokenURI() view returns (string)",
|
|
@@ -424,7 +438,7 @@ var require_abi = __commonJS({
|
|
|
424
438
|
"function paused() view returns (bool)",
|
|
425
439
|
"function setTimeBuffer(uint256 _timeBuffer)",
|
|
426
440
|
"function setReservePrice(uint256 _reservePrice)",
|
|
427
|
-
"function
|
|
441
|
+
"function setMinBidIncrementBps(uint256 _minBidIncrementBps)",
|
|
428
442
|
"function setDuration(uint256 _duration)",
|
|
429
443
|
"function setMintTierId(uint256 _tierId)",
|
|
430
444
|
"function setDefaultTokenURI(string _uri)",
|
|
@@ -437,7 +451,7 @@ var require_abi = __commonJS({
|
|
|
437
451
|
"event AuctionSettled(uint256 indexed nftId, address winner, uint256 amount)",
|
|
438
452
|
"event AuctionTimeBufferUpdated(uint256 timeBuffer)",
|
|
439
453
|
"event AuctionReservePriceUpdated(uint256 reservePrice)",
|
|
440
|
-
"event
|
|
454
|
+
"event AuctionMinBidIncrementBpsUpdated(uint256 minBidIncrementBps)",
|
|
441
455
|
"event AuctionDurationUpdated(uint256 duration)"
|
|
442
456
|
];
|
|
443
457
|
var SimpleBountySystem = [
|
|
@@ -447,10 +461,8 @@ var require_abi = __commonJS({
|
|
|
447
461
|
// Bounty Creation
|
|
448
462
|
"function createBounty(string title, string description, string ipfsCID, uint256 reward, uint256 deadline) returns (uint256)",
|
|
449
463
|
"function createBountyAdvanced(string title, string description, string ipfsCID, uint256 reward, uint256 deadline, uint256 votingDuration, uint8 mode, uint8 libraryAction, address assignee, string libraryKey) returns (uint256)",
|
|
450
|
-
// Submission
|
|
451
|
-
"function claimBounty(uint256 bountyId)",
|
|
464
|
+
// Submission
|
|
452
465
|
"function submitEntry(uint256 bountyId, string promptIPFS, string deliverableIPFS) returns (uint256)",
|
|
453
|
-
"function completeBounty(uint256 bountyId, string deliverableIPFS)",
|
|
454
466
|
// Voting (COMPETITIVE mode)
|
|
455
467
|
"function startVoting(uint256 bountyId)",
|
|
456
468
|
"function vote(uint256 bountyId, uint256 submissionId)",
|
|
@@ -529,7 +541,6 @@ var require_abi = __commonJS({
|
|
|
529
541
|
Timelock,
|
|
530
542
|
ERC20Votes,
|
|
531
543
|
SXXX,
|
|
532
|
-
PersonalLibraryFacet,
|
|
533
544
|
PersonalMarketplace,
|
|
534
545
|
PersonalLicenseReceipt,
|
|
535
546
|
TreasuryWrapper,
|