Verifying a contribution has been submitted
To verify that a contribution has been successfully submitted and the contributor’s balance has been updated accordingly, perform any one or both of the following steps:
Retrieve a list of the peer’s contributions:
httpGET /data/api/v1/contribution-management/contribution?fetch-mode=SELFjson5{ status: { code: integer($int32), name: 'string' }, data: { contributions: [ { id: 'string', //127.0.0.1-127.0.0.2 OR +14155552671-+14155552672 OR 107615702016566 OR name@example.com OR https://www.address.com/ fraudType: 'string', origination: 'string', destination: 'string', expiryDate: 'string', //ISO 8601: YYYY-MM-DDTHH:MM:SSZ fraudStatus: 'string(enum)', //'Active' OR 'Flagged' confidenceIndex: number($double), isPrivileged: boolean, peerId: 'string', flagger: 'string', timestamp: 'string', //ISO 8601: YYYY-MM-DDTHH:MM:SSZ flagTimestamp: 'string', //ISO 8601: YYYY-MM-DDTHH:MM:SSZ assetDefinitionId: 'string', sourcePeerId: 'string' } ], details: { self: integer($int32), //The number of returned contributions that have been submitted by the requesting peer old: integer($int32), //The number of returned contributions that the requesting peer has retrieved before new: integer($int32), //The number of returned contributions that the requesting peer retrieves for the first time newWithConfidenceIndex: integer($int32), //Reserved. Always 0 creditsSpent: integer($int64), //The total amount of tokens spent on the retrieved contributions balanceLeft: integer($int64), //The remaining tokens balance after retrieving contributions contributionsNotReturned: integer($int32), //The number of contributions that met the filters but were not returned, because the balance does not cover them contributionsNotReturnedCost: integer($int64) //The total cost of the contributions that were not returned } } }json5{ status: { code: 0, name: 'Ok' }, data: { contributions: [ { id: '127.0.0.1-127.0.0.1', fraudType: 'IPFraud', origination: 'UA', destination: 'GB', expiryDate: '2024-09-30T11:35:41Z', fraudStatus: 'Active', confidenceIndex: null, isPrivileged: false, peerId: 'test', flagger: null, timestamp: '2024-08-31T11:35:41Z', flagTimestamp: null, assetDefinitionId: '0192f3a1-7c2e-7b41-9d0a-4f6c2a8e5b10', sourcePeerId: 'test' }, { id: '127.0.0.2-127.0.0.2', fraudType: 'IPFraud', origination: 'UA', destination: 'GB', expiryDate: '2024-09-29T17:07:33Z', fraudStatus: 'Flagged', confidenceIndex: null, isPrivileged: false, peerId: 'test', flagger: 'example_mobile', timestamp: '2024-08-30T17:07:33Z', flagTimestamp: '2024-09-15T10:05:24Z', assetDefinitionId: '0192f3a1-7c2e-7b41-9d0a-4f6c2a8e5b11', sourcePeerId: 'test' } ], details: { self: 2, old: 0, new: 0, newWithConfidenceIndex: 0, creditsSpent: 0, balanceLeft: 510, contributionsNotReturned: 0, contributionsNotReturnedCost: 0 } } }If a contribution has been submitted successfully, it is added to the top of the list of the peer’s contributions.
Retrieve the peer’s token balance:
httpGET /data/api/v1/wallet-management/balancejson5{ status: { code: integer($int32), name: 'string' }, data: { tokenId: { definitionId: 'credit#admin', accountId: 'admin@peerId' }, balance: integer($int64) } }json5{ status: { code: 0, name: 'Ok' }, data: { tokenId: { definitionId: 'credit#admin', accountId: 'admin@test' }, balance: 510 } }If a contribution has been submitted successfully, the peer’s balance is updated in accordance with the declared reward amounts.