File tree Expand file tree Collapse file tree 2 files changed +97
-148
lines changed
Expand file tree Collapse file tree 2 files changed +97
-148
lines changed Original file line number Diff line number Diff line change @@ -1101,8 +1101,21 @@ export class Near extends BaseCoin {
11011101 throw new Error ( 'Error on token enablements: transaction has no outputs to validate beneficiary' ) ;
11021102 }
11031103
1104+ // NEAR token enablements only support a single recipient
1105+ if ( ! txParams . recipients || txParams . recipients . length === 0 ) {
1106+ throw new Error ( 'Error on token enablements: missing recipients in transaction parameters' ) ;
1107+ }
1108+
1109+ if ( txParams . recipients . length !== 1 ) {
1110+ throw new Error ( 'Error on token enablements: token enablement only supports a single recipient' ) ;
1111+ }
1112+
1113+ if ( explainedTx . outputs . length !== 1 ) {
1114+ throw new Error ( 'Error on token enablements: transaction must have exactly 1 output' ) ;
1115+ }
1116+
11041117 const output = explainedTx . outputs [ 0 ] ;
1105- const recipient = txParams . recipients ?. [ 0 ] ;
1118+ const recipient = txParams . recipients [ 0 ] ;
11061119
11071120 if ( ! recipient ?. address ) {
11081121 throw new Error ( 'Error on token enablements: missing beneficiary address in transaction parameters' ) ;
You can’t perform that action at this time.
0 commit comments