@hanamesh/api-contracts 0.22.2 → 0.22.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.
@@ -6,9 +6,9 @@
6
6
  "manifestSHA256": "918790fd46272d591b45465780dc4747f5d16c5f2b5250f3db268c5e7e006820",
7
7
  "evidence": "SOURCE_BUILD",
8
8
  "providerRepository": "yzsnstotz/hanamesh-server-chain",
9
- "providerCommit": "a862a558e5eedb725d480735f31244aa6abfa164",
10
- "providerVersion": "0.39.2",
11
- "providerDeclarationsSHA256": "8f3aa68f135f511cb09cf9de767add686155133433615b290069293db09d0dce",
9
+ "providerCommit": "11569ecfa34a47e08be872978b018887abc97dae",
10
+ "providerVersion": "0.39.5",
11
+ "providerDeclarationsSHA256": "b6adb917f1644c85df7514ea516f29301fae1306d2b94dd4c21a0e16dadbcda1",
12
12
  "gasHandling": {
13
13
  "project": "Uniswap/interface",
14
14
  "tag": "v4.0.0",
@@ -48,7 +48,7 @@ export interface QuoteV2BondFact extends QuoteV2Fact{hanaId:Hex;token:Address;bo
48
48
  export interface QuoteV2MigrationEvent{eventName:'BondClosed'|'MigrationDeferred'|'Migrated';args:Readonly<Record<string,string|number|boolean>>;blockNumber:string;blockHash:Hex;transactionHash:Hex;logIndex:number}
49
49
  export interface QuoteV2BuyQuote extends QuoteV2Fact{hanaId:Hex;bond:Address;quote:Address;kind:'exact'|'budget';hana:string;principal:string;hanaFee:string;meshFee:string;total:string;nativePaymentAvailable:boolean}
50
50
  export interface QuoteV2SellQuote extends QuoteV2Fact{hanaId:Hex;bond:Address;quote:Address;account:Address;amount:string;principal:string;hanaFee:string;meshFee:string;receive:string;sellable:string;nativeProceeds:boolean}
51
- export interface QuoteV2Reader{readonly deployment:QuoteV2Deployment;readonly mode:'test-only'|'production';readonly evidence:'FIXTURE'|'READ_ONLY_RPC';readReleaseState(input:QuoteV2ReleaseStateQuery):Promise<QuoteV2ReleaseStateFact>;readReleaseStart(input:{hanaId:Hex}):Promise<QuoteV2ReleaseStartFact>;quoteBuy(input:{hanaId:Hex;kind:'exact'|'budget';amount:bigint}):Promise<QuoteV2BuyQuote>;quoteSell(input:{hanaId:Hex;amount:bigint;account:Address}):Promise<QuoteV2SellQuote>;verifyDeployment():Promise<QuoteV2Fact&{deployment:QuoteV2Deployment}>;readQuoteConfig(input:{quote:Address}):Promise<QuoteV2Fact&{quote:Address;virtualQuote:string;enabled:boolean}>;readIssuance(input:{hanaId:Hex}):Promise<QuoteV2IssuanceFact>;readReserveHistory(input:{hanaKey:Hex;bucket:0|1;limit:number;scanBlockSpan:number;cursor?:string}):Promise<QuoteV2ReserveHistoryPage>;readReserveProposal(input:{proposalId:Hex}):Promise<QuoteV2ReserveProposalFact>;readIssuedAt(input:{hanaKey:Hex;scanBlockSpan:number}):Promise<QuoteV2IssuedAtFact>;readBond(input:{hanaId:Hex;account:Address}):Promise<QuoteV2BondFact>;readMigrationEvents(input:{hanaId:Hex}):Promise<QuoteV2Fact&{hanaId:Hex;bond:Address;events:readonly QuoteV2MigrationEvent[]}>}
51
+ export interface QuoteV2Reader{readonly deployment:QuoteV2Deployment;readonly mode:'test-only'|'production';readonly evidence:'FIXTURE'|'READ_ONLY_RPC';readReleaseState(input:QuoteV2ReleaseStateQuery):Promise<QuoteV2ReleaseStateFact>;readReleaseStart(input:{hanaId:Hex}):Promise<QuoteV2ReleaseStartFact>;quoteBuy(input:{hanaId:Hex;kind:'exact'|'budget';amount:bigint}):Promise<QuoteV2BuyQuote>;quoteSell(input:{hanaId:Hex;amount:bigint;account:Address}):Promise<QuoteV2SellQuote>;verifyDeployment():Promise<QuoteV2Fact&{deployment:QuoteV2Deployment}>;readQuoteConfig(input:{quote:Address}):Promise<QuoteV2Fact&{quote:Address;virtualQuote:string;enabled:boolean}>;readIssuance(input:{hanaId:Hex}):Promise<QuoteV2IssuanceFact>;readReserveHistory(input:{hanaKey:Hex;bucket:0|1;limit:number;scanBlockSpan:number;cursor?:string}):Promise<QuoteV2ReserveHistoryPage>;readReserveProposal(input:{proposalId:Hex}):Promise<QuoteV2ReserveProposalFact>;readIssuedAt(input:{hanaKey:Hex;scanBlockSpan:number}):Promise<QuoteV2IssuedAtFact>;listQuotes(input:{scanBlockSpan:number}):Promise<QuoteV2QuoteList>;readMarketFacts(input:{hanaKey:Hex;anchor?:QuoteV2MarketAnchor}):Promise<QuoteV2MarketFacts>;listIssuedHanaKeys(input:{limit:number;scanBlockSpan:number;cursor?:string;anchor?:QuoteV2MarketAnchor}):Promise<QuoteV2IssuedHanaKeysPage>;readHoldersAllocation(input:QuoteV2MarketPageQuery):Promise<QuoteV2HoldersPage>;readTimeline(input:QuoteV2MarketPageQuery):Promise<QuoteV2TimelinePage>;readMarketHistory(input:QuoteV2MarketHistoryQuery):Promise<QuoteV2MarketHistoryPage>;readBond(input:{hanaId:Hex;account:Address}):Promise<QuoteV2BondFact>;readMigrationEvents(input:{hanaId:Hex}):Promise<QuoteV2Fact&{hanaId:Hex;bond:Address;events:readonly QuoteV2MigrationEvent[]}>}
52
52
  /** One canonical Launcher ReserveWithdrawn event; amounts are decimal strings. */
53
53
  export interface QuoteV2ReserveRecord{readonly proposalId:Hex;readonly expectedRemaining:string;readonly bucket:0|1;readonly to:Address;readonly token:Address;readonly amount:string;readonly remaining:string;readonly transactionHash:Hex;readonly transactionIndex:number;readonly logIndex:number;readonly blockNumber:string;readonly blockHash:Hex;readonly blockTimestamp:string}
54
54
  /** Same-block reserveState counters plus one page of the selected bucket; every page of a cursor chain has the same asOf block. */
@@ -57,7 +57,42 @@ export interface QuoteV2ReserveHistoryPage extends QuoteV2Fact{readonly mode:'te
57
57
  export interface QuoteV2ReserveProposalFact extends QuoteV2Fact{readonly proposalId:Hex;readonly used:boolean}
58
58
  /** Snapshot block plus the original canonical Issued event; issuedAt equals issuance.blockTimestamp. */
59
59
  export interface QuoteV2IssuedAtFact extends QuoteV2Fact{readonly mode:'test-only'|'production';readonly hanaKey:Hex;readonly token:Address;readonly bond:Address;readonly requestId:Hex;readonly authorizationHash:Hex;readonly issuedAt:string;readonly issuance:{readonly transactionHash:Hex;readonly transactionIndex:number;readonly logIndex:number;readonly blockNumber:string;readonly blockHash:Hex;readonly blockTimestamp:string}}
60
- export declare function createQuoteV2Reader(options:{deployment:QuoteV2Deployment;publicClient:Pick<PublicClient,'getChainId'|'getBlock'|'getCode'|'readContract'|'getLogs'>;confirmations:number;fromBlock:bigint;mode:'test-only'|'production'}):Promise<QuoteV2Reader>;
60
+ /** listQuotes: enabled Factory quoteConfig entries rebuilt from QuoteConfigured events, each equal to the same-block view. */
61
+ export interface QuoteV2QuoteList extends QuoteV2Fact{readonly mode:'test-only'|'production';readonly bondFactory:Address;readonly quotes:readonly {readonly quote:Address;readonly virtualQuote:string;readonly name:string;readonly symbol:string;readonly decimals:number;readonly configured:{readonly transactionHash:Hex;readonly blockNumber:string;readonly blockHash:Hex;readonly logIndex:number}}[]}
62
+ /** Registry market snapshot fields shared by every market read. */
63
+ export interface QuoteV2MarketFact extends QuoteV2Fact{readonly mode:'test-only'|'production';readonly sourceRef:string}
64
+ /** Fixed-block read: every view and log is taken at this confirmed block (e.g. the snapshot of an Issued enumeration). */
65
+ export interface QuoteV2MarketAnchor{blockNumber:string;blockHash:Hex}
66
+ export interface QuoteV2MarketPageQuery{hanaKey:Hex;limit:number;scanBlockSpan:number;cursor?:string;anchor?:QuoteV2MarketAnchor}
67
+ export interface QuoteV2MarketAsset{readonly address:Address;readonly name:string;readonly symbol:string;readonly decimals:number}
68
+ export interface QuoteV2MarketIssuance{readonly hanaKey:Hex;readonly requestId:Hex;readonly token:Address;readonly bond:Address;readonly issuer:Address;readonly hanaTreasury:Address;readonly phase:'bond'|'migrated'|'inactive';readonly pointsBps:number;readonly earlyReleaseAllowed:boolean;readonly earlyReleaseAt:string|null;readonly migratedAt:string|null;readonly pair:Address|null;readonly pool:Address;readonly quote:Address;readonly releaseStartedAt:string|null;readonly releaseStartSource:'early-release'|'migration'|null}
69
+ export interface QuoteV2MarketBucket{readonly authority:Address;readonly holder:Address;readonly initial:string;readonly withdrawn:string;readonly remaining:string}
70
+ export interface QuoteV2MarketAllocation{readonly source:'canonical-launcher-issuance-and-reserves';readonly supply:{readonly pointsBps:number;readonly pointsAirdrop:string;readonly platformReserve:string;readonly creatorReserve:string;readonly curve:string;readonly liquidity:string};readonly pointsBps:number;readonly creatorCustody:QuoteV2MarketBucket;readonly platformReserve:QuoteV2MarketBucket;readonly frozenHolderAllocations:'separate-custody-provider'}
71
+ export type QuoteV2MarketFacts=QuoteV2MarketFact&({readonly hanaKey:Hex;readonly status:'unissued';readonly issuance:null}|{readonly hanaKey:Hex;readonly status:'issued';readonly issuance:QuoteV2MarketIssuance;readonly sold:string;readonly sales:string;readonly remaining:string;
72
+ readonly price:{readonly kind:'curve-marginal-rational'|'pool-reserve-rational';readonly numerator:string;readonly denominator:string;readonly base:Address;readonly quote:Address}|null;
73
+ readonly poolReserves:{readonly pair:Address;readonly baseToken:Address;readonly quoteToken:Address;readonly baseReserve:string;readonly quoteReserve:string}|null;readonly totalSupply:string;readonly tokenMetadata:QuoteV2MarketAsset;readonly quoteMetadata:QuoteV2MarketAsset;readonly allocation:QuoteV2MarketAllocation;
74
+ readonly bondCurve:{readonly market:'bond';readonly bond:Address;readonly active:boolean;readonly virtualHana:string;readonly virtualQuote:string;readonly sales:string;readonly sold:string;readonly position:{readonly kind:'block-end';readonly blockNumber:string;readonly blockHash:Hex;readonly blockTimestamp:string}}});
75
+ export interface QuoteV2CanonicalEvent{readonly event:string;readonly address:Address;readonly args:Readonly<Record<string,string|number|boolean>>;readonly transactionHash:Hex;readonly transactionIndex:number;readonly logIndex:number;readonly blockNumber:string;readonly blockHash:Hex;readonly blockTimestamp:string;readonly eventId:string;readonly source:'canonical-chain-event'}
76
+ export interface QuoteV2IssuedHanaKeysPage extends QuoteV2MarketFact{readonly launcher:Address;readonly fromBlock:string;readonly limit:number;readonly scanBlockSpan:number;readonly scanFromBlock:string;readonly scanToBlock:string;readonly order:'block-transaction-log-ascending';readonly coverage:'launcher-issued-events';readonly records:readonly (Omit<QuoteV2CanonicalEvent,'event'|'address'|'args'>&{readonly hanaKey:Hex})[];readonly anchorCursor:string;readonly nextCursor:string|null}
77
+ export interface QuoteV2HoldersPage extends QuoteV2MarketFact{readonly hanaKey:Hex;readonly token:Address;readonly bond:Address;readonly holderCount:number;readonly countBasis:'positive-token-addresses-including-contracts';readonly order:'balance-desc-address-asc';readonly totalSupply:string;readonly allocation:QuoteV2MarketAllocation;readonly issuance:{readonly transactionHash:Hex;readonly blockNumber:string;readonly blockHash:Hex;readonly blockTimestamp:string;readonly transactionIndex:number;readonly logIndex:number};readonly totalRecords:number;readonly records:readonly {readonly address:Address;readonly balance:string;readonly share:{readonly numerator:string;readonly denominator:string}}[];readonly nextCursor:string|null}
78
+ export interface QuoteV2TimelinePage extends QuoteV2MarketFact{readonly hanaKey:Hex;readonly token:Address;readonly bond:Address;readonly order:'block-transaction-log-ascending';readonly coverage:'on-chain-only-custody-admission-freeze-separate';readonly totalRecords:number;readonly records:readonly QuoteV2CanonicalEvent[];readonly nextCursor:string|null}
79
+ /** readMarketHistory: Bond Bought/Sold before migration, official pool Sync/Swap after, joined at Migrated. cursor and checkpoint are exclusive. */
80
+ export interface QuoteV2MarketHistoryQuery{hanaKey:Hex;limit:number;scanBlockSpan:number;cursor?:string;checkpoint?:string;anchor?:QuoteV2MarketAnchor}
81
+ export type QuoteV2HistoryPosition={readonly kind:'event';readonly address:Address;readonly blockNumber:string;readonly blockHash:Hex;readonly blockTimestamp:string;readonly transactionHash:Hex;readonly transactionIndex:number;readonly logIndex:number}|{readonly kind:'block-end';readonly blockNumber:string;readonly blockHash:Hex;readonly blockTimestamp:string};
82
+ export interface QuoteV2HistoryPrice{readonly base:Address;readonly quote:Address;readonly numerator:string;readonly denominator:string;readonly basis:'quote-base-units-per-token-base-unit'}
83
+ export type QuoteV2HistorySupply={readonly status:'available';readonly totalSupply:string;readonly basis:'verified-constant-supply';readonly source:QuoteV2HistoryPosition}|null;
84
+ export type QuoteV2HistoryState={readonly position:QuoteV2HistoryPosition;readonly sourceRefs:readonly QuoteV2HistoryPosition[];readonly supply:QuoteV2HistorySupply}&(
85
+ {readonly market:'bond';readonly bond:Address;readonly virtualQuote:string;readonly virtualHana:string;readonly sold:string;readonly netReserve:string;readonly price:QuoteV2HistoryPrice}|
86
+ {readonly market:'swap'|'pool-pending';readonly pair:Address;readonly token0:Address;readonly token1:Address;readonly reserve0:string;readonly reserve1:string;readonly baseReserve:string;readonly quoteReserve:string;readonly price:QuoteV2HistoryPrice|null});
87
+ export type QuoteV2HistoryRecord={readonly kind:'trade';readonly event:QuoteV2CanonicalEvent&{readonly market:'bond'|'swap';readonly side:'buy'|'sell';readonly tokenAmount:string;readonly quoteAmount:string;readonly amountBasis:'bond-principal-excludes-fees'|'pool-swap-flow';readonly account:Address;readonly accountBasis:'bond-event-account'|'transaction-from';readonly recipient:Address|null};readonly before:QuoteV2HistoryState;readonly after:QuoteV2HistoryState;readonly fees:readonly unknown[];readonly flow:{readonly basis:'bond-protocol-flow'|'pool-swap-flow';readonly input:{readonly asset:Address;readonly amount:string};readonly output:{readonly asset:Address;readonly amount:string}};readonly walletFlow:{readonly status:'not-attested'}}|
88
+ {readonly kind:'state-change';readonly event:QuoteV2CanonicalEvent;readonly reason:'pool-sync'|'migration';readonly relatedEvent:QuoteV2CanonicalEvent|null;readonly appliesToActiveMarket:boolean;readonly before:QuoteV2HistoryState;readonly after:QuoteV2HistoryState;readonly countAsTrade:false};
89
+ export interface QuoteV2MarketHistoryPage extends QuoteV2MarketFact{readonly schema:'hanamesh-chain-market-history-v1';readonly readKind:'bootstrap'|'delta';readonly hanaKey:Hex;readonly token:Address;readonly bond:Address;readonly pool:Address;readonly quote:Address;readonly tokenMetadata:QuoteV2MarketAsset;readonly quoteMetadata:QuoteV2MarketAsset;
90
+ readonly bondCurve:Extract<QuoteV2MarketFacts,{status:'issued'}>['bondCurve'];readonly baseCheckpoint:string|null;readonly initialState:QuoteV2HistoryState|null;readonly records:readonly QuoteV2HistoryRecord[];readonly order:'block-transaction-log-ascending';
91
+ readonly coverage:{readonly scanRange:{readonly fromBlock:string;readonly toBlock:string}|null;readonly complete:boolean;readonly basis:'canonical-rpc-log-coverage'};readonly anchorCursor:string;readonly nextCursor:string|null;readonly checkpoint:string|null;
92
+ readonly phaseBoundary:{readonly migratedAt:string;readonly event:QuoteV2CanonicalEvent;readonly tailState:QuoteV2HistoryState;readonly initialPoolState:QuoteV2HistoryState;readonly initialPoolSync:QuoteV2CanonicalEvent;readonly initialPoolMint:QuoteV2CanonicalEvent}|null}
93
+ /** Registry market publicFailure: QuoteV2Error only; generic message; null for any other error. */
94
+ export declare function publicQuoteV2ReadError(error:unknown):{readonly statusCode:400|404|503;readonly code:string;readonly message:string;readonly need:{readonly action:string}}|null;
95
+ export declare function createQuoteV2Reader(options:{deployment:QuoteV2Deployment;publicClient:Pick<PublicClient,'getChainId'|'getBlock'|'getCode'|'readContract'|'getLogs'|'getTransaction'>;confirmations:number;fromBlock:bigint;mode:'test-only'|'production'}):Promise<QuoteV2Reader>;
61
96
 
62
97
  /** Fixed20% gas margin from Uniswap/interface v4.0.0 calculateGasMargin. */
63
98
  export declare function calculateQuoteV2GasMargin(estimate:bigint):bigint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanamesh/api-contracts",
3
- "version": "0.22.2",
3
+ "version": "0.22.4",
4
4
  "description": "Consumed quote-v2 provider declarations and exact current contract artifacts.",
5
5
  "type": "module",
6
6
  "license": "MIT",