Skip to main content

ChompApiService Actions

15 actions registered.

NameDeprecated
associateAddressV2
createAddressChallenge
createIntents
createIntentsV2
createUpgrade
createWithdrawal
disassociateAddress
getAssociatedAddresses
getDerivedIdentities
getDerivedIdentityByAddress
getIntentsByAddress
getServiceDetails
getUpgrades
startFundsTransfer
verifyDelegation

ChompApiService:associateAddressV2​

Package: @metamask/chomp-api-service

Associates an address with a CHOMP profile by submitting the signature of a challenge from ChompApiService.createAddressChallenge. The address, purpose and predecessor come from the challenge. For ASSOCIATE_SUCCESSOR, the association and the link to the predecessor are written atomically.

POST /v2/auth/address

Parameters:

NameDescription
paramsThe challenge ID and its signature.

Returns: The profile association result: status: 'created' when the association or link was written, status: 'active' when the address was already associated with the authenticated profile. Throws on 400 CHALLENGE_INVALID_OR_EXPIRED (request a new challenge), on 409 when the address is associated with a different profile, and on link validation errors.

Handler signature:

(params: AssociateAddressV2Params) => Promise<AssociateAddressResponse>

ChompApiService:createAddressChallenge​

Package: @metamask/chomp-api-service

Requests a single-use challenge for associating an address through the v2 flow. Sign the returned message exactly as received, using personal_sign with the address being associated, then submit it with ChompApiService.associateAddressV2 before expiresAt. Requesting a new challenge for the same address replaces the previous one.

POST /v2/auth/address/challenge

Each call issues a new challenge, so the result is never cached.

Parameters:

NameDescription
paramsThe address to associate and the association purpose. ASSOCIATE_SUCCESSOR also requires the predecessor address.

Returns: The challenge ID, the message to sign, and when it expires.

Handler signature:

(params: CreateAddressChallengeParams) => Promise<CreateAddressChallengeResponse>

ChompApiService:createIntents​

Package: @metamask/chomp-api-service

Submits one or more intents to the CHOMP API.

POST /v1/intent

Parameters:

NameDescription
intentsThe array of intents to submit.

Returns: The array of intent responses.

Handler signature:

(intents: SendIntentParams[]) => Promise<SendIntentResponse[]>

ChompApiService:createIntentsV2​

Package: @metamask/chomp-api-service

Submits one or more intents to the CHOMP API, including the Money Account migration intents that POST /v1/intent rejects.

POST /v2/intent

CHOMP accepts at most 10 intents per request. Their delegations must already be saved to the authenticated user storage.

Parameters:

NameDescription
intentsThe array of intents to submit.

Returns: The array of intent responses.

Handler signature:

(intents: SendIntentV2Params[]) => Promise<SendIntentV2Response[]>

ChompApiService:createUpgrade​

Package: @metamask/chomp-api-service

Creates an account upgrade request.

POST /v1/account-upgrade

Parameters:

NameDescription
paramsThe upgrade params containing signature components and chain details.

Returns: The upgrade result.

Handler signature:

(params: CreateUpgradeParams) => Promise<CreateUpgradeResponse>

ChompApiService:createWithdrawal​

Package: @metamask/chomp-api-service

Creates a withdrawal for card spend flows.

POST /v1/withdrawal

Parameters:

NameDescription
paramsThe withdrawal params containing chainId, amount (decimal or hex string), and account address.

Returns: The withdrawal result.

Handler signature:

(params: CreateWithdrawalParams) => Promise<CreateWithdrawalResponse>

ChompApiService:disassociateAddress​

Package: @metamask/chomp-api-service

Removes an address association from the authenticated profile. When called with an addresses that is linked as successors it will only succeed if the chomp migration has not yet created a funds-transfer request. Otherwise CHOMP will reject the request with LINK_COMPLETE

DELETE /v1/auth/address

Executed as a mutation so it is never retried: a retry after a lost response would hit an already-removed address and fail with a 404.

Parameters:

NameDescription
addressThe address to disassociate.

Handler signature:

(address: Hex) => Promise<void>

ChompApiService:getAssociatedAddresses​

