@hanamesh/api-contracts 0.0.0-stage → 0.22.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/LICENSE +21 -0
- package/README.md +10 -2
- package/contracts/chain/quote-v2/BatchVestingDistributorQuoteV2.json +3601 -0
- package/contracts/chain/quote-v2/HanaBondFactoryQuoteV2.json +953 -0
- package/contracts/chain/quote-v2/HanaBondQuoteV2.json +2951 -0
- package/contracts/chain/quote-v2/HanaLauncherQuoteV2.json +2820 -0
- package/contracts/chain/quote-v2/HanaTokenQuoteV2.json +817 -0
- package/contracts/chain/quote-v2/WETH9.json +610 -0
- package/contracts/chain/quote-v2/index.d.ts +3 -0
- package/contracts/chain/quote-v2/index.js +1 -0
- package/contracts/chain/quote-v2/manifest.json +125 -0
- package/contracts/chain/quote-v2/provenance.json +20 -0
- package/contracts/chain/quote-v2/provider.d.ts +90 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +52 -4
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "release-quote-v2",
|
|
3
|
+
"evidence": "SOURCE_BUILD",
|
|
4
|
+
"revision": "2.2.0",
|
|
5
|
+
"compiler": "0.8.26+commit.8a97fa7a",
|
|
6
|
+
"settings": {
|
|
7
|
+
"remappings": [
|
|
8
|
+
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
|
|
9
|
+
"forge-std/=lib/forge-std/src/"
|
|
10
|
+
],
|
|
11
|
+
"optimizer": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"runs": 200
|
|
14
|
+
},
|
|
15
|
+
"metadata": {
|
|
16
|
+
"bytecodeHash": "ipfs"
|
|
17
|
+
},
|
|
18
|
+
"compilationTarget": {
|
|
19
|
+
"src/BatchVestingDistributorQuoteV2.sol": "BatchVestingDistributorQuoteV2"
|
|
20
|
+
},
|
|
21
|
+
"evmVersion": "paris",
|
|
22
|
+
"libraries": {}
|
|
23
|
+
},
|
|
24
|
+
"contracts": {
|
|
25
|
+
"HanaLauncherQuoteV2": {
|
|
26
|
+
"path": "HanaLauncherQuoteV2.json",
|
|
27
|
+
"source": "src/HanaLauncherQuoteV2.sol",
|
|
28
|
+
"fileSHA256": "f2e3925cdc58b8a8340049373b5c0cc9cafcac19406b06b8781d0e9183e1220e",
|
|
29
|
+
"sourceSHA256": "91afeebbfe96a05b50fa049f32d047cbe1c38c854e466f45ab007bf2fb21b1fe",
|
|
30
|
+
"abiSHA256": "811b774c71131beac41afba6986a4c7a55d37491a9d18aef8897ad97320c90d3",
|
|
31
|
+
"creationKeccak": "0xd5945667a94cf4ab5636f2b60c9ab45ee0c6515293e24cc86c11e92f224f7069",
|
|
32
|
+
"runtimeTemplateKeccak": "0xad200b42c3a47b8f35a9fc1e564f4c015f5db464b22b749198aa2c2ea9410dc5",
|
|
33
|
+
"runtimeBytes": 14681,
|
|
34
|
+
"immutableSlots": 24
|
|
35
|
+
},
|
|
36
|
+
"HanaBondFactoryQuoteV2": {
|
|
37
|
+
"path": "HanaBondFactoryQuoteV2.json",
|
|
38
|
+
"source": "src/HanaBondQuoteV2.sol",
|
|
39
|
+
"fileSHA256": "966560f06a8e24d685fbba0a08a74934c84c5d775f182366fbf129e4baea5c9b",
|
|
40
|
+
"sourceSHA256": "54f1aacacc2ff4a7e86677e1864a5a625ccdf8bcd506867ab6b95a0f600ca4f1",
|
|
41
|
+
"abiSHA256": "8058aca9fdab82c01e9437686d00ffaca6a8f49dffde949e6479cb7f4ca7802a",
|
|
42
|
+
"creationKeccak": "0x02642f54a54e23c8845c99ddcfc1a97af1efac3de8a83a78f64365d4fe0be0f6",
|
|
43
|
+
"runtimeTemplateKeccak": "0x3c377352bde7800f7bf9e47778ac63bc16f54a5cfb932c57c532f0cf52c85921",
|
|
44
|
+
"runtimeBytes": 24476,
|
|
45
|
+
"immutableSlots": 8
|
|
46
|
+
},
|
|
47
|
+
"HanaBondQuoteV2": {
|
|
48
|
+
"path": "HanaBondQuoteV2.json",
|
|
49
|
+
"source": "src/HanaBondQuoteV2.sol",
|
|
50
|
+
"fileSHA256": "4a754dee89ea4e8b07cd9da54bd32889f6a236c049c518d533ec7d72e7a5c8a8",
|
|
51
|
+
"sourceSHA256": "54f1aacacc2ff4a7e86677e1864a5a625ccdf8bcd506867ab6b95a0f600ca4f1",
|
|
52
|
+
"abiSHA256": "5e913ac833dc86b9cc268b35f37d22d52fd3be56932349e9570e3790c1bb080a",
|
|
53
|
+
"creationKeccak": "0xa06e328d33b13f2b901d7c18b3cda7360914a8d79fa4fdc96029caaab473376e",
|
|
54
|
+
"runtimeTemplateKeccak": "0x8975809842d86c4ec2f8073287b8c39aae0bad9dcb60c444a9bdf43931fb6cdb",
|
|
55
|
+
"runtimeBytes": 19195,
|
|
56
|
+
"immutableSlots": 75
|
|
57
|
+
},
|
|
58
|
+
"HanaTokenQuoteV2": {
|
|
59
|
+
"path": "HanaTokenQuoteV2.json",
|
|
60
|
+
"source": "src/HanaTokenQuoteV2.sol",
|
|
61
|
+
"fileSHA256": "5a2fab3e94d642a88eb6fea627c80370462e88d764073cf85b073fca42a0e1b0",
|
|
62
|
+
"sourceSHA256": "acd89ff6bf4647429d0396f7cc28a4789c630a4a2bdef5044cfafc3655bad6fa",
|
|
63
|
+
"abiSHA256": "6a9eee53d9e09ec26a7c854d8ba765a0dac9c6eca652daba1e080de001a3dd1c",
|
|
64
|
+
"creationKeccak": "0x5ee558e9707eb57bc982738fcc803a21eb278c9d76d0a9816de2ba56984535e8",
|
|
65
|
+
"runtimeTemplateKeccak": "0x5474253257db29ccd0d9786907da1a0a4d718b1835a4e5cbf9f4341b2f2e5c57",
|
|
66
|
+
"runtimeBytes": 1900,
|
|
67
|
+
"immutableSlots": 1
|
|
68
|
+
},
|
|
69
|
+
"BatchVestingDistributorQuoteV2": {
|
|
70
|
+
"path": "BatchVestingDistributorQuoteV2.json",
|
|
71
|
+
"source": "src/BatchVestingDistributorQuoteV2.sol",
|
|
72
|
+
"fileSHA256": "8a342f2f14c9c0dafbf156aa763818a470e7477197a4488f9f25d85631b576d4",
|
|
73
|
+
"sourceSHA256": "027a5b5274e3785eb18352cfcd5afb455eeb31a1faec4aaad46c0c0a993e1649",
|
|
74
|
+
"abiSHA256": "98c4c55e3390104361166342d3c4ee1412f9feeabb8e1a6c90b1ad0332bf19f7",
|
|
75
|
+
"creationKeccak": "0x95ab394179d3609dedbf3170921da7dc5762006447f00f03f269d87f35512cab",
|
|
76
|
+
"runtimeTemplateKeccak": "0x9a45881a05e813194cc6753b42d658a9ab25fcbf45af47956f559cc68fac5090",
|
|
77
|
+
"runtimeBytes": 16711,
|
|
78
|
+
"immutableSlots": 25
|
|
79
|
+
},
|
|
80
|
+
"WETH9": {
|
|
81
|
+
"path": "WETH9.json",
|
|
82
|
+
"source": "hanaswap/periphery/contracts/test/WETH9.sol",
|
|
83
|
+
"fileSHA256": "e8b0c1802e879c6ce2d60d48bf0d4c669df5b59f2fc79ec956746b58594ff5f3",
|
|
84
|
+
"sourceSHA256": "33f13565b207188485030aa20fd1f38d52d8c455cc64720560fb38149dcb4137",
|
|
85
|
+
"abiSHA256": "22bc25d82ab57cbe1bbcc104a31e92b2d234caaa28863f8b7a2fa941ad481730",
|
|
86
|
+
"creationKeccak": "0xd0dfea2f79e9df259aa15badec97021306fcc0d296a789f2e8df809300be2bc3",
|
|
87
|
+
"runtimeTemplateKeccak": "0xe3d6980b1aaa343a26342ea69009baad9dfb15963504f21ce09584f65370cff2",
|
|
88
|
+
"runtimeBytes": 2227,
|
|
89
|
+
"immutableSlots": 0,
|
|
90
|
+
"compiler": "0.6.6+commit.6c089d02",
|
|
91
|
+
"license": "GPL-3.0-or-later",
|
|
92
|
+
"frozenFixtureSHA256": "febaadd9bdbc0f709a50d8575c47897f69c6490270861983e58d37e15b9f4864"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"openzeppelin": {
|
|
96
|
+
"url": "https://github.com/OpenZeppelin/openzeppelin-contracts",
|
|
97
|
+
"tag": "v5.3.0",
|
|
98
|
+
"commit": "e4f70216d759d8e6a64144a9e1f7bbeed78e7079",
|
|
99
|
+
"mode": "git-submodule",
|
|
100
|
+
"path": "lib/openzeppelin-contracts",
|
|
101
|
+
"license": "MIT",
|
|
102
|
+
"scope": "business ERC20, safe transfer/approval, reentrancy, typed-data/signatures and Merkle proofs (D-4/HM-4)"
|
|
103
|
+
},
|
|
104
|
+
"runtimeCheck": "Zero all immutableReferences ranges in deployed runtime, compare runtimeTemplate.",
|
|
105
|
+
"wrappedNative": {
|
|
106
|
+
"fixture": "fixtures/release-quote-v2/WETH9.json",
|
|
107
|
+
"compiler": "0.6.6+commit.6c089d02",
|
|
108
|
+
"settings": {
|
|
109
|
+
"compilationTarget": {
|
|
110
|
+
"hanaswap/periphery/contracts/test/WETH9.sol": "WETH9"
|
|
111
|
+
},
|
|
112
|
+
"evmVersion": "istanbul",
|
|
113
|
+
"libraries": {},
|
|
114
|
+
"metadata": {
|
|
115
|
+
"bytecodeHash": "ipfs"
|
|
116
|
+
},
|
|
117
|
+
"optimizer": {
|
|
118
|
+
"enabled": true,
|
|
119
|
+
"runs": 999999
|
|
120
|
+
},
|
|
121
|
+
"remappings": []
|
|
122
|
+
},
|
|
123
|
+
"license": "GPL-3.0-or-later"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"provider": "@hanamesh/server-chain/quote-v2",
|
|
3
|
+
"sourceRepository": "yzsnstotz/hanamesh-contracts",
|
|
4
|
+
"sourceCommit": "59ddb9554286d9ba1c68a2f8227a67d2b5c8d450",
|
|
5
|
+
"revision": "2.2.0",
|
|
6
|
+
"manifestSHA256": "918790fd46272d591b45465780dc4747f5d16c5f2b5250f3db268c5e7e006820",
|
|
7
|
+
"evidence": "SOURCE_BUILD",
|
|
8
|
+
"providerRepository": "yzsnstotz/hanamesh-server-chain",
|
|
9
|
+
"providerCommit": "ad5bebac6095ca50d8039be3c53c9e55b59ad9a4",
|
|
10
|
+
"providerVersion": "0.38.0",
|
|
11
|
+
"providerDeclarationsSHA256": "53c9d0b36723cbdf71b1a6dc1f7b60fdeb8cbdb0fb0ce9568ff2d94d2dbdbc03",
|
|
12
|
+
"gasHandling": {
|
|
13
|
+
"project": "Uniswap/interface",
|
|
14
|
+
"tag": "v4.0.0",
|
|
15
|
+
"commit": "e9148b30c9aff44613003b83daacc83d24b157f0",
|
|
16
|
+
"source": "src/utils/calculateGasMargin.ts",
|
|
17
|
+
"walletFlow": "src/hooks/useSwapCallback.ts",
|
|
18
|
+
"adopted": "single viem estimateContractGas then fixed20% gas margin; user wallet sends"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type {Abi,PublicClient,Address,Hex} from 'viem';
|
|
2
|
+
export declare const QUOTE_V2_PROTOCOL:'release-quote-v2';
|
|
3
|
+
export declare const QUOTE_V2_SCHEMA:'hanamesh-release-quote-v2-deployment-v1';
|
|
4
|
+
export interface QuoteV2Deployment {readonly schema:typeof QUOTE_V2_SCHEMA;readonly protocol:typeof QUOTE_V2_PROTOCOL;readonly chainId:number;readonly addresses:{readonly launcher:Address;readonly bondFactory:Address;readonly release:Address;readonly hanaSwapRouter:Address;readonly wrappedNative:Address};readonly platformAuthority:Address;readonly admissionSigner:Address;readonly rootSigner:Address;readonly penaltyMode:'reschedule'|'original-cap'}
|
|
5
|
+
export declare function parseQuoteV2Deployment(meta:QuoteV2Deployment):QuoteV2Deployment;
|
|
6
|
+
export declare class QuoteV2Error extends Error{readonly code:string;constructor(code:string,message:string)}
|
|
7
|
+
export declare const quoteV2Abis:Readonly<Record<'HanaLauncherQuoteV2'|'HanaBondFactoryQuoteV2'|'HanaBondQuoteV2'|'HanaTokenQuoteV2'|'BatchVestingDistributorQuoteV2'|'WETH9',Abi>>;
|
|
8
|
+
export declare const quoteV2Runtime:Readonly<Record<string,{normalizedKeccak:Hex;byteLength:number;immutableReferences:Readonly<Record<string,readonly {start:number;length:number}[]>>}>>;
|
|
9
|
+
export declare const quoteV2SourceCommit:string;
|
|
10
|
+
export interface QuoteV2Authorization{hanaId:Hex;requestId:Hex;payer:Address;subject:Hex;snapshot:Hex;name:string;symbol:string;hanaTreasury:Address;quote:Address;launchFeeWei:bigint;pointsBps:bigint;earlyReleaseAllowed:boolean;deadline:bigint}
|
|
11
|
+
export interface QuoteV2LaunchInput{deployment:QuoteV2Deployment;authorization:QuoteV2Authorization}
|
|
12
|
+
export interface QuoteV2LaunchTypedData{readonly domain:{readonly name:'HanaLauncher';readonly version:'4';readonly chainId:number;readonly verifyingContract:Address};readonly types:{readonly LaunchAuthorization:readonly {readonly name:string;readonly type:string}[]};readonly primaryType:'LaunchAuthorization';readonly message:QuoteV2Authorization}
|
|
13
|
+
export declare function quoteV2LaunchTypedData(input:QuoteV2LaunchInput):QuoteV2LaunchTypedData;
|
|
14
|
+
export declare function quoteV2EmptyLaunchTypedData(input:QuoteV2LaunchInput):{readonly domain:QuoteV2LaunchTypedData['domain'];readonly types:{readonly EmptyLaunchAuthorization:readonly {readonly name:string;readonly type:string}[]};readonly primaryType:'EmptyLaunchAuthorization';readonly message:{readonly authorizationHash:Hex}};
|
|
15
|
+
export declare function quoteV2ReleaseDomain(deployment:QuoteV2Deployment):{readonly name:'HanaMesh Batch Release';readonly version:'3';readonly chainId:number;readonly verifyingContract:Address};
|
|
16
|
+
export interface QuoteV2EmptyInput{deployment:QuoteV2Deployment;token:Address;bond:Address;authorizationHash:Hex;epoch:bigint;nonce:bigint;deadline:bigint}
|
|
17
|
+
export declare function quoteV2EmptyAllocationTypedData(input:QuoteV2EmptyInput):{readonly domain:ReturnType<typeof quoteV2ReleaseDomain>;readonly types:{readonly EmptyAllocation:readonly {readonly name:string;readonly type:string}[]};readonly primaryType:'EmptyAllocation';readonly message:Omit<QuoteV2EmptyInput,'deployment'>};
|
|
18
|
+
export interface QuoteV2Call{address:Address;abi:Abi;functionName:string;args:readonly unknown[];account?:Address;value?:bigint;gas?:bigint}
|
|
19
|
+
export type QuoteV2Payment={payment:'native';value:bigint}|{payment:'erc20';value?:0n};
|
|
20
|
+
export type QuoteV2BuyInput={deployment:QuoteV2Deployment;bond:Address;quote:Address;account:Address;deadline:bigint;gas?:bigint}&QuoteV2Payment;
|
|
21
|
+
export declare const quoteV2Calls:{
|
|
22
|
+
createCampaign:(input:QuoteV2CreateCampaignInput&QuoteV2Sender&{signature:Hex})=>QuoteV2Call;
|
|
23
|
+
fundCampaign:(input:QuoteV2ReleaseIdInput&QuoteV2Sender)=>QuoteV2Call;
|
|
24
|
+
openRegistration:(input:QuoteV2OpenRegistrationInput&QuoteV2Sender&{signature:Hex})=>QuoteV2Call;
|
|
25
|
+
register:(input:QuoteV2RegisterInput&QuoteV2Sender&{proof:readonly Hex[];signature:Hex})=>QuoteV2Call;
|
|
26
|
+
claim:(input:QuoteV2ReleaseIdInput&QuoteV2Sender&{entitlementId:Hex})=>QuoteV2Call;
|
|
27
|
+
launch:(input:QuoteV2LaunchInput&{account:Address;signature:Hex;gas?:bigint})=>QuoteV2Call;
|
|
28
|
+
emptyLaunch:(input:QuoteV2LaunchInput&{account:Address;signature:Hex;nonce:bigint;deadline:bigint;emptySignature:Hex;gas?:bigint})=>QuoteV2Call;
|
|
29
|
+
buyExact:(input:QuoteV2BuyInput&{amount:bigint;maxSpend:bigint})=>QuoteV2Call;
|
|
30
|
+
buyBudget:(input:QuoteV2BuyInput&{budget:bigint;minHana:bigint})=>QuoteV2Call;
|
|
31
|
+
sell:(input:{bond:Address;account:Address;amount:bigint;minReceive:bigint;recipient:Address;deadline:bigint})=>QuoteV2Call;
|
|
32
|
+
migrate:(input:{bond:Address;account:Address;gas?:bigint})=>QuoteV2Call;
|
|
33
|
+
startEarlyRelease:(input:{bond:Address;account:Address})=>QuoteV2Call;
|
|
34
|
+
setQuote:(input:{deployment:QuoteV2Deployment;quote:Address;virtualQuote:bigint;enabled:boolean})=>QuoteV2Call;
|
|
35
|
+
settleEmpty:(input:QuoteV2EmptyInput&{signature:Hex})=>QuoteV2Call;
|
|
36
|
+
withdrawReserve:(input:{deployment:QuoteV2Deployment;hanaId:Hex;bucket:0|1;to:Address;amount:bigint;proposalId:Hex;expectedRemaining:bigint})=>QuoteV2Call;
|
|
37
|
+
};
|
|
38
|
+
export type QuoteV2MigrationReason=0|1|2|3;
|
|
39
|
+
export declare const QUOTE_V2_MIGRATION_REASONS:readonly ['None','HistoryUnavailable','PriceOutsideBand','NoFeasibleLiquidity'];
|
|
40
|
+
export interface QuoteV2MigrationStatus{closed:boolean;completed:boolean;historyReady:boolean;lastReason:QuoteV2MigrationReason;closedAt:string;migratedAt:string;closingQuote:string;windowSeconds:string;averageX112:string;spotX112:string}
|
|
41
|
+
export type QuoteV2MigrationState='open'|'pending'|'completed';
|
|
42
|
+
export declare function quoteV2MigrationState(status:Pick<QuoteV2MigrationStatus,'closed'|'completed'>):QuoteV2MigrationState;
|
|
43
|
+
export interface QuoteV2Fact{protocol:'release-quote-v2';chainId:number;evidence:'FIXTURE'|'READ_ONLY_RPC';blockNumber:string;blockHash:Hex;blockTimestamp:string;sourceCommit:string;confirmations:number;requiredConfirmations:number}
|
|
44
|
+
export interface QuoteV2Issuance extends QuoteV2Fact{hanaId:Hex;token:Address;bond:Address;pool:Address;payer:Address;hanaTreasury:Address;requestId:Hex;authorizationHash:Hex;quote:Address;virtualQuote:string;launchFeeWei:string;pointsBps:string;pointsAmount:string;earlyReleaseAllowed:boolean;treasuryReserve:string;creatorReserve:string}
|
|
45
|
+
export interface QuoteV2BondFact extends QuoteV2Fact{hanaId:Hex;token:Address;bond:Address;pool:Address;quote:Address;virtualQuote:string;account:Address;active:boolean;sold:string;netReserve:string;sellQuota:string;sellable:string;releaseStartedAt:string;migrationStatus:QuoteV2MigrationStatus;migrationState:QuoteV2MigrationState;migrationHana:string;migrationQuote:string;migrationPoolHana:string;migrationPoolQuote:string}
|
|
46
|
+
export interface QuoteV2MigrationEvent{eventName:'BondClosed'|'MigrationDeferred'|'Migrated';args:Readonly<Record<string,string|number|boolean>>;blockNumber:string;blockHash:Hex;transactionHash:Hex;logIndex:number}
|
|
47
|
+
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}
|
|
48
|
+
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}
|
|
49
|
+
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<QuoteV2Issuance>;readBond(input:{hanaId:Hex;account:Address}):Promise<QuoteV2BondFact>;readMigrationEvents(input:{hanaId:Hex}):Promise<QuoteV2Fact&{hanaId:Hex;bond:Address;events:readonly QuoteV2MigrationEvent[]}>}
|
|
50
|
+
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>;
|
|
51
|
+
|
|
52
|
+
/** Fixed20% gas margin from Uniswap/interface v4.0.0 calculateGasMargin. */
|
|
53
|
+
export declare function calculateQuoteV2GasMargin(estimate:bigint):bigint;
|
|
54
|
+
|
|
55
|
+
/** Chain-owned issuance range and frozen inventory formula; used by custody. */
|
|
56
|
+
export declare function isValidPointsBps(value:unknown):boolean;
|
|
57
|
+
/** Chain-owned launch fee rule (Launcher uint256: 0 allowed, no other cap); bigint or canonical decimal wei string; used by custody. */
|
|
58
|
+
export declare function isLaunchFeeWei(value:unknown):boolean;
|
|
59
|
+
export declare function quoteV2SupplySplit(pointsBps:number|bigint):Readonly<{pointsAmount:bigint;treasuryReserve:bigint;creatorReserve:bigint;bondAmount:bigint}>;
|
|
60
|
+
|
|
61
|
+
export interface QuoteV2CampaignParams {campaignId:Hex;token:Address;bond:Address;rightsRoot:Hex;budget:bigint}
|
|
62
|
+
export interface QuoteV2ReleaseAuthorization {epoch:bigint;nonce:bigint;deadline:bigint}
|
|
63
|
+
export interface QuoteV2CreateCampaignInput extends QuoteV2ReleaseAuthorization {deployment:QuoteV2Deployment;params:QuoteV2CampaignParams}
|
|
64
|
+
export interface QuoteV2ReleaseIdInput {deployment:QuoteV2Deployment;campaignId:Hex}
|
|
65
|
+
export interface QuoteV2OpenRegistrationInput extends QuoteV2ReleaseIdInput,QuoteV2ReleaseAuthorization {}
|
|
66
|
+
export interface QuoteV2RegistrationAuthorization extends QuoteV2ReleaseAuthorization {campaignId:Hex;entitlementId:Hex;committedAccount:Address;account:Address;total:bigint;amount:0n;caseId:Hex;version:bigint}
|
|
67
|
+
export interface QuoteV2RegisterInput {deployment:QuoteV2Deployment;authorization:QuoteV2RegistrationAuthorization}
|
|
68
|
+
export interface QuoteV2Sender {account:Address;gas?:bigint}
|
|
69
|
+
export interface QuoteV2ReleaseTypedData<T extends string,M> {readonly domain:ReturnType<typeof quoteV2ReleaseDomain>;readonly primaryType:T;readonly types:Readonly<Record<T,readonly {readonly name:string;readonly type:string}[]>>;readonly message:M}
|
|
70
|
+
export declare function quoteV2CreateCampaignTypedData(input:QuoteV2CreateCampaignInput):QuoteV2ReleaseTypedData<'CreateCampaign',QuoteV2CampaignParams&QuoteV2ReleaseAuthorization>;
|
|
71
|
+
export declare function quoteV2OpenRegistrationTypedData(input:QuoteV2OpenRegistrationInput):QuoteV2ReleaseTypedData<'OpenRegistration',Omit<QuoteV2OpenRegistrationInput,'deployment'>>;
|
|
72
|
+
export declare function quoteV2RegisterTypedData(input:QuoteV2RegisterInput):QuoteV2ReleaseTypedData<'Register',QuoteV2RegistrationAuthorization>;
|
|
73
|
+
export interface QuoteV2ReleasePolicy {readonly 'release.initialBps':number;readonly 'release.linearDays':number;readonly 'release.stepHours':number;readonly 'release.cliffDays':number;readonly 'release.bindingClaimWindowDays':number}
|
|
74
|
+
export interface QuoteV2ReleaseStart {readonly started:boolean;readonly trigger:'early-release'|'migration'|'none';readonly startedAt:string;readonly earlyReleaseAllowed:boolean}
|
|
75
|
+
export interface QuoteV2StartTransaction {readonly transactionHash:Hex;readonly blockNumber:string;readonly blockHash:Hex}
|
|
76
|
+
export interface QuoteV2ReleaseStartFact extends QuoteV2Fact {readonly hanaId:Hex;readonly token:Address;readonly bond:Address;readonly releaseStart:QuoteV2ReleaseStart;readonly bondMigration:{readonly migrated:boolean;readonly migratedAt:string;readonly pair:Address};readonly startTransaction?:QuoteV2StartTransaction}
|
|
77
|
+
export interface QuoteV2CampaignState {readonly token:Address;readonly bond:Address;readonly rightsRoot:Hex;readonly budget:string;readonly releaseStartedAt:string;readonly openedAt:string;readonly registrationDeadline:string;readonly allocated:string;readonly funded:boolean}
|
|
78
|
+
export interface QuoteV2RightState {readonly committedAccount:Address;readonly account:Address;readonly total:string;readonly cap:string;readonly claimed:string;readonly deducted:string;readonly restored:string;readonly checkpointVested:string;readonly checkpointDay:string;readonly version:string;readonly registered:boolean;readonly swept:boolean;readonly originalCurve:boolean;readonly vested:string;readonly claimable:string}
|
|
79
|
+
export interface QuoteV2ReleaseStateQuery {readonly campaignId:Hex;readonly entitlementId:Hex;readonly token:Address;readonly bond:Address;/** Required for claim facts; application key provided by the host. */readonly hanaId?:Hex}
|
|
80
|
+
export interface QuoteV2ReleaseStateFact extends QuoteV2Fact {readonly mode:'test-only'|'production';readonly release:Address;readonly rootSigner:Address;readonly treasury:Address;readonly bondFactory:Address;readonly penaltyMode:'reschedule'|'original-cap';readonly policyLocked:true;readonly policy:QuoteV2ReleasePolicy;readonly campaignId:Hex;readonly entitlementId:Hex;readonly token:Address;readonly bond:Address;readonly observedAt:{readonly blockNumber:string;readonly blockHash:Hex;readonly timestamp:string};readonly epoch:string;readonly campaign:QuoteV2CampaignState;readonly right:QuoteV2RightState;readonly releaseStart:QuoteV2ReleaseStart;readonly bondMigration:QuoteV2ReleaseStartFact['bondMigration'];readonly startTransaction?:QuoteV2StartTransaction;readonly issuance?:Pick<QuoteV2Issuance,'pointsBps'|'earlyReleaseAllowed'>}
|
|
81
|
+
export interface QuoteV2EntitlementQuery {readonly protocol:'release-quote-v2';readonly evidence:'FIXTURE'|'TRUSTED';readonly hanaId:string;readonly chainId:number;readonly release:Address;readonly campaignId:Hex;readonly entitlementId:Hex;readonly token:Address;readonly bond:Address;readonly issuance:{readonly pointsBps:number;readonly earlyReleaseAllowed:boolean}}
|
|
82
|
+
export interface QuoteV2ClaimChainState {readonly protocol:'release-quote-v2';readonly evidence:'FIXTURE'|'TRUSTED';readonly chainId:number;readonly release:Address;readonly hanaId:string;readonly campaignId:Hex;readonly entitlementId:Hex;readonly sourceRef:string;readonly verifiedAt:string;readonly canonical:true;readonly block:{readonly number:string;readonly hash:Hex;/** ISO UTC */readonly timestamp:string;readonly confirmations:number;readonly requiredConfirmations:number};readonly policyVersion:string;readonly policy:QuoteV2ReleasePolicy;readonly penaltyMode:'reschedule'|'original-cap';readonly releaseStart:QuoteV2ReleaseStart;readonly campaign:(QuoteV2CampaignState&{readonly migratedAt:string})|null;readonly right:QuoteV2RightState|null}
|
|
83
|
+
export interface QuoteV2CustodyStartBase {readonly protocol:'custody-release-start-v1';readonly evidence:'TRUSTED'|'FIXTURE';readonly hanaId:string;readonly campaignId:string;readonly verifiedAt:string;readonly sourceRef:string;readonly earlyReleaseAllowed:boolean;readonly source:{readonly protocol:'release-quote-v2';readonly chainId:number;readonly hanaKey:Hex;readonly blockNumber:string;readonly blockHash:Hex;/** ISO UTC */readonly blockTimestamp:string;readonly confirmations:number;readonly requiredConfirmations:number}}
|
|
84
|
+
export type QuoteV2CustodyStartFact=QuoteV2CustodyStartBase&({readonly status:'not-started'}|({readonly status:'started';readonly trigger:'early-release'|'migration';/** ISO UTC */readonly startedAt:string}&QuoteV2StartTransaction));
|
|
85
|
+
export interface QuoteV2ReleasePorts {
|
|
86
|
+
readonly publicationReader:{read(input:Omit<QuoteV2ReleaseStateQuery,'hanaId'>):Promise<Omit<QuoteV2ReleaseStateFact,'confirmations'>&{readonly confirmations:string}>};
|
|
87
|
+
readonly chainState:{readonly protocol:'release-quote-v2';readonly evidence:'FIXTURE'|'TRUSTED';read(input:QuoteV2EntitlementQuery):Promise<QuoteV2ClaimChainState>};
|
|
88
|
+
readonly releaseStartFacts:{readonly protocol:'custody-release-start-v1';readonly deploymentProtocol:'release-quote-v2';readonly evidence:'FIXTURE'|'TRUSTED';readReleaseStart(input:{hanaId:string;campaignId:string;asOf:string}):Promise<QuoteV2CustodyStartFact>};
|
|
89
|
+
}
|
|
90
|
+
export declare function createQuoteV2ReleasePorts(options:{reader:QuoteV2Reader;hanaKey:(hanaId:string)=>Hex;now?:()=>Date}):QuoteV2ReleasePorts;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './contracts/chain/quote-v2/index.js';
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './contracts/chain/quote-v2/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanamesh/api-contracts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.22.1",
|
|
4
|
+
"description": "Consumed quote-v2 provider declarations and exact current contract artifacts.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/yzsnstotz/hanamesh-api-contracts.git"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=20"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"default": "./index.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json",
|
|
20
|
+
"./chain/quote-v2": {
|
|
21
|
+
"types": "./contracts/chain/quote-v2/index.d.ts",
|
|
22
|
+
"default": "./contracts/chain/quote-v2/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./chain/quote-v2/BatchVestingDistributorQuoteV2.json": "./contracts/chain/quote-v2/BatchVestingDistributorQuoteV2.json",
|
|
25
|
+
"./chain/quote-v2/provenance.json": "./contracts/chain/quote-v2/provenance.json",
|
|
26
|
+
"./chain/quote-v2/HanaBondQuoteV2.json": "./contracts/chain/quote-v2/HanaBondQuoteV2.json",
|
|
27
|
+
"./chain/quote-v2/HanaLauncherQuoteV2.json": "./contracts/chain/quote-v2/HanaLauncherQuoteV2.json",
|
|
28
|
+
"./chain/quote-v2/HanaTokenQuoteV2.json": "./contracts/chain/quote-v2/HanaTokenQuoteV2.json",
|
|
29
|
+
"./chain/quote-v2/manifest.json": "./contracts/chain/quote-v2/manifest.json",
|
|
30
|
+
"./chain/quote-v2/WETH9.json": "./contracts/chain/quote-v2/WETH9.json",
|
|
31
|
+
"./chain/quote-v2/HanaBondFactoryQuoteV2.json": "./contracts/chain/quote-v2/HanaBondFactoryQuoteV2.json"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"index.js",
|
|
35
|
+
"index.d.ts",
|
|
36
|
+
"contracts/chain/quote-v2"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "node --test test/*.test.mjs && tsc -p test/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"viem": "^2.56.9"
|
|
43
|
+
},
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"viem": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"viem": "2.56.9",
|
|
52
|
+
"@types/node": "24.3.0"
|
|
53
|
+
}
|
|
54
|
+
}
|