Skip to content
← Public packages

@kentcdodds/wise

Call Wise profiles, balances, quotes, recipients, and transfers with wiseApiToken.

AGENTS.md

97 lines · 2.9 KB · Markdown

@kentcdodds/wise — agent notes

Human setup and intent live in README.md. This file is for agents: imports, smoke checks, dry-run snippets, and edge cases. Secrets by name only — never paste token values.

Secret

  • Name: wiseApiToken (user scope)
  • Host: api.wise.com
  • Save URL: https://kody.codes/account/secrets/new?name=wiseApiToken&allowedHosts=api.wise.com&scope=user

Import paths

ExportImport
list profileskody:@kentcdodds/wise/list-profiles
list balanceskody:@kentcdodds/wise/list-balances
list recipientskody:@kentcdodds/wise/list-recipients
list transferskody:@kentcdodds/wise/list-transfers
get transferkody:@kentcdodds/wise/get-transfer
create quotekody:@kentcdodds/wise/create-quote
smoke testkody:@kentcdodds/wise/smoke-test

Prefer named exports over the package root.

Smoke test (read-only)

After wiseApiToken is saved and the host is approved:

import smokeTest from 'kody:@kentcdodds/wise/smoke-test'

export default async function main() {
	return await smokeTest()
	// => { ok: true, profileCount, profiles, businessProfileId, balanceCount, balancesSample }
}

Lighter read-only checks:

import listProfiles from 'kody:@kentcdodds/wise/list-profiles'

export default async function main() {
	return await listProfiles()
}
import listBalances from 'kody:@kentcdodds/wise/list-balances'

export default async function main() {
	return await listBalances({ profileType: 'business' })
}

dryRun / confirm (mutations)

Only create-quote writes. Always prefer dry-run first:

import createQuote from 'kody:@kentcdodds/wise/create-quote'

export default async function main() {
	return await createQuote({
		sourceCurrency: 'USD',
		targetCurrency: 'EUR',
		sourceAmount: 100,
		dryRun: true,
	})
}

Live quote requires confirm: true (and exactly one of sourceAmount or targetAmount). Do not fund or execute transfers — out of package scope.

Edge cases

  • When profileId is omitted, helpers resolve via profileType (default business). Pass profileType: 'personal' when needed.
  • Smoke test lists balances only for the first business profile; personal-only tokens get businessProfileId: null and empty balances.
  • create-quote throws if both or neither amount fields are set, or if neither dryRun nor confirm: true is passed.
  • Not for “share my Wise ID” flows — that is usually the account email.

Fork / setup for agents

  1. Fork or clone this package into the caller's account if they need their own token wiring.
  2. Ensure secret wiseApiToken exists with host api.wise.com approved (and any pending package secret approvals cleared).
  3. Run ./smoke-test via static import from execute before treating the package as ready.
  4. Keep branding assets in brand/, icon.svg, and community-icon.svg unchanged unless deliberately updating official artwork.