Package: @metamask/chomp-api-service

Fetches the addresses associated with the authenticated profile.

GET /v1/auth/address

The result is scoped to the authenticated profile and consumers use it to decide whether an association already exists, so it is always fetched fresh (staleTime: 0) and evicted as soon as the call settles (gcTime: 0). The query key carries a SHA-256 digest of the bearer token — the same token the request is made with — so concurrent calls only share an in-flight request when they are for the same profile. The digest, not the token, is used because query keys leave the service via the cacheUpdated messenger events.

Returns: The active address associations; empty array if none exist. Addresses are lowercased.

Handler signature:

() => Promise<ProfileAddressEntry[]>

ChompApiService:getDerivedIdentities​

Package: @metamask/chomp-api-service

Fetches the Money Account identities of the authenticated profile, including status and migration steps information. Calling this will start migrations.

GET /v1/money-account/identities

Profile-scoped and used to drive migrations, so it is always fetched fresh and keyed by a digest of the bearer token, like ChompApiService.getAssociatedAddresses.

Returns: The identities; empty when the profile has no Money Account. Addresses are lowercased.

Handler signature:

() => Promise<DerivedIdentitiesResponse>

ChompApiService:getDerivedIdentityByAddress​

Package: @metamask/chomp-api-service

Fetches the identity containing an address, along with where the address sits in it.

GET /v1/money-account/identities/address/:address

Always fetched fresh and keyed by a digest of the bearer token.

Parameters:

NameDescription
addressThe address to look up.

Returns: The identity and address details, or null when CHOMP responds with ADDRESS_NOT_ASSOCIATED Addresses are lowercased.

Handler signature:

(address: Hex) => Promise<AddressIdentityResponse | null>

ChompApiService:getIntentsByAddress​

Package: @metamask/chomp-api-service

Fetches intents associated with a given address.

GET /v1/intent/account/:address

Callers use the result to decide whether an intent already exists, so it is always fetched fresh (staleTime: 0).

Parameters:

NameDescription
addressThe address to look up intents for.

Returns: The array of intents for the address, omitting any with an intent type this service does not recognise.

Handler signature:

(address: Hex) => Promise<IntentEntry[]>

ChompApiService:getServiceDetails​

Package: @metamask/chomp-api-service

Retrieves service details including delegation redeemer addresses and DeFi contract details for signing delegations for auto-deposit functionality.

GET /v1/chomp

Parameters:

NameDescription
chainIdsArray of chain IDs (0x-prefixed hex strings) to retrieve details for.

Returns: The service details for the requested chains.

Handler signature:

(chainIds: Hex[]) => Promise<ServiceDetailsResponse>

ChompApiService:getUpgrades​

Package: @metamask/chomp-api-service

Fetches all EIP-7702 upgrade authorizations for a given address (one per chain).

GET /v1/account-upgrade/:address

Parameters:

NameDescription
addressThe address to look up.

Returns: The upgrade entries; empty array if none exist.

Handler signature:

(address: Hex) => Promise<UpgradeEntry[]>

ChompApiService:startFundsTransfer​

Package: @metamask/chomp-api-service

Starts moving the funds of a migrating Money Account to its successor.

POST /v1/money-account/identities/address/:address/funds-transfer

CHOMP starts the transfer for the predecessor of the migrating identity that contains address, once every other migration step is complete, and rejects the request with MIGRATION_STEPS_INCOMPLETE otherwise. Once the transfer exists, the migration can no longer be cancelled. Repeating the request returns the existing transfer requests, so it is retried like a read.

Parameters:

NameDescription
addressAny address of the migrating identity.

Returns: The funds-transfer requests. Addresses are lowercased.

Handler signature:

(address: Hex) => Promise<FundsTransferStart>

ChompApiService:verifyDelegation​

Package: @metamask/chomp-api-service

Verifies a delegation signature.

POST /v1/intent/verify-delegation

Parameters:

NameDescription
paramsThe delegation verification params.

Returns: The verification result including validity and optional errors.

Handler signature:

(params: VerifyDelegationParams) => Promise<VerifyDelegationResponse>