@floorlaunchpad/sdk 0.7.0 → 0.8.1
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/CHANGELOG.md +143 -0
- package/README.md +12 -1
- package/dist/abi/evm.gen.js +75 -2
- package/dist/abi/functions.gen.js +87 -1
- package/dist/abi/solana.gen.js +59 -0
- package/dist/client/solana/index.js +25 -6
- package/dist/config/generated.js +803 -26374
- package/dist/errors.js +20 -1
- package/dist/events/types.gen.js +1 -1
- package/dist/evm/chains.js +49 -0
- package/dist/evm/floor/abi.gen.js +115 -0
- package/dist/evm/squid.js +21 -5
- package/dist/evm/venues.js +302 -0
- package/dist/generated/interface.gen.js +45 -1
- package/dist/index.js +7 -0
- package/dist/indexer/bodies.js +154 -2
- package/dist/indexer/client.js +8 -1
- package/dist/indexer/contract.js +78 -11
- package/dist/indexer/paths.js +46 -0
- package/dist/indexer/read.js +14 -1
- package/dist/math/v2/book.js +24 -7
- package/dist/math/v2/create.js +1 -1
- package/dist/math/v2/escrow.js +205 -0
- package/dist/math/v2/office.js +110 -0
- package/dist/math/v2/relay.js +263 -96
- package/dist/math/v2/team.js +28 -0
- package/dist/math/v2/trade.js +3 -1
- package/dist/reprice.js +88 -0
- package/dist/route/quote.js +16 -0
- package/dist/scaledUi.js +113 -0
- package/dist/solana/floor/accounts.js +8 -2
- package/dist/solana/floor/events.js +56 -1
- package/dist/solana/floor/instructions.js +16 -0
- package/dist/stockRefresh.js +99 -0
- package/dist/ton/consts.generated.js +2 -2
- package/dist/ton/gas.js +3 -3
- package/dist/v2/claims.js +28 -5
- package/dist/v2/devbuy.js +28 -3
- package/dist/v2/evm.js +178 -5
- package/dist/v2/layouts.js +100 -2
- package/dist/v2/office-events.js +127 -0
- package/dist/v2/office-evm.js +68 -0
- package/dist/v2/office-read.js +182 -0
- package/dist/v2/office-solana.js +134 -0
- package/dist/v2/office-trade.js +73 -0
- package/dist/v2/route-alt.js +1 -0
- package/dist/v2/route.js +1 -1
- package/dist/v2/solana.js +224 -5
- package/dist/v2/solanaSettle.js +2 -0
- package/dist/v2/tx/evm.js +51 -1
- package/dist/v2/tx/solana.js +3 -3
- package/dist/v2/types.js +4 -0
- package/docs/aggregator.md +19 -0
- package/examples/floor-line.html +1 -1
- package/package.json +26 -1
- package/src/abi/evm.gen.ts +75 -2
- package/src/abi/functions.gen.ts +87 -1
- package/src/abi/solana.gen.ts +59 -0
- package/src/client/solana/index.ts +25 -6
- package/src/config/generated.ts +803 -26374
- package/src/errors.ts +20 -1
- package/src/events/types.gen.ts +402 -1
- package/src/evm/chains.ts +58 -0
- package/src/evm/floor/abi.gen.ts +115 -0
- package/src/evm/squid.ts +22 -6
- package/src/evm/venues.ts +340 -0
- package/src/generated/interface.gen.ts +45 -1
- package/src/index.ts +7 -0
- package/src/indexer/bodies.ts +167 -2
- package/src/indexer/client.ts +16 -2
- package/src/indexer/contract.ts +84 -12
- package/src/indexer/paths.ts +77 -0
- package/src/indexer/read.ts +16 -3
- package/src/math/v2/book.ts +23 -7
- package/src/math/v2/create.ts +1 -1
- package/src/math/v2/escrow.ts +213 -0
- package/src/math/v2/office.ts +114 -0
- package/src/math/v2/relay.ts +269 -96
- package/src/math/v2/team.ts +28 -0
- package/src/math/v2/trade.ts +3 -1
- package/src/reprice.ts +121 -0
- package/src/route/quote.ts +16 -0
- package/src/scaledUi.ts +123 -0
- package/src/solana/floor/accounts.ts +8 -2
- package/src/solana/floor/events.ts +57 -2
- package/src/solana/floor/instructions.ts +16 -0
- package/src/stockRefresh.ts +131 -0
- package/src/ton/consts.generated.ts +2 -2
- package/src/ton/gas.ts +3 -3
- package/src/v2/claims.ts +34 -5
- package/src/v2/devbuy.ts +38 -3
- package/src/v2/evm.ts +204 -5
- package/src/v2/layouts.ts +100 -2
- package/src/v2/office-events.ts +133 -0
- package/src/v2/office-evm.ts +76 -0
- package/src/v2/office-read.ts +264 -0
- package/src/v2/office-solana.ts +159 -0
- package/src/v2/office-trade.ts +96 -0
- package/src/v2/route-alt.ts +1 -0
- package/src/v2/route.ts +1 -1
- package/src/v2/solana.ts +235 -5
- package/src/v2/solanaSettle.ts +2 -0
- package/src/v2/tx/evm.ts +51 -1
- package/src/v2/tx/solana.ts +5 -3
- package/src/v2/types.ts +66 -1
package/src/errors.ts
CHANGED
|
@@ -91,7 +91,13 @@ export const SOLANA_ERROR_NAMES = [
|
|
|
91
91
|
"GenesisDustNotYet", "GenesisConvertCapped", "GenesisPriceStale", "GenesisConvertSlippage", "GenesisSolNotConverted",
|
|
92
92
|
"GenesisWagmiWrongState", "GenesisWagmiNoPreset", "GenesisWagmiQuoteNotListed", "HolderDestNotSet", "NotTeamMember",
|
|
93
93
|
"BurnTooLarge", "NothingToSettle", "HolderPositionExists", "HolderPositionNotEmpty", "HolderBookMismatch", "DeadAccountNotDead",
|
|
94
|
-
"HookAccountsMissing", "RowTooManyRanges", "RowNotFeasible", "OgFull",
|
|
94
|
+
"HookAccountsMissing", "RowTooManyRanges", "RowNotFeasible", "OgFull", "DealFeeOverCap", "DealFeeFixed",
|
|
95
|
+
"DealEscrowSteps", "DealEscrowExpiry", "DealEscrowTarget", "DealEscrowNotArmed", "DealEscrowTooSoon", "DealEscrowDone", "DealEscrowExpired", "DealEscrowNotExpired", "DealEscrowFunding", "DealEscrowNotParty",
|
|
96
|
+
"DealEscrowAgency", "DealEscrowProofNotRequired", "DealEscrowProofState", "DealEscrowWindowClosed", "DealEscrowNoObjectionLeft", "DealEscrowNotProven", "DealEscrowVersion",
|
|
97
|
+
|
|
98
|
+
"RefVolumeBookFull",
|
|
99
|
+
|
|
100
|
+
"OfficeNotMember", "OfficeNotController", "OfficeFull", "OfficeAlreadyMember", "OfficeShareSum", "OfficeOverShare", "OfficeNoCash", "OfficePositions", "OfficeZeroAmount", "OfficeZeroUnits", "OfficeZeroValue", "OfficeNotHeld", "OfficeMergeSize", "OfficeNotMergeable", "OfficeMergeMismatch", "OfficeNotSeller", "OfficeWrongQuote", "OfficeControllerLeaves", "OfficeSlippage", "OfficeOverflow", "OfficeExists", "OfficeMergeLocked", "OfficeNoMerge",
|
|
95
101
|
] as const;
|
|
96
102
|
|
|
97
103
|
export const SOLANA_ERROR_BASE = 6000;
|
|
@@ -106,6 +112,12 @@ const EXACT: Readonly<Record<string, FloorErrorCode>> = {
|
|
|
106
112
|
HolderPositionExists: "BadAccount", HolderPositionNotEmpty: "BadAccount", UnknownLaunch: "BadAccount",
|
|
107
113
|
QuoteNotListed: "QuoteNotListed", QuoteDisabled: "QuoteNotListed", QuoteListed: "QuoteNotListed", QuoteRowCannotOpen: "QuoteNotListed",
|
|
108
114
|
QuoteTransferShort: "TransferFailed", NativeTransferFailed: "TransferFailed", SwapFailed: "TransferFailed", Reentrancy: "TransferFailed",
|
|
115
|
+
|
|
116
|
+
OfficeNotMember: "NotAuthorized", OfficeNotController: "NotAuthorized", OfficeNotSeller: "NotAuthorized", OfficeControllerLeaves: "Locked", OfficeMergeLocked: "Locked",
|
|
117
|
+
OfficeFull: "BadArgument", OfficeAlreadyMember: "BadArgument", OfficeShareSum: "BadArgument", OfficeOverShare: "BadArgument", OfficeNoCash: "BadArgument",
|
|
118
|
+
OfficePositions: "BadArgument", OfficeZeroAmount: "BadArgument", OfficeZeroUnits: "BadArgument", OfficeZeroValue: "BadArgument", OfficeNotHeld: "BadArgument",
|
|
119
|
+
OfficeMergeSize: "BadArgument", OfficeNotMergeable: "BadArgument", OfficeMergeMismatch: "BadArgument", OfficeWrongQuote: "BadArgument", OfficeExists: "BadArgument", OfficeNoMerge: "BadArgument",
|
|
120
|
+
OfficeSlippage: "SlippageExceeded", OfficeOverflow: "Overflow",
|
|
109
121
|
CreatesPaused: "CreatesPaused",
|
|
110
122
|
PresetInvalid: "PresetUnavailable", PresetIdNotNext: "PresetUnavailable", PresetDeleted: "PresetUnavailable", PresetDisabled: "PresetUnavailable",
|
|
111
123
|
PresetUnchecked: "PresetUnavailable", RowTooManyRanges: "PresetUnavailable", RowNotFeasible: "PresetUnavailable",
|
|
@@ -114,6 +126,13 @@ const EXACT: Readonly<Record<string, FloorErrorCode>> = {
|
|
|
114
126
|
OverOwed: "OverOwed", ClaimsShort: "OverOwed", UnknownClaimType: "UnknownClaimType",
|
|
115
127
|
TeamSlotRateOverMax: "TeamSlot", TeamSlotFull: "TeamSlot", TeamSlotPaid: "TeamSlot", TeamSlotExists: "TeamSlot", TeamSlotNoRequest: "TeamSlot",
|
|
116
128
|
NotPendingHandle: "TeamSlot", BadMember: "TeamSlot", HandleAlreadyBound: "TeamSlot",
|
|
129
|
+
DealFeeOverCap: "TeamSlot", DealFeeFixed: "TeamSlot",
|
|
130
|
+
DealEscrowSteps: "BadArgument", DealEscrowExpiry: "BadArgument", DealEscrowFunding: "TransferFailed",
|
|
131
|
+
DealEscrowTarget: "Locked", DealEscrowNotArmed: "Locked", DealEscrowTooSoon: "Locked", DealEscrowNotExpired: "Locked",
|
|
132
|
+
DealEscrowDone: "NothingToDo", DealEscrowExpired: "DeadlineExpired", DealEscrowNotParty: "NotAuthorized",
|
|
133
|
+
|
|
134
|
+
DealEscrowAgency: "BadArgument", DealEscrowProofNotRequired: "BadArgument", DealEscrowVersion: "BadArgument", RefVolumeBookFull: "BadArgument",
|
|
135
|
+
DealEscrowProofState: "Locked", DealEscrowNotProven: "Locked", DealEscrowWindowClosed: "DeadlineExpired", DealEscrowNoObjectionLeft: "NothingToDo",
|
|
117
136
|
TraderRefMismatch: "Referral", TraderRefSet: "Referral", OgFull: "Referral", BadReferralSig: "Referral", BadSignature: "Referral", ReferralSigExpired: "Referral",
|
|
118
137
|
BurnTooLarge: "BurnTooLarge", PageFull: "PageFull",
|
|
119
138
|
NotAuthority: "NotAuthorized", NotUpgradeAuthority: "NotAuthorized", NotPriceUpdater: "NotAuthorized", RoleNotHeld: "NotAuthorized",
|
package/src/events/types.gen.ts
CHANGED
|
@@ -341,6 +341,135 @@ export interface SolTokensBurnedFields {
|
|
|
341
341
|
slot: bigint;
|
|
342
342
|
fromShareBought: bigint | null;
|
|
343
343
|
}
|
|
344
|
+
export interface SolDealFeePaidFields {
|
|
345
|
+
launch: string;
|
|
346
|
+
place: number;
|
|
347
|
+
member: string;
|
|
348
|
+
owed: bigint;
|
|
349
|
+
fee: bigint;
|
|
350
|
+
agencyPart: bigint;
|
|
351
|
+
}
|
|
352
|
+
export interface SolPlatformCreditedFields {
|
|
353
|
+
launch: string;
|
|
354
|
+
payer: string;
|
|
355
|
+
quoteMint: string;
|
|
356
|
+
amount: bigint;
|
|
357
|
+
memo: Uint8Array;
|
|
358
|
+
}
|
|
359
|
+
export interface SolTeamSlotDealFeeFields {
|
|
360
|
+
launch: string;
|
|
361
|
+
index: number;
|
|
362
|
+
key: Uint8Array;
|
|
363
|
+
dealFeeBps: number;
|
|
364
|
+
}
|
|
365
|
+
export interface SolTeamSlotAgencyFields {
|
|
366
|
+
launch: string;
|
|
367
|
+
index: number;
|
|
368
|
+
key: Uint8Array;
|
|
369
|
+
agency: string;
|
|
370
|
+
agencyBps: number;
|
|
371
|
+
}
|
|
372
|
+
export interface SolDealFeeCapSetFields {
|
|
373
|
+
capBps: number;
|
|
374
|
+
}
|
|
375
|
+
export interface SolDealEscrowOpenedFields {
|
|
376
|
+
launch: string;
|
|
377
|
+
escrow: string;
|
|
378
|
+
launcher: string;
|
|
379
|
+
kol: string;
|
|
380
|
+
ref32: Uint8Array;
|
|
381
|
+
assetMint: string;
|
|
382
|
+
kind: number;
|
|
383
|
+
n: number;
|
|
384
|
+
targets: bigint[];
|
|
385
|
+
amounts: bigint[];
|
|
386
|
+
total: bigint;
|
|
387
|
+
expiry: bigint;
|
|
388
|
+
}
|
|
389
|
+
export interface SolDealEscrowArmedFields {
|
|
390
|
+
launch: string;
|
|
391
|
+
escrow: string;
|
|
392
|
+
ref32: Uint8Array;
|
|
393
|
+
step: number;
|
|
394
|
+
marketCap: bigint;
|
|
395
|
+
armedAt: bigint;
|
|
396
|
+
armedSlot: bigint;
|
|
397
|
+
}
|
|
398
|
+
export interface SolDealEscrowReleasedFields {
|
|
399
|
+
launch: string;
|
|
400
|
+
escrow: string;
|
|
401
|
+
ref32: Uint8Array;
|
|
402
|
+
step: number;
|
|
403
|
+
kol: string;
|
|
404
|
+
amount: bigint;
|
|
405
|
+
fee: bigint;
|
|
406
|
+
marketCap: bigint;
|
|
407
|
+
}
|
|
408
|
+
export interface SolDealEscrowRefundedFields {
|
|
409
|
+
launch: string;
|
|
410
|
+
escrow: string;
|
|
411
|
+
ref32: Uint8Array;
|
|
412
|
+
launcher: string;
|
|
413
|
+
amount: bigint;
|
|
414
|
+
}
|
|
415
|
+
export interface SolDealEscrowCancelAgreedFields {
|
|
416
|
+
launch: string;
|
|
417
|
+
escrow: string;
|
|
418
|
+
ref32: Uint8Array;
|
|
419
|
+
by: string;
|
|
420
|
+
party: number;
|
|
421
|
+
agreed: number;
|
|
422
|
+
}
|
|
423
|
+
export interface SolDealEscrowCancelledFields {
|
|
424
|
+
launch: string;
|
|
425
|
+
escrow: string;
|
|
426
|
+
ref32: Uint8Array;
|
|
427
|
+
launcher: string;
|
|
428
|
+
amount: bigint;
|
|
429
|
+
}
|
|
430
|
+
export interface SolRefVolumeOpenedFields {
|
|
431
|
+
launch: string;
|
|
432
|
+
referrer: string;
|
|
433
|
+
}
|
|
434
|
+
export interface SolDealEscrowTermsV3Fields {
|
|
435
|
+
launch: string;
|
|
436
|
+
escrow: string;
|
|
437
|
+
ref32: Uint8Array;
|
|
438
|
+
kinds: Uint8Array;
|
|
439
|
+
proofMask: number;
|
|
440
|
+
agency: string;
|
|
441
|
+
agencyBps: number;
|
|
442
|
+
volAtLock: bigint;
|
|
443
|
+
}
|
|
444
|
+
export interface SolDealEscrowSplitFields {
|
|
445
|
+
launch: string;
|
|
446
|
+
escrow: string;
|
|
447
|
+
ref32: Uint8Array;
|
|
448
|
+
step: number;
|
|
449
|
+
kind: number;
|
|
450
|
+
kol: string;
|
|
451
|
+
kolPart: bigint;
|
|
452
|
+
agency: string;
|
|
453
|
+
agencyPart: bigint;
|
|
454
|
+
tiers: string[];
|
|
455
|
+
refs: bigint[];
|
|
456
|
+
feeRest: bigint;
|
|
457
|
+
}
|
|
458
|
+
export interface SolDealEscrowProofSubmittedFields {
|
|
459
|
+
launch: string;
|
|
460
|
+
escrow: string;
|
|
461
|
+
ref32: Uint8Array;
|
|
462
|
+
step: number;
|
|
463
|
+
proofHash: Uint8Array;
|
|
464
|
+
state: number;
|
|
465
|
+
windowEnds: bigint;
|
|
466
|
+
}
|
|
467
|
+
export interface SolDealEscrowProofObjectedFields {
|
|
468
|
+
launch: string;
|
|
469
|
+
escrow: string;
|
|
470
|
+
ref32: Uint8Array;
|
|
471
|
+
step: number;
|
|
472
|
+
}
|
|
344
473
|
export interface SolGenesisPublicStartedFields {
|
|
345
474
|
signer: string;
|
|
346
475
|
at: bigint;
|
|
@@ -511,6 +640,22 @@ export type SolanaEventMap = {
|
|
|
511
640
|
GenesisListRootSet: SolGenesisListRootSetFields;
|
|
512
641
|
BurnsSynced: SolBurnsSyncedFields;
|
|
513
642
|
TokensBurned: SolTokensBurnedFields;
|
|
643
|
+
DealFeePaid: SolDealFeePaidFields;
|
|
644
|
+
PlatformCredited: SolPlatformCreditedFields;
|
|
645
|
+
TeamSlotDealFee: SolTeamSlotDealFeeFields;
|
|
646
|
+
TeamSlotAgency: SolTeamSlotAgencyFields;
|
|
647
|
+
DealFeeCapSet: SolDealFeeCapSetFields;
|
|
648
|
+
DealEscrowOpened: SolDealEscrowOpenedFields;
|
|
649
|
+
DealEscrowArmed: SolDealEscrowArmedFields;
|
|
650
|
+
DealEscrowReleased: SolDealEscrowReleasedFields;
|
|
651
|
+
DealEscrowRefunded: SolDealEscrowRefundedFields;
|
|
652
|
+
DealEscrowCancelAgreed: SolDealEscrowCancelAgreedFields;
|
|
653
|
+
DealEscrowCancelled: SolDealEscrowCancelledFields;
|
|
654
|
+
RefVolumeOpened: SolRefVolumeOpenedFields;
|
|
655
|
+
DealEscrowTermsV3: SolDealEscrowTermsV3Fields;
|
|
656
|
+
DealEscrowSplit: SolDealEscrowSplitFields;
|
|
657
|
+
DealEscrowProofSubmitted: SolDealEscrowProofSubmittedFields;
|
|
658
|
+
DealEscrowProofObjected: SolDealEscrowProofObjectedFields;
|
|
514
659
|
GenesisPublicStarted: SolGenesisPublicStartedFields;
|
|
515
660
|
GenesisEndSet: SolGenesisEndSetFields;
|
|
516
661
|
LaunchCreatedV2: SolLaunchCreatedV2Fields;
|
|
@@ -650,6 +795,109 @@ export interface EvmCreatorBuyUnlockedFields {
|
|
|
650
795
|
members: bigint[];
|
|
651
796
|
paid: bigint;
|
|
652
797
|
}
|
|
798
|
+
export interface EvmDealEscrowArmedFields {
|
|
799
|
+
launchId: bigint;
|
|
800
|
+
escrow: string;
|
|
801
|
+
ref32: string;
|
|
802
|
+
step: bigint;
|
|
803
|
+
marketCap: bigint;
|
|
804
|
+
armedAt: bigint;
|
|
805
|
+
armedBlock: bigint;
|
|
806
|
+
}
|
|
807
|
+
export interface EvmDealEscrowCancelAgreedFields {
|
|
808
|
+
launchId: bigint;
|
|
809
|
+
escrow: string;
|
|
810
|
+
ref32: string;
|
|
811
|
+
by: string;
|
|
812
|
+
party: bigint;
|
|
813
|
+
agreed: bigint;
|
|
814
|
+
}
|
|
815
|
+
export interface EvmDealEscrowCancelledFields {
|
|
816
|
+
launchId: bigint;
|
|
817
|
+
escrow: string;
|
|
818
|
+
ref32: string;
|
|
819
|
+
launcher: string;
|
|
820
|
+
amount: bigint;
|
|
821
|
+
}
|
|
822
|
+
export interface EvmDealEscrowOpenedFields {
|
|
823
|
+
launchId: bigint;
|
|
824
|
+
escrow: string;
|
|
825
|
+
launcher: string;
|
|
826
|
+
kol: string;
|
|
827
|
+
ref32: string;
|
|
828
|
+
asset: string;
|
|
829
|
+
isToken: boolean;
|
|
830
|
+
targets: bigint[];
|
|
831
|
+
amounts: bigint[];
|
|
832
|
+
total: bigint;
|
|
833
|
+
expiry: bigint;
|
|
834
|
+
}
|
|
835
|
+
export interface EvmDealEscrowProofObjectedFields {
|
|
836
|
+
launchId: bigint;
|
|
837
|
+
escrow: string;
|
|
838
|
+
ref32: string;
|
|
839
|
+
step: bigint;
|
|
840
|
+
}
|
|
841
|
+
export interface EvmDealEscrowProofSubmittedFields {
|
|
842
|
+
launchId: bigint;
|
|
843
|
+
escrow: string;
|
|
844
|
+
ref32: string;
|
|
845
|
+
step: bigint;
|
|
846
|
+
proofHash: string;
|
|
847
|
+
state: bigint;
|
|
848
|
+
windowEnds: bigint;
|
|
849
|
+
}
|
|
850
|
+
export interface EvmDealEscrowRefundedFields {
|
|
851
|
+
launchId: bigint;
|
|
852
|
+
escrow: string;
|
|
853
|
+
ref32: string;
|
|
854
|
+
launcher: string;
|
|
855
|
+
amount: bigint;
|
|
856
|
+
}
|
|
857
|
+
export interface EvmDealEscrowReleasedFields {
|
|
858
|
+
launchId: bigint;
|
|
859
|
+
escrow: string;
|
|
860
|
+
ref32: string;
|
|
861
|
+
step: bigint;
|
|
862
|
+
kol: string;
|
|
863
|
+
amount: bigint;
|
|
864
|
+
fee: bigint;
|
|
865
|
+
marketCap: bigint;
|
|
866
|
+
}
|
|
867
|
+
export interface EvmDealEscrowSplitFields {
|
|
868
|
+
launchId: bigint;
|
|
869
|
+
escrow: string;
|
|
870
|
+
ref32: string;
|
|
871
|
+
step: bigint;
|
|
872
|
+
kind: bigint;
|
|
873
|
+
kol: string;
|
|
874
|
+
kolPart: bigint;
|
|
875
|
+
agency: string;
|
|
876
|
+
agencyPart: bigint;
|
|
877
|
+
tiers: string[];
|
|
878
|
+
refs: bigint[];
|
|
879
|
+
feeRest: bigint;
|
|
880
|
+
}
|
|
881
|
+
export interface EvmDealEscrowTermsV3Fields {
|
|
882
|
+
launchId: bigint;
|
|
883
|
+
escrow: string;
|
|
884
|
+
ref32: string;
|
|
885
|
+
kinds: bigint[];
|
|
886
|
+
proofMask: bigint;
|
|
887
|
+
agency: string;
|
|
888
|
+
agencyBps: bigint;
|
|
889
|
+
volAtLock: bigint;
|
|
890
|
+
}
|
|
891
|
+
export interface EvmDealFeeCapSetFields {
|
|
892
|
+
capBps: bigint;
|
|
893
|
+
}
|
|
894
|
+
export interface EvmDealFeePaidFields {
|
|
895
|
+
launchId: bigint;
|
|
896
|
+
place: bigint;
|
|
897
|
+
member: string;
|
|
898
|
+
owed: bigint;
|
|
899
|
+
fee: bigint;
|
|
900
|
+
}
|
|
653
901
|
export interface EvmGraduatedFields {
|
|
654
902
|
launchId: bigint;
|
|
655
903
|
windowPriceX64: bigint;
|
|
@@ -699,6 +947,101 @@ export interface EvmMetadataBaseSetFields {
|
|
|
699
947
|
export interface EvmNativeCreateFeeSetFields {
|
|
700
948
|
fee: bigint;
|
|
701
949
|
}
|
|
950
|
+
export interface EvmOfficeBuyFields {
|
|
951
|
+
officeId: string;
|
|
952
|
+
buyer: string;
|
|
953
|
+
launchId: bigint;
|
|
954
|
+
gross: bigint;
|
|
955
|
+
tokens: bigint;
|
|
956
|
+
refund: bigint;
|
|
957
|
+
}
|
|
958
|
+
export interface EvmOfficeControllerProposedFields {
|
|
959
|
+
officeId: string;
|
|
960
|
+
member: string;
|
|
961
|
+
}
|
|
962
|
+
export interface EvmOfficeControllerSetFields {
|
|
963
|
+
officeId: string;
|
|
964
|
+
controller: string;
|
|
965
|
+
}
|
|
966
|
+
export interface EvmOfficeDepositFields {
|
|
967
|
+
officeId: string;
|
|
968
|
+
member: string;
|
|
969
|
+
amount: bigint;
|
|
970
|
+
units: bigint;
|
|
971
|
+
valueBefore: bigint;
|
|
972
|
+
unitsTotal: bigint;
|
|
973
|
+
}
|
|
974
|
+
export interface EvmOfficeMemberAddedFields {
|
|
975
|
+
officeId: string;
|
|
976
|
+
member: string;
|
|
977
|
+
}
|
|
978
|
+
export interface EvmOfficeMemberLeftFields {
|
|
979
|
+
officeId: string;
|
|
980
|
+
member: string;
|
|
981
|
+
byController: boolean;
|
|
982
|
+
units: bigint;
|
|
983
|
+
cashOut: bigint;
|
|
984
|
+
launchIds: bigint[];
|
|
985
|
+
tokensOut: bigint[];
|
|
986
|
+
}
|
|
987
|
+
export interface EvmOfficeMergeCancelledFields {
|
|
988
|
+
officeId: string;
|
|
989
|
+
}
|
|
990
|
+
export interface EvmOfficeMergeProposedFields {
|
|
991
|
+
officeId: string;
|
|
992
|
+
other: string;
|
|
993
|
+
newController: string;
|
|
994
|
+
}
|
|
995
|
+
export interface EvmOfficeMergeStartedFields {
|
|
996
|
+
officeId: string;
|
|
997
|
+
other: string;
|
|
998
|
+
newController: string;
|
|
999
|
+
unitsFrom: bigint;
|
|
1000
|
+
valueFrom: bigint;
|
|
1001
|
+
valueTo: bigint;
|
|
1002
|
+
members: bigint;
|
|
1003
|
+
}
|
|
1004
|
+
export interface EvmOfficeMergeStepFields {
|
|
1005
|
+
officeId: string;
|
|
1006
|
+
other: string;
|
|
1007
|
+
moved: bigint;
|
|
1008
|
+
left: bigint;
|
|
1009
|
+
unitsTo: bigint;
|
|
1010
|
+
}
|
|
1011
|
+
export interface EvmOfficeMergedFields {
|
|
1012
|
+
officeId: string;
|
|
1013
|
+
other: string;
|
|
1014
|
+
newController: string;
|
|
1015
|
+
unitsFrom: bigint;
|
|
1016
|
+
unitsTo: bigint;
|
|
1017
|
+
valueFrom: bigint;
|
|
1018
|
+
valueTo: bigint;
|
|
1019
|
+
}
|
|
1020
|
+
export interface EvmOfficeOpenedFields {
|
|
1021
|
+
officeId: string;
|
|
1022
|
+
controller: string;
|
|
1023
|
+
quote: string;
|
|
1024
|
+
}
|
|
1025
|
+
export interface EvmOfficePayoutOwedFields {
|
|
1026
|
+
officeId: string;
|
|
1027
|
+
member: string;
|
|
1028
|
+
amount: bigint;
|
|
1029
|
+
}
|
|
1030
|
+
export interface EvmOfficeSellFields {
|
|
1031
|
+
officeId: string;
|
|
1032
|
+
seller: string;
|
|
1033
|
+
buyer: string;
|
|
1034
|
+
launchId: bigint;
|
|
1035
|
+
tokens: bigint;
|
|
1036
|
+
out: bigint;
|
|
1037
|
+
unfilled: bigint;
|
|
1038
|
+
}
|
|
1039
|
+
export interface EvmOfficeShareSetFields {
|
|
1040
|
+
officeId: string;
|
|
1041
|
+
member: string;
|
|
1042
|
+
shareBps: bigint;
|
|
1043
|
+
shareSum: bigint;
|
|
1044
|
+
}
|
|
702
1045
|
export interface EvmPayoutClaimedFields {
|
|
703
1046
|
wallet: string;
|
|
704
1047
|
sender: string;
|
|
@@ -711,6 +1054,13 @@ export interface EvmPayoutOwedFields {
|
|
|
711
1054
|
quote: string;
|
|
712
1055
|
amount: bigint;
|
|
713
1056
|
}
|
|
1057
|
+
export interface EvmPlatformCreditedFields {
|
|
1058
|
+
launchId: bigint;
|
|
1059
|
+
payer: string;
|
|
1060
|
+
quote: string;
|
|
1061
|
+
amount: bigint;
|
|
1062
|
+
memo: string;
|
|
1063
|
+
}
|
|
714
1064
|
export interface EvmPlatformWithdrawnFields {
|
|
715
1065
|
quote: string;
|
|
716
1066
|
to: string;
|
|
@@ -765,6 +1115,26 @@ export interface EvmTeamShareBoughtClaimedFields {
|
|
|
765
1115
|
wallet: string;
|
|
766
1116
|
tokens: bigint;
|
|
767
1117
|
}
|
|
1118
|
+
export interface EvmTeamSlotAgencyFields {
|
|
1119
|
+
launchId: bigint;
|
|
1120
|
+
index: bigint;
|
|
1121
|
+
key: string;
|
|
1122
|
+
agency: string;
|
|
1123
|
+
agencyBps: bigint;
|
|
1124
|
+
}
|
|
1125
|
+
export interface EvmTeamSlotAgencyPaidFields {
|
|
1126
|
+
launchId: bigint;
|
|
1127
|
+
place: bigint;
|
|
1128
|
+
member: string;
|
|
1129
|
+
agency: string;
|
|
1130
|
+
agencyPart: bigint;
|
|
1131
|
+
}
|
|
1132
|
+
export interface EvmTeamSlotDealFeeFields {
|
|
1133
|
+
launchId: bigint;
|
|
1134
|
+
index: bigint;
|
|
1135
|
+
key: string;
|
|
1136
|
+
dealFeeBps: bigint;
|
|
1137
|
+
}
|
|
768
1138
|
export interface EvmTeamSlotMemberFields {
|
|
769
1139
|
launchId: bigint;
|
|
770
1140
|
index: bigint;
|
|
@@ -866,6 +1236,18 @@ export type EvmEventMap = {
|
|
|
866
1236
|
Claimed: EvmClaimedFields;
|
|
867
1237
|
ConfigWritten: EvmConfigWrittenFields;
|
|
868
1238
|
CreatorBuyUnlocked: EvmCreatorBuyUnlockedFields;
|
|
1239
|
+
DealEscrowArmed: EvmDealEscrowArmedFields;
|
|
1240
|
+
DealEscrowCancelAgreed: EvmDealEscrowCancelAgreedFields;
|
|
1241
|
+
DealEscrowCancelled: EvmDealEscrowCancelledFields;
|
|
1242
|
+
DealEscrowOpened: EvmDealEscrowOpenedFields;
|
|
1243
|
+
DealEscrowProofObjected: EvmDealEscrowProofObjectedFields;
|
|
1244
|
+
DealEscrowProofSubmitted: EvmDealEscrowProofSubmittedFields;
|
|
1245
|
+
DealEscrowRefunded: EvmDealEscrowRefundedFields;
|
|
1246
|
+
DealEscrowReleased: EvmDealEscrowReleasedFields;
|
|
1247
|
+
DealEscrowSplit: EvmDealEscrowSplitFields;
|
|
1248
|
+
DealEscrowTermsV3: EvmDealEscrowTermsV3Fields;
|
|
1249
|
+
DealFeeCapSet: EvmDealFeeCapSetFields;
|
|
1250
|
+
DealFeePaid: EvmDealFeePaidFields;
|
|
869
1251
|
Graduated: EvmGraduatedFields;
|
|
870
1252
|
HandleBound: EvmHandleBoundFields;
|
|
871
1253
|
HandleOwedMoved: EvmHandleOwedMovedFields;
|
|
@@ -873,8 +1255,24 @@ export type EvmEventMap = {
|
|
|
873
1255
|
LaunchCreated: EvmLaunchCreatedFields;
|
|
874
1256
|
MetadataBaseSet: EvmMetadataBaseSetFields;
|
|
875
1257
|
NativeCreateFeeSet: EvmNativeCreateFeeSetFields;
|
|
1258
|
+
OfficeBuy: EvmOfficeBuyFields;
|
|
1259
|
+
OfficeControllerProposed: EvmOfficeControllerProposedFields;
|
|
1260
|
+
OfficeControllerSet: EvmOfficeControllerSetFields;
|
|
1261
|
+
OfficeDeposit: EvmOfficeDepositFields;
|
|
1262
|
+
OfficeMemberAdded: EvmOfficeMemberAddedFields;
|
|
1263
|
+
OfficeMemberLeft: EvmOfficeMemberLeftFields;
|
|
1264
|
+
OfficeMergeCancelled: EvmOfficeMergeCancelledFields;
|
|
1265
|
+
OfficeMergeProposed: EvmOfficeMergeProposedFields;
|
|
1266
|
+
OfficeMergeStarted: EvmOfficeMergeStartedFields;
|
|
1267
|
+
OfficeMergeStep: EvmOfficeMergeStepFields;
|
|
1268
|
+
OfficeMerged: EvmOfficeMergedFields;
|
|
1269
|
+
OfficeOpened: EvmOfficeOpenedFields;
|
|
1270
|
+
OfficePayoutOwed: EvmOfficePayoutOwedFields;
|
|
1271
|
+
OfficeSell: EvmOfficeSellFields;
|
|
1272
|
+
OfficeShareSet: EvmOfficeShareSetFields;
|
|
876
1273
|
PayoutClaimed: EvmPayoutClaimedFields;
|
|
877
1274
|
PayoutOwed: EvmPayoutOwedFields;
|
|
1275
|
+
PlatformCredited: EvmPlatformCreditedFields;
|
|
878
1276
|
PlatformWithdrawn: EvmPlatformWithdrawnFields;
|
|
879
1277
|
PotsSwept: EvmPotsSweptFields;
|
|
880
1278
|
PresetWritten: EvmPresetWrittenFields;
|
|
@@ -884,6 +1282,9 @@ export type EvmEventMap = {
|
|
|
884
1282
|
TeamBuyClaimed: EvmTeamBuyClaimedFields;
|
|
885
1283
|
TeamShareBought: EvmTeamShareBoughtFields;
|
|
886
1284
|
TeamShareBoughtClaimed: EvmTeamShareBoughtClaimedFields;
|
|
1285
|
+
TeamSlotAgency: EvmTeamSlotAgencyFields;
|
|
1286
|
+
TeamSlotAgencyPaid: EvmTeamSlotAgencyPaidFields;
|
|
1287
|
+
TeamSlotDealFee: EvmTeamSlotDealFeeFields;
|
|
887
1288
|
TeamSlotMember: EvmTeamSlotMemberFields;
|
|
888
1289
|
TeamSlotOpened: EvmTeamSlotOpenedFields;
|
|
889
1290
|
TradeV1: EvmTradeV1Fields;
|
|
@@ -896,4 +1297,4 @@ export type EvmEventMap = {
|
|
|
896
1297
|
};
|
|
897
1298
|
export type EvmEvent = { [N in keyof EvmEventMap]: { chain: "evm"; name: N; fields: EvmEventMap[N]; address?: string } }[keyof EvmEventMap];
|
|
898
1299
|
|
|
899
|
-
export const SHARED_EVENT_NAMES = ["BackingCredited","Claimed","ConfigWritten","CreatorBuyUnlocked","DeadSynced","Graduated","HandleBound","HolderIndexRolled","HolderWithdrawn","LaunchCreated","MetadataBaseSet","OgUserRevoked","OgUserSet","PlatformWithdrawn","PotsSwept","PresetWritten","QuoteWritten","RefSlices","TeamShareBought","TeamSlotMember","TeamSlotOpened","Trade","TraderRefCleared","TraderRefOpened"] as const;
|
|
1300
|
+
export const SHARED_EVENT_NAMES = ["BackingCredited","Claimed","ConfigWritten","CreatorBuyUnlocked","DeadSynced","DealEscrowArmed","DealEscrowCancelAgreed","DealEscrowCancelled","DealEscrowOpened","DealEscrowProofObjected","DealEscrowProofSubmitted","DealEscrowRefunded","DealEscrowReleased","DealEscrowSplit","DealEscrowTermsV3","DealFeeCapSet","DealFeePaid","Graduated","HandleBound","HolderIndexRolled","HolderWithdrawn","LaunchCreated","MetadataBaseSet","OgUserRevoked","OgUserSet","PlatformCredited","PlatformWithdrawn","PotsSwept","PresetWritten","QuoteWritten","RefSlices","TeamShareBought","TeamSlotAgency","TeamSlotDealFee","TeamSlotMember","TeamSlotOpened","Trade","TraderRefCleared","TraderRefOpened"] as const;
|
package/src/evm/chains.ts
CHANGED
|
@@ -96,6 +96,64 @@ function withBookedZaps(key: ChainKey, rows: readonly ZapRouterSpec[]): ZapRoute
|
|
|
96
96
|
return rows.map((row) => ({ ...row, zap: book[row.slot] ?? null }));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
const ROUTER_PROXY_INITCODE = "0x67363d3d37363d34f03d5260086018f3";
|
|
100
|
+
|
|
101
|
+
export function floorRouterAddressV2(p: { deployer: string; slot: string }): string {
|
|
102
|
+
let slot32 = new Uint8Array(32);
|
|
103
|
+
if (/^0x[0-9a-fA-F]{64}$/.test(p.slot)) slot32 = hexToBytes(p.slot);
|
|
104
|
+
else {
|
|
105
|
+
const name = new TextEncoder().encode(p.slot);
|
|
106
|
+
if (name.length === 0 || name.length > 32) throw new RangeError("a slot name is 1 to 32 bytes");
|
|
107
|
+
slot32.set(name);
|
|
108
|
+
}
|
|
109
|
+
const proxySalt = bytesToHex(keccak256(encodeAbi(["string", "bytes32"], ["floor-router.v1.FloorRouter", bytesToHex(slot32)])));
|
|
110
|
+
const proxy = create2Address({ deployer: p.deployer, salt: proxySalt, initCode: ROUTER_PROXY_INITCODE });
|
|
111
|
+
return checksumAddress(bytesToHex(keccak256(hexToBytes("0xd694" + proxy.slice(2) + "01")).slice(12)));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const FLOOR_ROUTER_DEPLOYER_EARLIER = "0x3e70158e54E91d2984c0F3B66ce2cE730d1E0e11";
|
|
115
|
+
|
|
116
|
+
export const FLOOR_ROUTER_DEPLOYER_FOR = "0xF100d298F684d86612c06484dFcdF67Be50FBe54";
|
|
117
|
+
|
|
118
|
+
export const FLOOR_ROUTER_SLOTS_FOR: Readonly<Record<string, string>> = {
|
|
119
|
+
"uniswap-ur": "0x756e69737761702d757200000000000000000000000000000000000001ad3b9e",
|
|
120
|
+
"aerodrome-ur": "0x6165726f64726f6d652d75720000000000000000000000000000000005132a9d",
|
|
121
|
+
"pancake-ur": "0x70616e63616b652d7572000000000000000000000000000000000000009e7fe0",
|
|
122
|
+
prjx: "0x70726a7800000000000000000000000000000000000000000000000001e7f80d",
|
|
123
|
+
nest: "0x6e65737400000000000000000000000000000000000000000000000002201db1",
|
|
124
|
+
"ramses-ur": "0x72616d7365732d7572000000000000000000000000000000000000000186a9db",
|
|
125
|
+
hyperswap: "0x6879706572737761700000000000000000000000000000000000000004539830",
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const ROUTER_EARLIER: Readonly<Record<string, string>> = {
|
|
129
|
+
"aerodrome-ur": "0xc662617d009fded9ea074ba9e4fafdccffbb7e12",
|
|
130
|
+
"uniswap-ur": "0xb7acc822eb51226277b1ac3814e90ba6c71fcfde",
|
|
131
|
+
"pancake-ur": "0xd862571b9027df6dfadda6c17786d70329e26982",
|
|
132
|
+
prjx: "0x34c41c05ed27fc8ab0ac21c74c1d4640756563e7",
|
|
133
|
+
nest: "0x58da2a3f4ee02373c2ff130914aa99d987917c8a",
|
|
134
|
+
"ramses-ur": "0x119265957bcadc4ee9c2aaec01008cd9d018c293",
|
|
135
|
+
hyperswap: "0x8c2b426b19456d6a15e607c9063544df6a33d119",
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export interface FloorRouterInstance {
|
|
139
|
+
slot: string;
|
|
140
|
+
address: string;
|
|
141
|
+
|
|
142
|
+
forCaller: boolean;
|
|
143
|
+
|
|
144
|
+
deployer: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const routerBook = (key: ChainKey): FloorRouterInstance[] =>
|
|
148
|
+
Object.keys(FLOOR_ZAP_ADDRESSES[key]).flatMap((slot) => [
|
|
149
|
+
{ slot, address: strict(ROUTER_EARLIER[slot]!), forCaller: false, deployer: FLOOR_ROUTER_DEPLOYER_EARLIER },
|
|
150
|
+
{ slot, address: floorRouterAddressV2({ deployer: FLOOR_ROUTER_DEPLOYER_FOR, slot: FLOOR_ROUTER_SLOTS_FOR[slot]! }), forCaller: true, deployer: FLOOR_ROUTER_DEPLOYER_FOR },
|
|
151
|
+
]);
|
|
152
|
+
|
|
153
|
+
export const FLOOR_ROUTER_ADDRESSES: Readonly<Record<ChainKey, readonly FloorRouterInstance[]>> = Object.fromEntries(
|
|
154
|
+
(Object.keys(FLOOR_ZAP_ADDRESSES) as ChainKey[]).map((k) => [k, routerBook(k)]),
|
|
155
|
+
) as Record<ChainKey, readonly FloorRouterInstance[]>;
|
|
156
|
+
|
|
99
157
|
const UNISWAP_UR = "uniswap-ur";
|
|
100
158
|
|
|
101
159
|
const ROUTES: Record<ChainKey, Omit<EvmChain, "key" | "chainId" | "name" | "nativeSymbol">> = {
|