Skip to content

Commit 24e2c0e

Browse files
feat: include all account object properties in GraphQL response for getAccount API query
1 parent 05cdbc4 commit 24e2c0e

File tree

1 file changed

+41
-8
lines changed

1 file changed

+41
-8
lines changed

apps/klesia/src/methods/mina.ts

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,24 +150,57 @@ const getAccount = async ({ publicKey }: { publicKey: string }) => {
150150
gql`
151151
query {
152152
account(publicKey: $publicKey) {
153+
publicKey
154+
token
153155
nonce
154156
balance {
155157
total
156158
}
159+
tokenSymbol
160+
receiptChainHash
161+
timing {
162+
initialMinimumBalance
163+
cliffTime
164+
cliffAmount
165+
vestingPeriod
166+
vestingIncrement
167+
}
168+
permissions {
169+
editState
170+
access
171+
send
172+
receive
173+
setDelegate
174+
setPermissions
175+
setVerificationKey {
176+
auth
177+
txnVersion
178+
}
179+
setZkappUri
180+
editActionState
181+
setTokenSymbol
182+
incrementNonce
183+
setVotingFor
184+
setTiming
185+
}
186+
delegateAccount { publicKey }
187+
votingFor
188+
zkappState
189+
verificationKey {
190+
verificationKey
191+
hash
192+
}
193+
actionState
194+
provedState
195+
zkappUri
157196
}
158197
}
159198
`,
160199
{ publicKey },
161200
);
162-
return {
163-
nonce: data.account.nonce,
164-
balance: data.account.balance.total,
165-
};
201+
return data.account;
166202
} catch {
167-
return {
168-
nonce: "0",
169-
balance: "0",
170-
};
203+
return null;
171204
}
172205
};
173206

0 commit comments

Comments
 (0)