-2

https://api.coinbase.com/v1/transactions/send_money
使用此 api 传递以下参数。

{
  "transaction": {
    "to": "user1@example.com",
    "amount": "1.234",
    "notes": "Sample transaction for you"
  }
}
4

2 回答 2

1

这是使用Coinbase iOS SDK的完整示例:

NSDictionary *transactionDict = @{
    @"to": @"user1@example.com",
    @"amount": @"1.234",
    @"notes": @"sending money" };
NSDictionary *params = @{ @"transaction": transactionDict };

[apiClient doPost:@"transactions/send_money" params:transactionDict completion:^(id result, NSError *error) {
    if (error) {
        NSLog(@"Could not send money: %@", error);
    } else {
        NSLog(@"Success: %@", [result objectForKey:@"transaction"]);
    }
}];
于 2015-04-03T20:18:26.493 回答
0

我得到了这个答案..

NSMutableDictionary *dic = [[NSMutableDictionary alloc]init];
        [dic setObject:@"user1@example.com" forKey:@"to"];
        [dic setObject:@"1.234" forKey:@"amount"];
        [dic setObject:@"sending money" forKey:@"notes"];

NSMutableDictionary *dic1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:dic,@"transaction", nil];
于 2015-04-03T19:51:35.597 回答