diff --git a/examples/simple-dapp/src/main.ts b/examples/simple-dapp/src/main.ts index 231c6929..6ea29f66 100644 --- a/examples/simple-dapp/src/main.ts +++ b/examples/simple-dapp/src/main.ts @@ -82,8 +82,7 @@ const proofOfOwnershipRequest = document.getElementById( 'proof-of-ownership-request', )! -let subintentExpiration: 'secondsAfterSignature' | 'atTime' = - 'secondsAfterSignature' +let subintentExpiration: 'afterDelay' | 'atTime' = 'afterDelay' document.querySelectorAll('input[name="option"]').forEach((radio) => { radio.addEventListener('change', () => { @@ -92,9 +91,7 @@ document.querySelectorAll('input[name="option"]').forEach((radio) => { ) as HTMLInputElement if (selectedOption) { console.log(`Selected value: ${selectedOption.value}`) - subintentExpiration = selectedOption.value as - | 'secondsAfterSignature' - | 'atTime' + subintentExpiration = selectedOption.value as 'afterDelay' | 'atTime' } }) }) diff --git a/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.spec.ts b/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.spec.ts index 6c719dc3..f28b1709 100644 --- a/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.spec.ts +++ b/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.spec.ts @@ -5,7 +5,7 @@ describe('SubintentRequestBuilder', () => { it('should build a subintent request', () => { const tx = SubintentRequestBuilder() .manifest('...') - .setExpiration('secondsAfterSignature', 60) + .setExpiration('afterDelay', 60) .addBlobs('deadbeef', 'beefdead') .message('hello') .toRequestItem() diff --git a/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.ts b/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.ts index 26d1fa17..280a80bb 100644 --- a/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.ts +++ b/packages/dapp-toolkit/src/modules/wallet-request/pre-authorization-request/subintent-builder.ts @@ -27,14 +27,11 @@ export const SubintentRequestBuilder = () => { /** * Sets the expiration for a request. * - * @param type - The type of expiration. Can be 'atTime' for a specific time or 'secondsAfterSignature' for a duration after the signature. - * @param value - The value associated with the expiration type. For 'atTime', this is a timestamp. For 'secondsAfterSignature', this is the number of seconds. + * @param type - The type of expiration. Can be 'atTime' for a specific time or 'afterDelay' for a duration after the signature. + * @param value - The value associated with the expiration type. For 'atTime', this is a timestamp. For 'afterDelay', this is the number of seconds. * @returns The API object for chaining. */ - const setExpiration = ( - type: 'atTime' | 'secondsAfterSignature', - value: number, - ) => { + const setExpiration = (type: 'atTime' | 'afterDelay', value: number) => { state.expiration = type === 'atTime' ? {