opacity-issuer-core 0.2.1 → 0.2.2
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/dist/index.cjs +785 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +254 -1
- package/dist/index.d.ts +254 -1
- package/dist/index.js +773 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -11085,4 +11085,257 @@ declare class SandboxTransferError extends Error {
|
|
|
11085
11085
|
*/
|
|
11086
11086
|
declare function transferSandboxUser(publicClient: PublicClient, params: TransferSandboxUserParams): Promise<SandboxTransferProgress>;
|
|
11087
11087
|
|
|
11088
|
-
|
|
11088
|
+
/** Dedicated capability: sandboxVersion 2 does not imply wallet linking or issuer registration. */
|
|
11089
|
+
declare const sandboxWalletLinkAbi: readonly [{
|
|
11090
|
+
readonly type: "function";
|
|
11091
|
+
readonly name: "sandboxWalletLinkingVersion";
|
|
11092
|
+
readonly stateMutability: "pure";
|
|
11093
|
+
readonly inputs: readonly [];
|
|
11094
|
+
readonly outputs: readonly [{
|
|
11095
|
+
readonly type: "uint256";
|
|
11096
|
+
}];
|
|
11097
|
+
}, {
|
|
11098
|
+
readonly type: "function";
|
|
11099
|
+
readonly name: "sandboxWalletLinkUsed";
|
|
11100
|
+
readonly stateMutability: "view";
|
|
11101
|
+
readonly inputs: readonly [{
|
|
11102
|
+
readonly name: "digest";
|
|
11103
|
+
readonly type: "bytes32";
|
|
11104
|
+
}];
|
|
11105
|
+
readonly outputs: readonly [{
|
|
11106
|
+
readonly type: "bool";
|
|
11107
|
+
}];
|
|
11108
|
+
}, {
|
|
11109
|
+
readonly type: "function";
|
|
11110
|
+
readonly name: "sandboxLinkWallet";
|
|
11111
|
+
readonly stateMutability: "nonpayable";
|
|
11112
|
+
readonly inputs: readonly [{
|
|
11113
|
+
readonly name: "newWallet";
|
|
11114
|
+
readonly type: "address";
|
|
11115
|
+
}, {
|
|
11116
|
+
readonly name: "nonce";
|
|
11117
|
+
readonly type: "bytes32";
|
|
11118
|
+
}, {
|
|
11119
|
+
readonly name: "deadline";
|
|
11120
|
+
readonly type: "uint64";
|
|
11121
|
+
}, {
|
|
11122
|
+
readonly name: "newWalletSignature";
|
|
11123
|
+
readonly type: "bytes";
|
|
11124
|
+
}];
|
|
11125
|
+
readonly outputs: readonly [];
|
|
11126
|
+
}, {
|
|
11127
|
+
readonly type: "event";
|
|
11128
|
+
readonly name: "SandboxWalletLinked";
|
|
11129
|
+
readonly anonymous: false;
|
|
11130
|
+
readonly inputs: readonly [{
|
|
11131
|
+
readonly name: "existingWallet";
|
|
11132
|
+
readonly type: "address";
|
|
11133
|
+
readonly indexed: true;
|
|
11134
|
+
}, {
|
|
11135
|
+
readonly name: "newWallet";
|
|
11136
|
+
readonly type: "address";
|
|
11137
|
+
readonly indexed: true;
|
|
11138
|
+
}, {
|
|
11139
|
+
readonly name: "userId";
|
|
11140
|
+
readonly type: "bytes32";
|
|
11141
|
+
readonly indexed: true;
|
|
11142
|
+
}, {
|
|
11143
|
+
readonly name: "nonce";
|
|
11144
|
+
readonly type: "bytes32";
|
|
11145
|
+
readonly indexed: false;
|
|
11146
|
+
}, {
|
|
11147
|
+
readonly name: "deadline";
|
|
11148
|
+
readonly type: "uint64";
|
|
11149
|
+
readonly indexed: false;
|
|
11150
|
+
}];
|
|
11151
|
+
}];
|
|
11152
|
+
declare const sandboxWalletLinkTypes: {
|
|
11153
|
+
readonly SandboxWalletLink: readonly [{
|
|
11154
|
+
readonly name: "existingWallet";
|
|
11155
|
+
readonly type: "address";
|
|
11156
|
+
}, {
|
|
11157
|
+
readonly name: "newWallet";
|
|
11158
|
+
readonly type: "address";
|
|
11159
|
+
}, {
|
|
11160
|
+
readonly name: "userId";
|
|
11161
|
+
readonly type: "bytes32";
|
|
11162
|
+
}, {
|
|
11163
|
+
readonly name: "nonce";
|
|
11164
|
+
readonly type: "bytes32";
|
|
11165
|
+
}, {
|
|
11166
|
+
readonly name: "deadline";
|
|
11167
|
+
readonly type: "uint64";
|
|
11168
|
+
}];
|
|
11169
|
+
};
|
|
11170
|
+
interface SandboxWalletLinkParams {
|
|
11171
|
+
chainId: number;
|
|
11172
|
+
registryAddress: Address;
|
|
11173
|
+
existingWallet: Address;
|
|
11174
|
+
newWallet: Address;
|
|
11175
|
+
nonce: Hex;
|
|
11176
|
+
deadline: bigint;
|
|
11177
|
+
/** Nonempty inventory for this offering. Each token must use this registry; all target balances must be zero.
|
|
11178
|
+
* This does not prove absence of balances in omitted tokens. Link before any fund tokens arrive. */
|
|
11179
|
+
checkedAssets: readonly {
|
|
11180
|
+
token: Address;
|
|
11181
|
+
tokenId: bigint;
|
|
11182
|
+
}[];
|
|
11183
|
+
}
|
|
11184
|
+
interface SandboxWalletLinkIntent extends SandboxWalletLinkParams {
|
|
11185
|
+
userId: Hex;
|
|
11186
|
+
}
|
|
11187
|
+
type SandboxWalletLinkBlocker = 'unsupported-wallet-linking' | 'registry-paused' | 'source-not-approved' | 'source-identity-missing' | 'target-already-linked' | 'target-not-fresh' | 'target-is-issuer' | 'consent-expired' | 'consent-used' | 'target-holds-assets';
|
|
11188
|
+
interface PreparedSandboxWalletLink {
|
|
11189
|
+
intent: SandboxWalletLinkIntent;
|
|
11190
|
+
blockNumber: bigint;
|
|
11191
|
+
sourceExpiry: bigint;
|
|
11192
|
+
blockers: SandboxWalletLinkBlocker[];
|
|
11193
|
+
ready: boolean;
|
|
11194
|
+
/** Available after signature simulation; an estimate, not a guarantee of final gas cost. */
|
|
11195
|
+
gas?: {
|
|
11196
|
+
estimatedGas: bigint;
|
|
11197
|
+
gasPrice: bigint;
|
|
11198
|
+
estimatedCost: bigint;
|
|
11199
|
+
nativeBalance: bigint;
|
|
11200
|
+
};
|
|
11201
|
+
}
|
|
11202
|
+
/** Public journal: no keys, signatures or signature-containing calldata. Persist with bigint support. */
|
|
11203
|
+
interface SandboxWalletLinkProgress {
|
|
11204
|
+
kind: 'wallet-link';
|
|
11205
|
+
intent: SandboxWalletLinkIntent;
|
|
11206
|
+
stage: 'prepared' | 'sending' | 'submitted' | 'rejected' | 'complete';
|
|
11207
|
+
hash?: Hash;
|
|
11208
|
+
/** Source account nonce explicitly bound before broadcast; reconcile this nonce if no hash returned. */
|
|
11209
|
+
senderNonce?: number;
|
|
11210
|
+
result?: IssuerReceiptResult;
|
|
11211
|
+
}
|
|
11212
|
+
interface SubmittedSandboxWalletLink extends SandboxWalletLinkProgress {
|
|
11213
|
+
stage: 'submitted' | 'complete';
|
|
11214
|
+
hash: Hash;
|
|
11215
|
+
senderNonce: number;
|
|
11216
|
+
}
|
|
11217
|
+
interface SendSandboxWalletLinkParams {
|
|
11218
|
+
intent: SandboxWalletLinkIntent;
|
|
11219
|
+
/** Volatile consent; never included in journal records or SDK errors. */
|
|
11220
|
+
signature: Hex;
|
|
11221
|
+
persist(progress: SandboxWalletLinkProgress): Promise<void>;
|
|
11222
|
+
}
|
|
11223
|
+
declare class SandboxWalletLinkError extends Error {
|
|
11224
|
+
readonly code: 'blocked' | 'stale-intent' | 'send-in-progress' | 'rejected' | 'uncertain' | 'persistence-failed' | 'check-unavailable' | 'insufficient-gas';
|
|
11225
|
+
readonly progress?: SandboxWalletLinkProgress | undefined;
|
|
11226
|
+
constructor(code: 'blocked' | 'stale-intent' | 'send-in-progress' | 'rejected' | 'uncertain' | 'persistence-failed' | 'check-unavailable' | 'insufficient-gas', message: string, progress?: SandboxWalletLinkProgress | undefined);
|
|
11227
|
+
}
|
|
11228
|
+
declare function walletLinkData(value: unknown, label: string, keys: readonly string[]): void;
|
|
11229
|
+
declare function validateSandboxWalletLinkParams(input: SandboxWalletLinkParams): SandboxWalletLinkParams;
|
|
11230
|
+
declare function validateSandboxWalletLinkIntent(input: SandboxWalletLinkIntent): SandboxWalletLinkIntent;
|
|
11231
|
+
declare function buildSandboxWalletLinkTypedData(input: SandboxWalletLinkIntent): {
|
|
11232
|
+
domain: {
|
|
11233
|
+
name: string;
|
|
11234
|
+
version: string;
|
|
11235
|
+
chainId: number;
|
|
11236
|
+
verifyingContract: `0x${string}`;
|
|
11237
|
+
};
|
|
11238
|
+
types: {
|
|
11239
|
+
readonly SandboxWalletLink: readonly [{
|
|
11240
|
+
readonly name: "existingWallet";
|
|
11241
|
+
readonly type: "address";
|
|
11242
|
+
}, {
|
|
11243
|
+
readonly name: "newWallet";
|
|
11244
|
+
readonly type: "address";
|
|
11245
|
+
}, {
|
|
11246
|
+
readonly name: "userId";
|
|
11247
|
+
readonly type: "bytes32";
|
|
11248
|
+
}, {
|
|
11249
|
+
readonly name: "nonce";
|
|
11250
|
+
readonly type: "bytes32";
|
|
11251
|
+
}, {
|
|
11252
|
+
readonly name: "deadline";
|
|
11253
|
+
readonly type: "uint64";
|
|
11254
|
+
}];
|
|
11255
|
+
};
|
|
11256
|
+
primaryType: "SandboxWalletLink";
|
|
11257
|
+
message: {
|
|
11258
|
+
existingWallet: `0x${string}`;
|
|
11259
|
+
newWallet: `0x${string}`;
|
|
11260
|
+
userId: `0x${string}`;
|
|
11261
|
+
nonce: `0x${string}`;
|
|
11262
|
+
deadline: bigint;
|
|
11263
|
+
};
|
|
11264
|
+
};
|
|
11265
|
+
declare function buildSandboxWalletLinkTransaction(input: SandboxWalletLinkIntent, signature: Hex): {
|
|
11266
|
+
from: `0x${string}`;
|
|
11267
|
+
to: `0x${string}`;
|
|
11268
|
+
chainId: number;
|
|
11269
|
+
value: 0n;
|
|
11270
|
+
data: `0x${string}`;
|
|
11271
|
+
};
|
|
11272
|
+
declare function walletLinkWaitOptions(value?: IssuerWaitOptions): IssuerWaitOptions;
|
|
11273
|
+
/** Direct RPC implementation; hosted SDK wrappers reuse this exact logic. No automatic sends/retries. */
|
|
11274
|
+
declare function createSandboxWalletLinksNamespace(options: {
|
|
11275
|
+
publicClient: PublicClient;
|
|
11276
|
+
walletClient?: WalletClient | undefined;
|
|
11277
|
+
chainId?: number | undefined;
|
|
11278
|
+
}): {
|
|
11279
|
+
prepareWalletLink: (input: SandboxWalletLinkParams) => Promise<PreparedSandboxWalletLink>;
|
|
11280
|
+
signWalletLink: (input: SandboxWalletLinkIntent, newWalletClient: WalletClient) => Promise<Hex>;
|
|
11281
|
+
preflightWalletLink: (input: SandboxWalletLinkIntent, signature: Hex) => Promise<{
|
|
11282
|
+
gas: {
|
|
11283
|
+
estimatedGas: bigint;
|
|
11284
|
+
gasPrice: bigint;
|
|
11285
|
+
estimatedCost: bigint;
|
|
11286
|
+
nativeBalance: bigint;
|
|
11287
|
+
};
|
|
11288
|
+
intent: SandboxWalletLinkIntent;
|
|
11289
|
+
blockNumber: bigint;
|
|
11290
|
+
sourceExpiry: bigint;
|
|
11291
|
+
blockers: SandboxWalletLinkBlocker[];
|
|
11292
|
+
ready: boolean;
|
|
11293
|
+
}>;
|
|
11294
|
+
sendWalletLink: (input: SendSandboxWalletLinkParams) => Promise<SubmittedSandboxWalletLink>;
|
|
11295
|
+
waitForWalletLink: (input: SubmittedSandboxWalletLink, wait?: IssuerWaitOptions) => Promise<IssuerReceiptResult>;
|
|
11296
|
+
};
|
|
11297
|
+
type SandboxWalletLinksNamespace = ReturnType<typeof createSandboxWalletLinksNamespace>;
|
|
11298
|
+
|
|
11299
|
+
/** Contains a plaintext throwaway key. Store privately. userId is confirmed only after complete. */
|
|
11300
|
+
interface SandboxLinkedWalletProgress {
|
|
11301
|
+
kind: 'linked-wallet';
|
|
11302
|
+
wallet: Address;
|
|
11303
|
+
existingWallet: Address;
|
|
11304
|
+
privateKey: Hex;
|
|
11305
|
+
chainId: number;
|
|
11306
|
+
registryAddress: Address;
|
|
11307
|
+
userId: Hex;
|
|
11308
|
+
stage: 'created' | 'linking' | 'complete';
|
|
11309
|
+
link: SandboxWalletLinkProgress;
|
|
11310
|
+
}
|
|
11311
|
+
interface CreateSandboxLinkedWalletParams {
|
|
11312
|
+
chainId: number;
|
|
11313
|
+
registryAddress: Address;
|
|
11314
|
+
existingWallet: Address;
|
|
11315
|
+
checkedAssets: SandboxWalletLinkParams['checkedAssets'];
|
|
11316
|
+
sourceWalletClient: WalletClient;
|
|
11317
|
+
/** Persist credentials before any signature or send; then persist every journal transition. */
|
|
11318
|
+
persist(progress: SandboxLinkedWalletProgress): Promise<void>;
|
|
11319
|
+
/** Omit to generate a fresh account. Supplied keys must never have held registry assets. */
|
|
11320
|
+
privateKey?: Hex;
|
|
11321
|
+
nonce?: Hex;
|
|
11322
|
+
/** Defaults to fifteen minutes after the latest block timestamp. */
|
|
11323
|
+
deadline?: bigint;
|
|
11324
|
+
wait?: IssuerWaitOptions;
|
|
11325
|
+
}
|
|
11326
|
+
declare class SandboxLinkedWalletCreationError extends Error {
|
|
11327
|
+
readonly progress: SandboxLinkedWalletProgress;
|
|
11328
|
+
constructor(progress: SandboxLinkedWalletProgress);
|
|
11329
|
+
}
|
|
11330
|
+
/**
|
|
11331
|
+
* Generate, save and link a fresh wallet. Only the existing wallet submits/pays for the transaction.
|
|
11332
|
+
* Never self-onboards the new wallet, assigns a second identity, funds, or changes any traits.
|
|
11333
|
+
* No automatic retries; receipt recovery uses waitForWalletLink with the saved public journal.
|
|
11334
|
+
*/
|
|
11335
|
+
declare function createSandboxLinkedWallet(publicClient: PublicClient, input: CreateSandboxLinkedWalletParams): Promise<SandboxLinkedWalletProgress>;
|
|
11336
|
+
/** Shape/deployment validation only; saved completion is historical and live eligibility can change. */
|
|
11337
|
+
declare function validateSandboxLinkedWalletProgress(input: SandboxLinkedWalletProgress): SandboxLinkedWalletProgress;
|
|
11338
|
+
/** Restore a completed linked test wallet without funding, onboarding, signing, or network I/O. */
|
|
11339
|
+
declare function restoreSandboxLinkedWallet<chain extends Chain>(input: SandboxLinkedWalletProgress, options: RestoreSandboxUserWalletOptions<chain>): WalletClient<Transport, chain, PrivateKeyAccount>;
|
|
11340
|
+
|
|
11341
|
+
export { type CeilingBalanceConfig, type CreateSandboxLinkedWalletParams, type CreateSandboxUserParams, DEFAULT_ISSUER_BEACON_VARIANT, EMPTY_ISSUER_ENGINE, ISSUER_CONTRACTS_COMMIT, ISSUER_CONTRACTS_PR, type IssuerAdapterDeploymentParams, type IssuerAttachedPolicy, type IssuerAuxiliaryDeploymentParams, type IssuerClientOptions, IssuerDenominatorMode, type IssuerDeployTokenParams, type IssuerDeploymentBlocker, type IssuerDeploymentReceiptResult, type IssuerEngineConfig, IssuerGuardMode, type IssuerOperationContext, type IssuerOperationParams, type IssuerOverrideAuthorization, type IssuerOverrideOperation, type IssuerPolicyApprovalParams, type IssuerPolicyEngineOperation, type IssuerPolicyKind, type IssuerProtocolDeployment, type IssuerReceiptResult, type IssuerRuleSetParams, IssuerRuleType, type IssuerSandboxAccountParams, type IssuerSandboxCapabilities, type IssuerSandboxRegistrationBlocker, type IssuerSandboxRegistryOperation, type IssuerSandboxVaultAdminOperation, type IssuerSandboxVaultAdminParams, type IssuerTokenConfig, type IssuerTokenOperation, type IssuerTokenParams, type IssuerTransaction, type IssuerVaultDeploymentParams, type IssuerWaitOptions, OpacityIssuerError, OpacityIssuerOperationError, type OpacityIssuersNamespace, OpacityPurchaseError, type OpacityPurchasesNamespace, OpacityTransferError, type OpacityTransfersNamespace, type PolicyAttachment, type PolicyBatchOperation, type PolicyChange, type PolicyGuard, type PrepareSandboxUserParams, type PreparedIssuerDeployment, type PreparedPurchase, type PreparedSandboxUser, type PreparedSandboxWalletLink, type PreparedTransfer, type PurchaseApprovalRequest, type PurchaseApprovalStep, type PurchaseBlocker, type PurchaseBuyerState, type PurchaseClientOptions, type PurchaseDeployment, type PurchaseOffering, type PurchaseParams, type PurchaseQuote, type PurchaseQuoteParams, type PurchaseReceiptResult, type PurchaseTransaction, type PurchaseWaitOptions, type PurchaseWriteRequest, type RestoreSandboxUserWalletOptions, SANDBOX_ISSUER_DEPLOYMENT, SANDBOX_PURCHASE_DEPLOYMENT, SEPOLIA_SANDBOX_MANIFEST, SandboxLinkedWalletCreationError, type SandboxLinkedWalletProgress, SandboxTransferError, type SandboxTransferProgress, type SandboxUserBlocker, SandboxUserCreationError, type SandboxUserCreationProgress, type SandboxUserFundingTransaction, type SandboxUserStep, type SandboxUserTrait, type SandboxUserTraits, type SandboxWalletLinkBlocker, SandboxWalletLinkError, type SandboxWalletLinkIntent, type SandboxWalletLinkParams, type SandboxWalletLinkProgress, type SandboxWalletLinksNamespace, type SendSandboxWalletLinkParams, type SubmittedIssuerDeployment, type SubmittedIssuerTransaction, type SubmittedPurchase, type SubmittedPurchaseApproval, type SubmittedSandboxUserFunding, type SubmittedSandboxWalletLink, type SubmittedTransfer, type TransferBlocker, type TransferClientOptions, type TransferDeployment, type TransferGasEstimate, type TransferParams, type TransferReceiptResult, type TransferRejection, type TransferSandboxUserParams, type TransferTransaction, type TransferWaitOptions, type TransferWriteRequest, buildAdapterOperation, buildConfigureVaultTransaction, buildForcedTransferTransaction, buildIssuerAdapterDeployment, buildIssuerDeployTokenTransaction, buildIssuerSandboxAddSelfTransaction, buildIssuerSandboxRegisterIssuerTransaction, buildIssuerSandboxSetSelfTraitTransaction, buildIssuerSandboxVaultDeployment, buildIssuerTokenTraitRegistryDeployment, buildIssuerVaultDeployment, buildMintTransaction, buildOverrideOperation, buildOverrideTransferTransaction, buildOverrideTransferTypedData, buildPaymentTokenOperation, buildPolicyEngineOperation, buildPolicyModuleOperation, buildPolicyRegistryOperation, buildPurchaseTransaction, buildPurchaseWriteRequest, buildRuleSetOperation, buildSandboxRegistryOperation, buildSandboxVaultOperation, buildSandboxWalletLinkTransaction, buildSandboxWalletLinkTypedData, buildSetIssuerAdminTransaction, buildSetUserTraitsTransactions, buildSetWalletsTransaction, buildTokenMetadataTransactions, buildTokenOperation, buildTransferTransaction, buildTransferWriteRequest, buildVaultOperation, createIssuersNamespace, createPolicyAttachment, createPolicyBatch, createPolicyReplacementBatch, createPurchasesNamespace, createSandboxLinkedWallet, createSandboxUser, createSandboxWalletLinksNamespace, createTransfersNamespace, encodeAllowedTransfereeConfig, encodeCeilingBalanceConfig, encodeDenylistConfig, encodeFloorBalanceConfig, encodeHolderCountCapConfig, encodeInsiderFreezeConfig, encodeSelfTransferOnlyConfig, encodeTradingDisabledConfig, issuerAdapterAbi, issuerAdapterBytecode, issuerBeaconRegistryAbi, issuerFactoryAbi, issuerLensAbi, issuerOverrideHelperAbi, issuerOverrideTypes, issuerPaymentTokenAbi, issuerPolicyEngineAbi, issuerPolicyModuleAbis, issuerPolicyRegistryAbi, issuerPolicyTypes, issuerRegistryAbi, issuerRuleSetOrchestratorAbi, issuerSandboxVaultAbi, issuerSandboxVaultBytecode, issuerTokenAbi, issuerTokenTraitRegistryAbi, issuerTokenTraitRegistryBytecode, issuerVaultAbi, issuerVaultBytecode, parsePurchaseAmount, parseTransferAmount, prepareSandboxUser, purchasePaymentTokenAbi, purchaseRegistryAbi, purchaseSecurityTokenAbi, resolveSandboxUserTraits, restoreSandboxLinkedWallet, restoreSandboxUserWallet, sandboxJurisdictionTraitId, sandboxTraitId, sandboxWalletLinkAbi, sandboxWalletLinkTypes, securityTokenVaultAbi, transferSandboxUser, validateSandboxLinkedWalletProgress, validateSandboxWalletLinkIntent, validateSandboxWalletLinkParams, waitForSandboxUserFunding, walletLinkData, walletLinkWaitOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -11085,4 +11085,257 @@ declare class SandboxTransferError extends Error {
|
|
|
11085
11085
|
*/
|
|
11086
11086
|
declare function transferSandboxUser(publicClient: PublicClient, params: TransferSandboxUserParams): Promise<SandboxTransferProgress>;
|
|
11087
11087
|
|
|
11088
|
-
|
|
11088
|
+
/** Dedicated capability: sandboxVersion 2 does not imply wallet linking or issuer registration. */
|
|
11089
|
+
declare const sandboxWalletLinkAbi: readonly [{
|
|
11090
|
+
readonly type: "function";
|
|
11091
|
+
readonly name: "sandboxWalletLinkingVersion";
|
|
11092
|
+
readonly stateMutability: "pure";
|
|
11093
|
+
readonly inputs: readonly [];
|
|
11094
|
+
readonly outputs: readonly [{
|
|
11095
|
+
readonly type: "uint256";
|
|
11096
|
+
}];
|
|
11097
|
+
}, {
|
|
11098
|
+
readonly type: "function";
|
|
11099
|
+
readonly name: "sandboxWalletLinkUsed";
|
|
11100
|
+
readonly stateMutability: "view";
|
|
11101
|
+
readonly inputs: readonly [{
|
|
11102
|
+
readonly name: "digest";
|
|
11103
|
+
readonly type: "bytes32";
|
|
11104
|
+
}];
|
|
11105
|
+
readonly outputs: readonly [{
|
|
11106
|
+
readonly type: "bool";
|
|
11107
|
+
}];
|
|
11108
|
+
}, {
|
|
11109
|
+
readonly type: "function";
|
|
11110
|
+
readonly name: "sandboxLinkWallet";
|
|
11111
|
+
readonly stateMutability: "nonpayable";
|
|
11112
|
+
readonly inputs: readonly [{
|
|
11113
|
+
readonly name: "newWallet";
|
|
11114
|
+
readonly type: "address";
|
|
11115
|
+
}, {
|
|
11116
|
+
readonly name: "nonce";
|
|
11117
|
+
readonly type: "bytes32";
|
|
11118
|
+
}, {
|
|
11119
|
+
readonly name: "deadline";
|
|
11120
|
+
readonly type: "uint64";
|
|
11121
|
+
}, {
|
|
11122
|
+
readonly name: "newWalletSignature";
|
|
11123
|
+
readonly type: "bytes";
|
|
11124
|
+
}];
|
|
11125
|
+
readonly outputs: readonly [];
|
|
11126
|
+
}, {
|
|
11127
|
+
readonly type: "event";
|
|
11128
|
+
readonly name: "SandboxWalletLinked";
|
|
11129
|
+
readonly anonymous: false;
|
|
11130
|
+
readonly inputs: readonly [{
|
|
11131
|
+
readonly name: "existingWallet";
|
|
11132
|
+
readonly type: "address";
|
|
11133
|
+
readonly indexed: true;
|
|
11134
|
+
}, {
|
|
11135
|
+
readonly name: "newWallet";
|
|
11136
|
+
readonly type: "address";
|
|
11137
|
+
readonly indexed: true;
|
|
11138
|
+
}, {
|
|
11139
|
+
readonly name: "userId";
|
|
11140
|
+
readonly type: "bytes32";
|
|
11141
|
+
readonly indexed: true;
|
|
11142
|
+
}, {
|
|
11143
|
+
readonly name: "nonce";
|
|
11144
|
+
readonly type: "bytes32";
|
|
11145
|
+
readonly indexed: false;
|
|
11146
|
+
}, {
|
|
11147
|
+
readonly name: "deadline";
|
|
11148
|
+
readonly type: "uint64";
|
|
11149
|
+
readonly indexed: false;
|
|
11150
|
+
}];
|
|
11151
|
+
}];
|
|
11152
|
+
declare const sandboxWalletLinkTypes: {
|
|
11153
|
+
readonly SandboxWalletLink: readonly [{
|
|
11154
|
+
readonly name: "existingWallet";
|
|
11155
|
+
readonly type: "address";
|
|
11156
|
+
}, {
|
|
11157
|
+
readonly name: "newWallet";
|
|
11158
|
+
readonly type: "address";
|
|
11159
|
+
}, {
|
|
11160
|
+
readonly name: "userId";
|
|
11161
|
+
readonly type: "bytes32";
|
|
11162
|
+
}, {
|
|
11163
|
+
readonly name: "nonce";
|
|
11164
|
+
readonly type: "bytes32";
|
|
11165
|
+
}, {
|
|
11166
|
+
readonly name: "deadline";
|
|
11167
|
+
readonly type: "uint64";
|
|
11168
|
+
}];
|
|
11169
|
+
};
|
|
11170
|
+
interface SandboxWalletLinkParams {
|
|
11171
|
+
chainId: number;
|
|
11172
|
+
registryAddress: Address;
|
|
11173
|
+
existingWallet: Address;
|
|
11174
|
+
newWallet: Address;
|
|
11175
|
+
nonce: Hex;
|
|
11176
|
+
deadline: bigint;
|
|
11177
|
+
/** Nonempty inventory for this offering. Each token must use this registry; all target balances must be zero.
|
|
11178
|
+
* This does not prove absence of balances in omitted tokens. Link before any fund tokens arrive. */
|
|
11179
|
+
checkedAssets: readonly {
|
|
11180
|
+
token: Address;
|
|
11181
|
+
tokenId: bigint;
|
|
11182
|
+
}[];
|
|
11183
|
+
}
|
|
11184
|
+
interface SandboxWalletLinkIntent extends SandboxWalletLinkParams {
|
|
11185
|
+
userId: Hex;
|
|
11186
|
+
}
|
|
11187
|
+
type SandboxWalletLinkBlocker = 'unsupported-wallet-linking' | 'registry-paused' | 'source-not-approved' | 'source-identity-missing' | 'target-already-linked' | 'target-not-fresh' | 'target-is-issuer' | 'consent-expired' | 'consent-used' | 'target-holds-assets';
|
|
11188
|
+
interface PreparedSandboxWalletLink {
|
|
11189
|
+
intent: SandboxWalletLinkIntent;
|
|
11190
|
+
blockNumber: bigint;
|
|
11191
|
+
sourceExpiry: bigint;
|
|
11192
|
+
blockers: SandboxWalletLinkBlocker[];
|
|
11193
|
+
ready: boolean;
|
|
11194
|
+
/** Available after signature simulation; an estimate, not a guarantee of final gas cost. */
|
|
11195
|
+
gas?: {
|
|
11196
|
+
estimatedGas: bigint;
|
|
11197
|
+
gasPrice: bigint;
|
|
11198
|
+
estimatedCost: bigint;
|
|
11199
|
+
nativeBalance: bigint;
|
|
11200
|
+
};
|
|
11201
|
+
}
|
|
11202
|
+
/** Public journal: no keys, signatures or signature-containing calldata. Persist with bigint support. */
|
|
11203
|
+
interface SandboxWalletLinkProgress {
|
|
11204
|
+
kind: 'wallet-link';
|
|
11205
|
+
intent: SandboxWalletLinkIntent;
|
|
11206
|
+
stage: 'prepared' | 'sending' | 'submitted' | 'rejected' | 'complete';
|
|
11207
|
+
hash?: Hash;
|
|
11208
|
+
/** Source account nonce explicitly bound before broadcast; reconcile this nonce if no hash returned. */
|
|
11209
|
+
senderNonce?: number;
|
|
11210
|
+
result?: IssuerReceiptResult;
|
|
11211
|
+
}
|
|
11212
|
+
interface SubmittedSandboxWalletLink extends SandboxWalletLinkProgress {
|
|
11213
|
+
stage: 'submitted' | 'complete';
|
|
11214
|
+
hash: Hash;
|
|
11215
|
+
senderNonce: number;
|
|
11216
|
+
}
|
|
11217
|
+
interface SendSandboxWalletLinkParams {
|
|
11218
|
+
intent: SandboxWalletLinkIntent;
|
|
11219
|
+
/** Volatile consent; never included in journal records or SDK errors. */
|
|
11220
|
+
signature: Hex;
|
|
11221
|
+
persist(progress: SandboxWalletLinkProgress): Promise<void>;
|
|
11222
|
+
}
|
|
11223
|
+
declare class SandboxWalletLinkError extends Error {
|
|
11224
|
+
readonly code: 'blocked' | 'stale-intent' | 'send-in-progress' | 'rejected' | 'uncertain' | 'persistence-failed' | 'check-unavailable' | 'insufficient-gas';
|
|
11225
|
+
readonly progress?: SandboxWalletLinkProgress | undefined;
|
|
11226
|
+
constructor(code: 'blocked' | 'stale-intent' | 'send-in-progress' | 'rejected' | 'uncertain' | 'persistence-failed' | 'check-unavailable' | 'insufficient-gas', message: string, progress?: SandboxWalletLinkProgress | undefined);
|
|
11227
|
+
}
|
|
11228
|
+
declare function walletLinkData(value: unknown, label: string, keys: readonly string[]): void;
|
|
11229
|
+
declare function validateSandboxWalletLinkParams(input: SandboxWalletLinkParams): SandboxWalletLinkParams;
|
|
11230
|
+
declare function validateSandboxWalletLinkIntent(input: SandboxWalletLinkIntent): SandboxWalletLinkIntent;
|
|
11231
|
+
declare function buildSandboxWalletLinkTypedData(input: SandboxWalletLinkIntent): {
|
|
11232
|
+
domain: {
|
|
11233
|
+
name: string;
|
|
11234
|
+
version: string;
|
|
11235
|
+
chainId: number;
|
|
11236
|
+
verifyingContract: `0x${string}`;
|
|
11237
|
+
};
|
|
11238
|
+
types: {
|
|
11239
|
+
readonly SandboxWalletLink: readonly [{
|
|
11240
|
+
readonly name: "existingWallet";
|
|
11241
|
+
readonly type: "address";
|
|
11242
|
+
}, {
|
|
11243
|
+
readonly name: "newWallet";
|
|
11244
|
+
readonly type: "address";
|
|
11245
|
+
}, {
|
|
11246
|
+
readonly name: "userId";
|
|
11247
|
+
readonly type: "bytes32";
|
|
11248
|
+
}, {
|
|
11249
|
+
readonly name: "nonce";
|
|
11250
|
+
readonly type: "bytes32";
|
|
11251
|
+
}, {
|
|
11252
|
+
readonly name: "deadline";
|
|
11253
|
+
readonly type: "uint64";
|
|
11254
|
+
}];
|
|
11255
|
+
};
|
|
11256
|
+
primaryType: "SandboxWalletLink";
|
|
11257
|
+
message: {
|
|
11258
|
+
existingWallet: `0x${string}`;
|
|
11259
|
+
newWallet: `0x${string}`;
|
|
11260
|
+
userId: `0x${string}`;
|
|
11261
|
+
nonce: `0x${string}`;
|
|
11262
|
+
deadline: bigint;
|
|
11263
|
+
};
|
|
11264
|
+
};
|
|
11265
|
+
declare function buildSandboxWalletLinkTransaction(input: SandboxWalletLinkIntent, signature: Hex): {
|
|
11266
|
+
from: `0x${string}`;
|
|
11267
|
+
to: `0x${string}`;
|
|
11268
|
+
chainId: number;
|
|
11269
|
+
value: 0n;
|
|
11270
|
+
data: `0x${string}`;
|
|
11271
|
+
};
|
|
11272
|
+
declare function walletLinkWaitOptions(value?: IssuerWaitOptions): IssuerWaitOptions;
|
|
11273
|
+
/** Direct RPC implementation; hosted SDK wrappers reuse this exact logic. No automatic sends/retries. */
|
|
11274
|
+
declare function createSandboxWalletLinksNamespace(options: {
|
|
11275
|
+
publicClient: PublicClient;
|
|
11276
|
+
walletClient?: WalletClient | undefined;
|
|
11277
|
+
chainId?: number | undefined;
|
|
11278
|
+
}): {
|
|
11279
|
+
prepareWalletLink: (input: SandboxWalletLinkParams) => Promise<PreparedSandboxWalletLink>;
|
|
11280
|
+
signWalletLink: (input: SandboxWalletLinkIntent, newWalletClient: WalletClient) => Promise<Hex>;
|
|
11281
|
+
preflightWalletLink: (input: SandboxWalletLinkIntent, signature: Hex) => Promise<{
|
|
11282
|
+
gas: {
|
|
11283
|
+
estimatedGas: bigint;
|
|
11284
|
+
gasPrice: bigint;
|
|
11285
|
+
estimatedCost: bigint;
|
|
11286
|
+
nativeBalance: bigint;
|
|
11287
|
+
};
|
|
11288
|
+
intent: SandboxWalletLinkIntent;
|
|
11289
|
+
blockNumber: bigint;
|
|
11290
|
+
sourceExpiry: bigint;
|
|
11291
|
+
blockers: SandboxWalletLinkBlocker[];
|
|
11292
|
+
ready: boolean;
|
|
11293
|
+
}>;
|
|
11294
|
+
sendWalletLink: (input: SendSandboxWalletLinkParams) => Promise<SubmittedSandboxWalletLink>;
|
|
11295
|
+
waitForWalletLink: (input: SubmittedSandboxWalletLink, wait?: IssuerWaitOptions) => Promise<IssuerReceiptResult>;
|
|
11296
|
+
};
|
|
11297
|
+
type SandboxWalletLinksNamespace = ReturnType<typeof createSandboxWalletLinksNamespace>;
|
|
11298
|
+
|
|
11299
|
+
/** Contains a plaintext throwaway key. Store privately. userId is confirmed only after complete. */
|
|
11300
|
+
interface SandboxLinkedWalletProgress {
|
|
11301
|
+
kind: 'linked-wallet';
|
|
11302
|
+
wallet: Address;
|
|
11303
|
+
existingWallet: Address;
|
|
11304
|
+
privateKey: Hex;
|
|
11305
|
+
chainId: number;
|
|
11306
|
+
registryAddress: Address;
|
|
11307
|
+
userId: Hex;
|
|
11308
|
+
stage: 'created' | 'linking' | 'complete';
|
|
11309
|
+
link: SandboxWalletLinkProgress;
|
|
11310
|
+
}
|
|
11311
|
+
interface CreateSandboxLinkedWalletParams {
|
|
11312
|
+
chainId: number;
|
|
11313
|
+
registryAddress: Address;
|
|
11314
|
+
existingWallet: Address;
|
|
11315
|
+
checkedAssets: SandboxWalletLinkParams['checkedAssets'];
|
|
11316
|
+
sourceWalletClient: WalletClient;
|
|
11317
|
+
/** Persist credentials before any signature or send; then persist every journal transition. */
|
|
11318
|
+
persist(progress: SandboxLinkedWalletProgress): Promise<void>;
|
|
11319
|
+
/** Omit to generate a fresh account. Supplied keys must never have held registry assets. */
|
|
11320
|
+
privateKey?: Hex;
|
|
11321
|
+
nonce?: Hex;
|
|
11322
|
+
/** Defaults to fifteen minutes after the latest block timestamp. */
|
|
11323
|
+
deadline?: bigint;
|
|
11324
|
+
wait?: IssuerWaitOptions;
|
|
11325
|
+
}
|
|
11326
|
+
declare class SandboxLinkedWalletCreationError extends Error {
|
|
11327
|
+
readonly progress: SandboxLinkedWalletProgress;
|
|
11328
|
+
constructor(progress: SandboxLinkedWalletProgress);
|
|
11329
|
+
}
|
|
11330
|
+
/**
|
|
11331
|
+
* Generate, save and link a fresh wallet. Only the existing wallet submits/pays for the transaction.
|
|
11332
|
+
* Never self-onboards the new wallet, assigns a second identity, funds, or changes any traits.
|
|
11333
|
+
* No automatic retries; receipt recovery uses waitForWalletLink with the saved public journal.
|
|
11334
|
+
*/
|
|
11335
|
+
declare function createSandboxLinkedWallet(publicClient: PublicClient, input: CreateSandboxLinkedWalletParams): Promise<SandboxLinkedWalletProgress>;
|
|
11336
|
+
/** Shape/deployment validation only; saved completion is historical and live eligibility can change. */
|
|
11337
|
+
declare function validateSandboxLinkedWalletProgress(input: SandboxLinkedWalletProgress): SandboxLinkedWalletProgress;
|
|
11338
|
+
/** Restore a completed linked test wallet without funding, onboarding, signing, or network I/O. */
|
|
11339
|
+
declare function restoreSandboxLinkedWallet<chain extends Chain>(input: SandboxLinkedWalletProgress, options: RestoreSandboxUserWalletOptions<chain>): WalletClient<Transport, chain, PrivateKeyAccount>;
|
|
11340
|
+
|
|
11341
|
+
export { type CeilingBalanceConfig, type CreateSandboxLinkedWalletParams, type CreateSandboxUserParams, DEFAULT_ISSUER_BEACON_VARIANT, EMPTY_ISSUER_ENGINE, ISSUER_CONTRACTS_COMMIT, ISSUER_CONTRACTS_PR, type IssuerAdapterDeploymentParams, type IssuerAttachedPolicy, type IssuerAuxiliaryDeploymentParams, type IssuerClientOptions, IssuerDenominatorMode, type IssuerDeployTokenParams, type IssuerDeploymentBlocker, type IssuerDeploymentReceiptResult, type IssuerEngineConfig, IssuerGuardMode, type IssuerOperationContext, type IssuerOperationParams, type IssuerOverrideAuthorization, type IssuerOverrideOperation, type IssuerPolicyApprovalParams, type IssuerPolicyEngineOperation, type IssuerPolicyKind, type IssuerProtocolDeployment, type IssuerReceiptResult, type IssuerRuleSetParams, IssuerRuleType, type IssuerSandboxAccountParams, type IssuerSandboxCapabilities, type IssuerSandboxRegistrationBlocker, type IssuerSandboxRegistryOperation, type IssuerSandboxVaultAdminOperation, type IssuerSandboxVaultAdminParams, type IssuerTokenConfig, type IssuerTokenOperation, type IssuerTokenParams, type IssuerTransaction, type IssuerVaultDeploymentParams, type IssuerWaitOptions, OpacityIssuerError, OpacityIssuerOperationError, type OpacityIssuersNamespace, OpacityPurchaseError, type OpacityPurchasesNamespace, OpacityTransferError, type OpacityTransfersNamespace, type PolicyAttachment, type PolicyBatchOperation, type PolicyChange, type PolicyGuard, type PrepareSandboxUserParams, type PreparedIssuerDeployment, type PreparedPurchase, type PreparedSandboxUser, type PreparedSandboxWalletLink, type PreparedTransfer, type PurchaseApprovalRequest, type PurchaseApprovalStep, type PurchaseBlocker, type PurchaseBuyerState, type PurchaseClientOptions, type PurchaseDeployment, type PurchaseOffering, type PurchaseParams, type PurchaseQuote, type PurchaseQuoteParams, type PurchaseReceiptResult, type PurchaseTransaction, type PurchaseWaitOptions, type PurchaseWriteRequest, type RestoreSandboxUserWalletOptions, SANDBOX_ISSUER_DEPLOYMENT, SANDBOX_PURCHASE_DEPLOYMENT, SEPOLIA_SANDBOX_MANIFEST, SandboxLinkedWalletCreationError, type SandboxLinkedWalletProgress, SandboxTransferError, type SandboxTransferProgress, type SandboxUserBlocker, SandboxUserCreationError, type SandboxUserCreationProgress, type SandboxUserFundingTransaction, type SandboxUserStep, type SandboxUserTrait, type SandboxUserTraits, type SandboxWalletLinkBlocker, SandboxWalletLinkError, type SandboxWalletLinkIntent, type SandboxWalletLinkParams, type SandboxWalletLinkProgress, type SandboxWalletLinksNamespace, type SendSandboxWalletLinkParams, type SubmittedIssuerDeployment, type SubmittedIssuerTransaction, type SubmittedPurchase, type SubmittedPurchaseApproval, type SubmittedSandboxUserFunding, type SubmittedSandboxWalletLink, type SubmittedTransfer, type TransferBlocker, type TransferClientOptions, type TransferDeployment, type TransferGasEstimate, type TransferParams, type TransferReceiptResult, type TransferRejection, type TransferSandboxUserParams, type TransferTransaction, type TransferWaitOptions, type TransferWriteRequest, buildAdapterOperation, buildConfigureVaultTransaction, buildForcedTransferTransaction, buildIssuerAdapterDeployment, buildIssuerDeployTokenTransaction, buildIssuerSandboxAddSelfTransaction, buildIssuerSandboxRegisterIssuerTransaction, buildIssuerSandboxSetSelfTraitTransaction, buildIssuerSandboxVaultDeployment, buildIssuerTokenTraitRegistryDeployment, buildIssuerVaultDeployment, buildMintTransaction, buildOverrideOperation, buildOverrideTransferTransaction, buildOverrideTransferTypedData, buildPaymentTokenOperation, buildPolicyEngineOperation, buildPolicyModuleOperation, buildPolicyRegistryOperation, buildPurchaseTransaction, buildPurchaseWriteRequest, buildRuleSetOperation, buildSandboxRegistryOperation, buildSandboxVaultOperation, buildSandboxWalletLinkTransaction, buildSandboxWalletLinkTypedData, buildSetIssuerAdminTransaction, buildSetUserTraitsTransactions, buildSetWalletsTransaction, buildTokenMetadataTransactions, buildTokenOperation, buildTransferTransaction, buildTransferWriteRequest, buildVaultOperation, createIssuersNamespace, createPolicyAttachment, createPolicyBatch, createPolicyReplacementBatch, createPurchasesNamespace, createSandboxLinkedWallet, createSandboxUser, createSandboxWalletLinksNamespace, createTransfersNamespace, encodeAllowedTransfereeConfig, encodeCeilingBalanceConfig, encodeDenylistConfig, encodeFloorBalanceConfig, encodeHolderCountCapConfig, encodeInsiderFreezeConfig, encodeSelfTransferOnlyConfig, encodeTradingDisabledConfig, issuerAdapterAbi, issuerAdapterBytecode, issuerBeaconRegistryAbi, issuerFactoryAbi, issuerLensAbi, issuerOverrideHelperAbi, issuerOverrideTypes, issuerPaymentTokenAbi, issuerPolicyEngineAbi, issuerPolicyModuleAbis, issuerPolicyRegistryAbi, issuerPolicyTypes, issuerRegistryAbi, issuerRuleSetOrchestratorAbi, issuerSandboxVaultAbi, issuerSandboxVaultBytecode, issuerTokenAbi, issuerTokenTraitRegistryAbi, issuerTokenTraitRegistryBytecode, issuerVaultAbi, issuerVaultBytecode, parsePurchaseAmount, parseTransferAmount, prepareSandboxUser, purchasePaymentTokenAbi, purchaseRegistryAbi, purchaseSecurityTokenAbi, resolveSandboxUserTraits, restoreSandboxLinkedWallet, restoreSandboxUserWallet, sandboxJurisdictionTraitId, sandboxTraitId, sandboxWalletLinkAbi, sandboxWalletLinkTypes, securityTokenVaultAbi, transferSandboxUser, validateSandboxLinkedWalletProgress, validateSandboxWalletLinkIntent, validateSandboxWalletLinkParams, waitForSandboxUserFunding, walletLinkData, walletLinkWaitOptions };
|